forked from Imagelibrary/rtems
2009-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am, pxa255/clock/clock.c, pxa255/ffuart/ffuart.c, pxa255/irq/bsp_irq_init.c, pxa255/timer/timer.c: Fix typos and update timer.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2009-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* preinstall.am, pxa255/clock/clock.c, pxa255/ffuart/ffuart.c,
|
||||
pxa255/irq/bsp_irq_init.c, pxa255/timer/timer.c: Fix typos and update
|
||||
timer.
|
||||
|
||||
2009-06-05 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* pxa255/clock/clock.c: Add ON_SKYEYE option to enable fast idle mode.
|
||||
|
||||
@@ -28,7 +28,6 @@ $(PROJECT_INCLUDE)/libcpu/mmu.h: shared/include/mmu.h $(PROJECT_INCLUDE)/libcpu/
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/mmu.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/mmu.h
|
||||
endif
|
||||
|
||||
if pxa255
|
||||
$(PROJECT_INCLUDE)/pxa255.h: pxa255/include/pxa255.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pxa255.h
|
||||
@@ -42,7 +41,6 @@ $(PROJECT_INCLUDE)/irq.h: pxa255/irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h
|
||||
endif
|
||||
|
||||
if at91rm9200
|
||||
$(PROJECT_INCLUDE)/at91rm9200.h: at91rm9200/include/at91rm9200.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/at91rm9200.h
|
||||
|
||||
@@ -34,18 +34,15 @@ static unsigned long period_num;
|
||||
*/
|
||||
static void clock_isr_on(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
|
||||
/*Clear the interrupt bit */
|
||||
XSCALE_OS_TIMER_TSR = 0x1;
|
||||
|
||||
|
||||
/* enable timer interrupt */
|
||||
XSCALE_OS_TIMER_IER |= 0x1;
|
||||
|
||||
period_num = TIMER_RATE*(Configuration.microseconds_per_tick/10000);
|
||||
|
||||
XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,13 +74,15 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq)
|
||||
rtems_isr Clock_isr(rtems_vector_number vector);
|
||||
|
||||
/* Replace the first value with the clock's interrupt name. */
|
||||
rtems_irq_connect_data clock_isr_data = {XSCALE_IRQ_OS_TIMER,
|
||||
rtems_irq_connect_data clock_isr_data = {
|
||||
XSCALE_IRQ_OS_TIMER,
|
||||
(rtems_irq_hdl)Clock_isr,
|
||||
clock_isr_on,
|
||||
clock_isr_off,
|
||||
clock_isr_is_on,
|
||||
3, /* unused for ARM cpus */
|
||||
0 }; /* unused for ARM cpus */
|
||||
0 /* unused for ARM cpus */
|
||||
};
|
||||
|
||||
|
||||
#define Clock_driver_support_install_isr( _new, _old ) \
|
||||
@@ -91,10 +90,7 @@ rtems_irq_connect_data clock_isr_data = {XSCALE_IRQ_OS_TIMER,
|
||||
|
||||
void Clock_driver_support_initialize_hardware(void)
|
||||
{
|
||||
|
||||
|
||||
period_num = TIMER_RATE*(Configuration.microseconds_per_tick/10000);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -102,10 +98,11 @@ void Clock_driver_support_initialize_hardware(void)
|
||||
|
||||
#define Clock_driver_support_at_tick() \
|
||||
do { \
|
||||
;\
|
||||
XSCALE_OS_TIMER_TSR = 0x1;/* read the status to clear the int */ \
|
||||
XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num;/*Add the match register*/ \
|
||||
;\
|
||||
/* read the status to clear the int */ \
|
||||
XSCALE_OS_TIMER_TSR = 0x1; \
|
||||
\
|
||||
/*Add the match register*/ \
|
||||
XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num; \
|
||||
} while (0)
|
||||
|
||||
void Clock_driver_support_shutdown_hardware( void )
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <rtems/libio.h>
|
||||
|
||||
@@ -13,14 +13,15 @@
|
||||
#include <bsp.h>
|
||||
#include <pxa255.h>
|
||||
|
||||
extern void default_int_handler();
|
||||
extern void default_int_handler(void);
|
||||
|
||||
void (*IRQ_table[PRIMARY_IRQS])(uint32_t vector);
|
||||
|
||||
/*
|
||||
* Interrupt system initialization. Disable interrupts, clear
|
||||
* any that are pending.
|
||||
*/
|
||||
void BSP_rtems_irq_mngt_init()
|
||||
void BSP_rtems_irq_mngt_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -31,7 +32,8 @@ void BSP_rtems_irq_mngt_init()
|
||||
|
||||
/* disable all interrupts */
|
||||
XSCALE_INT_ICMR = 0x0;
|
||||
/*Direct the interrupt to IRQ*/
|
||||
|
||||
/* Direct the interrupt to IRQ*/
|
||||
XSCALE_INT_ICLR = 0x0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
*PXA255 timer by Yang Xi <hiyangxi@gmail.com>
|
||||
* PXA255 timer by Yang Xi <hiyangxi@gmail.com>
|
||||
* Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
|
||||
*
|
||||
* Notes:
|
||||
@@ -17,28 +17,25 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <bsp.h>
|
||||
#include <pxa255.h>
|
||||
|
||||
uint32_t tstart;
|
||||
bool Timer_driver_Find_average_overhead;
|
||||
static uint32_t tick_time;
|
||||
bool benchmark_timer_find_average_overhead;
|
||||
|
||||
bool benchmark_timer_is_initialized = false;
|
||||
|
||||
/*
|
||||
* Use the timer count register to measure.
|
||||
* The frequency of it is 3.4864MHZ
|
||||
*The longest period we are able to capture is 4G/3.4864MHZ
|
||||
*
|
||||
*
|
||||
* The longest period we are able to capture is 4G/3.4864MHZ
|
||||
*/
|
||||
void Timer_initialize( void )
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
|
||||
tick_time = XSCALE_OS_TIMER_TCR;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -56,7 +53,7 @@ void Timer_initialize( void )
|
||||
/* This value is in microseconds. */
|
||||
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
|
||||
|
||||
int Read_timer( void )
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
|
||||
uint32_t total;
|
||||
@@ -64,32 +61,20 @@ int Read_timer( void )
|
||||
if(total>=tick_time)
|
||||
total -= tick_time;
|
||||
else
|
||||
total += 0xffffffff-tick_time; /*Round up but not overflow*/
|
||||
total += 0xffffffff - tick_time; /*Round up but not overflow*/
|
||||
|
||||
if ( Timer_driver_Find_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == true )
|
||||
return total; /*Counter cycles*/
|
||||
else {
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
return 0; /* below timer resolution */
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
rtems_status_code Empty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void Set_find_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
bool find_flag
|
||||
)
|
||||
{
|
||||
Timer_driver_Find_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user