2 c/src/lib/libbsp/m68k/mo376/ChangeLog | 567 ++++
3 c/src/lib/libbsp/m68k/mo376/Makefile.am | 50
4 c/src/lib/libbsp/m68k/mo376/README | 24
5 c/src/lib/libbsp/m68k/mo376/bsp_specs | 13
6 c/src/lib/libbsp/m68k/mo376/clock/ckinit.c | 96
7 c/src/lib/libbsp/m68k/mo376/configure.ac | 20
8 c/src/lib/libbsp/m68k/mo376/console/console.c | 171 +
9 c/src/lib/libbsp/m68k/mo376/console/sci.c | 1596 ++++++++++++++
10 c/src/lib/libbsp/m68k/mo376/console/sci.h | 234 ++
11 c/src/lib/libbsp/m68k/mo376/include/bsp.h | 131 +
12 c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in | 16
13 c/src/lib/libbsp/m68k/mo376/include/mrm332.h | 70
14 c/src/lib/libbsp/m68k/mo376/include/tm27.h | 34
15 c/src/lib/libbsp/m68k/mo376/misc/dotests | 15
16 c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 | 16
17 c/src/lib/libbsp/m68k/mo376/misc/interr.c | 99
18 c/src/lib/libbsp/m68k/mo376/preinstall.am | 66
19 c/src/lib/libbsp/m68k/mo376/spurious/spinit.c | 105
20 c/src/lib/libbsp/m68k/mo376/start/start.S | 150 +
21 c/src/lib/libbsp/m68k/mo376/startup/bspclean.c | 27
22 c/src/lib/libbsp/m68k/mo376/startup/bspstart.c | 59
23 c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S | 293 ++
24 c/src/lib/libbsp/m68k/mo376/startup/linkcmds | 164 +
25 c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM | 200 +
26 c/src/lib/libbsp/m68k/mo376/startup/start_c.c | 125 +
27 c/src/lib/libbsp/m68k/mo376/timer/timer.c | 61
28 c/src/lib/libbsp/m68k/mo376/times | 195 +
29 make/custom/mo376.cfg | 55
30 28 files changed, 4652 insertions(+)
32 Index: rtems/make/custom/mo376.cfg
33 ===================================================================
34 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
35 +++ rtems/make/custom/mo376.cfg 2009-11-29 01:21:43.173939736 +0100
38 +# Config file for the mrm332 BSP
40 +# $Id: mrm332.cfg,v 1.18 2008/06/11 08:17:27 ccj Exp $
43 +include $(RTEMS_ROOT)/make/custom/default.cfg
46 +RTEMS_CPU_MODEL=m68332
48 +# This is the actual bsp directory used during the build process.
49 +RTEMS_BSP_FAMILY=mrm332
51 +# This contains the compiler options necessary to select the CPU model
52 +# and (hopefully) optimize for it.
53 +CPU_CFLAGS = -mcpu=cpu32
55 +# optimize flag: typically -O2
56 +CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
58 +ifeq ($(MRM_IN_ROM),yes)
59 +# Build a rommable image - move the .data section after the .text section
61 +CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM
64 +ifeq ($(MRM_IN_ROM),yes)
66 + $(OBJCOPY) --adjust-section-vma \
67 + .data=`m68k-rtems-objdump --section-headers $(basename $@).pxe | \
68 + awk 'function h2d(x) { x=toupper(x); digits=length(x); s=0 ; \
69 + for (p=digits; p>0; p--) \
70 + s += (16^(p-1)) * ( index("0123456789ABCDEF",\
71 + substr(x,1+digits-p,1)) -1 );\
73 + /\.text/ { base = $$4 ; size = $$3 };\
74 + END { printf("0x%x", h2d(base) + h2d(size)) }'\
75 + ` $(basename $@).pxe $(basename $@).exe
76 + $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec
77 + sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
78 + $(PACKHEX) > $(basename $@)$(DOWNEXT)
79 + $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum
80 + rm -f $(basename $@).srec $(basename $@).srec
81 + $(default-bsp-post-link)
85 + $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec
86 + sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
87 + $(PACKHEX) > $(basename $@)$(DOWNEXT)
88 + rm -f $(basename $@).srec
89 + $(default-bsp-post-link)
92 Index: rtems/c/src/lib/libbsp/m68k/mo376/console/sci.h
93 ===================================================================
94 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
95 +++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.h 2006-09-11 23:43:55.000000000 +0200
97 +/****************************************************************************
100 +* Desc: This is the include file for the serial communications interface.
102 +* Note: See bsp.h,confdefs.h,system.h for installing drivers into RTEMS.
104 +* $Id: sci.h,v 1.5 2006/09/11 21:43:55 joel Exp $
105 +****************************************************************************/
110 +/*******************************************************************************
111 + IOCTL commands for the sci driver.
112 + I'm still working on these...
113 +*******************************************************************************/
115 +#define SCI_IOCTL_PARITY_NONE 0x00 /* no parity bit after the data bits */
116 +#define SCI_IOCTL_PARITY_ODD 0x01 /* parity bit added after data bits */
117 +#define SCI_IOCTL_PARITY_EVEN 0x02 /* parity bit added after data bits */
118 +#define SCI_IOCTL_PARITY_MARK 0x03 /* parity bit is lo, -12 volts, logical 1 */
119 +#define SCI_IOCTL_PARITY_SPACE 0x04 /* parity bit is hi, +12 volts, logical 0 */
120 +#define SCI_IOCTL_PARITY_FORCED_ON 0x03 /* parity bit is forced hi or lo */
121 +#define SCI_IOCTL_PARITY_FORCED_OFF 0x04 /* parity bit is forced hi or lo */
123 +#define SCI_IOCTL_BAUD_RATE 0x20 /* set the baud rate, arg is baud */
125 +#define SCI_IOCTL_DATA_BITS 0x30 /* set the data bits, arg is # bits */
127 +#define SCI_IOCTL_STOP_BITS_1 0x40 /* 1 stop bit after char frame */
128 +#define SCI_IOCTL_STOP_BITS_2 0x41 /* 2 stop bit after char frame */
130 +#define SCI_IOCTL_MODE_NORMAL 0x50 /* normal operating mode */
131 +#define SCI_IOCTL_MODE_LOOP 0x51 /* internal loopback mode */
133 +#define SCI_IOCTL_FLOW_NONE 0x60 /* no flow control */
134 +#define SCI_IOCTL_FLOW_RTS_CTS 0x61 /* hardware flow control */
136 +#define SCI_IOCTL_SEND_BREAK 0x70 /* send an rs-232 break */
138 +#define SCI_IOCTL_MODE_1200 0x80 /* 1200,n,8,1 download mode */
139 +#define SCI_IOCTL_MODE_9600 0x81 /* 9600,n,8,1 download mode */
140 +#define SCI_IOCTL_MODE_9_BIT 0x82 /* 9600,forced,8,1 command mode */
143 +/*******************************************************************************
145 +*******************************************************************************/
147 +/* SCI Control Register 0 (SCCR0) $FFFC08
149 + 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
150 + ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
151 + | | | | | | | | | | | | | | | |
152 + | | | | | | | | | | | | | | | +----- 0 baud rate divisor
153 + | | | | | | | | | | | | | | +------- 1 baud rate divisor
154 + | | | | | | | | | | | | | +--------- 2 baud rate divisor
155 + | | | | | | | | | | | | +----------- 3 baud rate divisor
156 + | | | | | | | | | | | |
157 + | | | | | | | | | | | +--------------- 4 baud rate divisor
158 + | | | | | | | | | | +----------------- 5 baud rate divisor
159 + | | | | | | | | | +------------------- 6 baud rate divisor
160 + | | | | | | | | +--------------------- 7 baud rate divisor
162 + | | | | | | | +------------------------- 8 baud rate divisor
163 + | | | | | | +--------------------------- 9 baud rate divisor
164 + | | | | | +----------------------------- 10 baud rate divisor
165 + | | | | +------------------------------- 11 baud rate divisor
167 + | | | +----------------------------------- 12 baud rate divisor
168 + | | +------------------------------------- 13 unused
169 + | +--------------------------------------- 14 unused
170 + +----------------------------------------- 15 unused
172 + 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 1 0 0 reset value - (64k baud?)
175 +#define SCI_BAUD_57_6K 9
176 +#define SCI_BAUD_38_4K 14
177 +#define SCI_BAUD_19_2K 27
178 +#define SCI_BAUD_9600 55
179 +#define SCI_BAUD_4800 109
180 +#define SCI_BAUD_2400 218
181 +#define SCI_BAUD_1200 437
184 +/* SCI Control Register 1 (SCCR1) $FFFC0A
186 + 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
187 + ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
188 + | | | | | | | | | | | | | | | |
189 + | | | | | | | | | | | | | | | +----- 0 send a break
190 + | | | | | | | | | | | | | | +------- 1 rcvr wakeup mode
191 + | | | | | | | | | | | | | +--------- 2 rcvr enable
192 + | | | | | | | | | | | | +----------- 3 xmtr enable
193 + | | | | | | | | | | | |
194 + | | | | | | | | | | | +--------------- 4 idle line intr enable
195 + | | | | | | | | | | +----------------- 5 rcvr intr enable
196 + | | | | | | | | | +------------------- 6 xmit complete intr enable
197 + | | | | | | | | +--------------------- 7 xmtr intr enable
199 + | | | | | | | +------------------------- 8 wakeup on address mark
200 + | | | | | | +--------------------------- 9 mode 1=9 bits, 0=8 bits
201 + | | | | | +----------------------------- 10 parity enable 1=on, 0=off
202 + | | | | +------------------------------- 11 parity type 1=odd, 0=even
204 + | | | +----------------------------------- 12 idle line select
205 + | | +------------------------------------- 13 wired-or mode
206 + | +--------------------------------------- 14 loop mode
207 + +----------------------------------------- 15 unused
209 + 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 reset value
212 +#define SCI_SEND_BREAK 0x0001 /* 0000-0000-0000-0001 */
213 +#define SCI_RCVR_WAKEUP 0x0002 /* 0000-0000-0000-0010 */
214 +#define SCI_ENABLE_RCVR 0x0004 /* 0000-0000-0000-0100 */
215 +#define SCI_ENABLE_XMTR 0x0008 /* 0000-0000-0000-1000 */
217 +#define SCI_DISABLE_RCVR 0xFFFB /* 1111-1111-1111-1011 */
218 +#define SCI_DISABLE_XMTR 0xFFF7 /* 1111-1111-1111-0111 */
220 +#define SCI_ENABLE_INT_IDLE 0x0010 /* 0000-0000-0001-0000 */
221 +#define SCI_ENABLE_INT_RX 0x0020 /* 0000-0000-0010-0000 */
222 +#define SCI_ENABLE_INT_TX_DONE 0x0040 /* 0000-0000-0100-0000 */
223 +#define SCI_ENABLE_INT_TX 0x0080 /* 0000-0000-1000-0000 */
225 +#define SCI_DISABLE_INT_ALL 0xFF00 /* 1111-1111-0000-0000 ??? */
227 +#define SCI_DISABLE_INT_RX 0xFFDF /* 1111-1111-1101-1111 */
228 +#define SCI_CLEAR_RX_INT 0xFFBF /* 1111-1111-1011-1111 */
229 +#define SCI_DISABLE_INT_TX 0xFF7F /* 1111-1111-0111-1111 */
230 +#define SCI_CLEAR_TDRE 0xFEFF /* 1111-1110-1111-1111 */
232 +#define SCI_RCVR_WAKE_ON_MARK 0x0100 /* 0000-0001-0000-0000 */
233 +#define SCI_9_DATA_BITS 0x0200 /* 0000-0010-0000-0000 */
234 +#define SCI_PARITY_ENABLE 0x0400 /* 0000-0100-0000-0000 */
235 +#define SCI_PARITY_ODD 0x0800 /* 0000-1000-0000-0000 */
237 +#define SCI_RCVR_WAKE_ON_IDLE 0xFEFF /* 1111-1110-1111-1111 */
238 +#define SCI_8_DATA_BITS 0xFDFF /* 1111-1101-1111-1111 */
239 +#define SCI_PARITY_DISABLE 0xFBFF /* 1111-1011-1111-1111 */
240 +#define SCI_PARITY_EVEN 0xF7FF /* 1111-0111-1111-1111 */
242 +#define SCI_PARITY_NONE 0xF3FF /* 1111-0011-1111-1111 */
244 +#define SCI_IDLE_LINE_LONG 0x1000 /* 0001-0000-0000-0000 */
245 +#define SCI_TXD_OPEN_DRAIN 0x2000 /* 0010-0000-0000-0000 */
246 +#define SCI_LOOPBACK_MODE 0x4000 /* 0100-0000-0000-0000 */
247 +#define SCI_SCCR1_UNUSED 0x8000 /* 1000-0000-0000-0000 */
250 +/* SCI Status Register (SCSR) $FFFC0C
252 + 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
253 + ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
254 + | | | | | | | | | | | | | | | |
255 + | | | | | | | | | | | | | | | +----- 0 PF - parity error
256 + | | | | | | | | | | | | | | +------- 1 FE - framing error
257 + | | | | | | | | | | | | | +--------- 2 NF - noise flag
258 + | | | | | | | | | | | | +----------- 3 OR - overrun flag
259 + | | | | | | | | | | | |
260 + | | | | | | | | | | | +--------------- 4 IDLE - idle line detected
261 + | | | | | | | | | | +----------------- 5 RAF - rcvr active flag
262 + | | | | | | | | | +------------------- 6 RDRF - rcv data reg full
263 + | | | | | | | | +--------------------- 7 TC - xmt complete flag
265 + | | | | | | | +------------------------- 8 TDRE - xmt data reg empty
266 + | | | | | | +--------------------------- 9 always zero
267 + | | | | | +----------------------------- 10 always zero
268 + | | | | +------------------------------- 11 always zero
270 + | | | +----------------------------------- 12 always zero
271 + | | +------------------------------------- 13 always zero
272 + | +--------------------------------------- 14 always zero
273 + +----------------------------------------- 15 always zero
275 + 0 0 0 0 - 0 0 0 1 - 1 0 0 0 - 0 0 0 0 reset value
278 +#define SCI_ERROR_PARITY 0x0001 /* 0000-0000-0000-0001 */
279 +#define SCI_ERROR_FRAMING 0x0002 /* 0000-0000-0000-0010 */
280 +#define SCI_ERROR_NOISE 0x0004 /* 0000-0000-0000-0100 */
281 +#define SCI_ERROR_OVERRUN 0x0008 /* 0000-0000-0000-1000 */
283 +#define SCI_IDLE_LINE 0x0010 /* 0000-0000-0001-0000 */
284 +#define SCI_RCVR_ACTIVE 0x0020 /* 0000-0000-0010-0000 */
285 +#define SCI_RCVR_READY 0x0040 /* 0000-0000-0100-0000 */
286 +#define SCI_XMTR_IDLE 0x0080 /* 0000-0000-1000-0000 */
288 +#define SCI_CLEAR_RX_INT 0xFFBF /* 1111-1111-1011-1111 */
290 +#define SCI_XMTR_READY 0x0100 /* 0000-0001-0000-0000 */
292 +#define SCI_CLEAR_TDRE 0xFEFF /* 1111-1110-1111-1111 */
294 +#define SCI_XMTR_AVAILABLE 0x0180 /* 0000-0001-1000-0000 */
298 +/*******************************************************************************
299 + Function prototypes
300 +*******************************************************************************/
306 +/* look at console_open to see how this is called */
308 +const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled );
312 +/*rtems_isr SciIsr( rtems_vector_number vector ); */
314 +/*int32_t SciOpenPolled ( int32_t major, int32_t minor, void *arg ); */
315 +/*int32_t SciOpenInterrupt ( int32_t major, int32_t minor, void *arg ); */
317 +/*int32_t SciClose ( int32_t major, int32_t minor, void *arg ); */
319 +/*int32_t SciWritePolled ( int32_t minor, const char *buf, int32_t len ); */
320 +/*int32_t SciWriteInterrupt( int32_t minor, const char *buf, int32_t len ); */
322 +/*int32_t SciReadPolled ( int32_t minor ); */
324 +/*int32_t SciSetAttributes ( int32_t minor, const struct termios *t ); */
330 +#endif /* _sci_h_ */
331 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
332 ===================================================================
333 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
334 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM 2008-03-04 00:06:30.000000000 +0100
338 + * $Id: linkcmds_ROM,v 1.5 2008/03/03 23:06:30 joel Exp $
342 +STARTUP(except_vect_332_ROM.o)
347 + * +--------------------+ <- low memory
350 + * | ctor list | the ctor and dtor lists are for
351 + * | dtor list | C++ support
353 + * | temporary .data | .data is moved to RAM by crt0
355 + * +--------------------+ <- high memory
359 + * +--------------------+ <- low memory
360 + * | .data | initialized data goes here
363 + * +--------------------+
365 + * | __bss_start | start of bss, cleared by crt0
366 + * | _end | start of heap, used by sbrk()
367 + * +--------------------+
371 + * | __stack | top of stack
372 + * +--------------------+ <- high memory
377 + rom : ORIGIN = 0x90000, LENGTH = 0x70000
378 + ram : ORIGIN = 0x03000, LENGTH = 0x7d000
381 +_RamBase = DEFINED(_RamBase) ? _RamBase : 0x003000;
382 +_RamSize = DEFINED(_RamSize) ? _RamSize : 0x7d000;
383 +_RamEnd = _RamBase + _RamSize;
385 +__end_of_ram = 0x080000;
386 +_copy_data_from_rom = 1;
387 +_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
388 +_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
398 + CREATE_OBJECT_SYMBOLS
406 + * Initialization and finalization code.
408 + * Various files can provide initialization and finalization
409 + * functions. crtbegin.o and crtend.o are two instances. The
410 + * body of these functions are in .init and .fini sections. We
411 + * accumulate the bodies here, and prepend function prologues
412 + * from crti.o and function epilogues from crtn.o. crti.o must
413 + * be linked first; crtn.o must be linked last. Because these
414 + * are wildcards, it doesn't matter if the user does not
415 + * actually link against crti.o and crtn.o; the linker won't
416 + * look for a file to match a wildcard. The wildcard also
417 + * means that it doesn't matter which directory crti.o and
420 + PROVIDE (_init = .);
424 + PROVIDE (_fini = .);
430 + * Special FreeBSD sysctl sections.
433 + __start_set_sysctl_set = .;
435 + __stop_set_sysctl_set = ABSOLUTE(.);
440 + * C++ constructors/destructors
442 + * gcc uses crtbegin.o to find the start of the constructors
443 + * and destructors so we make sure it is first. Because this
444 + * is a wildcard, it doesn't matter if the user does not
445 + * actually link against crtbegin.o; the linker won't look for
446 + * a file to match a wildcard. The wildcard also means that
447 + * it doesn't matter which directory crtbegin.o is in. The
448 + * constructor and destructor list are terminated in
449 + * crtend.o. The same comments apply to it.
452 + *crtbegin.o(.ctors)
455 + *crtbegin.o(.dtors)
466 + _rodata_start = . ;
468 + *(.gnu.linkonce.r*)
470 + etext = ALIGN(0x10);
472 + LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
477 + LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
487 + AT ( ADDR(.text) + SIZEOF( .text ) )
498 + *(.gnu.linkonce.d*)
499 + *(.gcc_except_table*)
503 + edata = ALIGN(0x10);
512 + __bss_start = ALIGN(0x8);
518 + *(.bss* .gnu.linkonce.b.*)
523 + __end = ALIGN(0x8);
525 + _WorkspaceBase = . + _StackSize;
531 + .stabstr . (NOLOAD) :
536 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S
537 ===================================================================
538 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
539 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S 2004-04-21 18:01:35.000000000 +0200
542 + * $Id: except_vect_332_ROM.S,v 1.3 2004/04/21 16:01:35 ralf Exp $
545 +/* Exception Vector definitions follow */
547 + /* !!! Warning !!! This table is not tested, and
548 + the user must make sure it is complete. */
550 + /* If we use TRAP #15 for reboot, note that group 0 and 1 exceptions
551 + will have priority. */
553 + /* This is the "magic word" that CPU32bug uses to indicate that
554 + there is a bootable image here. */
557 + /* Vector 0: RESET: Initial SSP */
559 + /* Vector 1: RESET: Initial PC */
562 + /* default action for undefined vectors is to re-boot */
564 + /* Note group 0 and 1 exception (like trace) have priority
565 + over other exceptions (like trap #15) that may call this. */
567 + /* Vectors 2-255 */
568 + .long reboot /* exception vector: 2 */
569 + .long reboot /* exception vector: 3 */
570 + .long reboot /* exception vector: 4 */
571 + .long reboot /* exception vector: 5 */
572 + .long reboot /* exception vector: 6 */
573 + .long reboot /* exception vector: 7 */
574 + .long reboot /* exception vector: 8 */
575 + .long reboot /* exception vector: 9 */
576 + .long reboot /* exception vector: 10 */
577 + .long reboot /* exception vector: 11 */
578 + .long reboot /* exception vector: 12 */
579 + .long reboot /* exception vector: 13 */
580 + .long reboot /* exception vector: 14 */
581 + .long reboot /* exception vector: 15 */
582 + .long reboot /* exception vector: 16 */
583 + .long reboot /* exception vector: 17 */
584 + .long reboot /* exception vector: 18 */
585 + .long reboot /* exception vector: 19 */
586 + .long reboot /* exception vector: 20 */
587 + .long reboot /* exception vector: 21 */
588 + .long reboot /* exception vector: 22 */
589 + .long reboot /* exception vector: 23 */
590 + .long reboot /* exception vector: 24 */
591 + .long reboot /* exception vector: 25 */
592 + .long reboot /* exception vector: 26 */
593 + .long reboot /* exception vector: 27 */
594 + .long reboot /* exception vector: 28 */
595 + .long reboot /* exception vector: 29 */
596 + .long reboot /* exception vector: 30 */
597 + .long reboot /* exception vector: 31 */
598 + .long reboot /* exception vector: 32 */
599 + .long reboot /* exception vector: 33 */
600 + .long reboot /* exception vector: 34 */
601 + .long reboot /* exception vector: 35 */
602 + .long reboot /* exception vector: 36 */
603 + .long reboot /* exception vector: 37 */
604 + .long reboot /* exception vector: 38 */
605 + .long reboot /* exception vector: 39 */
606 + .long reboot /* exception vector: 40 */
607 + .long reboot /* exception vector: 41 */
608 + .long reboot /* exception vector: 42 */
609 + .long reboot /* exception vector: 43 */
610 + .long reboot /* exception vector: 44 */
611 + .long reboot /* exception vector: 45 */
612 + .long reboot /* exception vector: 46 */
613 + .long _reboot /* the reboot trap: 47 */
614 + .long reboot /* exception vector: 48 */
615 + .long reboot /* exception vector: 49 */
616 + .long reboot /* exception vector: 50 */
617 + .long reboot /* exception vector: 51 */
618 + .long reboot /* exception vector: 52 */
619 + .long reboot /* exception vector: 53 */
620 + .long reboot /* exception vector: 54 */
621 + .long reboot /* exception vector: 55 */
622 + .long reboot /* exception vector: 56 */
623 + .long reboot /* exception vector: 57 */
624 + .long reboot /* exception vector: 58 */
625 + .long reboot /* exception vector: 59 */
626 + .long reboot /* exception vector: 60 */
627 + .long reboot /* exception vector: 61 */
628 + .long reboot /* exception vector: 62 */
629 + .long reboot /* exception vector: 63 */
630 + .long reboot /* exception vector: 64 */
631 + .long reboot /* exception vector: 65 */
632 + .long reboot /* exception vector: 66 */
633 + .long reboot /* exception vector: 67 */
634 + .long reboot /* exception vector: 68 */
635 + .long reboot /* exception vector: 69 */
636 + .long reboot /* exception vector: 70 */
637 + .long reboot /* exception vector: 71 */
638 + .long reboot /* exception vector: 72 */
639 + .long reboot /* exception vector: 73 */
640 + .long reboot /* exception vector: 74 */
641 + .long reboot /* exception vector: 75 */
642 + .long reboot /* exception vector: 76 */
643 + .long reboot /* exception vector: 77 */
644 + .long reboot /* exception vector: 78 */
645 + .long reboot /* exception vector: 79 */
646 + .long reboot /* exception vector: 80 */
647 + .long reboot /* exception vector: 81 */
648 + .long reboot /* exception vector: 82 */
649 + .long reboot /* exception vector: 83 */
650 + .long reboot /* exception vector: 84 */
651 + .long reboot /* exception vector: 85 */
652 + .long reboot /* exception vector: 86 */
653 + .long reboot /* exception vector: 87 */
654 + .long reboot /* exception vector: 88 */
655 + .long reboot /* exception vector: 89 */
656 + .long reboot /* exception vector: 90 */
657 + .long reboot /* exception vector: 91 */
658 + .long reboot /* exception vector: 92 */
659 + .long reboot /* exception vector: 93 */
660 + .long reboot /* exception vector: 94 */
661 + .long reboot /* exception vector: 95 */
662 + .long reboot /* exception vector: 96 */
663 + .long reboot /* exception vector: 97 */
664 + .long reboot /* exception vector: 98 */
665 + .long reboot /* exception vector: 99 */
666 + .long reboot /* exception vector: 100 */
667 + .long reboot /* exception vector: 101 */
668 + .long reboot /* exception vector: 102 */
669 + .long reboot /* exception vector: 103 */
670 + .long reboot /* exception vector: 104 */
671 + .long reboot /* exception vector: 105 */
672 + .long reboot /* exception vector: 106 */
673 + .long reboot /* exception vector: 107 */
674 + .long reboot /* exception vector: 108 */
675 + .long reboot /* exception vector: 109 */
676 + .long reboot /* exception vector: 110 */
677 + .long reboot /* exception vector: 111 */
678 + .long reboot /* exception vector: 112 */
679 + .long reboot /* exception vector: 113 */
680 + .long reboot /* exception vector: 114 */
681 + .long reboot /* exception vector: 115 */
682 + .long reboot /* exception vector: 116 */
683 + .long reboot /* exception vector: 117 */
684 + .long reboot /* exception vector: 118 */
685 + .long reboot /* exception vector: 119 */
686 + .long reboot /* exception vector: 120 */
687 + .long reboot /* exception vector: 121 */
688 + .long reboot /* exception vector: 122 */
689 + .long reboot /* exception vector: 123 */
690 + .long reboot /* exception vector: 124 */
691 + .long reboot /* exception vector: 125 */
692 + .long reboot /* exception vector: 126 */
693 + .long reboot /* exception vector: 127 */
694 + .long reboot /* exception vector: 128 */
695 + .long reboot /* exception vector: 129 */
696 + .long reboot /* exception vector: 130 */
697 + .long reboot /* exception vector: 131 */
698 + .long reboot /* exception vector: 132 */
699 + .long reboot /* exception vector: 133 */
700 + .long reboot /* exception vector: 134 */
701 + .long reboot /* exception vector: 135 */
702 + .long reboot /* exception vector: 136 */
703 + .long reboot /* exception vector: 137 */
704 + .long reboot /* exception vector: 138 */
705 + .long reboot /* exception vector: 139 */
706 + .long reboot /* exception vector: 140 */
707 + .long reboot /* exception vector: 141 */
708 + .long reboot /* exception vector: 142 */
709 + .long reboot /* exception vector: 143 */
710 + .long reboot /* exception vector: 144 */
711 + .long reboot /* exception vector: 145 */
712 + .long reboot /* exception vector: 146 */
713 + .long reboot /* exception vector: 147 */
714 + .long reboot /* exception vector: 148 */
715 + .long reboot /* exception vector: 149 */
716 + .long reboot /* exception vector: 150 */
717 + .long reboot /* exception vector: 151 */
718 + .long reboot /* exception vector: 152 */
719 + .long reboot /* exception vector: 153 */
720 + .long reboot /* exception vector: 154 */
721 + .long reboot /* exception vector: 155 */
722 + .long reboot /* exception vector: 156 */
723 + .long reboot /* exception vector: 157 */
724 + .long reboot /* exception vector: 158 */
725 + .long reboot /* exception vector: 159 */
726 + .long reboot /* exception vector: 160 */
727 + .long reboot /* exception vector: 161 */
728 + .long reboot /* exception vector: 162 */
729 + .long reboot /* exception vector: 163 */
730 + .long reboot /* exception vector: 164 */
731 + .long reboot /* exception vector: 165 */
732 + .long reboot /* exception vector: 166 */
733 + .long reboot /* exception vector: 167 */
734 + .long reboot /* exception vector: 168 */
735 + .long reboot /* exception vector: 169 */
736 + .long reboot /* exception vector: 170 */
737 + .long reboot /* exception vector: 171 */
738 + .long reboot /* exception vector: 172 */
739 + .long reboot /* exception vector: 173 */
740 + .long reboot /* exception vector: 174 */
741 + .long reboot /* exception vector: 175 */
742 + .long reboot /* exception vector: 176 */
743 + .long reboot /* exception vector: 177 */
744 + .long reboot /* exception vector: 178 */
745 + .long reboot /* exception vector: 179 */
746 + .long reboot /* exception vector: 180 */
747 + .long reboot /* exception vector: 181 */
748 + .long reboot /* exception vector: 182 */
749 + .long reboot /* exception vector: 183 */
750 + .long reboot /* exception vector: 184 */
751 + .long reboot /* exception vector: 185 */
752 + .long reboot /* exception vector: 186 */
753 + .long reboot /* exception vector: 187 */
754 + .long reboot /* exception vector: 188 */
755 + .long reboot /* exception vector: 189 */
756 + .long reboot /* exception vector: 190 */
757 + .long reboot /* exception vector: 191 */
758 + .long reboot /* exception vector: 192 */
759 + .long reboot /* exception vector: 193 */
760 + .long reboot /* exception vector: 194 */
761 + .long reboot /* exception vector: 195 */
762 + .long reboot /* exception vector: 196 */
763 + .long reboot /* exception vector: 197 */
764 + .long reboot /* exception vector: 198 */
765 + .long reboot /* exception vector: 199 */
766 + .long reboot /* exception vector: 200 */
767 + .long reboot /* exception vector: 201 */
768 + .long reboot /* exception vector: 202 */
769 + .long reboot /* exception vector: 203 */
770 + .long reboot /* exception vector: 204 */
771 + .long reboot /* exception vector: 205 */
772 + .long reboot /* exception vector: 206 */
773 + .long reboot /* exception vector: 207 */
774 + .long reboot /* exception vector: 208 */
775 + .long reboot /* exception vector: 209 */
776 + .long reboot /* exception vector: 210 */
777 + .long reboot /* exception vector: 211 */
778 + .long reboot /* exception vector: 212 */
779 + .long reboot /* exception vector: 213 */
780 + .long reboot /* exception vector: 214 */
781 + .long reboot /* exception vector: 215 */
782 + .long reboot /* exception vector: 216 */
783 + .long reboot /* exception vector: 217 */
784 + .long reboot /* exception vector: 218 */
785 + .long reboot /* exception vector: 219 */
786 + .long reboot /* exception vector: 220 */
787 + .long reboot /* exception vector: 221 */
788 + .long reboot /* exception vector: 222 */
789 + .long reboot /* exception vector: 223 */
790 + .long reboot /* exception vector: 224 */
791 + .long reboot /* exception vector: 225 */
792 + .long reboot /* exception vector: 226 */
793 + .long reboot /* exception vector: 227 */
794 + .long reboot /* exception vector: 228 */
795 + .long reboot /* exception vector: 229 */
796 + .long reboot /* exception vector: 230 */
797 + .long reboot /* exception vector: 231 */
798 + .long reboot /* exception vector: 232 */
799 + .long reboot /* exception vector: 233 */
800 + .long reboot /* exception vector: 234 */
801 + .long reboot /* exception vector: 235 */
802 + .long reboot /* exception vector: 236 */
803 + .long reboot /* exception vector: 237 */
804 + .long reboot /* exception vector: 238 */
805 + .long reboot /* exception vector: 239 */
806 + .long reboot /* exception vector: 240 */
807 + .long reboot /* exception vector: 241 */
808 + .long reboot /* exception vector: 242 */
809 + .long reboot /* exception vector: 243 */
810 + .long reboot /* exception vector: 244 */
811 + .long reboot /* exception vector: 245 */
812 + .long reboot /* exception vector: 246 */
813 + .long reboot /* exception vector: 247 */
814 + .long reboot /* exception vector: 248 */
815 + .long reboot /* exception vector: 249 */
816 + .long reboot /* exception vector: 250 */
817 + .long reboot /* exception vector: 251 */
818 + .long reboot /* exception vector: 252 */
819 + .long reboot /* exception vector: 253 */
820 + .long reboot /* exception vector: 254 */
821 + .long reboot /* exception vector: 255 */
824 + move #0x2700,%sr /* mask interrupts */
825 + movea.l (0x0).w,%a7 /* load stack */
826 + movea.l (0x4).w,%a0 /* jmp to location of reset vector */
830 + trap #15 /* use trap exception to enter supervisor
831 + state. Trace mode ( and other group 0
832 + and 1 exceptions) *could* screw this up if
833 + not vectored to reboot or did not return. */
834 Index: rtems/c/src/lib/libbsp/m68k/mo376/console/console.c
835 ===================================================================
836 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
837 +++ rtems/c/src/lib/libbsp/m68k/mo376/console/console.c 2008-05-12 20:43:28.000000000 +0200
840 + * This file contains the generic console driver shell used
841 + * by all console drivers using libchip.
843 + * This driver uses the termios pseudo driver.
845 + * COPYRIGHT (c) 1989-1997.
846 + * On-Line Applications Research Corporation (OAR).
848 + * The license and distribution terms for this file may be
849 + * found in the file LICENSE in this distribution or at
850 + * http://www.rtems.com/license/LICENSE.
852 + * $Id: console.c,v 1.9 2008/05/12 18:43:28 joel Exp $
856 +#include <rtems/libio.h>
857 +#include <termios.h>
864 + * open a port as a termios console.
867 +rtems_device_driver console_open(
868 + rtems_device_major_number major,
869 + rtems_device_minor_number minor,
873 + rtems_status_code status;
875 + /* the console is opened three times at startup */
876 + /* for standard input, output, and error */
878 + /* Get correct callback structure for the device */
880 + /* argument of FALSE gives us interrupt driven serial io */
881 + /* argument of TRUE gives us polling based serial io */
883 + /* SCI internal uart */
885 + status = rtems_termios_open( major, minor, arg, SciGetTermiosHandlers( TRUE ) );
894 + * This routine closes a port that has been opened as console.
897 +rtems_device_driver console_close(
898 + rtems_device_major_number major,
899 + rtems_device_minor_number minor,
903 + return rtems_termios_close (arg);
910 + * This routine uses the termios driver to read a character.
913 +rtems_device_driver console_read(
914 + rtems_device_major_number major,
915 + rtems_device_minor_number minor,
919 + return rtems_termios_read (arg);
926 + * this routine uses the termios driver to write a character.
929 +rtems_device_driver console_write(
930 + rtems_device_major_number major,
931 + rtems_device_minor_number minor,
935 + return rtems_termios_write (arg);
942 + * this routine uses the termios driver to process io
945 +rtems_device_driver console_control(
946 + rtems_device_major_number major,
947 + rtems_device_minor_number minor,
951 + return rtems_termios_ioctl (arg);
956 + * console_initialize
958 + * Routine called to initialize the console device driver.
961 +rtems_device_driver console_initialize(
962 + rtems_device_major_number major,
963 + rtems_device_minor_number minor_arg,
967 + rtems_status_code status;
970 + * initialize the termio interface.
972 + rtems_termios_initialize();
975 + * register the SCI device name for termios
976 + * do this over in the sci driver init routine?
979 + status = rtems_io_register_name( "/dev/sci", major, 0 );
981 + if (status != RTEMS_SUCCESSFUL)
983 + rtems_fatal_error_occurred(status);
987 + * Link the uart device to the console device
991 + status = rtems_io_register_name( "/dev/console", major, 0 );
993 + if (status != RTEMS_SUCCESSFUL)
995 + rtems_fatal_error_occurred(status);
998 + if ( link( "/dev/sci", "/dev/console") < 0 )
1000 + rtems_fatal_error_occurred( RTEMS_IO_ERROR );
1005 + * Console Initialize Succesful
1008 + return RTEMS_SUCCESSFUL;
1010 Index: rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
1011 ===================================================================
1012 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1013 +++ rtems/c/src/lib/libbsp/m68k/mo376/start/start.S 2009-11-29 01:11:56.463558538 +0100
1019 +#include "mrm332.h"
1020 +#include <rtems/asm.h>
1021 +#include <rtems/m68k/sim.h>
1025 + /* Put the header necessary for the modified CPU32bug to automatically
1026 + start up rtems: */
1038 + addl #_StackSize,d0
1042 + /* include in ram_init.S */
1044 + * Initalize the SIM module.
1045 + * The stack pointer is not usable until the RAM chip select lines
1046 + * are configured. The following code must remain inline.
1049 + /* Module Configuration Register */
1050 + /* see section(s) 3.1.3-3.1.6 of the SIM Reference Manual */
1053 + oriw #SAM(0,8,SHEN),d0
1054 + oriw #(MM*SIM_MM),d0
1055 + oriw #SAM(SIM_IARB,0,IARB),d0
1058 + jsr start_c /* Jump to the C startup code */
1064 + /* Synthesizer Control Register */
1065 + /* see section(s) 4.8 */
1066 + /* end include in ram_init.S */
1067 + *SYNCR = (unsigned short int)
1068 + ( SAM(MRM_W,15,VCO) | SAM(0x0,14,PRESCALE) | SAM(MRM_Y,8,COUNTER) );
1069 + while (! (*SYNCR & SLOCK)); /* protect from clock overshoot */
1070 + /* include in ram_init.S */
1071 + *SYNCR = (unsigned short int)
1072 + ( SAM(MRM_W,15,VCO) | SAM(MRM_X,14,PRESCALE) | SAM(MRM_Y,8,COUNTER) );
1074 + /* System Protection Control Register */
1075 + /* !!! can only write to once after reset !!! */
1076 + /* see section 3.8.4 of the SIM Reference Manual */
1077 + *SYPCR = (unsigned char)( HME | BME );
1079 + /* Periodic Interrupr Control Register */
1080 + /* see section 3.8.2 of the SIM Reference Manual */
1081 + *PICR = (unsigned short int)
1082 + ( SAM(0,8,PIRQL) | SAM(MRM_PIV,0,PIV) );
1083 + /* ^^^ zero disables interrupt, don't enable here or ram_init will
1084 + be wrong. It's enabled below. */
1086 + /* Periodic Interrupt Timer Register */
1087 + /* see section 3.8.3 of the SIM Reference Manual */
1088 + *PITR = (unsigned short int)( SAM(0x09,0,PITM) );
1089 + /* 1.098mS interrupt, assuming 32.768 KHz input clock */
1092 + /* load values before enabled */
1093 + *PORTC = (unsigned char) 0x0;
1095 + /* Port E and F Data Register */
1096 + /* see section 9 of the SIM Reference Manual */
1097 + *PORTE0 = (unsigned char) 0;
1098 + *PORTF0 = (unsigned char) 0;
1100 + /* Port E and F Data Direction Register */
1101 + /* see section 9 of the SIM Reference Manual */
1102 + *DDRE = (unsigned char) 0xff;
1103 + *DDRF = (unsigned char) 0xfd;
1105 + /* Port E and F Pin Assignment Register */
1106 + /* see section 9 of the SIM Reference Manual */
1107 + *PEPAR = (unsigned char) 0;
1108 + *PFPAR = (unsigned char) 0;
1110 + /* end of SIM initalization code */
1111 + /* end include in ram_init.S */
1114 + * Initialize RAM by copying the .data section out of ROM (if
1115 + * needed) and "zero-ing" the .bss section.
1118 + register char *src = _etext;
1119 + register char *dst = _copy_start;
1121 + if (_copy_data_from_rom)
1122 + /* ROM has data at end of text; copy it. */
1123 + while (dst < _edata)
1127 + for (dst = _clear_start; dst< end; dst++)
1134 + * Initialize vector table.
1137 + m68k_isr_entry *monitors_vector_table;
1139 + m68k_get_vbr(monitors_vector_table);
1141 + M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
1142 + M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
1143 + M68Kvec[ 31 ] = monitors_vector_table[ 31 ]; /* level 7 interrupt */
1144 + M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */
1145 + M68Kvec[ 66 ] = monitors_vector_table[ 66 ]; /* user defined */
1147 + m68k_set_vbr(&M68Kvec);
1151 + * Initalize the board.
1153 + Spurious_Initialize();
1157 + * Execute main with arguments argc and agrv.
1159 + boot_card(1,__argv);
1165 Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/dotests
1166 ===================================================================
1167 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1168 +++ rtems/c/src/lib/libbsp/m68k/mo376/misc/dotests 2009-11-29 01:11:56.463558538 +0100
1172 +# $Id: dotests,v 1.1 2001/05/25 16:28:46 joel Exp $
1176 +find -name MyTests -prune -or -name "*.nxe" -exec cp {} MyTests \;
1178 +stty 1:0:80001cb2:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 </dev/ttyS1
1179 +/bin/cp /dev/ttyS1 screen &
1182 +( cd MyTests; for f in *nxe; do m68k-elf-gdb ${f} </dev/null; done )
1185 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
1186 ===================================================================
1187 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1188 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h 2007-12-11 16:49:20.000000000 +0100
1192 + * This include file contains all mrm board IO definitions.
1194 + * COPYRIGHT (c) 1989-1999.
1195 + * On-Line Applications Research Corporation (OAR).
1197 + * The license and distribution terms for this file may be
1198 + * found in the file LICENSE in this distribution or at
1199 + * http://www.rtems.com/license/LICENSE.
1201 + * $Id: bsp.h,v 1.17 2007/12/11 15:49:20 joel Exp $
1211 +#include <bspopts.h>
1214 +#include <rtems/bspIo.h>
1215 +#include <rtems/clockdrv.h>
1216 +#include <rtems/console.h>
1217 +#include <rtems/iosupp.h>
1218 +#include <mrm332.h>
1219 +#include <rtems/m68k/sim.h>
1220 +#include <rtems/m68k/qsm.h>
1223 + * confdefs.h overrides for this BSP:
1224 + * - number of termios serial ports (defaults to 1)
1225 + * - Interrupt stack space is not minimum if defined.
1228 +#define CONSOLE_SCI
1229 +/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
1232 + * Simple spin delay in microsecond units for device drivers.
1233 + * This is very dependent on the clock speed of the target.
1236 +#define rtems_bsp_delay( microseconds ) \
1237 + { register uint32_t _delay=(microseconds); \
1238 + register uint32_t _tmp=123; \
1239 + asm volatile( "0: \
1243 + : "=d" (_tmp), "=d" (_delay) \
1244 + : "0" (_tmp), "1" (_delay) ); \
1249 +extern char _etext[];
1250 +extern char _copy_start[];
1251 +extern char _edata[];
1252 +extern char _clear_start[];
1254 +extern char _copy_data_from_rom[];
1259 +#define STACK_SIZE "#0x800"
1261 +#define STACK_SIZE 0x800
1266 +#define RAW_PUTS(str) \
1267 + { register char *ptr = str; \
1268 + while (*ptr) SCI_output_char(*ptr++); \
1271 +#define RAW_PUTI(n) { \
1272 + register int i, j; \
1275 + for (i=28;i>=0;i -= 4) { \
1276 + j = (n>>i) & 0xf; \
1277 + SCI_output_char( (j>9 ? j-10+'a' : j+'0') ); \
1281 +/* miscellaneous stuff assumed to exist */
1283 +extern m68k_isr_entry M68Kvec[]; /* vector table address */
1285 +extern int stack_size;
1286 +extern int stack_start;
1289 + * Device Driver Table Entries
1293 + * NOTE: Use the standard Console driver entry
1297 + * NOTE: Use the standard Clock driver entry
1302 +void bsp_cleanup( void );
1304 +m68k_isr_entry set_vector(
1305 + rtems_isr_entry handler,
1306 + rtems_vector_number vector,
1310 +void Spurious_Initialize(void);
1312 +void _UART_flush(void);
1314 +void outbyte(char);
1321 Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/interr.c
1322 ===================================================================
1323 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1324 +++ rtems/c/src/lib/libbsp/m68k/mo376/misc/interr.c 2008-09-06 19:09:08.000000000 +0200
1327 + * Internal Error Handler
1329 + * COPYRIGHT (c) 1989-1999.
1330 + * On-Line Applications Research Corporation (OAR).
1332 + * The license and distribution terms for this file may be
1333 + * found in the file LICENSE in this distribution or at
1334 + * http://www.rtems.com/license/LICENSE.
1336 + * $Id: interr.c,v 1.5 2008/09/06 17:09:08 ralf Exp $
1339 +#include <rtems/system.h>
1340 +#include <rtems/score/interr.h>
1341 +#include <rtems/score/sysstate.h>
1342 +#include <rtems/score/userext.h>
1346 + * _Internal_error_Occurred
1348 + * This routine will invoke the fatal error handler supplied by the user
1349 + * followed by the the default one provided by the executive. The default
1350 + * error handler assumes no hardware is present to help inform the user
1351 + * of the problem. Halt stores the error code in a known register,
1352 + * disables interrupts, and halts the CPU. If the CPU does not have a
1353 + * halt instruction, it will loop to itself.
1355 + * Input parameters:
1356 + * the_source - what subsystem the error originated in
1357 + * is_internal - if the error was internally generated
1358 + * the_error - fatal error status code
1360 + * Output parameters:
1361 + * As much information as possible is stored in a CPU dependent fashion.
1362 + * See the CPU dependent code for more information.
1364 + * NOTE: The the_error is not necessarily a directive status code.
1368 + * Ugly hack.... _CPU_Fatal_halt() disonnects the bdm. Without this
1369 + * change, the_error is only known only to the cpu :).
1371 + * From "bsp.h" which is not yet available in the arch tree during
1372 + * this phase of install. jsg
1374 +void outbyte(char);
1375 +void bsp_cleanup( void );
1377 +#define RAW_PUTS(str) \
1378 + { register char *ptr = str; \
1379 + while (*ptr) outbyte(*ptr++); \
1382 +#define RAW_PUTI(n) { \
1383 + register int i, j; \
1386 + for (i=28;i>=0;i -= 4) { \
1387 + j = (n>>i) & 0xf; \
1388 + outbyte( (j>9 ? j-10+'a' : j+'0') ); \
1392 +void volatile _Internal_error_Occurred(
1393 + Internal_errors_Source the_source,
1395 + uint32_t the_error
1399 + _Internal_errors_What_happened.the_source = the_source;
1400 + _Internal_errors_What_happened.is_internal = is_internal;
1401 + _Internal_errors_What_happened.the_error = the_error;
1403 + _User_extensions_Fatal( the_source, is_internal, the_error );
1405 + _System_state_Set( SYSTEM_STATE_FAILED );
1407 + /* try to print error message to outbyte */
1408 + RAW_PUTS("\r\nRTEMS: A fatal error has occured.\r\n");
1409 + RAW_PUTS("RTEMS: fatal error ");
1410 + RAW_PUTI( the_error );
1412 + outbyte( (char)((the_error>>24) & 0xff) );
1413 + outbyte( (char)((the_error>>16) & 0xff) );
1414 + outbyte( (char)((the_error>>8) & 0xff) );
1415 + outbyte( (char)(the_error & 0xff) );
1416 + RAW_PUTS(").\r\n");
1418 + /* configure peripherals for a safe exit */
1421 + _CPU_Fatal_halt( the_error );
1423 + /* will not return from this routine */
1425 Index: rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
1426 ===================================================================
1427 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1428 +++ rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog 2008-12-08 06:15:06.000000000 +0100
1430 +2008-12-08 Ralf Corsépius <ralf.corsepius@rtems.org>
1432 + * bsp_specs: Backport from CVS-HEAD.
1434 +2008-09-30 Joel Sherrill <joel.sherrill@oarcorp.com>
1436 + * timer/timer.c: Eliminate uses of old benchmark timer names.
1438 +2008-09-29 Ralf Corsépius <ralf.corsepius@rtems.org>
1440 + * Makefile.am: Remove noinst_PROGRAMS (Unused).
1442 +2008-09-06 Ralf Corsépius <ralf.corsepius@rtems.org>
1444 + * misc/interr.c: Convert to "bool".
1446 +2008-09-05 Joel Sherrill <joel.sherrill@OARcorp.com>
1448 + * clock/ckinit.c: The Shared Memory Driver no longer requires the
1449 + special IOCTL in Clock_control. This was a hack which has existed
1450 + since before the Classic API Timer Manager was implemented. All
1451 + implementations of and references to Clock_control were removed.
1453 +2008-09-05 Ralf Corsépius <ralf.corsepius@rtems.org>
1455 + * timer/timer.c: Convert to "bool".
1457 +2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
1459 + * timer/timer.c: Eliminate empty function from every benchmark timer
1460 + driver. Fix spelling.
1462 +2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
1464 + * timer/timer.c: Rename timer driver methods to follow RTEMS
1465 + programming conventions.
1467 +2008-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>
1469 + * console/sci.c, startup/bspstart.c, startup/start_c.c,
1470 + timer/timer.c: Add missing prototypes.
1472 +2008-06-02 Joel Sherrill <joel.sherrill@oarcorp.com>
1474 + * misc/interr.c: Convention calls for leading underscore on private
1477 +2008-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
1479 + * Makefile.am: Rework to avoid .rel files.
1481 +2008-05-12 Joel Sherrill <joel.sherrill@OARcorp.com>
1483 + * console/console.c, startup/bspstart.c: Refactored and renamed
1484 + initialization routines to rtems_initialize_data_structures,
1485 + rtems_initialize_before_drivers, rtems_initialize_device_drivers, and
1486 + rtems_initialize_start_multitasking. This opened the sequence up so
1487 + that bootcard() could provide a more robust and flexible framework
1488 + which is easier to explain and understand. This also lays the
1489 + groundwork for sharing the division of available memory between the
1490 + RTEMS workspace and heap and the C library initialization across all
1493 +2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
1495 + * startup/linkcmds, startup/linkcmds_ROM: Add wildcard to
1496 + gcc_except_table section so programs compiled with gcc 4.3.x can
1499 +2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
1501 + * clock/ckinit.c, include/bsp.h, startup/bspstart.c: Eliminate copies
1502 + of the Configuration Table. Use the RTEMS provided accessor macros to
1503 + obtain configuration fields.
1505 +2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
1507 + * include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
1508 + from CPU Table to Configuration Table. Eliminate CPU Table from all
1509 + ports. Delete references to CPU Table in all forms.
1511 +2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
1513 + * startup/bspstart.c: Moved most of the remaining CPU Table fields to
1514 + the Configuration Table. This included pretasking_hook,
1515 + predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace,
1516 + extra_mpci_receive_server_stack, stack_allocate_hook, and
1517 + stack_free_hook. As a side-effect of this effort some multiprocessing
1518 + code was made conditional and some style clean up occurred.
1520 +2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
1522 + * startup/bspstart.c: Eliminate the interrupt_vector_table field in the
1523 + m68k CPU Table since it is never read.
1525 +2007-05-03 Joel Sherrill <joel@OARcorp.com>
1527 + * startup/linkcmds: Handle .data.* sections
1529 +2007-04-12 Ralf Corsépius <ralf.corsepius@rtems.org>
1531 + * bsp_specs: Remove qrtems_debug.
1533 +2007-03-13 Joel Sherrill <joel@OARcorp.com>
1535 + * include/bsp.h: Remove redundant prototypes.
1537 +2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
1539 + * configure.ac: New BUG-REPORT address.
1541 +2006-11-15 Joel Sherrill <joel@OARcorp.com>
1543 + * Makefile.am: Merge c_rtems_main() into boot_card(). This eliminated a
1544 + file and simplified initialization.
1546 +2006-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
1548 + * Makefile.am: Remove superfluous -DASM.
1550 +2006-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
1552 + * configure.ac: Require autoconf-2.60. Require automake-1.10.
1554 +2006-09-11 Joel Sherrill <joel@OARcorp.com>
1556 + * console/console.c, console/sci.c, console/sci.h, spurious/spinit.c,
1557 + startup/bspclean.c, startup/start_c.c: Convert C++ style comments to
1560 +2006-02-08 Joel Sherrill <joel@OARcorp.com>
1562 + * startup/linkcmds, startup/linkcmds_ROM: Add sections required by
1563 + newer gcc versions.
1565 +2006-01-11 Ralf Corsepius <ralf.corsepius@rtems.org>
1567 + * Makefile.am: Add preinstall.am.
1569 +2005-05-26 Ralf Corsepius <ralf.corsepius@rtems.org>
1571 + * include/bsp.h: New header guard.
1573 +2005-01-07 Ralf Corsepius <ralf.corsepius@rtems.org>
1575 + * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
1577 +2005-01-05 Ralf Corsepius <ralf.corsepius@rtems.org>
1579 + * console/sci.c: Remove CVS Log.
1581 +2005-01-04 Joel Sherrill <joel@OARcorp.com>
1583 + * console/sci.c: Remove warnings.
1585 +2005-01-02 Ralf Corsepius <ralf.corsepius@rtems.org>
1587 + * Makefile.am: Remove build-variant support.
1589 +2004-11-25 Joel Sherrill <joel@OARcorp.com>
1591 + * startup/linkcmds, startup/linkcmds_ROM: Add new bss sections .bss.*
1592 + and .gnu.linkonce.b*.
1594 +2004-09-24 Ralf Corsepius <ralf_corsepius@rtems.org>
1596 + * configure.ac: Require automake > 1.9.
1598 +2004-04-23 Ralf Corsepius <ralf_corsepius@rtems.org>
1601 + * Makefile.am: Add include/tm27.h, Cosmetics.
1602 + * include/tm27.h: Final cosmetics.
1604 +2004-04-22 Ralf Corsepius <ralf_corsepius@rtems.org>
1606 + * include/bsp.h: Split out tmtest27 support.
1607 + * include/tm27.h: New.
1609 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
1612 + * include/bsp.h: Remove MAX_LONG_TEST_DURATION.
1614 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
1617 + * include/bsp.h: Remove MAX_SHORT_TEST_DURATION (Unused).
1619 +2004-04-03 Ralf Corsepiu <ralf_corsepiu@rtems.org>
1621 + * c/src/lib/libbsp/m68k/mrm332/include/bsp.h,
1622 + c/src/lib/libbsp/m68k/mrm332/start/start.S,
1623 + c/src/lib/libbsp/m68k/mrm332/startup/start_c.c: Include
1624 + <rtems/m68k/sim.h> instead of <sim.h>.
1625 + * c/src/lib/libbsp/m68k/mrm332/include/bsp.h: Include
1626 + <rtems/m68k/qsm.h> instead of <qsm.h>.
1628 +2004-04-02 Ralf Corsepius <ralf_corsepius@rtems.org>
1630 + * start/start.S: Include <rtems/asm.h> instead of <asm.h>.
1632 +2004-04-01 Ralf Corsepius <ralf_corsepius@rtems.org>
1634 + * include/bsp.h: Include <rtems/clockdrv.h> instead of <clockdrv.h>.
1635 + * include/bsp.h: Include <rtems/console.h> instead of <console.h>.
1636 + * include/bsp.h: Include <rtems/iosupp.h> instead of <iosupp.h>.
1638 +2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
1640 + * clock/ckinit.c, console/sci.c, console/sci.h, include/bsp.h,
1641 + misc/interr.c, startup/bspstart.c, timer/timer.c: Convert to using
1642 + c99 fixed size types.
1644 +2004-02-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1646 + * Makefile.am: Reflect changes to bsp.am.
1647 + Preinstall dist_project_lib*.
1649 +2004-02-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1651 + * Makefile.am: Reflect changes to bsp.am.
1653 +2004-02-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1655 + * Makefile.am: Use CPPASCOMPILE instead of CCASCOMPILE.
1657 +2004-02-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1659 + * Makefile.am: Pickup files from ../../m68k/shared instead of
1660 + ../shared. Reformat.
1662 +2004-01-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1664 + * configure.ac: Add nostdinc to AUTOMAKE_OPTIONS.
1666 +2004-01-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1668 + * Makefile.am: Don't include subdirs.am.
1670 +2004-01-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1672 + * Makefile.am: Fix typo.
1674 +2004-01-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1676 + * Makefile.am: Merge-in clock/Makefile.am, console/Makefile.am,
1677 + spurious/Makefile.am, startup/Makefile.am, timer/Makefile.am,
1678 + wrapup/Makefile.am.
1679 + Use automake compilation rules.
1680 + * clock/Makefile.am, console/Makefile.am, spurious/Makefile.am,
1681 + startup/Makefile.am, timer/Makefile.am, wrapup/Makefile.am:
1683 + * configure.ac: Reflect changes above.
1685 +2004-01-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1687 + * Makefile.am: Add PREINSTALL_DIRS.
1688 + * wrapup/Makefile.am: Reflect changes to libcpu.
1690 +2004-01-20 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1692 + * wrapup/Makefile.am: Reflect changes to libcpu.
1694 +2004-01-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1696 + * Makefile.am: Re-add dirstamps to PRE/TMPINSTALL_FILES.
1697 + Add PRE/TMPINSTALL_FILES to CLEANFILES.
1698 + * startup/Makefile.am: Ditto.
1700 +2004-01-07 Joel Sherrill <joel@OARcorp.com>
1702 + * times, console/sci.c: Remove efi68k and efi332 references as they are
1703 + no longer in the tree.
1705 +2004-01-07 Joel Sherrill <joel@OARcorp.com>
1707 + * timer/timer.c: Remove efi68k and efi332 references as they are no
1708 + longer in the tree.
1710 +2004-01-07 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1712 + * start/Makefile.am: Remove.
1713 + * Makefile.am: Merge-in start/Makefile.am.
1714 + * configure.ac: Reflect changes above.
1716 +2004-01-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1718 + * wrapup/Makefile.am: Eliminate $(LIB).
1719 + Use noinst_DATA to trigger building libbsp.a.
1721 +2003-12-13 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1723 + * start/Makefile.am: s,${PROJECT_RELEASE}/lib,$(PROJECT_LIB),g.
1724 + * startup/Makefile.am: s,${PROJECT_RELEASE}/lib,$(PROJECT_LIB),g.
1726 +2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1728 + * start/Makefile.am: Use mkdir_p. Remove dirs from PRE/TMPINSTALL_FILES.
1729 + * startup/Makefile.am: Use mkdir_p. Remove dirs from PRE/TMPINSTALL_FILES.
1731 +2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1733 + * configure.ac: Require automake >= 1.8, autoconf >= 2.59.
1735 +2003-12-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1737 + * start/Makefile.am: Misc cleanups and fixes.
1738 + * startup/Makefile.am: Misc cleanups and fixes.
1739 + * wrapup/Makefile.am: Misc cleanups and fixes.
1741 +2003-12-03 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1743 + * Makefile.am: Add preinstallation dirstamp support.
1744 + * clock/Makefile.am: Cosmetics.
1745 + * console/Makefile.am: Cosmetics.
1746 + * spurious/Makefile.am: Cosmetics.
1747 + * startup/Makefile.am: Cosmetics.
1748 + * timer/Makefile.am: Cosmetics.
1749 + * wrapup/Makefile.am: Cosmetics.
1751 +2003-12-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1753 + * clock/Makefile.am: Remove all-local: $(ARCH).
1754 + * console/Makefile.am: Remove all-local: $(ARCH).
1755 + * spurious/Makefile.am: Remove all-local: $(ARCH).
1756 + * start/Makefile.am: Remove all-local: $(ARCH).
1757 + * startup/Makefile.am: Remove all-local: $(ARCH).
1758 + * timer/Makefile.am: Remove all-local: $(ARCH).
1759 + * wrapup/Makefile.am: Remove all-local: $(ARCH).
1761 +2003-09-29 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1763 + * Makefile.am: Merge-in include/Makefile.am.
1764 + Reflect changes to bsp.am.
1765 + * include/Makefile.am: Remove.
1766 + * configure.ac: Reflect changes above.
1768 +2003-09-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1770 + * bsp_specs: Remove *lib:.
1772 +2003-09-15 Joel Sherrill <joel@OARcorp.com>
1775 + * startup/bspstart.c, startup/start_c.c: Spurious interrupt handlers
1776 + cannot be installed until RTEMS has initialized the vector table.
1778 +2003-09-04 Joel Sherrill <joel@OARcorp.com>
1780 + * clock/ckinit.c, console/console.c, include/bsp.h, misc/interr.c,
1781 + spurious/spinit.c, startup/bspclean.c, startup/bspstart.c,
1782 + timer/timer.c: URL for license changed.
1784 +2003-08-20 Joel Sherrill <joel@OARcorp.com>
1786 + * console/console.c: Correct copyright statements.
1788 +2003-08-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1790 + * Makefile.am: Reflect having moved aclocal/.
1792 +2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1794 + * Makefile.am: Reflect having moved automake/.
1795 + * clock/Makefile.am: Reflect having moved automake/.
1796 + * console/Makefile.am: Reflect having moved automake/.
1797 + * include/Makefile.am: Reflect having moved automake/.
1798 + * spurious/Makefile.am: Reflect having moved automake/.
1799 + * start/Makefile.am: Reflect having moved automake/.
1800 + * startup/Makefile.am: Reflect having moved automake/.
1801 + * timer/Makefile.am: Reflect having moved automake/.
1802 + * wrapup/Makefile.am: Reflect having moved automake/.
1804 +2003-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1807 + * startup/Makefile.am: Remove USE_INIT_FINI.
1809 +2003-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1811 + * configure.ac: Use rtems-bugs@rtems.com as bug report email address.
1813 +2003-08-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1816 + * bsp_specs: Remove -D__embedded__ -Asystem(embedded) from cpp.
1817 + Remove cpp, old_cpp (now unused).
1819 +2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1821 + * configure.ac: Remove AC_CONFIG_AUX_DIR.
1823 +2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1825 + * configure.ac: AM_INIT_AUTOMAKE([1.7.2]).
1827 +2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1829 + * configure.ac: AC_PREREQ(2.57).
1831 +2003-01-20 Duane Gustavus <duane@unt.edu>
1833 + * console/sci.c, include/mrm332.h, startup/linkcmds,
1834 + startup/linkcmds_ROM: Various updates to make this run properly
1837 +2002-12-20 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1839 + * clock/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1840 + * console/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1841 + * spurious/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1842 + * start/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1843 + * startup/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1844 + * timer/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1846 +2002-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1848 + * start/Makefile.am: Use install-data-local to install startfile.
1850 +2002-12-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1852 + * wrapup/Makefile.am: Don't include @RTEMS_BSP@.cfg.
1854 +2002-11-04 Joel Sherrill <joel@OARcorp.com>
1856 + * console/sci.c, spurious/spinit.c: Removed warnings.
1858 +2002-10-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1860 + * .cvsignore: Reformat.
1861 + Add autom4te*cache.
1862 + Remove autom4te.cache.
1864 +2002-09-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1866 + * Makefile.am: ACLOCAL_AMFLAGS = -I ../../../../../../aclocal.
1868 +2002-08-21 Joel Sherrill <joel@OARcorp.com>
1870 + * wrapup/Makefile.am: PR217 required that the idle task be moved to
1871 + libcpu so it could be more acutely aware of the CPU model. This
1872 + file was modified to pick up the idle task from there.
1874 +2002-08-21 Joel Sherrill <joel@OARcorp.com>
1876 + * bsp_specs: Added support for -nostdlibs.
1878 +2002-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1880 + * clock/Makefile.am: Use .$(OBJEXT) instead of .o.
1881 + * console/Makefile.am: Use .$(OBJEXT) instead of .o.
1882 + * spurious/Makefile.am: Use .$(OBJEXT) instead of .o.
1883 + * start/Makefile.am: Use .$(OBJEXT) instead of .o.
1884 + * startup/Makefile.am: Use .$(OBJEXT) instead of .o.
1885 + * timer/Makefile.am: Use .$(OBJEXT) instead of .o.
1886 + * wrapup/Makefile.am: Use .$(OBJEXT) instead of .o.
1888 +2002-08-05 Joel Sherrill <joel@OARcorp.com>
1890 + * Per PR260 eliminate use of make-target-options. This impacted
1891 + RTEMS allowing a distinction between the CPU32 and CPU32+ in the
1892 + SuperCore and required that the m68k optimized memcpy be moved
1894 + * wrapup/Makefile.am: Pick up memcpy.o from libcpu.
1896 +2002-07-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1898 + * start/Makefile.am: Eliminate PGM.
1899 + Add bsplib_DATA = $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o.
1901 +2002-07-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1903 + * startup/Makefile.am: Add bsplib_DATA = linkcmds linkcmds_ROM.
1905 +2002-07-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1907 + * wrapup/Makefile.am: Eliminate TMPINSTALL_FILES.
1908 + Remove $(OBJS) from all-local.
1910 +2002-06-29 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1912 + * wrapup/Makefile.am: Remove preinstallation of libbsp.a,
1914 +2001-05-09 Joel Sherrill <joel@OARcorp.com>
1916 + * startup/linkcmds: In support of gcc 3.1, added one of more
1917 + of the sections .jcr, .rodata*, .data.*, .gnu.linkonce.s2.*,
1918 + .gnu.linkonce.sb2.*, and .gnu.linkonce.s.*. Spacing corrections
1919 + and direction of segments to memory regions may also have been
1920 + addressed. This was a sweep across all BSPs.
1922 +2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1925 + AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS).
1926 + AM_INIT_AUTOMAKE([no-define foreign 1.6]).
1927 + * clock/Makefile.am: Remove AUTOMAKE_OPTIONS.
1928 + * Makefile.am: Remove AUTOMAKE_OPTIONS.
1929 + * console/Makefile.am: Remove AUTOMAKE_OPTIONS.
1930 + * include/Makefile.am: Remove AUTOMAKE_OPTIONS.
1931 + * spurious/Makefile.am: Remove AUTOMAKE_OPTIONS.
1932 + * start/Makefile.am: Remove AUTOMAKE_OPTIONS.
1933 + * startup/Makefile.am: Remove AUTOMAKE_OPTIONS.
1934 + * timer/Makefile.am: Remove AUTOMAKE_OPTIONS.
1935 + * wrapup/Makefile.am: Remove AUTOMAKE_OPTIONS.
1937 +2002-02-28 Mike Panetta <ahuitzot@mindspring.com>
1939 + * console/sci.c, console/sci.h,
1940 + console/console.c: Added new SCI driver.
1941 + * start/start.c: Removed file.
1942 + * start/start.S: New file, the asm portion of the updated start code.
1943 + * start/configure.am: Added start.S, removed start.c
1944 + * startup/start_c.c: New file, the C portion of the updated start code. Contains most of the code that was in the old start.c.
1945 + * startup/configure.am: Added start_c.c to C_FILES.
1946 + * include/bsp.h: Added include <rtems/bspIo.h>
1948 +2001-11-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1950 + * configure.ac: Introduce RTEMS_BSP_CONFIGURE.
1952 +2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1954 + * .cvsignore: Add autom4te.cache for autoconf > 2.52.
1955 + * configure.in: Remove.
1956 + * configure.ac: New file, generated from configure.in by autoupdate.
1958 +2001-09-27 Joel Sherrill <joel@OARcorp.com>
1960 + * include/bsp.h: Renamed delay() to rtems_bsp_delay().
1962 +2001-09-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1964 + * include/Makefile.am: Use 'TMPINSTALL_FILES ='.
1966 +2001-05-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
1968 + * configure.in: Add bspopts.h.
1969 + * include/.cvsignore: Add bspopts.h*, stamp-h*.
1970 + * include/Makefile.am: Use *_HEADERS instead of *H_FILES.
1971 + * include/bsp.h: Include bspopts.h.
1973 +2001-05-25 Joel Sherrill <joel@OARcorp.com>
1975 + * clock/Makefile.am, console/Makefile.am, spurious/Makefile.am,
1976 + start/Makefile.am, startup/Makefile.am, timer/Makefile.am,
1977 + wrapup/Makefile.am: Modified to include compile.am.
1978 + * startup/bspstart.c: Removed include of <libcsupport.h>
1980 +2000-05-25 Matt Cross <profesor@gweep.net>
1982 + * New MRM332 BSP for the Mini RoboMind board based
1983 + on the 68332 microcontroller designed and build by Mark
1984 + Castelluccio. For details on the MRM see http://www.robominds.com.
1985 + * .cvsignore, ChangeLog Makefile.am, README, bsp_specs,
1986 + clock/.cvsignore, clock/Makefile.am, clock/ckinit.c, configure.in,
1987 + console/.cvsignore, console/Makefile.am, console/console.c,
1988 + include/.cvsignore, include/Makefile.am, include/bsp.h,
1989 + include/mrm332.h, misc/dotests, misc/gdbinit68, misc/interr.c,
1990 + spurious/.cvsignore, spurious/Makefile.am, spurious/spinit.c,
1991 + start/.cvsignore, start/Makefile.am, start/start.c, startup/.cvsignore,
1992 + startup/Makefile.am, startup/bspclean.c, startup/bspstart.c,
1993 + startup/except_vect_332_ROM.S, startup/linkcmds, startup/linkcmds_ROM,
1994 + timer/.cvsignore, timer/Makefile.am, timer/timer.c, times,
1995 + wrapup/.cvsignore, wrapup/Makefile.am: Initial files.
1997 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/bspclean.c
1998 ===================================================================
1999 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2000 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/bspclean.c 2006-09-11 23:43:56.000000000 +0200
2004 + * This routine cleans up in the sense that it places the board
2005 + * in a safe state and flushes the I/O buffers before exiting.
2011 + * COPYRIGHT (c) 1989-1999.
2012 + * On-Line Applications Research Corporation (OAR).
2014 + * The license and distribution terms for this file may be
2015 + * found in the file LICENSE in this distribution or at
2016 + * http://www.rtems.com/license/LICENSE.
2018 + * $Id: bspclean.c,v 1.5 2006/09/11 21:43:56 joel Exp $
2023 +void bsp_cleanup(void)
2025 + /* interrupt driven stdio must be flushed */
2026 + _CPU_ISR_Set_level( 7 );
2027 + /*_UART_flush(); */
2029 Index: rtems/c/src/lib/libbsp/m68k/mo376/timer/timer.c
2030 ===================================================================
2031 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2032 +++ rtems/c/src/lib/libbsp/m68k/mo376/timer/timer.c 2008-09-30 18:28:07.000000000 +0200
2035 + * COPYRIGHT (c) 1989-1999.
2036 + * On-Line Applications Research Corporation (OAR).
2038 + * The license and distribution terms for this file may be
2039 + * found in the file LICENSE in this distribution or at
2040 + * http://www.rtems.com/license/LICENSE.
2042 + * $Id: timer.c,v 1.10.2.1 2008/09/30 16:28:07 joel Exp $
2047 +bool benchmark_timer_find_average_overhead;
2049 +extern rtems_isr Clock_isr(void);
2051 +void benchmark_timer_initialize( void )
2056 + * The following controls the behavior of benchmark_timer_read().
2058 + * FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
2060 + * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
2061 + * is usually deducted from the number returned.
2063 + * LEAST_VALID is the lowest number this routine should trust. Numbers
2064 + * below this are "noise" and zero is returned.
2067 +#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
2068 + /* (Y countdowns) to start/stop the timer. */
2069 + /* This value is in microseconds. */
2070 +#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
2073 + * Return timer value in 1/2-microsecond units
2075 +int benchmark_timer_read( void )
2080 + if ( benchmark_timer_find_average_overhead == true )
2081 + return total; /* in XXX microsecond units */
2083 + if ( total < LEAST_VALID )
2084 + return 0; /* below timer resolution */
2086 + return (total - AVG_OVERHEAD);
2089 +void benchmark_timer_disable_subtracting_average_overhead(
2093 + benchmark_timer_find_average_overhead = find_flag;
2095 Index: rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
2096 ===================================================================
2097 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2098 +++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c 2008-09-06 00:05:15.000000000 +0200
2102 + * This routine initailizes the periodic interrupt timer on
2103 + * the Motorola 68332.
2105 + * Input parameters: NONE
2107 + * Output parameters: NONE
2109 + * COPYRIGHT (c) 1989-1999.
2110 + * On-Line Applications Research Corporation (OAR).
2112 + * The license and distribution terms for this file may be
2113 + * found in the file LICENSE in this distribution or at
2114 + * http://www.rtems.com/license/LICENSE.
2116 + * $Id: ckinit.c,v 1.7 2008/09/05 22:05:15 joel Exp $
2119 +#include <stdlib.h>
2121 +#include <rtems/libio.h>
2122 +#include <mrm332.h>
2124 +#define CLOCK_VECTOR MRM_PIV
2126 +uint32_t Clock_isrs; /* ISRs until next tick */
2127 +volatile uint32_t Clock_driver_ticks;
2128 + /* ticks since initialization */
2129 +rtems_isr_entry Old_ticker;
2131 +void Clock_exit( void );
2134 + * These are set by clock driver during its init
2137 +rtems_device_major_number rtems_clock_major = ~0;
2138 +rtems_device_minor_number rtems_clock_minor;
2140 +rtems_isr Clock_isr(rtems_vector_number vector)
2142 + Clock_driver_ticks += 1;
2144 + if ( Clock_isrs == 1 ) {
2145 + rtems_clock_tick();
2146 + Clock_isrs = rtems_configuration_get_microseconds_per_tick() / 1000;
2152 +void Install_clock(
2153 + rtems_isr_entry clock_isr
2156 + Clock_driver_ticks = 0;
2157 + Clock_isrs = rtems_configuration_get_microseconds_per_tick() / 1000;
2159 + Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
2161 + /* enable 1mS interrupts */
2162 + *PITR = (unsigned short int)( SAM(0x09,0,PITM) );/* load counter */
2163 + *PICR = (unsigned short int) /* enable interrupt */
2164 + ( SAM(ISRL_PIT,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
2166 + atexit( Clock_exit );
2169 +void Clock_exit( void )
2171 + /* shutdown the periodic interrupt */
2172 + *PICR = (unsigned short int)
2173 + ( SAM(0,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
2174 + /* ^^ zero disables interrupt */
2176 + /* do not restore old vector */
2179 +rtems_device_driver Clock_initialize(
2180 + rtems_device_major_number major,
2181 + rtems_device_minor_number minor,
2185 + Install_clock( Clock_isr );
2188 + * make major/minor avail to others such as shared memory driver
2191 + rtems_clock_major = major;
2192 + rtems_clock_minor = minor;
2194 + return RTEMS_SUCCESSFUL;
2196 Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
2197 ===================================================================
2198 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2199 +++ rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 2009-11-29 01:11:56.471556761 +0100
2202 +# $Id: gdbinit68,v 1.1 2001/05/25 16:28:46 joel Exp $
2204 +echo Setting up the environment for mrm debuging.\n
2206 +target bdm /dev/bdmcpu320
2209 +set remotecache off
2217 Index: rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
2218 ===================================================================
2219 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2220 +++ rtems/c/src/lib/libbsp/m68k/mo376/configure.ac 2006-12-02 06:55:13.000000000 +0100
2222 +## Process this file with autoconf to produce a configure script.
2224 +## $Id: configure.ac,v 1.16 2006/12/02 05:55:13 ralf Exp $
2227 +AC_INIT([rtems-c-src-lib-libbsp-m68k-mrm332],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
2228 +AC_CONFIG_SRCDIR([bsp_specs])
2229 +RTEMS_TOP(../../../../../..)
2231 +RTEMS_CANONICAL_TARGET_CPU
2232 +AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.10])
2233 +RTEMS_BSP_CONFIGURE
2235 +RTEMS_PROG_CC_FOR_TARGET
2236 +RTEMS_CANONICALIZE_TOOLS
2239 +# Explicitly list all Makefiles here
2240 +AC_CONFIG_FILES([Makefile])
2242 Index: rtems/c/src/lib/libbsp/m68k/mo376/README
2243 ===================================================================
2244 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2245 +++ rtems/c/src/lib/libbsp/m68k/mo376/README 2009-11-29 01:11:56.471556761 +0100
2248 +# $Id: README,v 1.1 2001/05/25 16:28:46 joel Exp $
2251 +Description: mrm332
2253 +CPU: MC68332 @16 or 25MHz
2257 + The Mini RoboMind is a small board based on the 68332 microcontroller
2258 +designed and build by Mark Castelluccio. For details, see:
2260 + http://www.robominds.com
2262 + This BSP was ported from the efi332 BSP by Matt Cross (profesor@gweep.net),
2263 +the efi332 BSP was written by John S Gwynne.
2267 +- integrate the interrupt driven stdin/stdout into RTEMS to (a) reduce
2268 + the interrupt priority and (2) to prevent it from blocking.
2269 +- add a timer driver for the tmtest set.
2271 Index: rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
2272 ===================================================================
2273 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2274 +++ rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am 2008-09-29 03:47:41.000000000 +0200
2277 +## $Id: Makefile.am,v 1.27.2.1 2008/09/29 01:47:41 ralf Exp $
2280 +ACLOCAL_AMFLAGS = -I ../../../../aclocal
2282 +include $(top_srcdir)/../../../../automake/compile.am
2283 +include $(top_srcdir)/../../bsp.am
2285 +dist_project_lib_DATA = bsp_specs
2287 +include_HEADERS = include/bsp.h
2288 +include_HEADERS += include/tm27.h
2290 +nodist_include_HEADERS = include/bspopts.h
2291 +DISTCLEANFILES = include/bspopts.h
2293 +include_HEADERS += include/mrm332.h
2294 +nodist_include_HEADERS += ../../shared/include/coverhd.h
2298 +EXTRA_DIST += start/start.S
2299 +start.$(OBJEXT): start/start.S
2300 + $(CPPASCOMPILE) -o $@ -c $<
2302 +project_lib_DATA = start.$(OBJEXT)
2304 +dist_project_lib_DATA += startup/linkcmds startup/linkcmds_ROM
2306 +startup_SOURCES = startup/start_c.c ../../shared/bsplibc.c \
2307 + ../../shared/bsppost.c startup/bspstart.c startup/bspclean.c \
2308 + ../../shared/bootcard.c ../../m68k/shared/m68kpretaskinghook.c \
2309 + ../../shared/sbrk.c ../../m68k/shared/setvec.c \
2310 + ../../shared/gnatinstallhandler.c startup/except_vect_332_ROM.S
2311 +clock_SOURCES = clock/ckinit.c
2312 +console_SOURCES = console/console.c console/sci.c console/sci.h
2313 +spurious_SOURCES = spurious/spinit.c
2314 +timer_SOURCES = timer/timer.c
2316 +noinst_LIBRARIES = libbsp.a
2317 +libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
2318 + $(spurious_SOURCES) $(timer_SOURCES)
2320 +libbsp_a_LIBADD = \
2321 + ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
2322 + ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
2324 +include $(srcdir)/preinstall.am
2325 +include $(top_srcdir)/../../../../automake/local.am
2326 Index: rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
2327 ===================================================================
2328 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2329 +++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c 2008-08-19 12:23:15.000000000 +0200
2331 +/*****************************************************************************
2334 +* Desc: This file contains the console IO routines for the SCI port.
2335 +* There are two interfaces in this module. One is for the rtems
2336 +* termios/console code and the other is a device driver interface.
2337 +* This module works together with the termio module which is
2338 +* sometimes referred to as the "line disciplines" which implements
2339 +* terminal i/o processing like tabs, backspaces, and newlines.
2340 +* The rtems printf uses interrupt io and the rtems printk routine
2341 +* uses polled io which is better for debugging.
2343 +* Index: Documentation
2344 +* Section A - Include Files
2345 +* Section B - Manifest Constants
2346 +* Section C - External Data
2347 +* Section D - External Functions
2348 +* Section E - Local Functions
2349 +* Section F - Local Variables
2350 +* Section G - A circular data buffer for rcv chars
2351 +* Section H - RTEMS termios callbacks for the interrupt api
2352 +* Section I - RTEMS termios callbacks for the polled api
2354 +* Section 0 - Miscellaneous routines
2355 +* Section 1 - Routines to manipulate the circular buffer
2356 +* Section 2 - Interrupt based entry points for the termios module
2357 +* Section 3 - Polling based entry points for the termios module
2358 +* Section 4 - Device driver public api entry points
2359 +* Section 5 - Hardware level routines
2360 +* Section 6 - Testing and debugging code
2362 +* Refer: Motorola QSM Reference Manual - Chapter 5 - SCI sub-module
2364 +* Note: See bsp.h,confdefs.h,system.h for installing drivers into RTEMS.
2366 +* $Id: sci.c,v 1.12 2008/08/19 10:23:15 ralf Exp $
2368 +*****************************************************************************/
2370 +/*****************************************************************************
2371 + Overview of serial port console terminal input/output
2372 +*****************************************************************************/
2375 + +-----------+ +---------+
2377 + +-----------+ +---------+
2379 + | (printf,scanf,etc.) |
2386 + | (open,close,read,write,ioctl) |
2387 + ======|==========================================|========================
2388 + | /dev/console | /dev/sci
2389 + | (stdin,stdout,stderr) |
2390 + ======|==========================================|========================
2394 + +-----------+ +-----------+ +---------+
2395 + | console | <---> | termios | <---> | sci |
2396 + | driver | | module | | driver |
2397 + +-----------+ +-----------+ +---------+
2409 +/*****************************************************************************
2410 + Section A - Include Files
2411 +*****************************************************************************/
2415 +#include <rtems/bspIo.h>
2417 +#include <rtems/libio.h>
2418 +#include <libchip/serial.h>
2419 +#include <libchip/sersupp.h>
2421 +/*#include "../misc/include/cpu332.h" */
2424 +/*****************************************************************************
2425 + Section B - Manifest Constants
2426 +*****************************************************************************/
2428 +#define SCI_MINOR 0 /* minor device number */
2430 +/* IMPORTANT - if the device driver api is opened, it means the sci is being
2431 + * used for direct hardware access, so other users (like termios) get ignored
2433 +#define DRIVER_CLOSED 0 /* the device driver api is closed */
2434 +#define DRIVER_OPENED 1 /* the device driver api is opened */
2436 +/* system clock definitions, i dont have documentation on this... */
2438 +#if 0 /* Not needed, this is provided in mrm332.h */
2439 +#define XTAL 32768.0 /* crystal frequency in Hz */
2440 +#define NUMB_W 0 /* system clock parameters */
2442 +#define NUMB_Y 0x38 /* for 14.942 Mhz */
2443 +#define NUMB_Y 0x3F /* for 16.777 Mhz */
2445 +#define SYS_CLOCK (XTAL * 4.0 * (NUMB_Y+1) * (1 << (2 * NUMB_W + NUMB_X)))
2450 +/*****************************************************************************
2451 + Section C - External Data
2452 +*****************************************************************************/
2456 +/*****************************************************************************
2457 + Section D - External Functions
2458 +*****************************************************************************/
2462 +/*****************************************************************************
2463 + Section E - Local Functions
2464 +*****************************************************************************/
2466 +void SCI_output_char(char c);
2468 +/*rtems_isr SciIsr( rtems_vector_number vector ); interrupt handler */
2470 +const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled );
2472 +rtems_device_driver SciInitialize( /* device driver api */
2473 + rtems_device_major_number, rtems_device_minor_number, void *);
2474 +rtems_device_driver SciOpen( /* device driver api */
2475 + rtems_device_major_number, rtems_device_minor_number, void *);
2476 +rtems_device_driver SciClose( /* device driver api */
2477 + rtems_device_major_number, rtems_device_minor_number, void *);
2478 +rtems_device_driver SciRead( /* device driver api */
2479 + rtems_device_major_number, rtems_device_minor_number, void *);
2480 +rtems_device_driver SciWrite( /* device driver api */
2481 + rtems_device_major_number, rtems_device_minor_number, void *);
2482 +rtems_device_driver SciControl( /* device driver api */
2483 + rtems_device_major_number, rtems_device_minor_number, void *);
2484 +rtems_device_driver SciRead (
2485 + rtems_device_major_number, rtems_device_minor_number, void *);
2487 +int SciInterruptOpen(int, int, void *); /* termios api */
2488 +int SciInterruptClose(int, int, void *); /* termios api */
2489 +int SciInterruptWrite(int, const char *, int); /* termios api */
2491 +int SciSetAttributes(int, const struct termios*); /* termios api */
2492 +int SciPolledOpen(int, int, void *); /* termios api */
2493 +int SciPolledClose(int, int, void *); /* termios api */
2494 +int SciPolledRead(int); /* termios api */
2495 +int SciPolledWrite(int, const char *, int); /* termios api */
2497 +static void SciSetBaud(uint32_t rate); /* hardware routine */
2498 +static void SciSetDataBits(uint16_t bits); /* hardware routine */
2499 +static void SciSetParity(uint16_t parity); /* hardware routine */
2501 +static void inline SciDisableAllInterrupts( void ); /* hardware routine */
2502 +static void inline SciDisableTransmitInterrupts( void );/* hardware routine */
2503 +static void inline SciDisableReceiveInterrupts( void ); /* hardware routine */
2505 +static void inline SciEnableTransmitInterrupts( void ); /* hardware routine */
2506 +static void inline SciEnableReceiveInterrupts( void ); /* hardware routine */
2508 +static void inline SciDisableReceiver( void ); /* hardware routine */
2509 +static void inline SciDisableTransmitter( void ); /* hardware routine */
2511 +static void inline SciEnableReceiver( void ); /* hardware routine */
2512 +static void inline SciEnableTransmitter( void ); /* hardware routine */
2514 +void SciWriteCharWait ( uint8_t ); /* hardware routine */
2515 +void SciWriteCharNoWait( uint8_t ); /* hardware routine */
2517 +uint8_t inline SciCharAvailable( void ); /* hardware routine */
2519 +uint8_t inline SciReadCharWait( void ); /* hardware routine */
2520 +uint8_t inline SciReadCharNoWait( void ); /* hardware routine */
2522 +void SciSendBreak( void ); /* test routine */
2524 +static int8_t SciRcvBufGetChar(void); /* circular rcv buf */
2525 +static void SciRcvBufPutChar( uint8_t); /* circular rcv buf */
2527 +static void SciRcvBufFlush( void ); /* unused routine */
2530 +void SciUnitTest(void); /* test routine */
2531 +void SciPrintStats(void); /* test routine */
2534 +/*****************************************************************************
2535 + Section F - Local Variables
2536 +*****************************************************************************/
2538 +static struct rtems_termios_tty *SciTermioTty;
2540 +static uint8_t SciInited = 0; /* has the driver been inited */
2542 +static uint8_t SciOpened; /* has the driver been opened */
2544 +static uint8_t SciMajor; /* major device number */
2546 +static uint16_t SciBaud; /* current value in baud register */
2548 +static uint32_t SciBytesIn = 0; /* bytes received */
2549 +static uint32_t SciBytesOut = 0; /* bytes transmitted */
2551 +static uint32_t SciErrorsParity = 0; /* error counter */
2552 +static uint32_t SciErrorsNoise = 0; /* error counter */
2553 +static uint32_t SciErrorsFraming = 0; /* error counter */
2554 +static uint32_t SciErrorsOverrun = 0; /* error counter */
2556 +#if defined(CONSOLE_SCI)
2558 +/* this is what rtems printk uses to do polling based output */
2560 +BSP_output_char_function_type BSP_output_char = SCI_output_char;
2561 +BSP_polling_getchar_function_type BSP_poll_char = NULL;
2565 +/* cvs id string so you can use the unix ident command on the object */
2568 +static const char SciIdent[]="$Id: sci.c,v 1.12 2008/08/19 10:23:15 ralf Exp $";
2572 +/*****************************************************************************
2573 + Section G - A circular buffer for rcv chars when the driver interface is used.
2574 +*****************************************************************************/
2576 +/* it is trivial to wrap your buffer pointers when size is a power of two */
2578 +#define SCI_RCV_BUF_SIZE 256 /* must be a power of 2 !!! */
2580 +/* if someone opens the sci device using the device driver interface,
2581 + * then the receive data interrupt handler will put characters in this buffer
2582 + * instead of sending them up to the termios module for the console
2584 +static uint8_t SciRcvBuffer[SCI_RCV_BUF_SIZE];
2586 +static uint8_t SciRcvBufPutIndex = 0; /* array index to put in next char */
2588 +static uint8_t SciRcvBufGetIndex = 0; /* array index to take out next char */
2590 +static uint16_t SciRcvBufCount = 0; /* how many bytes are in the buffer */
2594 +/*****************************************************************************
2595 + Section H - RTEMS termios callbacks for the interrupt version of the driver
2596 +*****************************************************************************/
2598 +static const rtems_termios_callbacks SciInterruptCallbacks =
2600 + SciInterruptOpen, /* first open */
2601 + SciInterruptClose, /* last close */
2602 + NULL, /* polled read (not required) */
2603 + SciInterruptWrite, /* write */
2604 + SciSetAttributes, /* set attributes */
2605 + NULL, /* stop remote xmit */
2606 + NULL, /* start remote xmit */
2607 + TRUE /* output uses interrupts */
2610 +/*****************************************************************************
2611 + Section I - RTEMS termios callbacks for the polled version of the driver
2612 +*****************************************************************************/
2614 +static const rtems_termios_callbacks SciPolledCallbacks =
2616 + SciPolledOpen, /* first open */
2617 + SciPolledClose, /* last close */
2618 + SciPolledRead, /* polled read */
2619 + SciPolledWrite, /* write */
2620 + SciSetAttributes, /* set attributes */
2621 + NULL, /* stop remote xmit */
2622 + NULL, /* start remote xmit */
2623 + FALSE /* output uses interrupts */
2629 + * MISCELLANEOUS ROUTINES
2632 +/****************************************************************************
2633 + * Func: SCI_output_char
2634 + * Desc: used by rtems printk function to send a char to the uart
2635 + * Inputs: the character to transmit
2639 + ****************************************************************************/
2641 +void SCI_output_char(char c)
2643 +/* ( minor device number, pointer to the character, length ) */
2645 + SciPolledWrite( SCI_MINOR, &c, 1);
2651 +/****************************************************************************
2652 +* Func: SciGetTermiosHandlers
2653 +* Desc: returns a pointer to the table of serial io functions
2654 +* this is called from console_open with polled set to false
2655 +* Inputs: flag indicating whether we want polled or interrupt driven io
2656 +* Outputs: pointer to function table
2659 +****************************************************************************/
2661 +const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled )
2665 + return &SciPolledCallbacks; /* polling based */
2669 + return &SciInterruptCallbacks; /* interrupt driven */
2674 +/****************************************************************************
2676 +* Desc: interrupt handler for serial communications interface
2677 +* Inputs: vector number - unused
2680 +* Scope: public API
2681 +****************************************************************************/
2683 +rtems_isr SciIsr( rtems_vector_number vector )
2687 + if ( (*SCSR) & SCI_ERROR_PARITY ) SciErrorsParity ++;
2688 + if ( (*SCSR) & SCI_ERROR_FRAMING ) SciErrorsFraming ++;
2689 + if ( (*SCSR) & SCI_ERROR_NOISE ) SciErrorsNoise ++;
2690 + if ( (*SCSR) & SCI_ERROR_OVERRUN ) SciErrorsOverrun ++;
2692 + /* see if it was a transmit interrupt */
2694 + if ( (*SCSR) & SCI_XMTR_AVAILABLE ) /* data reg empty, xmt complete */
2696 + SciDisableTransmitInterrupts();
2698 + /* tell termios module that the charcter was sent */
2699 + /* he will call us later to transmit more if there are any */
2701 + if (rtems_termios_dequeue_characters( SciTermioTty, 1 ))
2703 + /* there are more bytes to transmit so enable TX interrupt */
2705 + SciEnableTransmitInterrupts();
2709 + /* see if it was a receive interrupt */
2710 + /* on the sci uart we just get one character per interrupt */
2712 + while ( SciCharAvailable() ) /* char in data register? */
2714 + ch = SciReadCharNoWait(); /* get the char from the uart */
2716 + /* IMPORTANT!!! */
2717 + /* either send it to the termios module or keep it locally */
2719 + if ( SciOpened == DRIVER_OPENED ) /* the driver is open */
2721 + SciRcvBufPutChar(ch); /* keep it locally */
2723 + else /* put in termios buffer */
2725 + char c = (char) ch;
2726 + rtems_termios_enqueue_raw_characters( SciTermioTty, &c, 1 );
2729 + *SCSR &= SCI_CLEAR_RX_INT; /* clear the interrupt */
2736 + * ROUTINES TO MANIPULATE THE CIRCULAR BUFFER
2739 +/****************************************************************************
2740 +* Func: SciRcvBufGetChar
2741 +* Desc: read a character from the circular buffer
2742 +* make sure there is data before you call this!
2744 +* Outputs: the character or -1
2747 +****************************************************************************/
2749 +static int8_t SciRcvBufGetChar(void)
2751 + rtems_interrupt_level level;
2754 + if ( SciRcvBufCount == 0 )
2756 + rtems_fatal_error_occurred(0xDEAD); /* check the count first! */
2759 + rtems_interrupt_disable( level ); /* disable interrupts */
2761 + ch = SciRcvBuffer[SciRcvBufGetIndex]; /* get next byte */
2763 + SciRcvBufGetIndex++; /* bump the index */
2765 + SciRcvBufGetIndex &= SCI_RCV_BUF_SIZE - 1; /* and wrap it */
2767 + SciRcvBufCount--; /* decrement counter */
2769 + rtems_interrupt_enable( level ); /* restore interrupts */
2771 + return ch; /* return the char */
2775 +/****************************************************************************
2776 +* Func: SciRcvBufPutChar
2777 +* Desc: put a character into the rcv data circular buffer
2778 +* Inputs: the character
2782 +****************************************************************************/
2784 +static void SciRcvBufPutChar( uint8_t ch )
2786 + rtems_interrupt_level level;
2788 + if ( SciRcvBufCount == SCI_RCV_BUF_SIZE ) /* is there room? */
2790 + return; /* no, throw it away */
2793 + rtems_interrupt_disable( level ); /* disable interrupts */
2795 + SciRcvBuffer[SciRcvBufPutIndex] = ch; /* put it in the buf */
2797 + SciRcvBufPutIndex++; /* bump the index */
2799 + SciRcvBufPutIndex &= SCI_RCV_BUF_SIZE - 1; /* and wrap it */
2801 + SciRcvBufCount++; /* increment counter */
2803 + rtems_interrupt_enable( level ); /* restore interrupts */
2805 + return; /* return */
2809 +/****************************************************************************
2810 +* Func: SciRcvBufFlush
2811 +* Desc: completely reset and clear the rcv buffer
2816 +****************************************************************************/
2818 +#if 0 /* prevents compiler warning */
2819 +static void SciRcvBufFlush( void )
2821 + rtems_interrupt_level level;
2823 + rtems_interrupt_disable( level ); /* disable interrupts */
2825 + memset( SciRcvBuffer, 0, sizeof(SciRcvBuffer) );
2827 + SciRcvBufPutIndex = 0; /* clear */
2829 + SciRcvBufGetIndex = 0; /* clear */
2831 + SciRcvBufCount = 0; /* clear */
2833 + rtems_interrupt_enable( level ); /* restore interrupts */
2835 + return; /* return */
2843 + * INTERRUPT BASED ENTRY POINTS FOR THE TERMIOS MODULE
2846 +/****************************************************************************
2847 +* Func: SciInterruptOpen
2848 +* Desc: open routine for the interrupt based device driver
2849 +* Default state is 9600 baud, 8 bits, No parity, and 1 stop bit. ??
2850 +**CHANGED** Default baud rate is now 19200, 8N1
2851 +* called from rtems_termios_open which is called from console_open
2852 +* Inputs: major - device number
2853 +* minor - device number
2854 +* args - points to terminal info
2855 +* Outputs: success/fail
2857 +* Scope: public API
2858 +****************************************************************************/
2860 +int SciInterruptOpen(
2866 + rtems_libio_open_close_args_t * args = arg;
2867 + rtems_isr_entry old_vector;
2869 + if ( minor != SCI_MINOR ) /* check minor device num */
2874 + if ( !args ) /* must have args */
2879 + SciTermioTty = args->iop->data1; /* save address of struct */
2881 + SciDisableAllInterrupts(); /* turn off sci interrupts */
2883 + /* THIS IS ACTUALLY A BAD THING - SETTING LINE PARAMETERS HERE */
2884 + /* IT SHOULD BE DONE THROUGH TCSETATTR() WHEN THE CONSOLE IS OPENED!!! */
2886 +/* SciSetBaud(115200); set the baud rate */
2887 +/* SciSetBaud( 57600); set the baud rate */
2888 +/* SciSetBaud( 38400); set the baud rate */
2889 + SciSetBaud( 19200); /* set the baud rate */
2890 +/* SciSetBaud( 9600); set the baud rate */
2892 + SciSetParity(SCI_PARITY_NONE); /* set parity to none */
2894 + SciSetDataBits(SCI_8_DATA_BITS); /* set data bits to 8 */
2896 + /* Install our interrupt handler into RTEMS, where does 66 come from? */
2898 + rtems_interrupt_catch( SciIsr, 66, &old_vector );
2902 + *QILR |= 0x06 & 0x07;
2904 + SciEnableTransmitter(); /* enable the transmitter */
2906 + SciEnableReceiver(); /* enable the receiver */
2908 + SciEnableReceiveInterrupts(); /* enable rcv interrupts */
2910 + return RTEMS_SUCCESSFUL;
2914 +/****************************************************************************
2915 +* Func: SciInterruptClose
2916 +* Desc: close routine called by the termios module
2917 +* Inputs: major - device number
2918 +* minor - device number
2920 +* Outputs: success/fail
2922 +* Scope: public - termio entry point
2923 +****************************************************************************/
2925 +int SciInterruptClose(
2931 + SciDisableAllInterrupts();
2933 + return RTEMS_SUCCESSFUL;
2937 +/****************************************************************************
2938 +* Func: SciInterruptWrite
2939 +* Desc: writes data to the uart using transmit interrupts
2940 +* Inputs: minor - device number
2941 +* buf - points to the data
2942 +* len - number of bytes to send
2943 +* Outputs: success/fail
2945 +* Scope: public API
2946 +****************************************************************************/
2948 +int SciInterruptWrite(
2954 + /* We are using interrupt driven output so termios only sends us */
2955 + /* one character at a time. The sci does not have a fifo. */
2957 + if ( !len ) /* no data? */
2959 + return 0; /* return error */
2962 + if ( minor != SCI_MINOR ) /* check the minor dev num */
2964 + return 0; /* return error */
2967 + if ( SciOpened == DRIVER_OPENED ) /* is the driver api open? */
2969 + return 1; /* yep, throw this away */
2972 + SciWriteCharNoWait(*buf); /* try to send a char */
2974 + *SCSR &= SCI_CLEAR_TDRE; /* clear tx data reg empty flag */
2976 + SciEnableTransmitInterrupts(); /* enable the tx interrupt */
2978 + return 1; /* return success */
2982 +/****************************************************************************
2983 +* Func: SciSetAttributes
2984 +* Desc: setup the uart based on the termios modules requests
2985 +* Inputs: minor - device number
2986 +* t - pointer to the termios info struct
2989 +* Scope: public API
2990 +****************************************************************************/
2992 +int SciSetAttributes(
2994 + const struct termios *t
2997 + uint32_t baud_requested;
2998 + uint32_t sci_rate = 0;
2999 + uint16_t sci_parity = 0;
3000 + uint16_t sci_databits = 0;
3002 + if ( minor != SCI_MINOR ) /* check the minor dev num */
3004 + return -1; /* return error */
3007 + /* if you look closely you will see this is the only thing we use */
3008 + /* set the baud rate */
3010 + baud_requested = t->c_cflag & CBAUD; /* baud rate */
3012 + if (!baud_requested)
3014 +/* baud_requested = B9600; default to 9600 baud */
3015 + baud_requested = B19200; /* default to 19200 baud */
3018 + sci_rate = termios_baud_to_number( baud_requested );
3020 + /* parity error detection */
3022 + if (t->c_cflag & PARENB) /* enable parity detection? */
3024 + if (t->c_cflag & PARODD)
3026 + sci_parity = SCI_PARITY_ODD; /* select odd parity */
3030 + sci_parity = SCI_PARITY_EVEN; /* select even parity */
3035 + sci_parity = SCI_PARITY_NONE; /* no parity, most common */
3038 + /* set the number of data bits, 8 is most common */
3040 + if (t->c_cflag & CSIZE) /* was it specified? */
3042 + switch (t->c_cflag & CSIZE)
3044 + case CS8: sci_databits = SCI_8_DATA_BITS; break;
3045 + default : sci_databits = SCI_9_DATA_BITS; break;
3050 + sci_databits = SCI_8_DATA_BITS; /* default to 8 data bits */
3053 + /* the number of stop bits; always 1 for SCI */
3055 + if (t->c_cflag & CSTOPB)
3060 + /* setup the hardware with these serial port parameters */
3062 + SciSetBaud(sci_rate); /* set the baud rate */
3063 + SciSetParity(sci_parity); /* set the parity type */
3064 + SciSetDataBits(sci_databits); /* set the data bits */
3066 + return RTEMS_SUCCESSFUL;
3073 + * POLLING BASED ENTRY POINTS FOR THE TERMIOS MODULE
3076 +/****************************************************************************
3077 +* Func: SciPolledOpen
3078 +* Desc: open routine for the polled i/o version of the driver
3079 +* called from rtems_termios_open which is called from console_open
3080 +* Inputs: major - device number
3081 +* minor - device number
3082 +* args - points to terminal info struct
3083 +* Outputs: success/fail
3085 +* Scope: public - termios entry point
3086 +****************************************************************************/
3094 + rtems_libio_open_close_args_t * args = arg;
3096 + if ( minor != SCI_MINOR ) /* check minor device num */
3101 + if ( !args ) /* must have args */
3106 + SciTermioTty = args->iop->data1; /* Store tty pointer */
3108 + SciDisableAllInterrupts(); /* don't generate interrupts */
3110 + /* THIS IS ACTUALLY A BAD THING - SETTING LINE PARAMETERS HERE */
3111 + /* IT SHOULD BE DONE THROUGH TCSETATTR() WHEN THE CONSOLE IS OPENED!!! */
3113 +/* SciSetBaud(115200); set the baud rate */
3114 +/* SciSetBaud( 57600); set the baud rate */
3115 +/* SciSetBaud( 38400); set the baud rate */
3116 + SciSetBaud( 19200); /* set the baud rate */
3117 +/* SciSetBaud( 9600); set the baud rate */
3119 + SciSetParity(SCI_PARITY_NONE); /* set no parity */
3121 + SciSetDataBits(SCI_8_DATA_BITS); /* set 8 data bits */
3123 + SciEnableTransmitter(); /* enable the xmitter */
3125 + SciEnableReceiver(); /* enable the rcvr */
3127 + return RTEMS_SUCCESSFUL;
3131 +/****************************************************************************
3132 +* Func: SciPolledClose
3133 +* Desc: close routine for the device driver, same for both
3134 +* Inputs: major - device number
3135 +* minor - device number
3137 +* Outputs: success/fail
3139 +* Scope: public termios API
3140 +****************************************************************************/
3142 +int SciPolledClose(
3148 + SciDisableAllInterrupts();
3150 + return RTEMS_SUCCESSFUL;
3154 +/****************************************************************************
3155 +* Func: SciPolledRead
3156 +* Desc: polling based read routine for the uart
3157 +* Inputs: minor - device number
3158 +* Outputs: error or the character read
3160 +* Scope: public API
3161 +****************************************************************************/
3167 + if ( minor != SCI_MINOR ) /* check the type-punned dev num */
3169 + return -1; /* return error */
3172 + if ( SciCharAvailable() ) /* if a char is available */
3174 + return SciReadCharNoWait(); /* read the rx data register */
3177 + return -1; /* return error */
3181 +/****************************************************************************
3182 +* Func: SciPolledWrite
3183 +* Desc: writes out characters in polled mode, waiting for the uart
3184 +* check in console_open, but we only seem to use interrupt mode
3185 +* Inputs: minor - device number
3186 +* buf - points to the data
3187 +* len - how many bytes
3188 +* Outputs: error or number of bytes written
3190 +* Scope: public termios API
3191 +****************************************************************************/
3193 +int SciPolledWrite(
3199 + int32_t written = 0;
3201 + if ( minor != SCI_MINOR ) /* check minor device num */
3206 + if ( SciOpened == DRIVER_OPENED ) /* is the driver api open? */
3208 + return -1; /* toss the data */
3211 + /* send each byte in the string out the port */
3213 + while ( written < len )
3215 + SciWriteCharWait(*buf++); /* send a byte */
3217 + written++; /* increment counter */
3220 + return written; /* return count */
3227 + * DEVICE DRIVER PUBLIC API ENTRY POINTS
3230 +/****************************************************************************
3232 +* Desc: Initialize the lasers device driver and hardware
3233 +* Inputs: major - the major device number which is assigned by rtems
3234 +* minor - the minor device number which is undefined at this point
3236 +* Outputs: RTEMS_SUCCESSFUL
3238 +* Scope: public API
3239 +****************************************************************************/
3241 +rtems_device_driver SciInitialize (
3242 + rtems_device_major_number major,
3243 + rtems_device_minor_number minor,
3247 +/* rtems_status_code status; */
3249 +/*printk("%s\r\n", __FUNCTION__); */
3251 + /* register the SCI device name for termios console i/o
3252 + * this is done over in console.c which doesn't seem exactly right
3253 + * but there were problems doing it here...
3256 +/* status = rtems_io_register_name( "/dev/sci", major, 0 ); */
3258 +/* if (status != RTEMS_SUCCESSFUL) */
3259 +/* rtems_fatal_error_occurred(status); */
3261 + SciMajor = major; /* save the rtems major number */
3263 + SciOpened = DRIVER_CLOSED; /* initial state is closed */
3265 + /* if you have an interrupt handler, install it here */
3267 + SciInited = 1; /* set the inited flag */
3269 + return RTEMS_SUCCESSFUL;
3273 +/****************************************************************************
3275 +* Desc: device driver open routine
3276 +* you must open a device before you can anything else
3277 +* only one process can have the device opened at a time
3278 +* you could look at the task id to restrict access if you want
3279 +* Inputs: major - the major device number assigned by rtems
3280 +* minor - the minor device number assigned by us
3282 +* Outputs: see below
3284 +* Scope: public API
3285 +****************************************************************************/
3287 +rtems_device_driver SciOpen (
3288 + rtems_device_major_number major,
3289 + rtems_device_minor_number minor,
3293 +/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */
3295 + if (SciInited == 0) /* must be initialized first! */
3297 + return RTEMS_NOT_CONFIGURED;
3300 + if (minor != SCI_MINOR)
3302 + return RTEMS_INVALID_NAME; /* verify minor number */
3305 + if (SciOpened == DRIVER_OPENED)
3307 + return RTEMS_RESOURCE_IN_USE; /* already opened! */
3310 + SciOpened = DRIVER_OPENED; /* set the opened flag */
3312 + return RTEMS_SUCCESSFUL;
3316 +/****************************************************************************
3318 +* Desc: device driver close routine
3319 +* the device must be opened before you can close it
3320 +* the device must be closed before someone (else) can open it
3321 +* Inputs: major - the major device number
3322 +* minor - the minor device number
3324 +* Outputs: see below
3326 +* Scope: public API
3327 +****************************************************************************/
3329 +rtems_device_driver SciClose (
3330 + rtems_device_major_number major,
3331 + rtems_device_minor_number minor,
3335 +/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */
3337 + if (minor != SCI_MINOR)
3339 + return RTEMS_INVALID_NAME; /* check the minor number */
3342 + if (SciOpened != DRIVER_OPENED)
3344 + return RTEMS_INCORRECT_STATE; /* must be opened first */
3347 + SciOpened = DRIVER_CLOSED; /* set the flag */
3349 + return RTEMS_SUCCESSFUL;
3353 +/****************************************************************************
3355 +* Desc: device driver read routine
3356 +* this function is not meaningful for the laser devices
3357 +* Inputs: major - the major device number
3358 +* minor - the minor device number
3359 +* arg - read/write arguments
3360 +* Outputs: see below
3362 +* Scope: public API
3363 +****************************************************************************/
3365 +rtems_device_driver SciRead (
3366 + rtems_device_major_number major,
3367 + rtems_device_minor_number minor,
3371 + rtems_libio_rw_args_t *rw_args; /* ptr to argument struct */
3375 + rw_args = (rtems_libio_rw_args_t *) arg; /* arguments to read() */
3377 + if (minor != SCI_MINOR)
3379 + return RTEMS_INVALID_NAME; /* check the minor number */
3382 + if (SciOpened == DRIVER_CLOSED)
3384 + return RTEMS_INCORRECT_STATE; /* must be opened first */
3387 + buffer = rw_args->buffer; /* points to user's buffer */
3389 + length = rw_args->count; /* how many bytes they want */
3391 +/* *buffer = SciReadCharWait(); wait for a character */
3393 + /* if there isn't a character available, wait until one shows up */
3394 + /* or the timeout period expires, which ever happens first */
3396 + if ( SciRcvBufCount == 0 ) /* no chars */
3398 + /* wait for someone to wake me up... */
3399 + /*rtems_task_wake_after(SciReadTimeout); */
3402 + if ( SciRcvBufCount ) /* any characters locally? */
3404 + *buffer = SciRcvBufGetChar(); /* get the character */
3406 + rw_args->bytes_moved = 1; /* how many we actually read */
3409 + return RTEMS_SUCCESSFUL;
3413 +/****************************************************************************
3415 +* Desc: device driver write routine
3416 +* this function is not meaningful for the laser devices
3417 +* Inputs: major - the major device number
3418 +* minor - the minor device number
3419 +* arg - read/write arguments
3420 +* Outputs: see below
3422 +* Scope: public API
3423 +****************************************************************************/
3425 +rtems_device_driver SciWrite (
3426 + rtems_device_major_number major,
3427 + rtems_device_minor_number minor,
3431 + rtems_libio_rw_args_t *rw_args; /* ptr to argument struct */
3435 + rw_args = (rtems_libio_rw_args_t *) arg;
3437 + if (minor != SCI_MINOR)
3439 + return RTEMS_INVALID_NAME; /* check the minor number */
3442 + if (SciOpened == DRIVER_CLOSED)
3444 + return RTEMS_INCORRECT_STATE; /* must be opened first */
3447 + buffer = (uint8_t*)rw_args->buffer; /* points to data */
3449 + length = rw_args->count; /* how many bytes */
3453 + SciWriteCharWait(*buffer++); /* send the bytes out */
3456 + rw_args->bytes_moved = rw_args->count; /* how many we wrote */
3458 + return RTEMS_SUCCESSFUL;
3462 +/****************************************************************************
3464 +* Desc: device driver control routine
3465 +* see below for an example of how to use the ioctl interface
3466 +* Inputs: major - the major device number
3467 +* minor - the minor device number
3468 +* arg - io control args
3469 +* Outputs: see below
3471 +* Scope: public API
3472 +****************************************************************************/
3474 +rtems_device_driver SciControl (
3475 + rtems_device_major_number major,
3476 + rtems_device_minor_number minor,
3480 + rtems_libio_ioctl_args_t *args = arg; /* rtems arg struct */
3481 + uint16_t command; /* the cmd to execute */
3482 + uint16_t unused; /* maybe later */
3483 + uint16_t *ptr; /* ptr to user data */
3485 +/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */
3487 + /* do some sanity checking */
3489 + if (minor != SCI_MINOR)
3491 + return RTEMS_INVALID_NAME; /* check the minor number */
3494 + if (SciOpened == DRIVER_CLOSED)
3496 + return RTEMS_INCORRECT_STATE; /* must be open first */
3501 + return RTEMS_INVALID_ADDRESS; /* must have args */
3504 + args->ioctl_return = -1; /* assume an error */
3506 + command = args->command; /* get the command */
3507 + ptr = args->buffer; /* this is an address */
3508 + unused = *ptr; /* brightness */
3510 + if (command == SCI_SEND_BREAK) /* process the command */
3512 + SciSendBreak(); /* send break char */
3515 + args->ioctl_return = 0; /* return status */
3517 + return RTEMS_SUCCESSFUL;
3524 + * HARDWARE LEVEL ROUTINES
3527 +/****************************************************************************
3529 +* Desc: setup the uart based on the termios modules requests
3530 +* Inputs: baud rate
3534 +****************************************************************************/
3536 +static void SciSetBaud(uint32_t rate)
3539 + uint16_t save_sccr1;
3541 +/* when you open the console you need to set the termio struct baud rate */
3542 +/* it has a default value of 9600, when someone calls tcsetattr it reverts! */
3544 + SciBaud = rate; /* save the rate */
3546 + /* calculate the register value as a float and convert to an int */
3547 + /* set baud rate - you must define the system clock constant */
3548 + /* see mrm332.h for an example */
3550 + value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
3552 + save_sccr1 = *SCCR1; /* save register */
3554 + /* also turns off the xmtr and rcvr */
3556 + *SCCR1 &= SCI_DISABLE_INT_ALL; /* disable interrupts */
3558 + *SCCR0 = value; /* write the register */
3560 + *SCCR1 = save_sccr1; /* restore register */
3566 +/****************************************************************************
3567 +* Func: SciSetParity
3568 +* Desc: setup the uart based on the termios modules requests
3573 +****************************************************************************/
3575 +static void SciSetParity(uint16_t parity)
3579 + value = *SCCR1; /* get the register */
3581 + if (parity == SCI_PARITY_ODD)
3583 + value |= SCI_PARITY_ENABLE; /* parity enabled */
3584 + value |= SCI_PARITY_ODD; /* parity odd */
3587 + else if (parity == SCI_PARITY_EVEN)
3589 + value |= SCI_PARITY_ENABLE; /* parity enabled */
3590 + value &= ~SCI_PARITY_ODD; /* parity even */
3593 + else if (parity == SCI_PARITY_NONE)
3595 + value &= ~SCI_PARITY_ENABLE; /* disabled, most common */
3598 + /* else no changes */
3600 + *SCCR1 = value; /* write the register */
3606 +/****************************************************************************
3607 +* Func: SciSetDataBits
3608 +* Desc: setup the uart based on the termios modules requests
3609 +* Inputs: data bits
3613 +****************************************************************************/
3615 +static void SciSetDataBits(uint16_t bits)
3619 + value = *SCCR1; /* get the register */
3621 + /* note - the parity setting affects the number of data bits */
3623 + if (bits == SCI_9_DATA_BITS)
3625 + value |= SCI_9_DATA_BITS; /* 9 data bits */
3628 + else if (bits == SCI_8_DATA_BITS)
3630 + value &= SCI_8_DATA_BITS; /* 8 data bits */
3633 + /* else no changes */
3635 + *SCCR1 = value; /* write the register */
3641 +/****************************************************************************
3642 +* Func: SciDisableAllInterrupts
3643 +* Func: SciEnableTransmitInterrupts
3644 +* Func: SciEnableReceiveInterrupts
3645 +* Desc: handles generation of interrupts by the sci module
3650 +****************************************************************************/
3652 +static void inline SciDisableAllInterrupts( void )
3654 + /* this also turns off the xmtr and rcvr */
3656 + *SCCR1 &= SCI_DISABLE_INT_ALL;
3659 +static void inline SciEnableReceiveInterrupts( void )
3661 + *SCCR1 |= SCI_ENABLE_INT_RX;
3664 +static void inline SciDisableReceiveInterrupts( void )
3666 + *SCCR1 &= SCI_DISABLE_INT_RX;
3669 +static void inline SciEnableTransmitInterrupts( void )
3671 + *SCCR1 |= SCI_ENABLE_INT_TX;
3674 +static void inline SciDisableTransmitInterrupts( void )
3676 + *SCCR1 &= SCI_DISABLE_INT_TX;
3680 +/****************************************************************************
3681 +* Func: SciEnableTransmitter, SciDisableTransmitter
3682 +* Func: SciEnableReceiver, SciDisableReceiver
3683 +* Desc: turns the transmitter and receiver on and off
3688 +****************************************************************************/
3690 +static void inline SciEnableTransmitter( void )
3692 + *SCCR1 |= SCI_ENABLE_XMTR;
3695 +static void inline SciDisableTransmitter( void )
3697 + *SCCR1 &= SCI_DISABLE_XMTR;
3700 +static void inline SciEnableReceiver( void )
3702 + *SCCR1 |= SCI_ENABLE_RCVR;
3705 +static void inline SciDisableReceiver( void )
3707 + *SCCR1 &= SCI_DISABLE_RCVR;
3711 +/****************************************************************************
3712 +* Func: SciWriteCharWait
3713 +* Desc: wait for room in the fifo and then put a char in
3714 +* Inputs: a byte to send
3718 +****************************************************************************/
3720 +void SciWriteCharWait(uint8_t c)
3722 + /* poll the fifo, waiting for room for another character */
3724 + while ( ( *SCSR & SCI_XMTR_AVAILABLE ) == 0 )
3726 + /* Either we are writing to the fifo faster than
3727 + * the uart can clock bytes out onto the cable,
3728 + * or we are in flow control (actually no, we
3729 + * are ignoring flow control from the other end).
3730 + * In the first case, higher baud rates will help.
3732 + /* relinquish processor while waiting */
3733 + rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
3736 + *SCDR = c; /* send the charcter */
3738 + SciBytesOut++; /* increment the counter */
3743 +/****************************************************************************
3744 +* Func: SciWriteCharNoWait
3745 +* Desc: if no room in the fifo throw the char on the floor
3746 +* Inputs: a byte to send
3750 +****************************************************************************/
3752 +void SciWriteCharNoWait(uint8_t c)
3754 + if ( ( *SCSR & SCI_XMTR_AVAILABLE ) == 0 )
3756 + return; /* no room, throw it away */
3759 + *SCDR = c; /* put the char in the fifo */
3761 + SciBytesOut++; /* increment the counter */
3767 +/****************************************************************************
3768 +* Func: SciReadCharWait
3769 +* Desc: read a character, waiting for one to show up, if need be
3771 +* Outputs: a character
3774 +****************************************************************************/
3776 +uint8_t inline SciReadCharWait( void )
3780 + while ( SciCharAvailable() == 0 ) /* anything there? */
3782 + /* relinquish processor while waiting */
3783 + rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
3786 + /* if you have rcv ints enabled, then the isr will probably */
3787 + /* get the character before you will unless you turn off ints */
3788 + /* ie polling and ints don't mix that well */
3790 + ch = *SCDR; /* get the charcter */
3792 + SciBytesIn++; /* increment the counter */
3794 + return ch; /* return the char */
3797 +/****************************************************************************
3798 +* Func: SciReadCharNoWait
3799 +* Desc: try to get a char but dont wait for one
3801 +* Outputs: a character or -1 if none
3804 +****************************************************************************/
3806 +uint8_t inline SciReadCharNoWait( void )
3810 + if ( SciCharAvailable() == 0 ) /* anything there? */
3813 + ch = *SCDR; /* get the character */
3815 + SciBytesIn++; /* increment the count */
3817 + return ch; /* return the char */
3821 +/****************************************************************************
3822 +* Func: SciCharAvailable
3823 +* Desc: is there a receive character in the data register
3825 +* Outputs: false if no char available, else true
3828 +****************************************************************************/
3830 +uint8_t inline SciCharAvailable( void )
3832 + return ( *SCSR & SCI_RCVR_READY ); /* char in data register? */
3836 +/****************************************************************************
3837 +* Func: SciSendBreak
3838 +* Desc: send 1 or tow breaks (all zero bits)
3843 +****************************************************************************/
3845 +void SciSendBreak( void )
3847 + /* From the Motorola QSM reference manual - */
3849 + /* "if SBK is toggled by writing it first to a one and then immediately */
3850 + /* to a zero (in less than one serial frame interval), the transmitter */
3851 + /* sends only one or two break frames before reverting to mark (idle) */
3852 + /* or before commencing to send more data" */
3854 + *SCCR1 |= SCI_SEND_BREAK; /* set the bit */
3856 + *SCCR1 &= ~SCI_SEND_BREAK; /* clear the bit */
3868 +/****************************************************************************
3869 +* Func: SciUnitTest
3870 +* Desc: test the device driver
3874 +****************************************************************************/
3877 +#define O_RDWR LIBIO_FLAGS_READ_WRITE /* dont like this but... */
3881 + uint8_t byte; /* a character */
3882 + uint16_t fd; /* file descriptor for device */
3883 + uint16_t result; /* result of ioctl */
3885 + fd = open("/dev/sci",O_RDWR); /* open the device */
3887 +printk("SCI open fd=%d\r\n",fd);
3889 + result = write(fd, "abcd\r\n", 6); /* send a string */
3891 +printk("SCI write result=%d\r\n",result);
3893 + result = read(fd, &byte, 1); /* read a byte */
3895 +printk("SCI read result=%d,byte=%x\r\n",result,byte);
3902 +/****************************************************************************
3903 +* Func: SciPrintStats
3904 +* Desc: print out some driver information
3908 +****************************************************************************/
3910 +void SciPrintStats ( void )
3914 + printk( "SYS_CLOCK is %2.6f Mhz\r\n\n", SYS_CLOCK / 1000000.0 );
3916 + printk( "Current baud rate is %d bps or %d cps\r\n\n", SciBaud, SciBaud / 10 );
3918 + printk( "SCI Uart chars in %8d\r\n", SciBytesIn );
3919 + printk( "SCI Uart chars out %8d\r\n", SciBytesOut );
3920 + printk( "SCI Uart framing errors %8d\r\n", SciErrorsFraming );
3921 + printk( "SCI Uart parity errors %8d\r\n", SciErrorsParity );
3922 + printk( "SCI Uart overrun errors %8d\r\n", SciErrorsOverrun );
3923 + printk( "SCI Uart noise errors %8d\r\n", SciErrorsNoise );
3927 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/bspstart.c
3928 ===================================================================
3929 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3930 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/bspstart.c 2008-08-19 12:23:15.000000000 +0200
3933 + * This routine starts the application. It includes application,
3934 + * board, and monitor specific initialization and configuration.
3935 + * The generic CPU dependent initialization has been performed
3936 + * before this routine is invoked.
3938 + * COPYRIGHT (c) 1989-1999.
3939 + * On-Line Applications Research Corporation (OAR).
3941 + * The license and distribution terms for this file may be
3942 + * found in the file LICENSE in this distribution or at
3943 + * http://www.rtems.com/license/LICENSE.
3945 + * $Id: bspstart.c,v 1.13 2008/08/19 10:23:15 ralf Exp $
3949 +#include <rtems/libio.h>
3951 +#include <string.h>
3954 + * Use the shared implementations of the following routines
3957 +void bsp_libc_init( void *, uint32_t, int );
3958 +void bsp_pretasking_hook(void); /* m68k version */
3961 + * Call Spurious_Initialize in bsp_predriver_hook because
3962 + * bsp_predriver_hook is call after the _ISR_Vector_Table allocation
3965 +void bsp_predriver_hook(void)
3967 + extern void Spurious_Initialize(void);
3968 + Spurious_Initialize();
3974 + * This routine does the bulk of the system initialization.
3977 +void bsp_start( void )
3980 + extern void *_WorkspaceBase;
3981 + extern void *_RamSize;
3982 + extern unsigned long _M68k_Ramsize;
3984 + /* RAM size set in linker script */
3985 + _M68k_Ramsize = (unsigned long)&_RamSize;
3987 + m68k_get_vbr( vbr );
3989 + Configuration.work_space_start = (void *) &_WorkspaceBase;
3991 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
3992 ===================================================================
3993 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
3994 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c 2008-08-19 12:23:15.000000000 +0200
4000 +#include <mrm332.h>
4001 +#include <rtems/m68k/sim.h>
4002 +#define __START_C__
4005 +m68k_isr_entry M68Kvec[256];
4006 +m68k_isr_entry vectors[256];
4007 +char * const __argv[]= {"main", ""};
4009 +void boot_card(int argc, char * const argv[]);
4012 + * This prototype really should have the noreturn attribute but
4013 + * that causes a warning. Not sure how to fix that.
4015 +/* void dumby_start () __attribute__ ((noreturn)); */
4016 +void start_c(void);
4018 +void start_c(void) {
4020 + /* Synthesizer Control Register */
4021 + /* see section(s) 4.8 */
4022 + /* end include in ram_init.S */
4023 + *SYNCR = (unsigned short int)
4024 + ( SAM(MRM_W,15,VCO) | SAM(0x0,14,PRESCALE) | SAM(MRM_Y,8,COUNTER) );
4025 + while (! (*SYNCR & SLOCK)); /* protect from clock overshoot */
4026 + /* include in ram_init.S */
4027 + *SYNCR = (unsigned short int)
4028 + ( SAM(MRM_W,15,VCO) | SAM(MRM_X,14,PRESCALE) | SAM(MRM_Y,8,COUNTER) );
4030 + /* System Protection Control Register */
4031 + /* !!! can only write to once after reset !!! */
4032 + /* see section 3.8.4 of the SIM Reference Manual */
4033 + *SYPCR = (unsigned char)( HME | BME );
4035 + /* Periodic Interrupr Control Register */
4036 + /* see section 3.8.2 of the SIM Reference Manual */
4037 + *PICR = (unsigned short int)
4038 + ( SAM(0,8,PIRQL) | SAM(MRM_PIV,0,PIV) );
4039 + /* ^^^ zero disables interrupt, don't enable here or ram_init will
4040 + be wrong. It's enabled below. */
4042 + /* Periodic Interrupt Timer Register */
4043 + /* see section 3.8.3 of the SIM Reference Manual */
4044 + *PITR = (unsigned short int)( SAM(0x09,0,PITM) );
4045 + /* 1.098mS interrupt, assuming 32.768 KHz input clock */
4048 + /* load values before enabled */
4049 + *PORTC = (unsigned char) 0x0;
4051 + /* Port E and F Data Register */
4052 + /* see section 9 of the SIM Reference Manual */
4053 + *PORTE0 = (unsigned char) 0;
4054 + *PORTF0 = (unsigned char) 0;
4056 + /* Port E and F Data Direction Register */
4057 + /* see section 9 of the SIM Reference Manual */
4058 + *DDRE = (unsigned char) 0xff;
4059 + *DDRF = (unsigned char) 0xfd;
4061 + /* Port E and F Pin Assignment Register */
4062 + /* see section 9 of the SIM Reference Manual */
4063 + *PEPAR = (unsigned char) 0;
4064 + *PFPAR = (unsigned char) 0;
4066 + /* end of SIM initalization code */
4067 + /* end include in ram_init.S */
4070 + * Initialize RAM by copying the .data section out of ROM (if
4071 + * needed) and "zero-ing" the .bss section.
4074 + register char *src = _etext;
4075 + register char *dst = _copy_start;
4077 + if (_copy_data_from_rom)
4078 + /* ROM has data at end of text; copy it. */
4079 + while (dst < _edata)
4083 + for (dst = _clear_start; dst< end; dst++)
4090 + * Initialize vector table.
4093 + m68k_isr_entry *monitors_vector_table;
4095 + m68k_get_vbr(monitors_vector_table);
4097 + M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */
4098 + M68Kvec[ 9 ] = monitors_vector_table[ 9 ]; /* trace vector */
4099 + M68Kvec[ 31 ] = monitors_vector_table[ 31 ]; /* level 7 interrupt */
4100 + M68Kvec[ 47 ] = monitors_vector_table[ 47 ]; /* system call vector */
4101 + M68Kvec[ 66 ] = monitors_vector_table[ 66 ]; /* user defined */
4103 + m68k_set_vbr(&M68Kvec);
4107 + * Initalize the board.
4110 + /* Spurious should be called in the predriver hook */
4111 + /* Spurious_Initialize(); */
4112 + /*console_init(); */
4115 + * Execute main with arguments argc and agrv.
4117 + boot_card(1,__argv);
4121 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/tm27.h
4122 ===================================================================
4123 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4124 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/tm27.h 2009-11-29 01:11:56.475557339 +0100
4129 + * The license and distribution terms for this file may be
4130 + * found in the file LICENSE in this distribution or at
4131 + * http://www.rtems.com/license/LICENSE.
4133 + * $Id: tm27.h,v 1.2 2004/04/23 04:47:36 ralf Exp $
4136 +#ifndef _RTEMS_TMTEST27
4137 +#error "This is an RTEMS internal file you must not include directly."
4144 + * Define the interrupt mechanism for Time Test 27
4147 +/* XXX - JRS - I want to compile the tmtests */
4149 +#define MUST_WAIT_FOR_INTERRUPT 1
4151 +#define Install_tm27_vector( handler ) /* empty */
4153 +#define Cause_tm27_intr() /* empty */
4155 +#define Clear_tm27_intr() /* empty */
4157 +#define Lower_tm27_intr() /* empty */
4160 Index: rtems/c/src/lib/libbsp/m68k/mo376/times
4161 ===================================================================
4162 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4163 +++ rtems/c/src/lib/libbsp/m68k/mo376/times 2009-11-29 01:11:56.479557220 +0100
4166 +# Timing Test Suite Results for the MRM332 BSP
4168 +# $Id: times,v 1.2 2004/01/07 21:13:50 joel Exp $
4171 +NOTE: This BSP is user submitted and no information is currently available.
4173 +TBD: MATT - update this with real times!
4177 +Clock Speed: 20 Mhz
4178 +Memory Configuration: SRAM, DRAM, cache, etc
4181 +Times Reported in: cycles, microseconds, etc
4182 +Timer Source: Count Down Timer, on-CPU cycle counter, etc
4188 +== ================================================================= ==== ====
4189 + 1 rtems_semaphore_create 20
4190 + rtems_semaphore_delete 21
4191 + rtems_semaphore_obtain: available 15
4192 + rtems_semaphore_obtain: not available -- NO_WAIT 15
4193 + rtems_semaphore_release: no waiting tasks 16
4195 + 2 rtems_semaphore_obtain: not available -- caller blocks 62
4197 + 3 rtems_semaphore_release: task readied -- preempts caller 55
4199 + 4 rtems_task_restart: blocked task -- preempts caller 77
4200 + rtems_task_restart: ready task -- preempts caller 70
4201 + rtems_semaphore_release: task readied -- returns to caller 25
4202 + rtems_task_create 57
4203 + rtems_task_start 31
4204 + rtems_task_restart: suspended task -- returns to caller 36
4205 + rtems_task_delete: suspended task 47
4206 + rtems_task_restart: ready task -- returns to caller 37
4207 + rtems_task_restart: blocked task -- returns to caller 46
4208 + rtems_task_delete: blocked task 50
4210 + 5 rtems_task_suspend: calling task 51
4211 + rtems_task_resume: task readied -- preempts caller 49
4213 + 6 rtems_task_restart: calling task 59
4214 + rtems_task_suspend: returns to caller 18
4215 + rtems_task_resume: task readied -- returns to caller 19
4216 + rtems_task_delete: ready task 50
4218 + 7 rtems_task_restart: suspended task -- preempts caller 70
4220 + 8 rtems_task_set_priority: obtain current priority 12
4221 + rtems_task_set_priority: returns to caller 27
4222 + rtems_task_mode: obtain current mode 5
4223 + rtems_task_mode: no reschedule 5
4224 + rtems_task_mode: reschedule -- returns to caller 8
4225 + rtems_task_mode: reschedule -- preempts caller 39
4226 + rtems_task_set_note 13
4227 + rtems_task_get_note 13
4228 + rtems_clock_set 33
4231 + 9 rtems_message_queue_create 110
4232 + rtems_message_queue_send: no waiting tasks 37
4233 + rtems_message_queue_urgent: no waiting tasks 37
4234 + rtems_message_queue_receive: available 31
4235 + rtems_message_queue_flush: no messages flushed 12
4236 + rtems_message_queue_flush: messages flushed 16
4237 + rtems_message_queue_delete 26
4239 +10 rtems_message_queue_receive: not available -- NO_WAIT 15
4240 + rtems_message_queue_receive: not available -- caller blocks 62
4242 +11 rtems_message_queue_send: task readied -- preempts caller 72
4244 +12 rtems_message_queue_send: task readied -- returns to caller 39
4246 +13 rtems_message_queue_urgent: task readied -- preempts caller 72
4248 +14 rtems_message_queue_urgent: task readied -- returns to caller 39
4250 +15 rtems_event_receive: obtain current events 1
4251 + rtems_event_receive: not available -- NO_WAIT 12
4252 + rtems_event_receive: not available -- caller blocks 56
4253 + rtems_event_send: no task readied 12
4254 + rtems_event_receive: available 12
4255 + rtems_event_send: task readied -- returns to caller 24
4257 +16 rtems_event_send: task readied -- preempts caller 55
4259 +17 rtems_task_set_priority: preempts caller 62
4261 +18 rtems_task_delete: calling task 83
4263 +19 rtems_signal_catch 9
4264 + rtems_signal_send: returns to caller 15
4265 + rtems_signal_send: signal to self 18
4266 + exit ASR overhead: returns to calling task 22
4267 + exit ASR overhead: returns to preempting task 49
4269 +20 rtems_partition_create 35
4270 + rtems_region_create 23
4271 + rtems_partition_get_buffer: available 15
4272 + rtems_partition_get_buffer: not available 13
4273 + rtems_partition_return_buffer 18
4274 + rtems_partition_delete 16
4275 + rtems_region_get_segment: available 22
4276 + rtems_region_get_segment: not available -- NO_WAIT 21
4277 + rtems_region_return_segment: no waiting tasks 19
4278 + rtems_region_get_segment: not available -- caller blocks 64
4279 + rtems_region_return_segment: task readied -- preempts caller 74
4280 + rtems_region_return_segment: task readied -- returns to caller 44
4281 + rtems_region_delete 16
4282 + rtems_io_initialize 2
4287 + rtems_io_control 1
4289 +21 rtems_task_ident 149
4290 + rtems_message_queue_ident 145
4291 + rtems_semaphore_ident 156
4292 + rtems_partition_ident 145
4293 + rtems_region_ident 148
4294 + rtems_port_ident 145
4295 + rtems_timer_ident 145
4296 + rtems_rate_monotonic_ident 145
4298 +22 rtems_message_queue_broadcast: task readied -- returns to caller 42
4299 + rtems_message_queue_broadcast: no waiting tasks 17
4300 + rtems_message_queue_broadcast: task readied -- preempts caller 78
4302 +23 rtems_timer_create 14
4303 + rtems_timer_fire_after: inactive 22
4304 + rtems_timer_fire_after: active 24
4305 + rtems_timer_cancel: active 15
4306 + rtems_timer_cancel: inactive 13
4307 + rtems_timer_reset: inactive 21
4308 + rtems_timer_reset: active 23
4309 + rtems_timer_fire_when: inactive 34
4310 + rtems_timer_fire_when: active 34
4311 + rtems_timer_delete: active 19
4312 + rtems_timer_delete: inactive 17
4313 + rtems_task_wake_when 69
4315 +24 rtems_task_wake_after: yield -- returns to caller 9
4316 + rtems_task_wake_after: yields -- preempts caller 45
4318 +25 rtems_clock_tick 4
4323 + _Thread_Disable_dispatch 0
4324 + _Thread_Enable_dispatch 7
4325 + _Thread_Set_state 11
4326 + _Thread_Disptach (NO FP) 31
4327 + context switch: no floating point contexts 21
4328 + context switch: self 10
4329 + context switch: to another task 10
4330 + context switch: restore 1st FP task 25
4331 + fp context switch: save idle, restore idle 31
4332 + fp context switch: save idle, restore initialized 19
4333 + fp context switch: save initialized, restore initialized 20
4339 + _Thread_Get: invalid id 0
4341 +27 interrupt entry overhead: returns to interrupted task 6
4342 + interrupt exit overhead: returns to interrupted task 6
4343 + interrupt entry overhead: returns to nested interrupt 6
4344 + interrupt exit overhead: returns to nested interrupt 5
4345 + interrupt entry overhead: returns to preempting task 7
4346 + interrupt exit overhead: returns to preempting task 36
4348 +28 rtems_port_create 16
4349 + rtems_port_external_to_internal 11
4350 + rtems_port_internal_to_external 11
4351 + rtems_port_delete 16
4353 +29 rtems_rate_monotonic_create 15
4354 + rtems_rate_monotonic_period: initiate period -- returns to caller 21
4355 + rtems_rate_monotonic_period: obtain status 13
4356 + rtems_rate_monotonic_cancel 16
4357 + rtems_rate_monotonic_delete: inactive 18
4358 + rtems_rate_monotonic_delete: active 20
4359 + rtems_rate_monotonic_period: conclude periods -- caller blocks 53
4360 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
4361 ===================================================================
4362 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4363 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h 2009-11-29 01:11:56.479557220 +0100
4367 + * $Id: mrm332.h,v 1.5 2004/04/21 16:01:35 ralf Exp $
4373 +/* SIM_MM (SIM Module Mapping) determines the location of the control
4374 + register block. When MM=0, register addresses range fom 0x7ff000 to
4375 + 0x7FFFFF. When MM=1, register addresses range from 0xfff000 to
4379 +/* Interrupt related definitions */
4380 +#define SIM_IARB 15
4381 +#define QSM_IARB 10
4384 +#define ISRL_PIT 4 /* zero disables PIT */
4386 +#define EFI_QIVR 66 /* 66=>SCI and 67=>QSPI interrupt */
4387 +#define ISRL_QSPI 0
4389 +#define EFI_SPINT 24 /* spurious interrupt */
4390 +#define EFI_INT1 25 /* CTS interrupt */
4393 +/* System Clock definitions */
4394 +#define XTAL 32768.0 /* crystal frequency in Hz */
4397 +/* Default MRM clock rate (8.388688 MHz) set by CPU32: */
4398 +#define MRM_W 0 /* system clock parameters */
4404 +/* 16.77722 MHz: */
4405 +#define MRM_W 1 /* system clock parameters */
4411 +/* 25.16582 MHz: */
4412 +#define MRM_W 1 /* system clock parameters */
4417 +#define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X)))
4418 +#define SCI_BAUD 19200 /* RS232 Baud Rate */
4420 +/* macros/functions */
4425 + * This prototype really should have the noreturn attribute but
4426 + * that causes a warning. Not sure how to fix that.
4428 +/* static void reboot(void) __attribute__ ((noreturn)); */
4429 +static void reboot(void);
4430 +__inline__ static void reboot() {asm("trap #15; .word 0x0063");}
4434 +#endif /* _MRM_H_ */
4435 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in
4436 ===================================================================
4437 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4438 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in 2009-11-29 01:11:56.479557220 +0100
4440 +/* include/bspopts.h.in. Generated from configure.ac by autoheader. */
4442 +/* Define to the address where bug reports for this package should be sent. */
4443 +#undef PACKAGE_BUGREPORT
4445 +/* Define to the full name of this package. */
4446 +#undef PACKAGE_NAME
4448 +/* Define to the full name and version of this package. */
4449 +#undef PACKAGE_STRING
4451 +/* Define to the one symbol short name of this package. */
4452 +#undef PACKAGE_TARNAME
4454 +/* Define to the version of this package. */
4455 +#undef PACKAGE_VERSION
4456 Index: rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
4457 ===================================================================
4458 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4459 +++ rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c 2009-11-29 01:11:56.479557220 +0100
4463 + * This routine installs spurious interrupt handlers for the mrm.
4465 + * Input parameters: NONE
4467 + * Output parameters: NONE
4469 + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993.
4470 + * On-Line Applications Research Corporation (OAR).
4472 + * The license and distribution terms for this file may be
4473 + * found in the file LICENSE in this distribution or at
4474 + * http://www.rtems.com/license/LICENSE.
4476 + * $Id: spinit.c,v 1.6 2006/09/11 21:43:55 joel Exp $
4482 +const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
4483 + "Illegal Instruction","Zero Division","CHK, CHK2 Instruction",
4484 + "TRAPcc, TRAPV Instruction","Privilege Violation","Trace",
4485 + "Line 1010 Emulation","Line 1111 Emulation","Hardware Breakpoint",
4486 + "Coprocessor Protocal Violation",
4487 + "Format Error ans Uninitialized Interrupt","Unassigned",
4488 + "Spurious Interrupt","AVec1","AVec2","AVec3","AVec4","AVec5","AVec6",
4489 + "AVec7","Trap Instruction","Debug","Reboot","Reserved Coprocessor",
4490 + "Reserved Unassigned","User Defined"};
4492 +rtems_isr Spurious_Isr(
4493 + rtems_vector_number vector
4498 + const char * const VectDescrip[] = {
4499 + _Spurious_Error_[0], _Spurious_Error_[0], _Spurious_Error_[1],
4500 + _Spurious_Error_[2], _Spurious_Error_[3], _Spurious_Error_[4],
4501 + _Spurious_Error_[5], _Spurious_Error_[6], _Spurious_Error_[7],
4502 + _Spurious_Error_[8], _Spurious_Error_[9], _Spurious_Error_[10],
4503 + _Spurious_Error_[11], _Spurious_Error_[12], _Spurious_Error_[13],
4504 + _Spurious_Error_[13], _Spurious_Error_[14], _Spurious_Error_[14],
4505 + _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
4506 + _Spurious_Error_[14], _Spurious_Error_[14], _Spurious_Error_[14],
4507 + _Spurious_Error_[15], _Spurious_Error_[16], _Spurious_Error_[17],
4508 + _Spurious_Error_[18], _Spurious_Error_[19], _Spurious_Error_[20],
4509 + _Spurious_Error_[21], _Spurious_Error_[22], _Spurious_Error_[23],
4510 + _Spurious_Error_[24], _Spurious_Error_[23], _Spurious_Error_[23],
4511 + _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
4512 + _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
4513 + _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[23],
4514 + _Spurious_Error_[23], _Spurious_Error_[23], _Spurious_Error_[25],
4515 + _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
4516 + _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
4517 + _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[26],
4518 + _Spurious_Error_[26], _Spurious_Error_[26], _Spurious_Error_[27],
4519 + _Spurious_Error_[27], _Spurious_Error_[27], _Spurious_Error_[27],
4520 + _Spurious_Error_[27], _Spurious_Error_[28]};
4523 + /*asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) ); */
4525 + _CPU_ISR_Set_level( 7 );
4526 + /*_UART_flush(); */
4528 + RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
4529 + RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
4530 + RAW_PUTS("\n\rRTEMS: Vector: ");
4532 + RAW_PUTS(" sp: ");
4539 + asm(" .word 0x4afa");
4544 +void Spurious_Initialize(void)
4546 + rtems_vector_number vector;
4548 + for ( vector = 0x0 ; vector <= 0xFF ; vector++ )
4557 + /* These vectors used by CPU32bug - don't overwrite them. */
4561 + (void) set_vector( Spurious_Isr, vector, 1 );
4566 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
4567 ===================================================================
4568 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4569 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds 2008-03-04 00:06:30.000000000 +0100
4573 + * $Id: linkcmds,v 1.8 2008/03/03 23:06:30 joel Exp $
4580 + * The memory map looks like this:
4581 + * +--------------------+ <- low memory
4584 + * | ctor list | the ctor and dtor lists are for
4585 + * | dtor list | C++ support
4587 + * +--------------------+
4588 + * | .data | initialized data goes here
4591 + * +--------------------+
4593 + * | _clear_start| start of bss, cleared by crt0
4594 + * | _end | start of heap, used by sbrk()
4595 + * +--------------------+
4599 + * | __stack | top of stack
4600 + * +--------------------+ <- high memory
4604 + * Declare some sizes.
4606 +_RamBase = DEFINED(_RamBase) ? _RamBase : 0x10000;
4607 +_RamSize = DEFINED(_RamSize) ? _RamSize : 0x70000;
4608 +_RamEnd = _RamBase + _RamSize;
4609 +_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
4610 +_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
4614 + ram : ORIGIN = 0x10000, LENGTH = 0x70000
4617 +_copy_data_from_rom = 0;
4620 + * stick everything in ram (of course)
4629 + * Text, data and bss segments
4635 + * C++ constructors/destructors
4637 + *(.gnu.linkonce.t.*)
4640 + * Initialization and finalization code.
4642 + * Various files can provide initialization and finalization
4643 + * functions. crtbegin.o and crtend.o are two instances. The
4644 + * body of these functions are in .init and .fini sections. We
4645 + * accumulate the bodies here, and prepend function prologues
4646 + * from crti.o and function epilogues from crtn.o. crti.o must
4647 + * be linked first; crtn.o must be linked last. Because these
4648 + * are wildcards, it doesn't matter if the user does not
4649 + * actually link against crti.o and crtn.o; the linker won't
4650 + * look for a file to match a wildcard. The wildcard also
4651 + * means that it doesn't matter which directory crti.o and
4654 + PROVIDE (_init = .);
4658 + PROVIDE (_fini = .);
4664 + * Special FreeBSD sysctl sections.
4667 + __start_set_sysctl_set = .;
4669 + __stop_set_sysctl_set = ABSOLUTE(.);
4674 + * C++ constructors/destructors
4676 + * gcc uses crtbegin.o to find the start of the constructors
4677 + * and destructors so we make sure it is first. Because this
4678 + * is a wildcard, it doesn't matter if the user does not
4679 + * actually link against crtbegin.o; the linker won't look for
4680 + * a file to match a wildcard. The wildcard also means that
4681 + * it doesn't matter which directory crtbegin.o is in. The
4682 + * constructor and destructor list are terminated in
4683 + * crtend.o. The same comments apply to it.
4686 + *crtbegin.o(.ctors)
4689 + *crtbegin.o(.dtors)
4694 + * Exception frame info
4703 + _rodata_start = .;
4705 + *(.gnu.linkonce.r*)
4708 + PROVIDE (_etext = .);
4711 + PROVIDE (_copy_start = .);
4713 + *(.gnu.linkonce.d*)
4714 + *(.gcc_except_table*)
4717 + PROVIDE (_edata = .);
4718 + PROVIDE (_copy_end = .);
4723 + *(.bss* .gnu.linkonce.b.*)
4726 + PROVIDE (end = .);
4732 + _WorkspaceBase = .;
4735 Index: rtems/c/src/lib/libbsp/m68k/mo376/bsp_specs
4736 ===================================================================
4737 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4738 +++ rtems/c/src/lib/libbsp/m68k/mo376/bsp_specs 2008-12-08 06:15:06.000000000 +0100
4740 +%rename endfile old_endfile
4741 +%rename startfile old_startfile
4742 +%rename link old_link
4745 +%{!qrtems: %(old_startfile)} \
4746 +%{!nostdlib: %{qrtems: start.o%s crti.o%s crtbegin.o%s -e start}}
4749 +%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
4752 +%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
4753 Index: rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
4754 ===================================================================
4755 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4756 +++ rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am 2009-11-29 01:11:56.483556820 +0100
4758 +## Automatically generated by ampolish3 - Do not edit
4761 +$(srcdir)/preinstall.am: Makefile.am
4762 + $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
4766 +DISTCLEANFILES += $(PREINSTALL_DIRS)
4768 +all-local: $(TMPINSTALL_FILES)
4771 +CLEANFILES = $(TMPINSTALL_FILES)
4773 +all-am: $(PREINSTALL_FILES)
4776 +CLEANFILES += $(PREINSTALL_FILES)
4778 +$(PROJECT_LIB)/$(dirstamp):
4779 + @$(MKDIR_P) $(PROJECT_LIB)
4780 + @: > $(PROJECT_LIB)/$(dirstamp)
4781 +PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
4783 +$(PROJECT_INCLUDE)/$(dirstamp):
4784 + @$(MKDIR_P) $(PROJECT_INCLUDE)
4785 + @: > $(PROJECT_INCLUDE)/$(dirstamp)
4786 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
4788 +$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
4789 + $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
4790 +PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
4792 +$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
4793 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
4794 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
4796 +$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
4797 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
4798 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
4800 +$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
4801 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
4802 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
4804 +$(PROJECT_INCLUDE)/mrm332.h: include/mrm332.h $(PROJECT_INCLUDE)/$(dirstamp)
4805 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mrm332.h
4806 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/mrm332.h
4808 +$(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
4809 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
4810 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
4812 +$(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
4813 + $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
4814 +TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)
4816 +$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
4817 + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
4818 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
4820 +$(PROJECT_LIB)/linkcmds_ROM: startup/linkcmds_ROM $(PROJECT_LIB)/$(dirstamp)
4821 + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds_ROM
4822 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds_ROM