Path: blob/master/arch/arm/mach-bcmring/include/mach/csp/tmrHw_reg.h
10821 views
/*****************************************************************************1* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.2*3* Unless you and Broadcom execute a separate written software license4* agreement governing use of this software, this software is licensed to you5* under the terms of the GNU General Public License version 2, available at6* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").7*8* Notwithstanding the above, under no circumstances may you combine this9* software in any way with any other Broadcom software provided under a10* license other than the GPL, without Broadcom's express prior written11* consent.12*****************************************************************************/1314/****************************************************************************/15/**16* @file tmrHw_reg.h17*18* @brief Definitions for low level Timer registers19*20*/21/****************************************************************************/22#ifndef _TMRHW_REG_H23#define _TMRHW_REG_H2425#include <mach/csp/mm_io.h>26#include <mach/csp/hw_cfg.h>27/* Base address */28#define tmrHw_MODULE_BASE_ADDR MM_IO_BASE_TMR2930/*31This platform has four different timers running at different clock speed3233Timer one (Timer ID 0) runs at 25 MHz34Timer two (Timer ID 1) runs at 25 MHz35Timer three (Timer ID 2) runs at 150 MHz36Timer four (Timer ID 3) runs at 150 MHz37*/38#define tmrHw_LOW_FREQUENCY_MHZ 25 /* Always 25MHz from XTAL */39#define tmrHw_LOW_FREQUENCY_HZ 250000004041#if defined(CFG_GLOBAL_CHIP) && (CFG_GLOBAL_CHIP == FPGA11107)42#define tmrHw_HIGH_FREQUENCY_MHZ 150 /* Always 150MHz for FPGA */43#define tmrHw_HIGH_FREQUENCY_HZ 15000000044#else45#define tmrHw_HIGH_FREQUENCY_HZ HW_CFG_BUS_CLK_HZ46#define tmrHw_HIGH_FREQUENCY_MHZ (HW_CFG_BUS_CLK_HZ / 1000000)47#endif4849#define tmrHw_LOW_RESOLUTION_CLOCK tmrHw_LOW_FREQUENCY_HZ50#define tmrHw_HIGH_RESOLUTION_CLOCK tmrHw_HIGH_FREQUENCY_HZ51#define tmrHw_MAX_COUNT (0xFFFFFFFF) /* maximum number of count a timer can count */52#define tmrHw_TIMER_NUM_COUNT (4) /* Number of timer module supported */5354typedef struct {55uint32_t LoadValue; /* Load value for timer */56uint32_t CurrentValue; /* Current value for timer */57uint32_t Control; /* Control register */58uint32_t InterruptClear; /* Interrupt clear register */59uint32_t RawInterruptStatus; /* Raw interrupt status */60uint32_t InterruptStatus; /* Masked interrupt status */61uint32_t BackgroundLoad; /* Background load value */62uint32_t padding; /* Padding register */63} tmrHw_REG_t;6465/* Control bot masks */66#define tmrHw_CONTROL_TIMER_ENABLE 0x0000008067#define tmrHw_CONTROL_PERIODIC 0x0000004068#define tmrHw_CONTROL_INTERRUPT_ENABLE 0x0000002069#define tmrHw_CONTROL_PRESCALE_MASK 0x0000000C70#define tmrHw_CONTROL_PRESCALE_1 0x0000000071#define tmrHw_CONTROL_PRESCALE_16 0x0000000472#define tmrHw_CONTROL_PRESCALE_256 0x0000000873#define tmrHw_CONTROL_32BIT 0x0000000274#define tmrHw_CONTROL_ONESHOT 0x0000000175#define tmrHw_CONTROL_FREE_RUNNING 0x000000007677#define tmrHw_CONTROL_MODE_MASK (tmrHw_CONTROL_PERIODIC | tmrHw_CONTROL_ONESHOT)7879#define pTmrHw ((volatile tmrHw_REG_t *)tmrHw_MODULE_BASE_ADDR)8081#endif /* _TMRHW_REG_H */828384