forked from Imagelibrary/rtems
2010-04-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
* mpc5xx/clock/clock.c, mpc5xx/console-generic/console-generic.c, mpc5xx/irq/irq_init.c, mpc5xx/timer/timer.c: Remove warnings.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2010-04-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||||
|
|
||||||
|
* mpc5xx/clock/clock.c, mpc5xx/console-generic/console-generic.c,
|
||||||
|
mpc5xx/irq/irq_init.c, mpc5xx/timer/timer.c: Remove warnings.
|
||||||
|
|
||||||
2010-04-25 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
2010-04-25 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||||
|
|
||||||
* ppc403/clock/clock.c, ppc403/console/console405.c,
|
* ppc403/clock/clock.c, ppc403/console/console405.c,
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
volatile uint32_t Clock_driver_ticks;
|
volatile uint32_t Clock_driver_ticks;
|
||||||
extern int BSP_connect_clock_handler(rtems_isr_entry);
|
extern int BSP_connect_clock_handler(rtems_isr_entry);
|
||||||
extern int BSP_disconnect_clock_handler();
|
extern int BSP_disconnect_clock_handler();
|
||||||
|
extern uint32_t bsp_clicks_per_usec;
|
||||||
|
|
||||||
void Clock_exit( void );
|
void Clock_exit( void );
|
||||||
|
|
||||||
@@ -79,7 +80,6 @@ void clockOn(void* unused)
|
|||||||
{
|
{
|
||||||
unsigned desiredLevel;
|
unsigned desiredLevel;
|
||||||
uint32_t pit_value;
|
uint32_t pit_value;
|
||||||
extern uint32_t bsp_clicks_per_usec;
|
|
||||||
|
|
||||||
/* calculate and set modulus */
|
/* calculate and set modulus */
|
||||||
pit_value = (rtems_configuration_get_microseconds_per_tick() *
|
pit_value = (rtems_configuration_get_microseconds_per_tick() *
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include <rtems/bspIo.h> /* for printk */
|
#include <rtems/bspIo.h> /* for printk */
|
||||||
#include <mpc5xx.h>
|
#include <mpc5xx.h>
|
||||||
#include <mpc5xx/console.h>
|
#include <mpc5xx/console.h>
|
||||||
#include <libcpu/irq.h>
|
#include <bsp/irq.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -85,6 +85,8 @@ static struct termios default_termios = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern uint32_t bsp_clock_speed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Termios callback functions
|
* Termios callback functions
|
||||||
*/
|
*/
|
||||||
@@ -187,33 +189,10 @@ m5xx_uart_setAttributes(
|
|||||||
return RTEMS_INVALID_NUMBER;
|
return RTEMS_INVALID_NUMBER;
|
||||||
|
|
||||||
/* Baud rate */
|
/* Baud rate */
|
||||||
switch (t->c_cflag & CBAUD) {
|
baud = rtems_termios_baud_to_number( t->c_cflag & CBAUD );
|
||||||
default: baud = -1; break;
|
|
||||||
case B50: baud = 50; break;
|
|
||||||
case B75: baud = 75; break;
|
|
||||||
case B110: baud = 110; break;
|
|
||||||
case B134: baud = 134; break;
|
|
||||||
case B150: baud = 150; break;
|
|
||||||
case B200: baud = 200; break;
|
|
||||||
case B300: baud = 300; break;
|
|
||||||
case B600: baud = 600; break;
|
|
||||||
case B1200: baud = 1200; break;
|
|
||||||
case B1800: baud = 1800; break;
|
|
||||||
case B2400: baud = 2400; break;
|
|
||||||
case B4800: baud = 4800; break;
|
|
||||||
case B9600: baud = 9600; break;
|
|
||||||
case B19200: baud = 19200; break;
|
|
||||||
case B38400: baud = 38400; break;
|
|
||||||
case B57600: baud = 57600; break;
|
|
||||||
case B115200: baud = 115200; break;
|
|
||||||
case B230400: baud = 230400; break;
|
|
||||||
case B460800: baud = 460800; break;
|
|
||||||
}
|
|
||||||
if (baud > 0) {
|
if (baud > 0) {
|
||||||
extern uint32_t bsp_clock_speed;
|
|
||||||
sccr0 &= ~QSMCM_SCI_BAUD(-1);
|
sccr0 &= ~QSMCM_SCI_BAUD(-1);
|
||||||
sccr0 |=
|
sccr0 |= QSMCM_SCI_BAUD((bsp_clock_speed + (16 * baud)) / (32 * baud));
|
||||||
QSMCM_SCI_BAUD((bsp_clock_speed + (16 * baud)) / (32 * baud));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Number of data bits -- not available with MPC5xx SCI */
|
/* Number of data bits -- not available with MPC5xx SCI */
|
||||||
|
|||||||
@@ -23,40 +23,55 @@
|
|||||||
#include <mpc5xx.h>
|
#include <mpc5xx.h>
|
||||||
#include <libcpu/vectors.h>
|
#include <libcpu/vectors.h>
|
||||||
#include <libcpu/raw_exception.h>
|
#include <libcpu/raw_exception.h>
|
||||||
#include <libcpu/irq.h>
|
#include <bsp/irq.h>
|
||||||
|
|
||||||
|
|
||||||
extern rtems_exception_handler_t dispatch_irq_handler;
|
extern rtems_exception_handler_t dispatch_irq_handler;
|
||||||
|
|
||||||
volatile unsigned int ppc_cached_irq_mask;
|
volatile unsigned int ppc_cached_irq_mask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* default on/off function
|
* default methods
|
||||||
*/
|
*/
|
||||||
static void nop_func(){}
|
static void nop_hdl(rtems_irq_hdl_param ignored)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
static void nop_irq_enable(const struct __rtems_irq_connect_data__*ignored)
|
||||||
* default isOn function
|
{
|
||||||
*/
|
}
|
||||||
static int not_connected(void) {return 0;}
|
|
||||||
|
|
||||||
/*
|
static void nop_raw_enable(
|
||||||
* default possible isOn function
|
const struct __rtems_raw_except_connect_data__*ignored
|
||||||
*/
|
)
|
||||||
static int connected(void) {return 1;}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static rtems_irq_connect_data rtemsIrq[CPU_IRQ_COUNT];
|
static int irq_is_connected(const struct __rtems_irq_connect_data__*ignored)
|
||||||
static rtems_irq_global_settings initial_config;
|
{
|
||||||
static rtems_irq_connect_data defaultIrq = {
|
return 0;
|
||||||
/* vector, hdl ,handle , on , off , isOn */
|
}
|
||||||
0, nop_func ,NULL , nop_func , nop_func , not_connected
|
|
||||||
|
static int raw_is_connected(const struct __rtems_raw_except_connect_data__*ignored)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static rtems_irq_connect_data rtemsIrq[CPU_IRQ_COUNT];
|
||||||
|
static rtems_irq_global_settings initial_config;
|
||||||
|
static rtems_irq_connect_data defaultIrq = {
|
||||||
|
0, /* vector */
|
||||||
|
nop_hdl, /* hdl */
|
||||||
|
NULL, /* handle */
|
||||||
|
nop_irq_enable, /* on */
|
||||||
|
nop_irq_enable, /* off */
|
||||||
|
irq_is_connected /* isOn */
|
||||||
};
|
};
|
||||||
|
|
||||||
static rtems_irq_prio irqPrioTable[CPU_IRQ_COUNT]={
|
static rtems_irq_prio irqPrioTable[CPU_IRQ_COUNT]={
|
||||||
/*
|
/*
|
||||||
* actual priorities for interrupt :
|
* actual priorities for interrupt :
|
||||||
* 0 means that only current interrupt is masked
|
* 0 means that only current interrupt is masked
|
||||||
* 255 means all other interrupts are masked
|
* 255 means all other interrupts are masked
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* USIU interrupts.
|
* USIU interrupts.
|
||||||
@@ -118,11 +133,11 @@ void CPU_rtems_irq_mng_init(unsigned cpuId)
|
|||||||
/*
|
/*
|
||||||
* Init initial Interrupt management config
|
* Init initial Interrupt management config
|
||||||
*/
|
*/
|
||||||
initial_config.irqNb = CPU_IRQ_COUNT;
|
initial_config.irqNb = CPU_IRQ_COUNT;
|
||||||
initial_config.defaultEntry = defaultIrq;
|
initial_config.defaultEntry = defaultIrq;
|
||||||
initial_config.irqHdlTbl = rtemsIrq;
|
initial_config.irqHdlTbl = rtemsIrq;
|
||||||
initial_config.irqBase = CPU_ASM_IRQ_VECTOR_BASE;
|
initial_config.irqBase = CPU_ASM_IRQ_VECTOR_BASE;
|
||||||
initial_config.irqPrioTbl = irqPrioTable;
|
initial_config.irqPrioTbl = irqPrioTable;
|
||||||
|
|
||||||
if (!CPU_rtems_irq_mngt_set(&initial_config)) {
|
if (!CPU_rtems_irq_mngt_set(&initial_config)) {
|
||||||
/*
|
/*
|
||||||
@@ -135,17 +150,17 @@ void CPU_rtems_irq_mng_init(unsigned cpuId)
|
|||||||
* We must connect the raw irq handler for the two
|
* We must connect the raw irq handler for the two
|
||||||
* expected interrupt sources : decrementer and external interrupts.
|
* expected interrupt sources : decrementer and external interrupts.
|
||||||
*/
|
*/
|
||||||
vectorDesc.exceptIndex = ASM_DEC_VECTOR;
|
vectorDesc.exceptIndex = ASM_DEC_VECTOR;
|
||||||
vectorDesc.hdl.vector = ASM_DEC_VECTOR;
|
vectorDesc.hdl.vector = ASM_DEC_VECTOR;
|
||||||
vectorDesc.hdl.raw_hdl = dispatch_irq_handler;
|
vectorDesc.hdl.raw_hdl = dispatch_irq_handler;
|
||||||
vectorDesc.on = nop_func;
|
vectorDesc.on = nop_raw_enable;
|
||||||
vectorDesc.off = nop_func;
|
vectorDesc.off = nop_raw_enable;
|
||||||
vectorDesc.isOn = connected;
|
vectorDesc.isOn = raw_is_connected;
|
||||||
if (!mpc5xx_set_exception (&vectorDesc)) {
|
if (!mpc5xx_set_exception (&vectorDesc)) {
|
||||||
BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
|
BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
|
||||||
}
|
}
|
||||||
vectorDesc.exceptIndex = ASM_EXT_VECTOR;
|
vectorDesc.exceptIndex = ASM_EXT_VECTOR;
|
||||||
vectorDesc.hdl.vector = ASM_EXT_VECTOR;
|
vectorDesc.hdl.vector = ASM_EXT_VECTOR;
|
||||||
if (!mpc5xx_set_exception (&vectorDesc)) {
|
if (!mpc5xx_set_exception (&vectorDesc)) {
|
||||||
BSP_panic("Unable to initialize RTEMS external raw exception\n");
|
BSP_panic("Unable to initialize RTEMS external raw exception\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,9 @@
|
|||||||
static volatile uint32_t Timer_starting;
|
static volatile uint32_t Timer_starting;
|
||||||
static bool benchmark_timer_find_average_overhead;
|
static bool benchmark_timer_find_average_overhead;
|
||||||
|
|
||||||
|
extern uint32_t bsp_timer_least_valid;
|
||||||
|
extern uint32_t bsp_timer_average_overhead;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is so small that this code will be reproduced where needed.
|
* This is so small that this code will be reproduced where needed.
|
||||||
*/
|
*/
|
||||||
@@ -83,8 +86,6 @@ int benchmark_timer_read(void)
|
|||||||
{
|
{
|
||||||
uint32_t clicks;
|
uint32_t clicks;
|
||||||
uint32_t total;
|
uint32_t total;
|
||||||
extern uint32_t bsp_timer_least_valid;
|
|
||||||
extern uint32_t bsp_timer_average_overhead;
|
|
||||||
|
|
||||||
clicks = get_itimer();
|
clicks = get_itimer();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user