forked from Imagelibrary/rtems
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* at91rm9200/clock/clock.c, lpc22xx/clock/clockdrv.c, mc9328mxl/clock/clockdrv.c, s3c2400/clock/clockdrv.c: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* at91rm9200/clock/clock.c, lpc22xx/clock/clockdrv.c,
|
||||
mc9328mxl/clock/clockdrv.c, s3c2400/clock/clockdrv.c: Eliminate
|
||||
copies of the Configuration Table. Use the RTEMS provided accessor
|
||||
macros to obtain configuration fields.
|
||||
|
||||
2007-11-03 Ray Xu <rayx.cn@gmail.com>
|
||||
*lpc22xx/irq/bsp_irq_asm.S: Add veneer for ARM<->Thumb
|
||||
lpc22xx/irq/bsp_irq_init.c: add VIC address init
|
||||
|
||||
@@ -84,7 +84,7 @@ void Clock_driver_support_initialize_hardware(void)
|
||||
/* the system timer is driven from SLCK */
|
||||
slck = at91rm9200_get_slck();
|
||||
st_pimr_reload =
|
||||
(((BSP_Configuration.microseconds_per_tick * slck) + (1000000/2))/ 1000000);
|
||||
(((rtems_configuration_get_microseconds_per_tick() * slck) + (1000000/2))/ 1000000);
|
||||
|
||||
/* read the status to clear the int */
|
||||
st_str = ST_REG(ST_SR);
|
||||
|
||||
@@ -78,7 +78,7 @@ rtems_irq_connect_data clock_isr_data = {LPC22xx_INTERRUPT_TIMER0,
|
||||
* NOPs.
|
||||
*/
|
||||
|
||||
/* set timer to generate interrupt every BSP_Configuration.microseconds_per_tick
|
||||
/* set timer to generate interrupt every rtems_configuration_get_microseconds_per_tick()
|
||||
* MR0/(LPC22xx_Fpclk/(PR0+1)) = 10/1000 = 0.01s
|
||||
*/
|
||||
|
||||
@@ -86,8 +86,8 @@ rtems_irq_connect_data clock_isr_data = {LPC22xx_INTERRUPT_TIMER0,
|
||||
do { \
|
||||
T0TCR &= 0; /* disable and clear timer 0, set to */ \
|
||||
T0PC = 0; /* TC is incrementet on every pclk.*/ \
|
||||
T0MR0 = ((LPC22xx_Fpclk/1000* BSP_Configuration.microseconds_per_tick) / 1000); /* initialize the timer period and prescaler */ \
|
||||
/*T0PR = (((LPC22xx_Fpclk / 1000) * BSP_Configuration.microseconds_per_tick) / 1000-1); \ */ \
|
||||
T0MR0 = ((LPC22xx_Fpclk/1000* rtems_configuration_get_microseconds_per_tick()) / 1000); /* initialize the timer period and prescaler */ \
|
||||
/*T0PR = (((LPC22xx_Fpclk / 1000) * rtems_configuration_get_microseconds_per_tick()) / 1000-1); \ */ \
|
||||
T0MCR |= 0x03; /* generate interrupt when T0MR0 match T0TC and Reset Timer Count*/ \
|
||||
T0EMR = 0; /*No external match*/ \
|
||||
T0TCR = 1; /*enable timer0*/ \
|
||||
@@ -113,7 +113,7 @@ uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
|
||||
clicks = T0TC; /*T0TC is the 32bit time counter 0*/
|
||||
|
||||
return (uint32_t) (BSP_Configuration.microseconds_per_tick - clicks) * 1000;
|
||||
return (uint32_t) (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||
|
||||
@@ -83,7 +83,7 @@ rtems_irq_connect_data clock_isr_data = {
|
||||
int cnt; \
|
||||
freq = get_perclk1_freq(); \
|
||||
printk("perclk1 freq is %d\n", freq); \
|
||||
cnt = ((long long)freq * BSP_Configuration.microseconds_per_tick + 500000) / 1000000;\
|
||||
cnt = ((long long)freq * rtems_configuration_get_microseconds_per_tick() + 500000) / 1000000;\
|
||||
printk("cnt freq is %d\n", cnt); \
|
||||
MC9328MXL_TMR1_TCMP = cnt; \
|
||||
/* use PERCLK1 as input, enable timer */ \
|
||||
|
||||
@@ -80,7 +80,7 @@ rtems_irq_connect_data clock_isr_data = {BSP_INT_TIMER4,
|
||||
freq = get_PCLK(); \
|
||||
/* set TIMER4 counter, input freq=PLCK/16/16Mhz*/ \
|
||||
freq = (freq /16)/16; \
|
||||
rTCNTB4 = ((freq / 1000) * BSP_Configuration.microseconds_per_tick) / 1000; \
|
||||
rTCNTB4 = ((freq / 1000) * rtems_configuration_get_microseconds_per_tick()) / 1000; \
|
||||
/*unmask TIMER4 irq*/ \
|
||||
rINTMSK&=~BIT_TIMER4; \
|
||||
/* start TIMER4 with autoreload */ \
|
||||
|
||||
Reference in New Issue
Block a user