* mcf52235/README, mcf52235/gdb-init, mcf52235/clock/clock.c,
	mcf52235/console/console.c, mcf52235/include/bsp.h,
	mcf52235/include/coverhd.h, mcf52235/start/start.S,
	mcf52235/startup/bspclean.c, mcf52235/startup/bspstart.c,
	mcf52235/startup/linkcmds, mcf52235/timer/timer.c: Cleaned up
	white space and code formmated to adhere to RTEMS standards. Fixed
	a bug in the nano seconds since last tick support. Fixed a bug
	with the location of the start stack (no longer within
	.bss). Removed double definition of IPSBAR and some type defs
	etc.. Added timing test overhead results.
This commit is contained in:
Chris Johns
2008-06-19 05:46:19 +00:00
parent 8f25cec8bb
commit 9374e9b082
12 changed files with 644 additions and 622 deletions

View File

@@ -1,3 +1,16 @@
2008-06-19 Matthew Riek <matthew.riek@ibiscomputer.com.au>
* mcf52235/README, mcf52235/gdb-init, mcf52235/clock/clock.c,
mcf52235/console/console.c, mcf52235/include/bsp.h,
mcf52235/include/coverhd.h, mcf52235/start/start.S,
mcf52235/startup/bspclean.c, mcf52235/startup/bspstart.c,
mcf52235/startup/linkcmds, mcf52235/timer/timer.c: Cleaned up
white space and code formmated to adhere to RTEMS standards. Fixed
a bug in the nano seconds since last tick support. Fixed a bug
with the location of the start stack (no longer within
.bss). Removed double definition of IPSBAR and some type defs
etc.. Added timing test overhead results.
2008-06-10 Matthew Riek <matthew.riek@ibiscomputer.com.au> 2008-06-10 Matthew Riek <matthew.riek@ibiscomputer.com.au>
* .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, * .cvsignore, ChangeLog, Makefile.am, README, bsp_specs,

View File

@@ -3,7 +3,7 @@
# #
Description: Motorola MCF52235EVB Description: Motorola MCF52235EVB
============ ============================================================================
CPU: MCF52235, 60MHz CPU: MCF52235, 60MHz
SRAM: 32K SRAM: 32K
FLASH: 256K FLASH: 256K
@@ -11,10 +11,10 @@ FLASH: 256K
This is a Motorola evaluation board that uses the MCF52235 Coldfire CPU. This is a Motorola evaluation board that uses the MCF52235 Coldfire CPU.
This board is running at 60MHz scaled from a 25MHz oscillator. This board is running at 60MHz scaled from a 25MHz oscillator.
============================================================================
NOTES: NOTES:
======
Currently this BSP must be configured with most (all?) RTEMS features turned Currently this BSP must be configured with most RTEMS features turned
off as RAM usage is too high. off as RAM usage is too high.
Configure as follows: Configure as follows:
@@ -22,17 +22,35 @@ configure --target=m68k-rtems4.9 --enable-rtemsbsp=mcf52235 \
--disable-networking --disable-posix --disable-itron --disable-cxx \ --disable-networking --disable-posix --disable-itron --disable-cxx \
--disable-tests --disable-tests
TODO: To get the tests to compile (but not run) change the linkcmds to specify
===== a larger sram memory region (256K works). This of course will let you
compile all tests, but many or most of them wont run.
See testsuites/samples/minumum for an example of what type of config flags
you need for this BSP!
In you project before you include confdefs.h, define some or all of the
following:
#define CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
#define CONFIGURE_DISABLE_CLASSIC_NOTEPADS
#define CONFIGURE_INIT_TASK_STACK_SIZE x
#define CONFIGURE_MINIMUM_TASK_STACK_SIZE x
#define CONFIGURE_INTERRUPT_STACK_SIZE x
Note that the default stack size is 1K
Note that the default number of priorities is 15
============================================================================
TODO:
*) Work with TINY RTEMS to get the ram usage down.
*) Add drivers for I2C, ADC, FEC *) Add drivers for I2C, ADC, FEC
*) Support for LWIP *) Support for LWIP
*) Update the coverhd.h (calling overheads) page 21 of the BSP guide *) Update the coverhd.h (calling overheads) page 21 of the BSP guide
*) Adjust initial stack so that it's space is not forever unusable after init *) Recover the 1K stack space reserved in linkcmds used for board startup.
*) Fix up constants used by cfinit such as clockspeed, rambase, flashbase etc.
============================================================================ ============================================================================
Interrupt map Interrupt map
+-----+-----------------------------------------------------------------------+ +-----+-----------------------------------------------------------------------+
@@ -46,7 +64,7 @@ TODO:
+-----+--------+--------+--------+--------+--------+--------+--------+--------+ +-----+--------+--------+--------+--------+--------+--------+--------+--------+
| 5 | | | | | | | | | | 5 | | | | | | | | |
+-----+--------+--------+--------+--------+--------+--------+--------+--------+ +-----+--------+--------+--------+--------+--------+--------+--------+--------+
| 4 | FEC RX | FEC TX | | | | | | PIT | | 4 | | | | | | | | PIT |
+-----+--------+--------+--------+--------+--------+--------+--------+--------+ +-----+--------+--------+--------+--------+--------+--------+--------+--------+
| 3 | UART 0 | UART 1 | UART 2 | | | | | | | 3 | UART 0 | UART 1 | UART 2 | | | | | |
+-----+--------+--------+--------+--------+--------+--------+--------+--------+ +-----+--------+--------+--------+--------+--------+--------+--------+--------+
@@ -54,3 +72,92 @@ TODO:
+-----+--------+--------+--------+--------+--------+--------+--------+--------+ +-----+--------+--------+--------+--------+--------+--------+--------+--------+
| 1 | | | | | | | | | | 1 | | | | | | | | |
+-----+--------+--------+--------+--------+--------+--------+--------+--------+ +-----+--------+--------+--------+--------+--------+--------+--------+--------+
============================================================================
*** TIME TEST 1 ***
rtems_semaphore_create 8
rtems_semaphore_delete 10
rtems_semaphore_obtain: available 3
rtems_semaphore_obtain: not available -- NO_WAIT 3
rtems_semaphore_release: no waiting tasks 7
*** END OF TEST 1 ***
*** TIME TEST OVERHEAD ***
rtems_shutdown_executive 0
rtems_task_create 0
rtems_task_ident 0
rtems_task_start 0
rtems_task_restart 0
rtems_task_delete 0
rtems_task_suspend 0
rtems_task_resume 0
rtems_task_set_priority 0
rtems_task_mode 0
rtems_task_get_note 0
rtems_task_set_note 0
rtems_task_wake_when 0
rtems_task_wake_after 0
rtems_interrupt_catch 0
rtems_clock_get 0
rtems_clock_set 0
rtems_clock_tick 0
<pause>
rtems_timer_create 0
rtems_timer_delete 0
rtems_timer_ident 0
rtems_timer_fire_after 0
rtems_timer_fire_when 1
rtems_timer_reset 0
rtems_timer_cancel 0
rtems_semaphore_create 0
rtems_semaphore_delete 0
rtems_semaphore_ident 0
rtems_semaphore_obtain 0
rtems_semaphore_release 0
rtems_message_queue_create 0
rtems_message_queue_ident 0
rtems_message_queue_delete 0
rtems_message_queue_send 0
rtems_message_queue_urgent 0
rtems_message_queue_broadcast 0
rtems_message_queue_receive 0
rtems_message_queue_flush 0
<pause>
rtems_event_send 0
rtems_event_receive 0
rtems_signal_catch 0
rtems_signal_send 0
rtems_partition_create 0
rtems_partition_ident 0
rtems_partition_delete 0
rtems_partition_get_buffer 0
rtems_partition_return_buffer 0
rtems_region_create 0
rtems_region_ident 0
rtems_region_delete 0
rtems_region_get_segment 0
rtems_region_return_segment 0
rtems_port_create 0
rtems_port_ident 0
rtems_port_delete 0
rtems_port_external_to_internal 0
rtems_port_internal_to_external 0
<pause>
rtems_io_initialize 0
rtems_io_open 0
rtems_io_close 0
rtems_io_read 0
rtems_io_write 0
rtems_io_control 0
rtems_fatal_error_occurred 0
rtems_rate_monotonic_create 0
rtems_rate_monotonic_ident 0
rtems_rate_monotonic_delete 0
rtems_rate_monotonic_cancel 0
rtems_rate_monotonic_period 0
rtems_multiprocessing_announce 0
*** END OF TIME OVERHEAD ***

View File

@@ -17,15 +17,19 @@ static uint32_t s_nanoScale = 0;
/* /*
* Provide nanosecond extension * Provide nanosecond extension
* Interrupts are disabled when this is called
*/ */
static uint32_t bsp_clock_nanoseconds_since_last_tick(void) static uint32_t bsp_clock_nanoseconds_since_last_tick(void)
{ {
uint32_t i = MCF_PIT1_PCNTR; uint32_t i;
if(MCF_PIT1_PCSR & MCF_PIT_PCSR_PIF)
{ if (MCF_PIT1_PCSR & MCF_PIT_PCSR_PIF) {
i = MCF_PIT1_PCNTR + MCF_PIT1_PMR; i = s_pcntrAtTick + (MCF_PIT1_PMR - MCF_PIT1_PCNTR);
} }
return (i - s_pcntrAtTick) * s_nanoScale; else {
i = s_pcntrAtTick - MCF_PIT1_PCNTR;
}
return i * s_nanoScale;
} }
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick #define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
@@ -67,9 +71,11 @@ static void Clock_driver_support_initialize_hardware()
uint32_t preScaleCode = 0; uint32_t preScaleCode = 0;
uint32_t clk = bsp_get_CPU_clock_speed() >> 1; uint32_t clk = bsp_get_CPU_clock_speed() >> 1;
uint32_t tps = 1000000 / Configuration.microseconds_per_tick; uint32_t tps = 1000000 / Configuration.microseconds_per_tick;
while (preScaleCode < 15) { while (preScaleCode < 15) {
pmr = (clk >> preScaleCode) / tps; pmr = (clk >> preScaleCode) / tps;
if(pmr < (1 << 15)) break; if (pmr < (1 << 15))
break;
preScaleCode++; preScaleCode++;
} }
s_nanoScale = 1000000000 / (clk >> preScaleCode); s_nanoScale = 1000000000 / (clk >> preScaleCode);
@@ -82,14 +88,10 @@ static void Clock_driver_support_initialize_hardware()
rtems_interrupt_enable(level); rtems_interrupt_enable(level);
MCF_PIT1_PCSR = MCF_PIT_PCSR_PRE(preScaleCode) | MCF_PIT1_PCSR = MCF_PIT_PCSR_PRE(preScaleCode) |
MCF_PIT_PCSR_OVW | MCF_PIT_PCSR_OVW | MCF_PIT_PCSR_PIE | MCF_PIT_PCSR_RLD;
MCF_PIT_PCSR_PIE |
MCF_PIT_PCSR_RLD;
MCF_PIT1_PMR = pmr; MCF_PIT1_PMR = pmr;
MCF_PIT1_PCSR = MCF_PIT_PCSR_PRE(preScaleCode) | MCF_PIT1_PCSR = MCF_PIT_PCSR_PRE(preScaleCode) |
MCF_PIT_PCSR_PIE | MCF_PIT_PCSR_PIE | MCF_PIT_PCSR_RLD | MCF_PIT_PCSR_EN;
MCF_PIT_PCSR_RLD |
MCF_PIT_PCSR_EN;
s_pcntrAtTick = MCF_PIT1_PCNTR; s_pcntrAtTick = MCF_PIT1_PCNTR;
} }

View File

@@ -25,8 +25,7 @@
static int IntUartPollWrite(int minor, const char *buf, int len); static int IntUartPollWrite(int minor, const char *buf, int len);
static int IntUartInterruptWrite(int minor, const char *buf, int len); static int IntUartInterruptWrite(int minor, const char *buf, int len);
static void static void _BSP_null_char(char c)
_BSP_null_char( char c )
{ {
int level; int level;
@@ -40,6 +39,7 @@ _BSP_null_char( char c )
continue; continue;
rtems_interrupt_enable(level); rtems_interrupt_enable(level);
} }
BSP_output_char_function_type BSP_output_char = _BSP_null_char; BSP_output_char_function_type BSP_output_char = _BSP_null_char;
#define MAX_UART_INFO 3 #define MAX_UART_INFO 3
@@ -68,7 +68,8 @@ struct IntUartInfoStruct IntUartInfo[MAX_UART_INFO];
Description : This updates the hardware UART settings. Description : This updates the hardware UART settings.
***************************************************************************/ ***************************************************************************/
static void static void
IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwflow) IntUartSet(int minor, int baud, int databits, int parity, int stopbits,
int hwflow)
{ {
int divisor; int divisor;
uint32_t clock_speed; uint32_t clock_speed;
@@ -79,7 +80,6 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwfl
rtems_interrupt_disable(level); rtems_interrupt_disable(level);
/* disable interrupts, clear RTS line, and disable the UARTS */ /* disable interrupts, clear RTS line, and disable the UARTS */
MCF_UART_UIMR(minor) = 0; MCF_UART_UIMR(minor) = 0;
MCF_UART_UOP0(minor) = 1; MCF_UART_UOP0(minor) = 1;
@@ -95,15 +95,12 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwfl
clock_speed = bsp_get_CPU_clock_speed(); clock_speed = bsp_get_CPU_clock_speed();
/* determine the baud divisor value */ /* determine the baud divisor value */
// MRTODO
//divisor = ((clock_speed/2) / ( 32 * baud ));
divisor = ((clock_speed) / (32 * baud)); divisor = ((clock_speed) / (32 * baud));
if (divisor < 2) if (divisor < 2)
divisor = 2; divisor = 2;
/* check to see if doing hardware flow control */ /* check to see if doing hardware flow control */
if ( hwflow ) if (hwflow) {
{
/* set hardware flow options */ /* set hardware flow options */
umr1 |= MCF_UART_UMR_RXRTS; umr1 |= MCF_UART_UMR_RXRTS;
umr2 |= MCF_UART_UMR_TXCTS; umr2 |= MCF_UART_UMR_TXCTS;
@@ -124,7 +121,8 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwfl
MCF_UART_UMR(minor) = umr2; MCF_UART_UMR(minor) = umr2;
/* set the baud rate values */ /* set the baud rate values */
MCF_UART_UCSR(minor) = (MCF_UART_UCSR_RCS_SYS_CLK | MCF_UART_UCSR_TCS_SYS_CLK); MCF_UART_UCSR(minor) =
(MCF_UART_UCSR_RCS_SYS_CLK | MCF_UART_UCSR_TCS_SYS_CLK);
MCF_UART_UBG1(minor) = (divisor & 0xff00) >> 8; MCF_UART_UBG1(minor) = (divisor & 0xff00) >> 8;
MCF_UART_UBG2(minor) = (divisor & 0x00ff); MCF_UART_UBG2(minor) = (divisor & 0x00ff);
@@ -132,16 +130,14 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwfl
MCF_UART_UCR(minor) = (MCF_UART_UCR_TX_ENABLED | MCF_UART_UCR_RX_ENABLED); MCF_UART_UCR(minor) = (MCF_UART_UCR_TX_ENABLED | MCF_UART_UCR_RX_ENABLED);
/* check to see if interrupts need to be enabled */ /* check to see if interrupts need to be enabled */
if ( info->iomode != TERMIOS_POLLED ) if (info->iomode != TERMIOS_POLLED) {
{
/* enable rx interrupts */ /* enable rx interrupts */
info->uimr |= MCF_UART_UIMR_RXRDY_FU; info->uimr |= MCF_UART_UIMR_RXRDY_FU;
MCF_UART_UIMR(minor) = info->uimr; MCF_UART_UIMR(minor) = info->uimr;
} }
/* check to see if doing hardware flow control */ /* check to see if doing hardware flow control */
if ( hwflow ) if (hwflow) {
{
/* assert the RTS line */ /* assert the RTS line */
MCF_UART_UOP1(minor) = 1; MCF_UART_UOP1(minor) = 1;
} }
@@ -150,7 +146,6 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwfl
} }
/*************************************************************************** /***************************************************************************
Function : IntUartSetAttributes Function : IntUartSetAttributes
@@ -160,8 +155,7 @@ IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwfl
Note: The highest baudrate is 115200 as this stays within Note: The highest baudrate is 115200 as this stays within
an error of +/- 5% at 25MHz processor clock an error of +/- 5% at 25MHz processor clock
***************************************************************************/ ***************************************************************************/
static int static int IntUartSetAttributes(int minor, const struct termios *t)
IntUartSetAttributes(int minor, const struct termios *t)
{ {
/* set default index values */ /* set default index values */
int baud = (int) 19200; int baud = (int) 19200;
@@ -172,14 +166,12 @@ IntUartSetAttributes(int minor, const struct termios *t)
struct IntUartInfoStruct *info = &IntUartInfo[minor]; struct IntUartInfoStruct *info = &IntUartInfo[minor];
/* check to see if input is valid */ /* check to see if input is valid */
if ( t != (const struct termios *)0 ) if (t != (const struct termios *) 0) {
{
/* determine baud rate index */ /* determine baud rate index */
baud = termios_baud_to_number(t->c_cflag & CBAUD); baud = termios_baud_to_number(t->c_cflag & CBAUD);
/* determine data bits */ /* determine data bits */
switch ( t->c_cflag & CSIZE ) switch (t->c_cflag & CSIZE) {
{
case CS5: case CS5:
databits = (int) MCF_UART_UMR_BC_5; databits = (int) MCF_UART_UMR_BC_5;
break; break;
@@ -195,30 +187,24 @@ IntUartSetAttributes(int minor, const struct termios *t)
} }
/* determine if parity is enabled */ /* determine if parity is enabled */
if ( t->c_cflag & PARENB ) if (t->c_cflag & PARENB) {
{ if (t->c_cflag & PARODD) {
if ( t->c_cflag & PARODD )
{
/* odd parity */ /* odd parity */
parity = (int) MCF_UART_UMR_PM_ODD; parity = (int) MCF_UART_UMR_PM_ODD;
} } else {
else
{
/* even parity */ /* even parity */
parity = (int) MCF_UART_UMR_PM_EVEN; parity = (int) MCF_UART_UMR_PM_EVEN;
} }
} }
/* determine stop bits */ /* determine stop bits */
if ( t->c_cflag & CSTOPB ) if (t->c_cflag & CSTOPB) {
{
/* two stop bits */ /* two stop bits */
stopbits = (int) MCF_UART_UMR_SB_STOP_BITS_2; stopbits = (int) MCF_UART_UMR_SB_STOP_BITS_2;
} }
/* check to see if hardware flow control */ /* check to see if hardware flow control */
if ( t->c_cflag & CRTSCTS ) if (t->c_cflag & CRTSCTS) {
{
hwflow = 1; hwflow = 1;
} }
} }
@@ -227,9 +213,7 @@ IntUartSetAttributes(int minor, const struct termios *t)
if ((baud != info->baud) || if ((baud != info->baud) ||
(databits != info->databits) || (databits != info->databits) ||
(parity != info->parity) || (parity != info->parity) ||
( stopbits != info->stopbits ) || (stopbits != info->stopbits) || (hwflow != info->hwflow)) {
( hwflow != info->hwflow ) )
{
/* call function to set values */ /* call function to set values */
IntUartSet(minor, baud, databits, parity, stopbits, hwflow); IntUartSet(minor, baud, databits, parity, stopbits, hwflow);
@@ -246,21 +230,17 @@ IntUartSetAttributes(int minor, const struct termios *t)
determines which channel caused the interrupt before queueing any received determines which channel caused the interrupt before queueing any received
chars and dequeueing chars waiting for transmission. chars and dequeueing chars waiting for transmission.
***************************************************************************/ ***************************************************************************/
static rtems_isr static rtems_isr IntUartInterruptHandler(rtems_vector_number v)
IntUartInterruptHandler(rtems_vector_number v)
{ {
unsigned int chan = v - UART_INTC0_IRQ_VECTOR(0); unsigned int chan = v - UART_INTC0_IRQ_VECTOR(0);
struct IntUartInfoStruct *info = &IntUartInfo[chan]; struct IntUartInfoStruct *info = &IntUartInfo[chan];
/* check to see if received data */ /* check to see if received data */
if ( MCF_UART_UISR(chan) & MCF_UART_UISR_RXRDY_FU ) if (MCF_UART_UISR(chan) & MCF_UART_UISR_RXRDY_FU) {
{
/* read data and put into the receive buffer */ /* read data and put into the receive buffer */
while ( MCF_UART_USR(chan) & MCF_UART_USR_RXRDY ) while (MCF_UART_USR(chan) & MCF_UART_USR_RXRDY) {
{
if ( MCF_UART_USR(chan) & MCF_UART_USR_ERROR ) if (MCF_UART_USR(chan) & MCF_UART_USR_ERROR) {
{
/* clear the error */ /* clear the error */
MCF_UART_UCR(chan) = MCF_UART_UCR_RESET_ERROR; MCF_UART_UCR(chan) = MCF_UART_UCR_RESET_ERROR;
} }
@@ -270,25 +250,21 @@ IntUartInterruptHandler(rtems_vector_number v)
/* update buffer values */ /* update buffer values */
info->rx_in++; info->rx_in++;
if ( info->rx_in >= RX_BUFFER_SIZE ) if (info->rx_in >= RX_BUFFER_SIZE) {
{
info->rx_in = 0; info->rx_in = 0;
} }
} }
/* Make sure the port has been opened */ /* Make sure the port has been opened */
if ( info->ttyp ) if (info->ttyp) {
{
/* check to see if task driven */ /* check to see if task driven */
if ( info->iomode == TERMIOS_TASK_DRIVEN ) if (info->iomode == TERMIOS_TASK_DRIVEN) {
{
/* notify rx task that rx buffer has data */ /* notify rx task that rx buffer has data */
rtems_termios_rxirq_occured(info->ttyp); rtems_termios_rxirq_occured(info->ttyp);
} } else {
else
{
/* Push up the received data */ /* Push up the received data */
rtems_termios_enqueue_raw_characters(info->ttyp, info->rx_buffer, info->rx_in); rtems_termios_enqueue_raw_characters(info->ttyp, info->rx_buffer,
info->rx_in);
info->rx_in = 0; info->rx_in = 0;
} }
} }
@@ -296,8 +272,7 @@ IntUartInterruptHandler(rtems_vector_number v)
/* check to see if data needs to be transmitted */ /* check to see if data needs to be transmitted */
if ((info->uimr & MCF_UART_UIMR_TXRDY) && if ((info->uimr & MCF_UART_UIMR_TXRDY) &&
( MCF_UART_UISR(chan) & MCF_UART_UISR_TXRDY ) ) (MCF_UART_UISR(chan) & MCF_UART_UISR_TXRDY)) {
{
/* disable tx interrupts */ /* disable tx interrupts */
info->uimr &= ~MCF_UART_UIMR_TXRDY; info->uimr &= ~MCF_UART_UIMR_TXRDY;
@@ -309,8 +284,6 @@ IntUartInterruptHandler(rtems_vector_number v)
} }
} }
/*************************************************************************** /***************************************************************************
Function : IntUartInitialize Function : IntUartInitialize
@@ -318,16 +291,14 @@ IntUartInterruptHandler(rtems_vector_number v)
internal uarts. If the internal uart is to be interrupt driven then the internal uarts. If the internal uart is to be interrupt driven then the
interrupt vectors are hooked. interrupt vectors are hooked.
***************************************************************************/ ***************************************************************************/
static void static void IntUartInitialize(void)
IntUartInitialize(void)
{ {
unsigned int chan; unsigned int chan;
struct IntUartInfoStruct *info; struct IntUartInfoStruct *info;
rtems_isr_entry old_handler; rtems_isr_entry old_handler;
int level; int level;
for ( chan = 0; chan < MAX_UART_INFO; chan++ ) for (chan = 0; chan < MAX_UART_INFO; chan++) {
{
info = &IntUartInfo[chan]; info = &IntUartInfo[chan];
info->ttyp = NULL; info->ttyp = NULL;
@@ -342,11 +313,9 @@ IntUartInitialize(void)
MCF_UART_UACR(chan) = 0; MCF_UART_UACR(chan) = 0;
MCF_UART_UIMR(chan) = 0; MCF_UART_UIMR(chan) = 0;
if ( info->iomode != TERMIOS_POLLED ) if (info->iomode != TERMIOS_POLLED) {
{
rtems_interrupt_catch(IntUartInterruptHandler, rtems_interrupt_catch(IntUartInterruptHandler,
UART_INTC0_IRQ_VECTOR(chan), UART_INTC0_IRQ_VECTOR(chan), &old_handler);
&old_handler);
} }
/* set uart default values */ /* set uart default values */
@@ -358,32 +327,27 @@ IntUartInitialize(void)
case 0: case 0:
MCF_INTC0_ICR13 = MCF_INTC_ICR_IL(UART0_IRQ_LEVEL) | MCF_INTC0_ICR13 = MCF_INTC_ICR_IL(UART0_IRQ_LEVEL) |
MCF_INTC_ICR_IP(UART0_IRQ_PRIORITY); MCF_INTC_ICR_IP(UART0_IRQ_PRIORITY);
MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK13 | MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK13 | MCF_INTC_IMRL_MASKALL);
MCF_INTC_IMRL_MASKALL);
break; break;
case 1: case 1:
MCF_INTC0_ICR14 = MCF_INTC_ICR_IL(UART1_IRQ_LEVEL) | MCF_INTC0_ICR14 = MCF_INTC_ICR_IL(UART1_IRQ_LEVEL) |
MCF_INTC_ICR_IP(UART1_IRQ_PRIORITY); MCF_INTC_ICR_IP(UART1_IRQ_PRIORITY);
MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK14 | MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK14 | MCF_INTC_IMRL_MASKALL);
MCF_INTC_IMRL_MASKALL);
break; break;
case 2: case 2:
MCF_INTC0_ICR15 = MCF_INTC_ICR_IL(UART2_IRQ_LEVEL) | MCF_INTC0_ICR15 = MCF_INTC_ICR_IL(UART2_IRQ_LEVEL) |
MCF_INTC_ICR_IP(UART2_IRQ_PRIORITY); MCF_INTC_ICR_IP(UART2_IRQ_PRIORITY);
MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK15 | MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK15 | MCF_INTC_IMRL_MASKALL);
MCF_INTC_IMRL_MASKALL);
break; break;
} }
rtems_interrupt_enable(level); rtems_interrupt_enable(level);
} /* of chan loop */ } /* of chan loop */
} /* IntUartInitialise */ } /* IntUartInitialise */
/*************************************************************************** /***************************************************************************
Function : IntUartInterruptWrite Function : IntUartInterruptWrite
@@ -392,8 +356,7 @@ IntUartInitialize(void)
to initiate a transmit sequence. Calling this routine enables Tx to initiate a transmit sequence. Calling this routine enables Tx
interrupts. interrupts.
***************************************************************************/ ***************************************************************************/
static int static int IntUartInterruptWrite(int minor, const char *buf, int len)
IntUartInterruptWrite (int minor, const char *buf, int len)
{ {
int level; int level;
@@ -415,8 +378,7 @@ IntUartInterruptWrite (int minor, const char *buf, int len)
Description : This enables interrupts when the tty is opened. Description : This enables interrupts when the tty is opened.
***************************************************************************/ ***************************************************************************/
static int static int IntUartInterruptOpen(int major, int minor, void *arg)
IntUartInterruptOpen(int major, int minor, void *arg)
{ {
struct IntUartInfoStruct *info = &IntUartInfo[minor]; struct IntUartInfoStruct *info = &IntUartInfo[minor];
@@ -424,16 +386,14 @@ IntUartInterruptOpen(int major, int minor, void *arg)
MCF_UART_UCR(minor) = (MCF_UART_UCR_TX_ENABLED | MCF_UART_UCR_RX_ENABLED); MCF_UART_UCR(minor) = (MCF_UART_UCR_TX_ENABLED | MCF_UART_UCR_RX_ENABLED);
/* check to see if interrupts need to be enabled */ /* check to see if interrupts need to be enabled */
if ( info->iomode != TERMIOS_POLLED ) if (info->iomode != TERMIOS_POLLED) {
{
/* enable rx interrupts */ /* enable rx interrupts */
info->uimr |= MCF_UART_UIMR_RXRDY_FU; info->uimr |= MCF_UART_UIMR_RXRDY_FU;
MCF_UART_UIMR(minor) = info->uimr; MCF_UART_UIMR(minor) = info->uimr;
} }
/* check to see if doing hardware flow control */ /* check to see if doing hardware flow control */
if ( info->hwflow ) if (info->hwflow) {
{
/* assert the RTS line */ /* assert the RTS line */
MCF_UART_UOP1(minor) = 1; MCF_UART_UOP1(minor) = 1;
} }
@@ -441,15 +401,12 @@ IntUartInterruptOpen(int major, int minor, void *arg)
return (0); return (0);
} }
/*************************************************************************** /***************************************************************************
Function : IntUartInterruptClose Function : IntUartInterruptClose
Description : This disables interrupts when the tty is closed. Description : This disables interrupts when the tty is closed.
***************************************************************************/ ***************************************************************************/
static int static int IntUartInterruptClose(int major, int minor, void *arg)
IntUartInterruptClose(int major, int minor, void *arg)
{ {
struct IntUartInfoStruct *info = &IntUartInfo[minor]; struct IntUartInfoStruct *info = &IntUartInfo[minor];
@@ -473,8 +430,7 @@ IntUartInterruptClose(int major, int minor, void *arg)
and places them into the termios buffer. The rx interrupts will be and places them into the termios buffer. The rx interrupts will be
re-enabled after all data has been read. re-enabled after all data has been read.
***************************************************************************/ ***************************************************************************/
static int static int IntUartTaskRead(int minor)
IntUartTaskRead(int minor)
{ {
char buffer[RX_BUFFER_SIZE]; char buffer[RX_BUFFER_SIZE];
int count; int count;
@@ -484,33 +440,27 @@ IntUartTaskRead(int minor)
/* determine number of values to copy out */ /* determine number of values to copy out */
rx_in = info->rx_in; rx_in = info->rx_in;
if ( info->rx_out <= rx_in ) if (info->rx_out <= rx_in) {
{
count = rx_in - info->rx_out; count = rx_in - info->rx_out;
} } else {
else
{
count = (RX_BUFFER_SIZE - info->rx_out) + rx_in; count = (RX_BUFFER_SIZE - info->rx_out) + rx_in;
} }
/* copy data into local buffer from rx buffer */ /* copy data into local buffer from rx buffer */
while ( ( index < count ) && ( index < RX_BUFFER_SIZE ) ) while ((index < count) && (index < RX_BUFFER_SIZE)) {
{
/* copy data byte */ /* copy data byte */
buffer[index] = info->rx_buffer[info->rx_out]; buffer[index] = info->rx_buffer[info->rx_out];
index++; index++;
/* increment rx buffer values */ /* increment rx buffer values */
info->rx_out++; info->rx_out++;
if ( info->rx_out >= RX_BUFFER_SIZE ) if (info->rx_out >= RX_BUFFER_SIZE) {
{
info->rx_out = 0; info->rx_out = 0;
} }
} }
/* check to see if buffer is not empty */ /* check to see if buffer is not empty */
if ( count > 0 ) if (count > 0) {
{
/* set characters into termios buffer */ /* set characters into termios buffer */
rtems_termios_enqueue_raw_characters(info->ttyp, buffer, count); rtems_termios_enqueue_raw_characters(info->ttyp, buffer, count);
} }
@@ -518,16 +468,13 @@ IntUartTaskRead(int minor)
return (EOF); return (EOF);
} }
/*************************************************************************** /***************************************************************************
Function : IntUartPollRead Function : IntUartPollRead
Description : This reads a character from the internal uart. It returns Description : This reads a character from the internal uart. It returns
to the caller without blocking if not character is waiting. to the caller without blocking if not character is waiting.
***************************************************************************/ ***************************************************************************/
static int static int IntUartPollRead(int minor)
IntUartPollRead (int minor)
{ {
if ((MCF_UART_USR(minor) & MCF_UART_USR_RXRDY) == 0) if ((MCF_UART_USR(minor) & MCF_UART_USR_RXRDY) == 0)
return (-1); return (-1);
@@ -535,7 +482,6 @@ IntUartPollRead (int minor)
return (MCF_UART_URB(minor)); return (MCF_UART_URB(minor));
} }
/*************************************************************************** /***************************************************************************
Function : IntUartPollWrite Function : IntUartPollWrite
@@ -543,12 +489,10 @@ IntUartPollRead (int minor)
appropriate internal uart channel waiting till each one is sucessfully appropriate internal uart channel waiting till each one is sucessfully
transmitted. transmitted.
***************************************************************************/ ***************************************************************************/
static int static int IntUartPollWrite(int minor, const char *buf, int len)
IntUartPollWrite (int minor, const char *buf, int len)
{ {
/* loop over buffer */ /* loop over buffer */
while ( len-- ) while (len--) {
{
/* block until we can transmit */ /* block until we can transmit */
while ((MCF_UART_USR(minor) & MCF_UART_USR_TXRDY) == 0) while ((MCF_UART_USR(minor) & MCF_UART_USR_TXRDY) == 0)
continue; continue;
@@ -558,21 +502,18 @@ IntUartPollWrite (int minor, const char *buf, int len)
return (0); return (0);
} }
/*************************************************************************** /***************************************************************************
Function : console_initialize Function : console_initialize
Description : This initialises termios, both sets of uart hardware before Description : This initialises termios, both sets of uart hardware before
registering /dev/tty devices for each channel and the system /dev/console. registering /dev/tty devices for each channel and the system /dev/console.
***************************************************************************/ ***************************************************************************/
rtems_device_driver console_initialize( rtems_device_driver console_initialize(rtems_device_major_number major,
rtems_device_major_number major,
rtems_device_minor_number minor, rtems_device_minor_number minor,
void *arg) void *arg)
{ {
rtems_status_code status; rtems_status_code status;
/* Set up TERMIOS */ /* Set up TERMIOS */
rtems_termios_initialize(); rtems_termios_initialize();
@@ -582,25 +523,20 @@ rtems_device_driver console_initialize(
/* Register the console port */ /* Register the console port */
status = rtems_io_register_name("/dev/console", major, CONSOLE_PORT); status = rtems_io_register_name("/dev/console", major, CONSOLE_PORT);
if ( status != RTEMS_SUCCESSFUL ) if (status != RTEMS_SUCCESSFUL) {
{
rtems_fatal_error_occurred(status); rtems_fatal_error_occurred(status);
} }
/* Register the other port */ /* Register the other port */
if ( CONSOLE_PORT != 0 ) if (CONSOLE_PORT != 0) {
{
status = rtems_io_register_name("/dev/tty00", major, 0); status = rtems_io_register_name("/dev/tty00", major, 0);
if ( status != RTEMS_SUCCESSFUL ) if (status != RTEMS_SUCCESSFUL) {
{
rtems_fatal_error_occurred(status); rtems_fatal_error_occurred(status);
} }
} }
if ( CONSOLE_PORT != 1 ) if (CONSOLE_PORT != 1) {
{
status = rtems_io_register_name("/dev/tty01", major, 1); status = rtems_io_register_name("/dev/tty01", major, 1);
if ( status != RTEMS_SUCCESSFUL ) if (status != RTEMS_SUCCESSFUL) {
{
rtems_fatal_error_occurred(status); rtems_fatal_error_occurred(status);
} }
} }
@@ -616,10 +552,8 @@ rtems_device_driver console_initialize(
passed to termios when the devices is opened depending on whether it is passed to termios when the devices is opened depending on whether it is
polled or not. polled or not.
***************************************************************************/ ***************************************************************************/
rtems_device_driver console_open( rtems_device_driver console_open(rtems_device_major_number major,
rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
rtems_device_minor_number minor,
void * arg)
{ {
rtems_status_code status = RTEMS_INVALID_NUMBER; rtems_status_code status = RTEMS_INVALID_NUMBER;
rtems_libio_open_close_args_t *args = (rtems_libio_open_close_args_t *) arg; rtems_libio_open_close_args_t *args = (rtems_libio_open_close_args_t *) arg;
@@ -658,11 +592,9 @@ rtems_device_driver console_open(
}; };
/* open the port depending on the minor device number */ /* open the port depending on the minor device number */
if ( ( minor >= 0 ) && ( minor < MAX_UART_INFO ) ) if ((minor >= 0) && (minor < MAX_UART_INFO)) {
{
info = &IntUartInfo[minor]; info = &IntUartInfo[minor];
switch ( info->iomode ) switch (info->iomode) {
{
case TERMIOS_POLLED: case TERMIOS_POLLED:
status = rtems_termios_open(major, minor, arg, &IntUartPollCallbacks); status = rtems_termios_open(major, minor, arg, &IntUartPollCallbacks);
break; break;
@@ -677,14 +609,13 @@ rtems_device_driver console_open(
} }
} }
if (status == RTEMS_SUCCESSFUL) if (status == RTEMS_SUCCESSFUL) {
{
/* /*
* Reset the default baudrate. * Reset the default baudrate.
*/ */
struct termios term; struct termios term;
if (tcgetattr (STDIN_FILENO, &term) >= 0)
{ if (tcgetattr(STDIN_FILENO, &term) >= 0) {
term.c_cflag &= ~(CBAUD | CSIZE); term.c_cflag &= ~(CBAUD | CSIZE);
term.c_cflag |= CS8 | B19200; term.c_cflag |= CS8 | B19200;
tcsetattr(STDIN_FILENO, TCSANOW, &term); tcsetattr(STDIN_FILENO, TCSANOW, &term);
@@ -699,10 +630,8 @@ rtems_device_driver console_open(
Description : This closes the device via termios Description : This closes the device via termios
***************************************************************************/ ***************************************************************************/
rtems_device_driver console_close( rtems_device_driver console_close(rtems_device_major_number major,
rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
rtems_device_minor_number minor,
void * arg)
{ {
return (rtems_termios_close(arg)); return (rtems_termios_close(arg));
} }
@@ -713,10 +642,8 @@ rtems_device_driver console_close(
Description : Read from the device via termios Description : Read from the device via termios
***************************************************************************/ ***************************************************************************/
rtems_device_driver console_read( rtems_device_driver console_read(rtems_device_major_number major,
rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
rtems_device_minor_number minor,
void * arg)
{ {
return (rtems_termios_read(arg)); return (rtems_termios_read(arg));
} }
@@ -726,10 +653,8 @@ rtems_device_driver console_read(
Description : Write to the device via termios Description : Write to the device via termios
***************************************************************************/ ***************************************************************************/
rtems_device_driver console_write( rtems_device_driver console_write(rtems_device_major_number major,
rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
rtems_device_minor_number minor,
void * arg)
{ {
return (rtems_termios_write(arg)); return (rtems_termios_write(arg));
} }
@@ -739,8 +664,7 @@ rtems_device_driver console_write(
Description : Pass the IOCtl call to termios Description : Pass the IOCtl call to termios
***************************************************************************/ ***************************************************************************/
rtems_device_driver console_control( rtems_device_driver console_control(rtems_device_major_number major,
rtems_device_major_number major,
rtems_device_minor_number minor, rtems_device_minor_number minor,
void *arg) void *arg)
{ {
@@ -762,6 +686,7 @@ void DEBUG_OUTNUM(int i)
{ {
int n; int n;
static const char map[] = "0123456789ABCDEF"; static const char map[] = "0123456789ABCDEF";
DEBUG_OUTCHAR(' '); DEBUG_OUTCHAR(' ');
for (n = 28; n >= 0; n -= 4) for (n = 28; n >= 0; n -= 4)
DEBUG_OUTCHAR(map[(i >> n) & 0xF]); DEBUG_OUTCHAR(map[(i >> n) & 0xF]);

View File

@@ -24,10 +24,12 @@ define show-exception-sframe
end end
# Add -v and -d flags for bdm info # Add -v and -d flags for bdm info
# Add -B flags to utilize hardware breakpoints when they are availiable
#target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0 #target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
target remote | m68k-bdm-gdbserver pipe /dev/tblcf2 -B target remote | m68k-bdm-gdbserver pipe /dev/tblcf2 -B
#monitor set remote-debug 1 #monitor set remote-debug 1
monitor bdm-reset monitor bdm-reset
# Set VBR to the beginning of what will be SRAM # Set VBR to the beginning of what will be SRAM
@@ -42,5 +44,5 @@ monitor bdm-ctl-set 0x0C04 0x00000061
# Enable PST[3:0] signals # Enable PST[3:0] signals
set *((char*) 0x40100074) = 0x0F set *((char*) 0x40100074) = 0x0F
# Add the load when debugging from ram, should never happen with rtems # Add the load when debugging from ram which won't happen with rtems!
#load #load

View File

@@ -19,16 +19,13 @@ extern "C" {
/***************************************************************************/ /***************************************************************************/
/** Hardware data structure headers **/ /** Hardware data structure headers **/
#include <mcf52235/mcf52235.h> /* internal MCF52235 modules */ #include <mcf5223x/mcf5223x.h>
/* Declare base address of peripherals area */
#define __IPSBAR ((vuint8 *) 0x40000000)
/***************************************************************************/ /***************************************************************************/
/** Network driver configuration **/ /** Network driver configuration **/
#if 0
struct rtems_bsdnet_ifconfig;
extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching );
#define RTEMS_BSP_NETWORK_DRIVER_NAME "fs1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_fec_driver_attach
#endif
/***************************************************************************/ /***************************************************************************/
/** User Definable configuration **/ /** User Definable configuration **/
@@ -58,7 +55,9 @@ extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int at
/* functions */ /* functions */
uint32_t bsp_get_CPU_clock_speed(void); uint32_t bsp_get_CPU_clock_speed(void);
void bsp_cleanup(void); void bsp_cleanup(void);
m68k_isr_entry set_vector( m68k_isr_entry set_vector(
rtems_isr_entry handler, rtems_isr_entry handler,
rtems_vector_number vector, rtems_vector_number vector,
@@ -69,9 +68,6 @@ m68k_isr_entry set_vector(
* Interrupt assignments * Interrupt assignments
* Highest-priority listed first * Highest-priority listed first
*/ */
#define FEC_IRQ_LEVEL 4
#define FEC_IRQ_RX_PRIORITY 7
#define FEC_IRQ_TX_PRIORITY 6
#define PIT3_IRQ_LEVEL 4 #define PIT3_IRQ_LEVEL 4
#define PIT3_IRQ_PRIORITY 0 #define PIT3_IRQ_PRIORITY 0

View File

@@ -40,17 +40,17 @@
#define CALLING_OVERHEAD_TASK_MODE 0 #define CALLING_OVERHEAD_TASK_MODE 0
#define CALLING_OVERHEAD_TASK_GET_NOTE 0 #define CALLING_OVERHEAD_TASK_GET_NOTE 0
#define CALLING_OVERHEAD_TASK_SET_NOTE 0 #define CALLING_OVERHEAD_TASK_SET_NOTE 0
#define CALLING_OVERHEAD_TASK_WAKE_WHEN 1 #define CALLING_OVERHEAD_TASK_WAKE_WHEN 0
#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0 #define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
#define CALLING_OVERHEAD_INTERRUPT_CATCH 0 #define CALLING_OVERHEAD_INTERRUPT_CATCH 0
#define CALLING_OVERHEAD_CLOCK_GET 1 #define CALLING_OVERHEAD_CLOCK_GET 0
#define CALLING_OVERHEAD_CLOCK_SET 1 #define CALLING_OVERHEAD_CLOCK_SET 0
#define CALLING_OVERHEAD_CLOCK_TICK 0 #define CALLING_OVERHEAD_CLOCK_TICK 0
#define CALLING_OVERHEAD_TIMER_CREATE 0 #define CALLING_OVERHEAD_TIMER_CREATE 0
#define CALLING_OVERHEAD_TIMER_IDENT 0 #define CALLING_OVERHEAD_TIMER_IDENT 0
#define CALLING_OVERHEAD_TIMER_DELETE 0 #define CALLING_OVERHEAD_TIMER_DELETE 0
#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 1 #define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 1 #define CALLING_OVERHEAD_TIMER_FIRE_WHEN 1
#define CALLING_OVERHEAD_TIMER_RESET 0 #define CALLING_OVERHEAD_TIMER_RESET 0
#define CALLING_OVERHEAD_TIMER_CANCEL 0 #define CALLING_OVERHEAD_TIMER_CANCEL 0

View File

@@ -31,7 +31,7 @@ SYM(_INTERRUPT_VECTOR):
.long SYM(_uhoh) /* 02 Access Error */ .long SYM(_uhoh) /* 02 Access Error */
.long SYM(_uhoh) /* 03 Address Error */ .long SYM(_uhoh) /* 03 Address Error */
.long SYM(_uhoh) /* 04 Illegal Instruction */ .long SYM(_uhoh) /* 04 Illegal Instruction */
.long SYM(_uhoh) /* 05 Reserved */ .long SYM(_uhoh) /* 05 Divide by Zero */
.long SYM(_uhoh) /* 06 Reserved */ .long SYM(_uhoh) /* 06 Reserved */
.long SYM(_uhoh) /* 07 Reserved */ .long SYM(_uhoh) /* 07 Reserved */
.long SYM(_uhoh) /* 08 Privilege Violation */ .long SYM(_uhoh) /* 08 Privilege Violation */
@@ -41,7 +41,7 @@ SYM(_INTERRUPT_VECTOR):
.long SYM(_uhoh) /* 12 Debug Interrupt */ .long SYM(_uhoh) /* 12 Debug Interrupt */
.long SYM(_uhoh) /* 13 Reserved */ .long SYM(_uhoh) /* 13 Reserved */
.long SYM(_uhoh) /* 14 Format Error */ .long SYM(_uhoh) /* 14 Format Error */
.long SYM(_uhoh) /* 15 Unitialized Int. */ .long SYM(_uhoh) /* 15 Reserved */
.long SYM(_uhoh) /* 16 Reserved */ .long SYM(_uhoh) /* 16 Reserved */
.long SYM(_uhoh) /* 17 Reserved */ .long SYM(_uhoh) /* 17 Reserved */
.long SYM(_uhoh) /* 18 Reserved */ .long SYM(_uhoh) /* 18 Reserved */
@@ -51,13 +51,13 @@ SYM(_INTERRUPT_VECTOR):
.long SYM(_uhoh) /* 22 Reserved */ .long SYM(_uhoh) /* 22 Reserved */
.long SYM(_uhoh) /* 23 Reserved */ .long SYM(_uhoh) /* 23 Reserved */
.long SYM(_spuriousInterrupt) /* 24 Spurious Interrupt */ .long SYM(_spuriousInterrupt) /* 24 Spurious Interrupt */
.long SYM(_uhoh) /* 25 Autovector Level 1 */ .long SYM(_uhoh) /* 25 Reserved */
.long SYM(_uhoh) /* 26 Autovector Level 2 */ .long SYM(_uhoh) /* 26 Reserved */
.long SYM(_uhoh) /* 27 Autovector Level 3 */ .long SYM(_uhoh) /* 27 Reserved */
.long SYM(_uhoh) /* 28 Autovector Level 4 */ .long SYM(_uhoh) /* 28 Reserved */
.long SYM(_uhoh) /* 29 Autovector Level 5 */ .long SYM(_uhoh) /* 29 Reserved */
.long SYM(_uhoh) /* 30 Autovector Level 6 */ .long SYM(_uhoh) /* 30 Reserved */
.long SYM(_uhoh) /* 31 Autovector Level 7 */ .long SYM(_uhoh) /* 31 Reserved */
.long SYM(_uhoh) /* 32 TRAP #0 */ .long SYM(_uhoh) /* 32 TRAP #0 */
.long SYM(_uhoh) /* 33 TRAP #1 */ .long SYM(_uhoh) /* 33 TRAP #1 */
.long SYM(_uhoh) /* 34 TRAP #2 */ .long SYM(_uhoh) /* 34 TRAP #2 */
@@ -314,17 +314,6 @@ _cfm_msec: .long 0x00000000
.align 4 .align 4
PUBLIC (_uhoh) PUBLIC (_uhoh)
SYM(_uhoh): SYM(_uhoh):
/*
link a6,#0
lea -20(sp), sp
movem.l d0-d2/a0-a1, (sp)
pea.l 20(sp) | push exception frame address
jsr mcf5xxx_exception_handler
movem.l 4(sp), d0-d2/a0-a1
lea 24(sp), sp
unlk a6
rte
*/
nop | Leave spot for breakpoint nop | Leave spot for breakpoint
stop #0x2700 | Stop with interrupts disabled stop #0x2700 | Stop with interrupts disabled
bra.w SYM(_uhoh) | Stuck forever bra.w SYM(_uhoh) | Stuck forever

View File

@@ -25,10 +25,8 @@
void bsp_cleanup(void) void bsp_cleanup(void)
{ {
printk("\nRTEMS exited!\n"); printk("\nRTEMS exited!\n");
for ( ;; ) for (;;) {
{
asm volatile (" nop "); asm volatile (" nop ");
asm volatile (" nop "); asm volatile (" nop ");
} }
} }

View File

@@ -21,7 +21,6 @@ _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x400; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x400;
_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000; _FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000;
__IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000;
_VBR = 0x20000000; _VBR = 0x20000000;
ENTRY(start) ENTRY(start)
@@ -143,21 +142,23 @@ SECTIONS
.bss : .bss :
{ {
_clear_start = .; PROVIDE (_clear_start = .);
*(.bss*) *(.bss*)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_end = .); PROVIDE (_end = .);
PROVIDE (_clear_end = .);
} >sram
.stack :
{
/* /*
* Starting Stack * Starting Stack
*/ */
. += _StackSize; . += _StackSize;
. = ALIGN (16); . = ALIGN (16);
PROVIDE(_StackInit = .); PROVIDE(_StackInit = .);
PROVIDE(_WorkspaceBase = .);
_clear_end = .;
_WorkspaceBase = .;
} >sram } >sram
/* Stabs debugging sections. */ /* Stabs debugging sections. */

View File

@@ -16,28 +16,19 @@
#include <rtems.h> #include <rtems.h>
#include <bsp.h> #include <bsp.h>
typedef volatile unsigned char vuint8; void Timer_initialize(void)
typedef volatile unsigned short vuint16;
typedef volatile unsigned long vuint32;
/* Declare base address of peripherals area */
#define __IPSBAR ((vuint8 *) 0x40000000)
void
Timer_initialize(void)
{ {
uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000; uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
MCF_DTIM3_DTMR = 0; MCF_DTIM3_DTMR = 0;
MCF_DTIM3_DTMR = MCF_DTIM_DTMR_PS(preScaleDivisor - 1) | MCF_DTIM3_DTMR = MCF_DTIM_DTMR_PS(preScaleDivisor - 1) |
MCF_DTIM_DTMR_CLK_DIV1 | MCF_DTIM_DTMR_CLK_DIV1 | MCF_DTIM_DTMR_RST;
MCF_DTIM_DTMR_RST;
} }
/* /*
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int int Read_timer(void)
Read_timer(void)
{ {
return MCF_DTIM3_DTCN; return MCF_DTIM3_DTCN;
} }
@@ -46,13 +37,11 @@ Read_timer(void)
* Empty function call used in loops to measure basic cost of looping * Empty function call used in loops to measure basic cost of looping
* in Timing Test Suite. * in Timing Test Suite.
*/ */
rtems_status_code rtems_status_code Empty_function(void)
Empty_function(void)
{ {
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
void void Set_find_average_overhead(rtems_boolean find_flag)
Set_find_average_overhead(rtems_boolean find_flag)
{ {
} }