diff options
Diffstat (limited to 'c/src/lib/libbsp/m68k/mrm332')
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/console/console.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/console/sci.c | 35 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/console/sci.h | 12 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/include/mrm332.h | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/start/start.S | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/startup/except_vect_332_ROM.S | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/timer/timer.c | 2 |
7 files changed, 3 insertions, 55 deletions
diff --git a/c/src/lib/libbsp/m68k/mrm332/console/console.c b/c/src/lib/libbsp/m68k/mrm332/console/console.c index 757b196dc6..909adaec50 100644 --- a/c/src/lib/libbsp/m68k/mrm332/console/console.c +++ b/c/src/lib/libbsp/m68k/mrm332/console/console.c @@ -138,7 +138,6 @@ rtems_device_driver console_initialize( */ rtems_termios_initialize(); - /* * register the SCI device name for termios * do this over in the sci driver init routine? @@ -151,7 +150,6 @@ rtems_device_driver console_initialize( rtems_fatal_error_occurred(status); } - /* * Link the uart device to the console device */ diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.c b/c/src/lib/libbsp/m68k/mrm332/console/sci.c index 97c4a5c1b5..823ee215b2 100644 --- a/c/src/lib/libbsp/m68k/mrm332/console/sci.c +++ b/c/src/lib/libbsp/m68k/mrm332/console/sci.c @@ -36,6 +36,9 @@ * $Id$ * * $Log$ +* Revision 1.7 2004/04/21 10:42:52 ralf +* Remove stray white spaces. +* * Revision 1.6 2004/04/15 13:26:13 ralf * Remove stray white spaces. * @@ -162,14 +165,12 @@ #define SCI_MINOR 0 // minor device number - // IMPORTANT - if the device driver api is opened, it means the sci is being // used for direct hardware access, so other users (like termios) get ignored #define DRIVER_CLOSED 0 // the device driver api is closed #define DRIVER_OPENED 1 // the device driver api is opened - // system clock definitions, i dont have documentation on this... #if 0 // Not needed, this is provided in mrm332.h @@ -188,7 +189,6 @@ Section C - External Data *****************************************************************************/ - /***************************************************************************** @@ -266,7 +266,6 @@ void SciPrintStats(); // test routine static struct rtems_termios_tty *SciTermioTty; - static uint8_t SciInited = 0; // has the driver been inited static uint8_t SciOpened; // has the driver been opened @@ -292,7 +291,6 @@ BSP_polling_getchar_function_type BSP_poll_char = NULL; #endif - // cvs id string so you can use the unix ident command on the object #ifdef ID_STRINGS @@ -338,7 +336,6 @@ static const rtems_termios_callbacks SciInterruptCallbacks = TRUE // output uses interrupts }; - /***************************************************************************** Section I - RTEMS termios callbacks for the polled version of the driver *****************************************************************************/ @@ -363,7 +360,6 @@ static const rtems_termios_callbacks SciPolledCallbacks = // ///////////////////////////////////////////////////////////////////////////// - /**************************************************************************** * Func: SCI_output_char * Desc: used by rtems printk function to send a char to the uart @@ -419,13 +415,11 @@ rtems_isr SciIsr( rtems_vector_number vector ) { uint8_t ch; - if ( (*SCSR) & SCI_ERROR_PARITY ) SciErrorsParity ++; if ( (*SCSR) & SCI_ERROR_FRAMING ) SciErrorsFraming ++; if ( (*SCSR) & SCI_ERROR_NOISE ) SciErrorsNoise ++; if ( (*SCSR) & SCI_ERROR_OVERRUN ) SciErrorsOverrun ++; - // see if it was a transmit interrupt if ( (*SCSR) & SCI_XMTR_AVAILABLE ) // data reg empty, xmt complete @@ -474,7 +468,6 @@ rtems_isr SciIsr( rtems_vector_number vector ) // ///////////////////////////////////////////////////////////////////////////// - /**************************************************************************** * Func: SciRcvBufGetChar * Desc: read a character from the circular buffer @@ -511,7 +504,6 @@ static int8_t SciRcvBufGetChar() } - /**************************************************************************** * Func: SciRcvBufPutChar * Desc: put a character into the rcv data circular buffer @@ -584,7 +576,6 @@ static void SciRcvBufFlush( void ) // ///////////////////////////////////////////////////////////////////////////// - /**************************************************************************** * Func: SciInterruptOpen * Desc: open routine for the interrupt based device driver @@ -635,7 +626,6 @@ SciSetBaud( 19200); // set the baud rate SciSetDataBits(SCI_8_DATA_BITS); // set data bits to 8 - // Install our interrupt handler into RTEMS, where does 66 come from? rtems_interrupt_catch( SciIsr, 66, &old_vector ); @@ -778,7 +768,6 @@ int32_t SciSetAttributes( sci_parity = SCI_PARITY_NONE; // no parity, most common } - // set the number of data bits, 8 is most common if (t->c_cflag & CSIZE) // was it specified? @@ -794,7 +783,6 @@ int32_t SciSetAttributes( sci_databits = SCI_8_DATA_BITS; // default to 8 data bits } - // the number of stop bits; always 1 for SCI if (t->c_cflag & CSTOPB) @@ -802,7 +790,6 @@ int32_t SciSetAttributes( // do nothing } - // setup the hardware with these serial port parameters SciSetBaud(sci_rate); // set the baud rate @@ -811,7 +798,6 @@ int32_t SciSetAttributes( SciSetDataBits(sci_databits); // set the data bits - return RTEMS_SUCCESSFUL; } @@ -978,7 +964,6 @@ int32_t SciPolledWrite( // ///////////////////////////////////////////////////////////////////////////// - /**************************************************************************** * Func: SciInit * Desc: Initialize the lasers device driver and hardware @@ -1000,7 +985,6 @@ rtems_device_driver SciInitialize ( //printk("%s\r\n", __FUNCTION__); - // register the SCI device name for termios console i/o // this is done over in console.c which doesn't seem exactly right // but there were problems doing it here... @@ -1010,15 +994,12 @@ rtems_device_driver SciInitialize ( // if (status != RTEMS_SUCCESSFUL) // rtems_fatal_error_occurred(status); - SciMajor = major; // save the rtems major number SciOpened = DRIVER_CLOSED; // initial state is closed - // if you have an interrupt handler, install it here - SciInited = 1; // set the inited flag return RTEMS_SUCCESSFUL; @@ -1129,7 +1110,6 @@ rtems_device_driver SciRead ( rw_args = (rtems_libio_rw_args_t *) arg; // arguments to read() - if (minor != SCI_MINOR) { return RTEMS_INVALID_NAME; // check the minor number @@ -1281,7 +1261,6 @@ rtems_device_driver SciControl ( // ///////////////////////////////////////////////////////////////////////////// - /**************************************************************************** * Func: SciSetBaud * Desc: setup the uart based on the termios modules requests @@ -1299,7 +1278,6 @@ static void SciSetBaud(uint32_t rate) // when you open the console you need to set the termio struct baud rate // it has a default value of 9600, when someone calls tcsetattr it reverts! - SciBaud = rate; // save the rate // calculate the register value as a float and convert to an int @@ -1499,7 +1477,6 @@ void SciWriteCharWait(uint8_t c) return; } - /**************************************************************************** * Func: SciWriteCharNoWait * Desc: if no room in the fifo throw the char on the floor @@ -1554,7 +1531,6 @@ uint8_t inline SciReadCharWait( void ) return ch; // return the char } - /**************************************************************************** * Func: SciReadCharNoWait * Desc: try to get a char but dont wait for one @@ -1579,7 +1555,6 @@ uint8_t inline SciReadCharNoWait( void ) } - /**************************************************************************** * Func: SciCharAvailable * Desc: is there a receive character in the data register @@ -1628,7 +1603,6 @@ void SciSendBreak( void ) // ///////////////////////////////////////////////////////////////////////////// - /**************************************************************************** * Func: SciUnitTest * Desc: test the device driver @@ -1646,17 +1620,14 @@ void SciUnitTest() uint16_t fd; // file descriptor for device uint16_t result; // result of ioctl - fd = open("/dev/sci",O_RDWR); // open the device printk("SCI open fd=%d\r\n",fd); - result = write(fd, "abcd\r\n", 6); // send a string printk("SCI write result=%d\r\n",result); - result = read(fd, &byte, 1); // read a byte printk("SCI read result=%d,byte=%x\r\n",result,byte); diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.h b/c/src/lib/libbsp/m68k/mrm332/console/sci.h index a5d780b10f..237c2897aa 100644 --- a/c/src/lib/libbsp/m68k/mrm332/console/sci.h +++ b/c/src/lib/libbsp/m68k/mrm332/console/sci.h @@ -8,11 +8,9 @@ * $Id$ ****************************************************************************/ - #ifndef _sci_h_ #define _sci_h_ - /******************************************************************************* IOCTL commands for the sci driver. I'm still working on these... @@ -46,12 +44,10 @@ #define SCI_IOCTL_MODE_9_BIT 0x82 // 9600,forced,8,1 command mode - /******************************************************************************* SCI Registers *******************************************************************************/ - // SCI Control Register 0 (SCCR0) $FFFC08 // 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1 @@ -79,7 +75,6 @@ // 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 1 0 0 reset value - (64k baud?) - #define SCI_BAUD_57_6K 9 #define SCI_BAUD_38_4K 14 #define SCI_BAUD_19_2K 27 @@ -89,7 +84,6 @@ #define SCI_BAUD_1200 437 - // SCI Control Register 1 (SCCR1) $FFFC0A // 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1 @@ -182,7 +176,6 @@ // 0 0 0 0 - 0 0 0 1 - 1 0 0 0 - 0 0 0 0 reset value - #define SCI_ERROR_PARITY 0x0001 // 0000-0000-0000-0001 #define SCI_ERROR_FRAMING 0x0002 // 0000-0000-0000-0010 #define SCI_ERROR_NOISE 0x0004 // 0000-0000-0000-0100 @@ -211,17 +204,14 @@ extern "C" { #endif - // look at console_open to see how this is called const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled ); - /* SCI interrupt */ //rtems_isr SciIsr( rtems_vector_number vector ); - //int32_t SciOpenPolled ( int32_t major, int32_t minor, void *arg ); //int32_t SciOpenInterrupt ( int32_t major, int32_t minor, void *arg ); @@ -234,10 +224,8 @@ const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled ); //int32_t SciSetAttributes ( int32_t minor, const struct termios *t ); - #ifdef __cplusplus } #endif - #endif // _sci_h_ diff --git a/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h b/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h index 8e385f8079..947fd9efce 100644 --- a/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h +++ b/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h @@ -6,14 +6,12 @@ #ifndef _MRM332_H_ #define _MRM332_H_ - /* SIM_MM (SIM Module Mapping) determines the location of the control register block. When MM=0, register addresses range fom 0x7ff000 to 0x7FFFFF. When MM=1, register addresses range from 0xfff000 to 0xffffff. */ #define SIM_MM 1 - /* Interrupt related definitions */ #define SIM_IARB 15 #define QSM_IARB 10 @@ -28,8 +26,6 @@ #define EFI_INT1 25 /* CTS interrupt */ #define ISRL_SCI 6 - - /* System Clock definitions */ #define XTAL 32768.0 /* crystal frequency in Hz */ @@ -57,7 +53,6 @@ #define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X))) #define SCI_BAUD 19200 /* RS232 Baud Rate */ - /* macros/functions */ #ifndef ASM diff --git a/c/src/lib/libbsp/m68k/mrm332/start/start.S b/c/src/lib/libbsp/m68k/mrm332/start/start.S index fec7bbee81..05bb23348d 100644 --- a/c/src/lib/libbsp/m68k/mrm332/start/start.S +++ b/c/src/lib/libbsp/m68k/mrm332/start/start.S @@ -25,7 +25,6 @@ BEGIN_CODE movel d0,sp movel d0,a6 - /* include in ram_init.S */ /* * Initalize the SIM module. diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/except_vect_332_ROM.S b/c/src/lib/libbsp/m68k/mrm332/startup/except_vect_332_ROM.S index edc0b633f4..a40f694e22 100644 --- a/c/src/lib/libbsp/m68k/mrm332/startup/except_vect_332_ROM.S +++ b/c/src/lib/libbsp/m68k/mrm332/startup/except_vect_332_ROM.S @@ -280,7 +280,6 @@ .long reboot /* exception vector: 254 */ .long reboot /* exception vector: 255 */ - _reboot: move #0x2700,%sr /* mask interrupts */ movea.l (0x0).w,%a7 /* load stack */ diff --git a/c/src/lib/libbsp/m68k/mrm332/timer/timer.c b/c/src/lib/libbsp/m68k/mrm332/timer/timer.c index 8100914286..5d2f050cf7 100644 --- a/c/src/lib/libbsp/m68k/mrm332/timer/timer.c +++ b/c/src/lib/libbsp/m68k/mrm332/timer/timer.c @@ -19,7 +19,6 @@ * $Id$ */ - #include <bsp.h> rtems_boolean Timer_driver_Find_average_overhead; @@ -64,7 +63,6 @@ int Read_timer( void ) return (total - AVG_OVERHEAD); } - /* * Empty function call used in loops to measure basic cost of looping * in Timing Test Suite. |