1 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/.cvsignore
2 ===================================================================
4 +++ rtems/c/src/lib/libbsp/powerpc/ec555/.cvsignore
20 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/ChangeLog
21 ===================================================================
23 +++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
25 +2005-05-26 Ralf Corsepius <ralf.corsepius@rtems.org>
27 + * include/bsp.h: New header guard.
29 +2005-05-10 Ralf Corsepius <ralf.corsepius@rtems.org>
31 + * console/console.c: Eliminate unsigned8.
33 +2005-04-26 Joel Sherrill <joel@OARcorp.com>
35 + * startup/bspstart.c: Eliminate warnings.
37 +2005-04-25 Jennifer Averett <jennifer.averett@oarcorp.com>
40 + * clock/p_clock.c: Add parameter to powerpc exception handler routines
42 +2005-02-17 Ralf Corsepius <ralf.corsepius@rtems.org>
44 + * startup/bspstart.c: include <rtems/powerpc/powerpc.h>.
45 + Use PPC_MINIMUM_STACK_FRAME_SIZE instead of
46 + CPU_MINIMUM_STACK_FRAME_SIZE.
48 +2005-02-16 Ralf Corsepius <ralf.corsepius@rtems.org>
50 + * configure.ac: Remove argument from RTEMS_PPC_EXCEPTIONS.
52 +2005-02-11 Ralf Corsepius <ralf.corsepius@rtems.org>
54 + * Makefile.am: Merge-in wrapup/Makefile.am.
55 + * wrapup/Makefile.am: Remove.
56 + * configure.ac: Reflect changes above.
58 +2005-01-07 Ralf Corsepius <ralf.corsepius@rtems.org>
60 + * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
62 +2005-01-02 Ralf Corsepius <ralf.corsepius@rtems.org>
64 + * Makefile.am, wrapup/Makefile.am: Remove build-variant support.
66 +2004-10-20 Ralf Corsepius <ralf_corsepius@rtems.org>
68 + * console/console.c, include/bsp.h, startup/bspstart.c,
69 + startup/iss555.c: Use POSIX fixed size types.
71 +2004-09-24 Ralf Corsepius <ralf_corsepius@rtems.org>
73 + * configure.ac: Require automake > 1.9.
75 +2004-04-23 Ralf Corsepius <ralf_corsepius@rtems.org>
78 + * Makefile.am: Add include/tm27.h, Cosmetics.
79 + * include/tm27.h: Final cosmetics.
81 +2004-04-22 Ralf Corsepius <ralf_corsepius@rtems.org>
83 + * include/bsp.h: Split out tmtest27 support.
84 + * include/tm27.h: New.
86 +2004-04-21 Joel Sherrill <joel@OARcorp.com>
89 + * Makefile.am, include/bsp.h, wrapup/Makefile.am: Follow conventions
90 + for tm27 and do not add another macro definition.
91 + * startup/tm27supp.c: New file.
93 +2004-04-21 Joel Sherrill <joel@OARcorp.com>
96 + * Makefile.am, include/bsp.h, wrapup/Makefile.am: Follow conventions
97 + for tm27 and do not add another macro definition.
98 + * startup/tm27supp.c: New file.
100 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
103 + * include/bsp.h: Remove MAX_LONG_TEST_DURATION.
105 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
108 + * include/bsp.h: Remove MAX_SHORT_TEST_DURATION (Unused).
110 +2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org>
112 + * include/bsp.h, startup/start.S: Reflect new locations of cpukit headers.
114 +2004-04-12 David Querbach <querbach@realtime.bc.ca>
116 + * .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
117 + times, clock/p_clock.c, console/console.c, include/.cvsignore,
118 + include/bsp.h, include/coverhd.h, irq/irq.h, startup/bspstart.c,
119 + startup/iss555.c, startup/linkcmds, startup/start.S,
120 + wrapup/.cvsignore, wrapup/Makefile.am: New files.
122 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/Makefile.am
123 ===================================================================
125 +++ rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am
128 +## $Id: Makefile.am,v 1.6 2005/02/12 03:31:07 ralf Exp $
131 +ACLOCAL_AMFLAGS = -I ../../../../aclocal
133 +include $(top_srcdir)/../../../../automake/compile.am
134 +include $(top_srcdir)/../../bsp.am
136 +dist_project_lib_DATA = bsp_specs
138 +include_HEADERS = include/bsp.h
139 +include_HEADERS += include/tm27.h
141 +nodist_include_HEADERS = include/bspopts.h
142 +DISTCLEANFILES = include/bspopts.h
146 +include_bspdir = $(includedir)/bsp
148 +include_HEADERS += include/coverhd.h
149 +include_bsp_HEADERS = irq/irq.h
153 +dist_project_lib_DATA += startup/linkcmds
155 +noinst_PROGRAMS += pclock.rel
156 +pclock_rel_SOURCES = clock/p_clock.c
157 +pclock_rel_CPPFLAGS = $(AM_CPPFLAGS)
158 +pclock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
160 +noinst_PROGRAMS += console.rel
161 +console_rel_SOURCES = console/console.c
162 +console_rel_CPPFLAGS = $(AM_CPPFLAGS)
163 +console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
165 +noinst_PROGRAMS += startup.rel
166 +startup_rel_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
167 + ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
168 + startup/iss555.c ../../shared/main.c ../../shared/sbrk.c \
169 + ../../shared/gnatinstallhandler.c startup/start.S
170 +startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
171 +startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
173 +noinst_PROGRAMS += tm27supp.rel
174 +tm27supp_rel_SOURCES = startup/tm27supp.c
175 +tm27supp_rel_CPPFLAGS = $(AM_CPPFLAGS)
176 +tm27supp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
178 +noinst_LIBRARIES = libbsp.a
180 +libbsp_a_LIBADD = pclock.rel console.rel startup.rel tm27supp.rel
181 +libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
182 + ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
183 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/clock.rel \
184 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/console-generic.rel \
185 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/exceptions.rel \
186 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/irq.rel \
187 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/timer.rel \
188 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/vectors.rel
190 +all-local: $(PREINSTALL_FILES) $(TMPINSTALL_FILES)
195 +$(PROJECT_INCLUDE)/$(dirstamp):
196 + @$(mkdir_p) $(PROJECT_INCLUDE)
197 + @: > $(PROJECT_INCLUDE)/$(dirstamp)
198 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
200 +$(PROJECT_LIB)/$(dirstamp):
201 + @$(mkdir_p) $(PROJECT_LIB)
202 + @: > $(PROJECT_LIB)/$(dirstamp)
203 +PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
205 +$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
206 + $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
207 +PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
209 +$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
210 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
211 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
213 +$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
214 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
215 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
217 +$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
218 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
219 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
221 +$(PROJECT_INCLUDE)/bsp/$(dirstamp):
222 + @$(mkdir_p) $(PROJECT_INCLUDE)/bsp
223 + @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
224 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
226 +$(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
227 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
228 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
230 +$(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
231 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
232 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
234 +$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
235 + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
236 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
238 +CLEANFILES = $(PREINSTALL_FILES)
239 +DISTCLEANFILES += $(PREINSTALL_DIRS)
241 +include $(top_srcdir)/../../../../automake/subdirs.am
242 +include $(top_srcdir)/../../../../automake/local.am
243 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/README
244 ===================================================================
246 +++ rtems/c/src/lib/libbsp/powerpc/ec555/README
249 +# $Id: README,v 1.1 2004/04/12 21:52:13 joel Exp $
252 +This is a README file for the Intec SS555 of RTEMS 4.6.0
254 +The SS555 port was sponsored by Defence Research and Development
255 +Canada - Suffield, and is Copyright (C) 2004, Real-Time Systems Inc.
257 +Please send any comments, improvements, or bug reports to:
260 +querbach@realtime.bc.ca
267 +BOARD: Intec Automation Inc. SS555
271 +COPROCESSORS: Built-in Motorola TPU
278 +TIMERS: PIT / Timebase
279 + RESOLUTION: 1 microsecond (4 MHz crystal / 4)
281 +REAL-TIME CLOCK: On-chip.
300 + SCI2 serial port (console)
302 + TB timing test support
304 + SWT watchdog timer -- enable in startup/iss555.c
305 + *CS0 external 512k 2-1-1-1 Burst SRAM
329 +Clock rate: 40 MHz development/embeddable board
330 +Bus width: 32-bit on-board RAM, 16-bit off-board I/O
332 +RAM: 512k 2-1-1-1 burst SRAM
338 +The ss555 port uses the Intec SS555's external RAM in two different ways,
339 +depending on whether or not it is built for debugging by giving the
340 +VARIANT=DEBUG switch to make:
342 + make VARIANT=DEBUG all
344 +1. In the debugging case, the linker script concanttenates the .text,
345 +.data, and .bss sections starting at location zero, so they all can be
346 +loaded into the external RAM for debugging. We assume that the debugger
347 +disables the internal Flash ROM and enables the external RAM before loading
348 +the code into the external RAM.
350 +2. In the normal (non-debugging) case, the linker script still places the
351 +.text section near zero, but places the start of the .data and .bss sections
352 +at the start location of the MPC555's internal RAM. The system startup code
353 +then configures the external RAM just after the internal RAM in memory,
354 +forming one large block from the two RAM devices.
360 +This BSP includes an termios-capable asynchronous serial line driver that
361 +supports SCI1 and SCI2. The RTEMS console is selected at configuration time
362 +with the CONSOLE_MINOR variable (see .../ss555/configure.ac). We default to
363 +SCI2 for the console, since SCI1 has some extra features which may be
364 +desired for application use.
366 +The BSP console supports three different modes of operation:
368 + 1. polled I/O done with termios support,
369 + 2. polled I/O done without termios support,
370 + 3. interrupt-driven I/O with termios support.
372 +The mode of operation of the serial driver is determined at configure time in
373 +part by the value of the UARTS_IO_MODE variable (see .../ss555/configure.ac).
376 + 1 - interrupt-driven I/O.
378 +Also, set the value of UARTS_USE_TERMIOS to select whether termios should be
379 +used to perform buffering and input/output processing. Without termios
380 +support, input processing is limited to the substitution of LF for a
381 +received CR, and output processing is limited to the transmission of a CR
382 +following the transmission of a LF. The choices for UARTS_USE_TERMIOS are:
384 + 0 - do not use termios
387 +In most real-time applications, the driver should be configured to use
388 +termios and interrupt-driven I/O. Special requirements may dictate otherwise.
390 +Polled I/O must be used when running the timing tests. It must also be used
391 +to run some other tests and some samples, such as the cdtest. Some tests
392 +change the interrupt mask and will hang interrupt-driven I/O indefinitely.
393 +Others, such as cdtest, perform console output from the static constructors
394 +before the console is opened, causing the test to hang. Still other tests
395 +produce output that is supposed to be in some specific order. For these
396 +tests, termios should not be used, as termios buffers output and the
397 +transmission of the buffers occur at somewhat unpredictable times.
399 +The real solution is to fix the tests so that they work with interrupt-driven
403 +printk() and debug output
404 +-----------------------
406 +The implementation of printk() in RTEMS is mostly independent of most system
407 +services. The printk() function can therefore be used to print messages to a
408 +debug console, particularly when debugging startup code or device drivers,
409 +i.e. code that runs before the console driver is opened or that runs with
410 +interrupts disabled.
412 +Support is provided to send printk output to either port. Specify the
413 +desired port at configure time by setting the value of PRINTK_MINOR to one
414 +of SCI1_MINOR or SCI2_MINOR.
416 +printk() always uses polled I/O, and never uses termios.
418 +If the printk() port is opened by RTEMS, then UARTS_IO_MODE must be set for
419 +polled I/O, otherwise the I/O functions will be in conflict. Using printk()
420 +before the port is initialized is, of course, not possible. This
421 +initialization occurs in console_initialize(), which is called by
422 +rtems_initialize_executive_early().
428 +The MPC555 watchdog timer can be enabled at configuration time by defining
429 +the WATCHDOG_TIMEOUT variable. This variable sets the watchdog timeout
433 + --------- = --------- = 51.2 usec
436 +or about 1/20 msec. When WATCHDOG_TIMEOUT is left undefined, the watchdog
443 +Most code came from the mbx8xx port, except for the floating-point handling
444 +which came from the mpc8260ads.
450 +The port was developed on an x86 box running Debian 3.0. The toolchain was
451 +built from the sources at rtems.org, except for the autotools which came
452 +from the Debian distribution.
458 +Board: Intec SS555 v1.1
459 +CPU: Motorola MPC555LFMZP40, mask 1K83H
460 +Clock Speed: Crystal 4.0 MHz, CPU 40.0 MHz
461 +RAM: 512K bytes of 2-1-1-1 Burst SRAM
462 +Times Reported in: Microseconds
463 +Timer Source: Timebase clock
464 +GCC Flags: -O4 -fno-keep-inline-functions -mcpu=(821/860)
465 +Console: Operates in polled mode on SMC2. No I/O through EPPC-Bug.
471 +Single processor tests:
472 + All tests passed, except that:
473 + - sp09 aborts due to memory shortage
474 + - sp20 needs to be run with output buffering enabled (see
477 +Multi-processor tests:
481 + All tests passed. Note that the termios test only works if the system is
482 + rebuilt with termios enabled.
485 + All tests passed, except that:
486 + - the message queue test failed with "errno (91 - File or path name too
490 + Due to memory limitations, many of the tests will not run unless you set
491 + OPERATION_COUNT=20 at configuration time.
493 + To run tm27 (the interrupt latency timer test), short CN5-48 to CN5-50 on
496 + All tests run cleanly, except for tm26, which gives a "PANIC 12" after it
497 + exits. This doesn't seem to cause a problem otherwise.
499 + See the times file for the results of the timing tests.
505 + These run correctly, except that:
506 + - The "minimum" sample is not designed to run properly on any system.
507 + - The loopback, fileio, unilimited, and pppd tests fail due to memory
509 + - The paranoia program dies on a floating-point assist exception.
510 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/bsp_specs
511 ===================================================================
513 +++ rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs
516 +%rename endfile old_endfile
517 +%rename startfile old_startfile
518 +%rename link old_link
521 +%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: --start-group \
522 +%{!qrtems_debug: -lrtemsbsp -lrtemscpu} %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
523 +%{qjava: -lffi -lgcjgc -lzgcj -lgcj} %{qc++: -lstdc++} -lc -lgcc --end-group \
524 +%{!qnolinkcmds: %{qrtems_debug: --defsym RTEMS_DEBUG=1} -T linkcmds%s -Map %b.map}}}
527 +%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s}}
530 +%{!qrtems: %(old_endfile)} %{qrtems: ecrtn%O%s}
533 +%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -N -u start -e start}
535 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
536 ===================================================================
538 +++ rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
541 + * Clock Tick interrupt conexion code.
543 + * COPYRIGHT (c) 1989-1997.
544 + * On-Line Applications Research Corporation (OAR).
546 + * The license and distribution terms for this file may in
547 + * the file LICENSE in this distribution or at
548 + * http://www.rtems.com/license/LICENSE.
550 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
551 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
553 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/clock/p_clock.c:
555 + * Modified to support the MPC750.
556 + * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
558 + * $Id: p_clock.c,v 1.3 2005/04/25 14:46:37 jennifer Exp $
562 +#include <bsp/irq.h>
563 +#include <rtems/bspIo.h>
565 +extern void clockOn(void*);
566 +extern void clockOff (void*);
567 +extern int clockIsOn(void*);
568 +extern void Clock_isr(void *);
570 +static rtems_irq_connect_data clockIrqData = {
571 + CPU_PERIODIC_TIMER,
572 + (rtems_irq_hdl)Clock_isr,
574 + (rtems_irq_enable)clockOn,
575 + (rtems_irq_disable)clockOff,
576 + (rtems_irq_is_enabled)clockIsOn
579 +int BSP_disconnect_clock_handler (void)
581 + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
582 + printk("Unable to stop system clock\n");
583 + rtems_fatal_error_occurred(1);
585 + return BSP_remove_rtems_irq_handler (&clockIrqData);
588 +int BSP_connect_clock_handler (rtems_irq_hdl hdl)
590 + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
591 + printk("Unable to get system clock handler\n");
592 + rtems_fatal_error_occurred(1);
594 + if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
595 + printk("Unable to remove current system clock handler\n");
596 + rtems_fatal_error_occurred(1);
601 + clockIrqData.name = CPU_PERIODIC_TIMER;
602 + clockIrqData.hdl = (rtems_irq_hdl) hdl;
603 + clockIrqData.on = (rtems_irq_enable)clockOn;
604 + clockIrqData.off = (rtems_irq_enable)clockOff;
605 + clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;
607 + return BSP_install_rtems_irq_handler (&clockIrqData);
609 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/configure.ac
610 ===================================================================
612 +++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
614 +## Process this file with autoconf to produce a configure script.
616 +## $Id: configure.ac,v 1.5 2005/02/16 10:13:09 ralf Exp $
619 +AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
620 +AC_CONFIG_SRCDIR([bsp_specs])
621 +RTEMS_TOP(../../../../../..)
623 +RTEMS_CANONICAL_TARGET_CPU
624 +AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.9])
627 +RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
628 +RTEMS_CANONICALIZE_TOOLS
631 +RTEMS_CHECK_NETWORKING
632 +AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
634 +RTEMS_BSPOPTS_SET([WATCHDOG_TIMEOUT],[*],[0xFFFF])
635 +RTEMS_BSPOPTS_HELP([WATCHDOG_TIMEOUT],
636 +[Define to the desired timeout (in steps of 1/20 msec) to enable the
637 + watchdog. Default is to disable the watchdog entirely.])
639 +RTEMS_BSPOPTS_SET([UARTS_USE_TERMIOS],[*],[0])
640 +RTEMS_BSPOPTS_HELP([UARTS_USE_TERMIOS],
641 +[Define to 1 if you want termios support for every port.
642 + Termios support is independent of the choice of UART I/O mode.])
644 +RTEMS_BSPOPTS_SET([CONSOLE_MINOR],[*],[SCI2_MINOR])
645 +RTEMS_BSPOPTS_HELP([CONSOLE_MINOR],
646 +[Must be defined to be one of SCI1_MINOR or SCI2_MINOR. Determines which
647 + device will be registered as /dev/console.])
649 +RTEMS_BSPOPTS_SET([UARTS_IO_MODE],[*],[0])
650 +RTEMS_BSPOPTS_HELP([UARTS_IO_MODE],
651 +[Define to 1 if you want interrupt-driven I/O for the SCI ports.])
653 +RTEMS_BSPOPTS_SET([PRINTK_MINOR],[*],[SCI2_MINOR])
654 +RTEMS_BSPOPTS_HELP([PRINTK_MINOR],
655 +[Must be defined to be one of SCI1_MINOR or SCI2_MINOR. Determines which
656 + device is used for output by printk(). The printk port always uses polled
657 + I/O. Don't open the printk port from RTEMS unless also using polled I/O
658 + for the SCI ports.])
660 +# Explicitly list a Makefile here
661 +AC_CONFIG_FILES([Makefile])
663 +RTEMS_PPC_EXCEPTIONS
666 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/console/console.c
667 ===================================================================
669 +++ rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c
674 + * This file contains the Intec SS555 termios serial I/O package.
676 + * The SCI channels are assigned as follows
678 + * Channel Device Minor
682 + * All ports support termios. The use of termios is recommended for real-time
683 + * applications. Termios provides buffering and input processing. When not
684 + * using termios, processing is limited to the substitution of LF for CR on
685 + * input, and the output of a CR following the output of a LF character.
686 + * Note that the terminal should not send CR/LF pairs when the return key
687 + * is pressed, and that output lines are terminated with LF/CR, not CR/LF
688 + * (although that would be easy to change).
690 + * I/O may be interrupt-driven (recommended for real-time applications) or
695 + * It is not possible to use different I/O modes on the different ports. The
696 + * exception is with printk. The printk port can use a different mode from
697 + * the other ports. If this is done, it is important not to open the printk
698 + * port from an RTEMS application.
700 + * Currently, the I/O modes are determined at build time. It would be much
701 + * better to have the mode selected at boot time based on parameters in
704 + * Interrupt-driven I/O requires termios.
708 + * TO RUN THE TESTS, USE POLLED I/O WITHOUT TERMIOS SUPPORT. Some tests
709 + * play with the interrupt masks and turn off I/O. Those tests will hang
710 + * when interrupt-driven I/O is used. Other tests, such as cdtest, do I/O
711 + * from the static constructors before the console is open. This test
712 + * will not work with interrupt-driven I/O. Because of the buffering
713 + * performed in termios, test output may not be in sequence.The tests
714 + * should all be fixed to work with interrupt-driven I/O and to
715 + * produce output in the expected sequence. Obviously, the termios test
716 + * requires termios support in the driver.
718 + * Set CONSOLE_MINOR to the appropriate device minor number in the
719 + * config file. This allows the RTEMS application console to be different
720 + * from the GDB port.
722 + * This driver handles both available serial ports: it distinguishes
723 + * the sub-devices using minor device numbers. It is not possible to have
724 + * other protocols running on the other ports when this driver is used as
725 + * currently written.
728 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
729 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
731 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/console/console.c:
733 + * Based on code (alloc860.c in eth_comm port) by
734 + * Jay Monkman (jmonkman@frasca.com),
735 + * Copyright (C) 1998 by Frasca International, Inc.
737 + * Modifications by Darlene Stewart <Darlene.Stewart@iit.nrc.ca>
738 + * and Charles-Antoine Gauthier <charles.gauthier@iit.nrc.ca>.
739 + * Copyright (c) 2000, National Research Council of Canada
744 +#include <bsp.h> /* Must be before libio.h */
745 +#include <rtems/bspIo.h>
746 +#include <rtems/libio.h>
747 +#include <termios.h>
749 +static void _BSP_output_char( char c );
750 +static rtems_status_code do_poll_read( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
751 +static rtems_status_code do_poll_write( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
753 +static void _BSP_null_char( char c ) {return;}
755 +BSP_output_char_function_type BSP_output_char = _BSP_null_char;
760 + * Input characters through polled I/O. Returns as soon as a character has
761 + * been received. Otherwise, if we wait for the number of requested
762 + * characters, we could be here forever!
764 + * CR is converted to LF on input. The terminal should not send a CR/LF pair
765 + * when the return or enter key is pressed.
767 + * Input parameters:
768 + * major - ignored. Should be the major number for this driver.
769 + * minor - selected channel.
770 + * arg->buffer - where to put the received characters.
771 + * arg->count - number of characters to receive before returning--Ignored.
773 + * Output parameters:
774 + * arg->bytes_moved - the number of characters read. Always 1.
776 + * Return value: RTEMS_SUCCESSFUL
778 + * CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
780 +static rtems_status_code do_poll_read(
781 + rtems_device_major_number major,
782 + rtems_device_minor_number minor,
786 + rtems_libio_rw_args_t *rw_args = arg;
789 + while( (c = m5xx_uart_pollRead(minor)) == -1 );
790 + rw_args->buffer[0] = (uint8_t)c;
791 + if( rw_args->buffer[0] == '\r' )
792 + rw_args->buffer[0] = '\n';
793 + rw_args->bytes_moved = 1;
795 + return RTEMS_SUCCESSFUL;
801 + * Output characters through polled I/O. Returns only once every character has
804 + * CR is transmitted AFTER a LF on output.
806 + * Input parameters:
807 + * major - ignored. Should be the major number for this driver.
808 + * minor - selected channel
809 + * arg->buffer - where to get the characters to transmit.
810 + * arg->count - the number of characters to transmit before returning.
812 + * Output parameters:
813 + * arg->bytes_moved - the number of characters read
815 + * Return value: RTEMS_SUCCESSFUL
817 + * CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
819 +static rtems_status_code do_poll_write(
820 + rtems_device_major_number major,
821 + rtems_device_minor_number minor,
825 + rtems_libio_rw_args_t *rw_args = arg;
829 + for( i = 0; i < rw_args->count; i++ ) {
830 + m5xx_uart_pollWrite(minor, &(rw_args->buffer[i]), 1);
831 + if ( rw_args->buffer[i] == '\n' )
832 + m5xx_uart_pollWrite(minor, &cr, 1);
834 + rw_args->bytes_moved = i;
836 + return RTEMS_SUCCESSFUL;
840 + * Print functions prototyped in bspIo.h
843 +static void _BSP_output_char( char c )
848 + * Can't rely on console_initialize having been called before this
849 + * function is used, so it may fail.
852 + m5xx_uart_pollWrite( PRINTK_MINOR, &c, 1 );
854 + m5xx_uart_pollWrite( PRINTK_MINOR, &cr, 1 );
862 + * All these functions are prototyped in rtems/c/src/lib/include/console.h.
866 + * Initialize and register the device
868 +rtems_device_driver console_initialize(
869 + rtems_device_major_number major,
870 + rtems_device_minor_number minor,
874 + rtems_status_code status;
877 + * Set up TERMIOS if needed
879 + #if UARTS_USE_TERMIOS == 1
880 + rtems_termios_initialize ();
881 + #endif /* UARTS_USE_TERMIOS */
884 + * Do device-specific initialization
886 + BSP_output_char = _BSP_output_char;
888 + m5xx_uart_initialize(SCI1_MINOR);
889 + status = rtems_io_register_name ("/dev/tty0", major, SCI1_MINOR);
890 + if (status != RTEMS_SUCCESSFUL)
891 + rtems_fatal_error_occurred (status);
893 + m5xx_uart_initialize(SCI2_MINOR);
894 + status = rtems_io_register_name ("/dev/tty1", major, SCI2_MINOR);
895 + if (status != RTEMS_SUCCESSFUL)
896 + rtems_fatal_error_occurred (status);
898 + /* Now register the RTEMS console */
899 + status = rtems_io_register_name ("/dev/console", major, CONSOLE_MINOR);
900 + if (status != RTEMS_SUCCESSFUL)
901 + rtems_fatal_error_occurred (status);
903 + return RTEMS_SUCCESSFUL;
909 +rtems_device_driver console_open(
910 + rtems_device_major_number major,
911 + rtems_device_minor_number minor,
915 + rtems_status_code sc;
917 + if ( minor > NUM_PORTS - 1 )
918 + return RTEMS_INVALID_NUMBER;
920 + #if (UARTS_USE_TERMIOS == 1)
922 + #if (UARTS_IO_MODE == 1) /* RTEMS interrupt-driven I/O with termios */
924 + static const rtems_termios_callbacks callbacks = {
925 + m5xx_uart_firstOpen, /* firstOpen */
926 + m5xx_uart_lastClose, /* lastClose */
927 + NULL, /* pollRead */
928 + m5xx_uart_write, /* write */
929 + m5xx_uart_setAttributes, /* setAttributes */
930 + NULL, /* stopRemoteTx */
931 + NULL, /* startRemoteTx */
932 + TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */
934 + sc = rtems_termios_open( major, minor, arg, &callbacks );
936 + #else /* UARTS_IO_MODE != 1 */ /* RTEMS polled I/O with termios */
938 + static const rtems_termios_callbacks callbacks = {
939 + m5xx_uart_firstOpen, /* firstOpen */
940 + m5xx_uart_lastClose, /* lastClose */
941 + m5xx_uart_pollRead, /* pollRead */
942 + m5xx_uart_pollWrite, /* write */
943 + m5xx_uart_setAttributes, /* setAttributes */
944 + NULL, /* stopRemoteTx */
945 + NULL, /* startRemoteTx */
946 + TERMIOS_POLLED /* outputUsesInterrupts */
948 + sc = rtems_termios_open( major, minor, arg, &callbacks );
955 + #else /* no termios -- default to polled I/O */
957 + sc = RTEMS_SUCCESSFUL;
967 +rtems_device_driver console_close(
968 + rtems_device_major_number major,
969 + rtems_device_minor_number minor,
973 + if ( minor > NUM_PORTS-1 )
974 + return RTEMS_INVALID_NUMBER;
976 + #if UARTS_USE_TERMIOS == 1
977 + return rtems_termios_close( arg );
979 + return RTEMS_SUCCESSFUL;
984 + * Read from the device
986 +rtems_device_driver console_read(
987 + rtems_device_major_number major,
988 + rtems_device_minor_number minor,
992 + if ( minor > NUM_PORTS-1 )
993 + return RTEMS_INVALID_NUMBER;
995 + #if UARTS_USE_TERMIOS == 1
996 + return rtems_termios_read( arg );
998 + return do_poll_read( major, minor, arg );
1003 + * Write to the device
1005 +rtems_device_driver console_write(
1006 + rtems_device_major_number major,
1007 + rtems_device_minor_number minor,
1011 + if ( minor > NUM_PORTS-1 )
1012 + return RTEMS_INVALID_NUMBER;
1014 + #if UARTS_USE_TERMIOS == 1
1015 + return rtems_termios_write( arg );
1017 + return do_poll_write( major, minor, arg );
1022 + * Handle ioctl request.
1024 +rtems_device_driver console_control(
1025 + rtems_device_major_number major,
1026 + rtems_device_minor_number minor,
1030 + if ( minor > NUM_PORTS-1 )
1031 + return RTEMS_INVALID_NUMBER;
1033 + #if UARTS_USE_TERMIOS == 1
1034 + return rtems_termios_ioctl( arg );
1036 + return RTEMS_SUCCESSFUL;
1039 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/include/.cvsignore
1040 ===================================================================
1042 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/.cvsignore
1048 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
1049 ===================================================================
1051 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
1055 + * This include file contains all board IO definitions.
1057 + * This file includes definitions for the Intec SS555.
1060 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1061 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1063 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h:
1065 + * COPYRIGHT (c) 1989-1998.
1066 + * On-Line Applications Research Corporation (OAR).
1068 + * The license and distribution terms for this file may be
1069 + * found in the file LICENSE in this distribution or at
1070 + * http://www.rtems.com/license/LICENSE.
1072 + * $Id: bsp.h,v 1.9 2005/05/26 05:36:48 ralf Exp $
1082 +#include <bspopts.h>
1085 +#include <rtems/console.h>
1086 +#include <rtems/clockdrv.h>
1087 +#include <mpc5xx.h>
1088 +#include <mpc5xx/console.h>
1089 +#include <libcpu/vectors.h>
1090 +#include <bsp/irq.h>
1093 + * Clock definitions
1096 +#define BSP_CRYSTAL_HZ 4000000 /* crystal frequency, Hz */
1097 +#define BSP_CLOCK_HZ 40000000 /* CPU clock frequency, Hz
1102 + * The SS555 board includes a CPLD to control on-board features and
1103 + * off-board devices.
1105 +typedef struct cpld_ {
1106 + uint8_t cs3a[32]; /* Chip select 3A */
1107 + uint8_t pad0[0x200000 - 0x000020];
1109 + uint8_t cs3b[32]; /* Chip select 3B */
1110 + uint8_t pad2[0x400000 - 0x200020];
1112 + uint8_t cs3c[32]; /* Chip select 3C */
1113 + uint8_t pad4[0x600000 - 0x400020];
1115 + uint8_t cs3d[32]; /* Chip select 3D */
1116 + uint8_t pad6[0x800000 - 0x600020];
1118 + uint8_t serial_ints; /* Enable/disable serial interrupts */
1119 + uint8_t serial_resets; /* Enable/disable serial resets */
1120 + uint8_t serial_ack; /* Acknowledge serial transfers */
1121 + uint8_t pad8[0xA00000 - 0x800003];
1123 + uint8_t iflash_writess; /* Enable/disable internal-flash writes */
1124 + uint8_t nflash_writess; /* Enable/disable NAND-flash writes */
1125 + uint8_t padA[0xC00000 - 0xA00002];
1128 +extern volatile cpld_t cpld; /* defined in linkcmds */
1130 +/* miscellaneous stuff assumed to exist */
1132 +extern rtems_configuration_table BSP_Configuration;
1135 + * Device Driver Table Entries
1139 + * NOTE: Use the standard Console driver entry
1143 + * NOTE: Use the standard Clock driver entry
1147 + * How many libio files we want
1150 +#define BSP_LIBIO_MAX_FDS 20
1154 +void bsp_cleanup( void );
1156 +rtems_isr_entry set_vector( /* returns old vector */
1157 + rtems_isr_entry handler, /* isr routine */
1158 + rtems_vector_number vector, /* vector number */
1159 + int type /* RTEMS or RAW intr */
1167 +/* end of include file */
1168 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
1169 ===================================================================
1171 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
1175 + * This include file has defines to represent the overhead associated
1176 + * with calling a particular directive from C. These are used in the
1177 + * Timing Test Suite to ignore the overhead required to pass arguments
1178 + * to directives. On some CPUs and/or target boards, this overhead
1179 + * is significant and makes it difficult to distinguish internal
1180 + * RTEMS execution time from that used to call the directive.
1181 + * This file should be updated after running the C overhead timing
1182 + * test. Once this update has been performed, the RTEMS Time Test
1183 + * Suite should be rebuilt to account for these overhead times in the
1186 + * NOTE: If these are all zero, then the times reported include
1187 + * all calling overhead including passing of arguments.
1189 + * COPYRIGHT (c) 1989-1998.
1190 + * On-Line Applications Research Corporation (OAR).
1192 + * The license and distribution terms for this file may be
1193 + * found in the file LICENSE in this distribution or at
1194 + * http://www.rtems.com/license/LICENSE.
1196 + * $Id: coverhd.h,v 1.1 2004/04/12 21:52:13 joel Exp $
1199 +#ifndef __COVERHD_h
1200 +#define __COVERHD_h
1207 + * 40 MHz processor, running from external 2-1-1-1 burst SRAM.
1209 +#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
1210 +#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
1211 +#define CALLING_OVERHEAD_TASK_CREATE 0
1212 +#define CALLING_OVERHEAD_TASK_IDENT 0
1213 +#define CALLING_OVERHEAD_TASK_START 0
1214 +#define CALLING_OVERHEAD_TASK_RESTART 0
1215 +#define CALLING_OVERHEAD_TASK_DELETE 0
1216 +#define CALLING_OVERHEAD_TASK_SUSPEND 0
1217 +#define CALLING_OVERHEAD_TASK_RESUME 0
1218 +#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
1219 +#define CALLING_OVERHEAD_TASK_MODE 0
1220 +#define CALLING_OVERHEAD_TASK_GET_NOTE 0
1221 +#define CALLING_OVERHEAD_TASK_SET_NOTE 0
1222 +#define CALLING_OVERHEAD_TASK_WAKE_WHEN 2
1223 +#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
1224 +#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
1225 +#define CALLING_OVERHEAD_CLOCK_GET 2
1226 +#define CALLING_OVERHEAD_CLOCK_SET 3
1227 +#define CALLING_OVERHEAD_CLOCK_TICK 0
1229 +#define CALLING_OVERHEAD_TIMER_CREATE 0
1230 +#define CALLING_OVERHEAD_TIMER_IDENT 0
1231 +#define CALLING_OVERHEAD_TIMER_DELETE 0
1232 +#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
1233 +#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 3
1234 +#define CALLING_OVERHEAD_TIMER_RESET 0
1235 +#define CALLING_OVERHEAD_TIMER_CANCEL 0
1236 +#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
1237 +#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
1238 +#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
1239 +#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
1240 +#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
1241 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
1242 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
1243 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
1244 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
1245 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
1246 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
1247 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
1248 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
1250 +#define CALLING_OVERHEAD_EVENT_SEND 0
1251 +#define CALLING_OVERHEAD_EVENT_RECEIVE 0
1252 +#define CALLING_OVERHEAD_SIGNAL_CATCH 0
1253 +#define CALLING_OVERHEAD_SIGNAL_SEND 0
1254 +#define CALLING_OVERHEAD_PARTITION_CREATE 0
1255 +#define CALLING_OVERHEAD_PARTITION_IDENT 0
1256 +#define CALLING_OVERHEAD_PARTITION_DELETE 0
1257 +#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
1258 +#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
1259 +#define CALLING_OVERHEAD_REGION_CREATE 0
1260 +#define CALLING_OVERHEAD_REGION_IDENT 0
1261 +#define CALLING_OVERHEAD_REGION_DELETE 0
1262 +#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
1263 +#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
1264 +#define CALLING_OVERHEAD_PORT_CREATE 0
1265 +#define CALLING_OVERHEAD_PORT_IDENT 0
1266 +#define CALLING_OVERHEAD_PORT_DELETE 0
1267 +#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
1268 +#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
1270 +#define CALLING_OVERHEAD_IO_INITIALIZE 0
1271 +#define CALLING_OVERHEAD_IO_OPEN 0
1272 +#define CALLING_OVERHEAD_IO_CLOSE 0
1273 +#define CALLING_OVERHEAD_IO_READ 0
1274 +#define CALLING_OVERHEAD_IO_WRITE 0
1275 +#define CALLING_OVERHEAD_IO_CONTROL 0
1276 +#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
1277 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
1278 +#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
1279 +#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
1280 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
1281 +#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
1282 +#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
1289 +/* end of include file */
1290 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
1291 ===================================================================
1293 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
1298 + * The license and distribution terms for this file may be
1299 + * found in the file LICENSE in this distribution or at
1300 + * http://www.rtems.com/license/LICENSE.
1302 + * $Id: tm27.h,v 1.2 2004/04/23 04:47:38 ralf Exp $
1305 +#ifndef _RTEMS_TMTEST27
1306 +#error "This is an RTEMS internal file you must not include directly."
1313 + * Stuff for Time Test 27
1315 + * The following require that IRQ7 be jumpered to ground. On the SS555,
1316 + * this can be done by shorting together CN5 pin 48 and CN5 pin 50.
1319 +#define MUST_WAIT_FOR_INTERRUPT 1
1321 +#define Install_tm27_vector( handler ) \
1323 + extern rtems_irq_connect_data tm27IrqData; \
1324 + usiu.siel |= (1 << 17); \
1325 + usiu.sipend |= (1 << 17); \
1327 + tm27IrqData.hdl = (rtems_irq_hdl)handler; \
1328 + BSP_install_rtems_irq_handler (&tm27IrqData); \
1331 +#define Cause_tm27_intr() \
1333 + usiu.siel &= ~(1 << 17); \
1336 +#define Clear_tm27_intr() \
1338 + usiu.siel |= (1 << 17); \
1339 + usiu.sipend |= (1 << 17); \
1342 +#define Lower_tm27_intr() \
1344 + ppc_cached_irq_mask |= (1 << 17); \
1345 + usiu.simask = ppc_cached_irq_mask; \
1349 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
1350 ===================================================================
1352 +++ rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
1356 + * This include file describe the data structure and the functions implemented
1357 + * by rtems to write interrupt handlers.
1360 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1361 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1363 + * Derived from libbsp/powerpc/mbx8xx/irq/irq.h:
1365 + * CopyRight (C) 1999 valette@crf.canon.fr
1367 + * This code is heavilly inspired by the public specification of STREAM V2
1368 + * that can be found at :
1370 + * <http://www.chorus.com/Documentation/index.html> by following
1371 + * the STREAM API Specification Document link.
1373 + * The license and distribution terms for this file may be
1374 + * found in found in the file LICENSE in this distribution or at
1375 + * http://www.rtems.com/license/LICENSE.
1377 + * $Id: irq.h,v 1.2 2004/04/21 10:43:03 ralf Exp $
1380 +#ifndef LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1381 +#define LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1383 +#include <libcpu/irq.h>
1392 + * The SS555 has no external interrupt controller chip, so use the standard
1393 + * routines from the CPU-dependent code.
1395 +#define BSP_install_rtems_irq_handler(ptr) CPU_install_rtems_irq_handler(ptr)
1396 +#define BSP_get_current_rtems_irq_handler(ptr) CPU_get_current_rtems_irq_handler(ptr)
1397 +#define BSP_remove_rtems_irq_handler(ptr) CPU_remove_rtems_irq_handler(ptr)
1398 +#define BSP_rtems_irq_mngt_set(config) CPU_rtems_irq_mngt_set(config)
1399 +#define BSP_rtems_irq_mngt_get(config) CPU_rtems_irq_mngt_get(config)
1400 +#define BSP_rtems_irq_mng_init(cpuId) CPU_rtems_irq_mng_init(cpuId)
1408 +#endif /* LIBBSP_POWERPC_SS555_IRQ_IRQ_H */
1409 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
1410 ===================================================================
1412 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
1416 + * This set of routines starts the application. It includes application,
1417 + * board, and monitor specific initialization and configuration.
1418 + * The generic CPU dependent initialization has been performed
1419 + * before this routine is invoked.
1421 + * COPYRIGHT (c) 1989-1998.
1422 + * On-Line Applications Research Corporation (OAR).
1424 + * The license and distribution terms for this file may be
1425 + * found in the file LICENSE in this distribution or at
1426 + * http://www.rtems.com/license/LICENSE.
1428 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1429 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1431 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c:
1433 + * Modifications for MBX860:
1434 + * Copyright (c) 1999, National Research Council of Canada
1436 + * $Id: bspstart.c,v 1.7 2005/04/26 23:16:21 joel Exp $
1439 +#include <string.h>
1441 +#include <rtems/libio.h>
1442 +#include <rtems/libcsupport.h>
1443 +#include <rtems/bspIo.h>
1444 +#include <rtems/powerpc/powerpc.h>
1446 +#include <libcpu/cpuIdent.h>
1447 +#include <libcpu/spr.h>
1449 +#include <bsp/irq.h>
1456 + * The original table from the application (in ROM) and our copy of it with
1457 + * some changes. Configuration is defined in <confdefs.h>. Make sure that
1458 + * our configuration tables are uninitialized so that they get allocated in
1459 + * the .bss section (RAM).
1461 +extern rtems_configuration_table Configuration;
1462 +extern unsigned long intrStackPtr;
1463 +rtems_configuration_table BSP_Configuration;
1465 +rtems_cpu_table Cpu_table;
1467 +char *rtems_progname;
1470 + * Use the shared implementations of the following routines.
1471 + * Look in rtems/c/src/lib/libbsp/shared/bsppost.c and
1472 + * rtems/c/src/lib/libbsp/shared/bsplibc.c.
1474 +void bsp_postdriver_hook(void);
1475 +void bsp_libc_init( void *, uint32_t, int );
1477 +void BSP_panic(char *s)
1479 + printk("%s PANIC %s\n",_RTEMS_version, s);
1480 + __asm__ __volatile ("sc");
1483 +void _BSP_Fatal_error(unsigned int v)
1485 + printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
1486 + __asm__ __volatile ("sc");
1490 + * bsp_pretasking_hook
1492 + * Called when RTEMS initialization is complete but before interrupts and
1493 + * tasking are enabled. Used to setup libc and install any BSP extensions.
1495 + * Must not use libc (to do io) from here, since drivers are not yet
1498 + * Installed in the rtems_cpu_table defined in
1499 + * rtems/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h by main()
1500 + * below. Called from rtems_initialize_executive() defined in
1501 + * rtems/c/src/exec/sapi/src/init.c
1503 + * Input parameters: NONE
1505 + * Output parameters: NONE
1507 + * Return values: NONE
1509 +void bsp_pretasking_hook(void)
1512 + * These are assigned addresses in the linkcmds file for the BSP. This
1513 + * approach is better than having these defined as manifest constants and
1514 + * compiled into the kernel, but it is still not ideal when dealing with
1515 + * multiprocessor configuration in which each board as a different memory
1516 + * map. A better place for defining these symbols might be the makefiles.
1517 + * Consideration should also be given to developing an approach in which
1518 + * the kernel and the application can be linked and burned into ROM
1519 + * independently of each other.
1521 + uint8_t *_HeapStart =
1522 + (uint8_t *)BSP_Configuration.work_space_start
1523 + + BSP_Configuration.work_space_size;
1524 + extern uint8_t _HeapEnd[];
1526 + bsp_libc_init( _HeapStart, _HeapEnd - _HeapStart, 0 );
1529 + rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
1536 + * Board-specific initialization code. Called from the generic boot_card()
1537 + * function defined in rtems/c/src/lib/libbsp/shared/main.c. That function
1538 + * does some of the board independent initialization. It is called from the
1539 + * SS555 entry point _start() defined in
1540 + * rtems/c/src/lib/libbsp/powerpc/ss555/startup/start.S
1542 + * _start() has set up a stack, has zeroed the .bss section, has set up the
1543 + * .data section from contents stored in ROM, has turned off interrupts,
1544 + * and placed the processor in the supervisor mode. boot_card() has left
1545 + * the processor in that state when bsp_start() was called.
1547 + * Input parameters: NONE
1549 + * Output parameters: NONE
1551 + * Return values: NONE
1553 +void bsp_start(void)
1555 + extern char _WorkspaceBase[];
1557 + ppc_cpu_id_t myCpu;
1558 + ppc_cpu_revision_t myCpuRevision;
1559 + register unsigned char* intrStack;
1562 + * Get CPU identification dynamically. Note that the get_ppc_cpu_type()
1563 + * function stores the result in global variables so that it can be used
1566 + myCpu = get_ppc_cpu_type();
1567 + myCpuRevision = get_ppc_cpu_revision();
1570 + * Initialize some SPRG registers related to irq handling
1572 + intrStack = (((unsigned char*)&intrStackPtr) - PPC_MINIMUM_STACK_FRAME_SIZE);
1573 + _write_SPRG1((unsigned int)intrStack);
1574 + /* signal them that we have fixed PR288 - eventually, this should go away */
1575 + _write_SPRG0(PPC_BSP_HAS_FIXED_PR288);
1578 + * Install our own set of exception vectors
1580 + initialize_exceptions();
1583 + * Allocate the memory for the RTEMS Work Space. This can come from
1584 + * a variety of places: hard coded address, malloc'ed from outside
1585 + * RTEMS world (e.g. simulator or primitive memory manager), or (as
1586 + * typically done by stock BSPs) by subtracting the required amount
1587 + * of work space from the last physical address on the CPU board.
1589 + * In this case, the memory is not malloc'ed. It is just
1590 + * "pulled from the air".
1592 + BSP_Configuration.work_space_start = _WorkspaceBase;
1595 + * initialize the CPU table for this BSP
1597 + Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
1598 + Cpu_table.postdriver_hook = bsp_postdriver_hook;
1599 + if( Cpu_table.interrupt_stack_size < 4 * 1024 )
1600 + Cpu_table.interrupt_stack_size = 4 * 1024;
1602 + Cpu_table.clicks_per_usec = BSP_CRYSTAL_HZ / 4 / 1000000;
1603 + Cpu_table.clock_speed = BSP_CLOCK_HZ; /* for SCI baud rate generator */
1606 + * Call this in case we use TERMIOS for console I/O
1608 + m5xx_uart_reserve_resources( &BSP_Configuration );
1611 + * Initalize RTEMS IRQ system
1613 + BSP_rtems_irq_mng_init(0);
1615 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
1616 ===================================================================
1618 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
1623 + * Intec SS555 initialization routines.
1625 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1626 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1628 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c:
1630 + * Copyright (c) 1999, National Research Council of Canada
1632 + * The license and distribution terms for this file may be
1633 + * found in the file LICENSE in this distribution or at
1634 + * http://www.rtems.com/license/LICENSE.
1649 + * Initialize SS555
1651 +void _InitSS555 (void)
1653 + register uint32_t plprcr, msr;
1656 + * Initialize the System Protection Control Register (SYPCR).
1657 + * The SYPCR can only be written once after Reset.
1660 + USIU_SYPCR_SWTC(WATCHDOG_TIMEOUT) /* set watchdog timeout */
1661 + | USIU_SYPCR_BMT(0xFF) /* set bus monitor timeout */
1662 + | USIU_SYPCR_BME /* enable bus monitor */
1663 + | USIU_SYPCR_SWF /* watchdog halted in freeze */
1664 +#if WATCHDOG_TIMEOUT != 0xFFFF
1665 + | USIU_SYPCR_SWE /* enable watchdog */
1667 + | USIU_SYPCR_SWRI /* watchdog forces reset */
1668 + | USIU_SYPCR_SWP; /* prescale watchdog by 2048 */
1670 + TICKLE_WATCHDOG(); /* restart watchdog timer */
1673 + * Re-tune the PLL to the desired system clock frequency.
1675 + usiu.plprck = USIU_UNLOCK_KEY; /* unlock PLPRCR */
1677 + USIU_PLPRCR_TEXPS /* assert TEXP always */
1678 + | USIU_PLPRCR_MF(BSP_CLOCK_HZ / BSP_CRYSTAL_HZ);
1679 + /* PLL multiplication factor */
1680 + usiu.plprck = 0; /* lock PLPRCR */
1682 + while (((plprcr = usiu.plprcr) & USIU_PLPRCR_SPLS) == 0)
1683 + ; /* wait for PLL to re-lock */
1686 + * Enable the timebase and decrementer, then initialize decrementer
1687 + * register to a large value to guarantee that a decrementer interrupt
1688 + * will not be generated before the kernel is fully initialized.
1689 + * Initialize the timebase register to zero.
1691 + usiu.tbscrk = USIU_UNLOCK_KEY;
1692 + usiu.tbscr |= USIU_TBSCR_TBE; /* enable time base and decrementer */
1695 + usiu.tbk = USIU_UNLOCK_KEY;
1696 + _write_DEC(0x7FFFFFFF);
1697 + _write_TBWU(0x00000000 );
1698 + _write_TBWL(0x00000000 );
1702 + * Run the Inter-Module Bus at full speed.
1704 + imb.uimb.umcr &= ~UIMB_UMCR_HSPEED;
1707 + * Initialize Memory Controller for External RAM
1709 + * Initialize the Base and Option Registers (BR0-BR7 and OR0-OR7). Note
1710 + * that for all chip selects, ORx should be programmed before BRx.
1712 + * If booting from internal flash ROM, configure the external RAM to
1713 + * extend the internal RAM. If booting from external RAM, leave it at
1714 + * zero but set it up appropriately.
1716 + extern char int_ram_top[]; /* top of internal ram */
1718 + usiu.memc[0]._or =
1719 + USIU_MEMC_OR_512K /* bank size */
1720 + | USIU_MEMC_OR_SCY(0) /* wait states in first beat of burst */
1721 + | USIU_MEMC_OR_BSCY(0); /* wait states in subsequent beats */
1723 + usiu.memc[0]._br =
1724 + USIU_MEMC_BR_BA(_read_IMMR() & IMMR_FLEN
1725 + ? (uint32_t)int_ram_top : 0) /* base address */
1726 + | USIU_MEMC_BR_PS32 /* 32-bit data bus */
1727 + | USIU_MEMC_BR_TBDIP /* toggle bdip */
1728 + | USIU_MEMC_BR_V; /* base register valid */
1731 + * Initialize Memory Controller for External CPLD
1733 + * The SS555 board includes a CPLD to control on-board features and
1734 + * off-board devices. (Configuration taken from Intec's hwhook.c)
1736 + usiu.memc[3]._or =
1737 + USIU_MEMC_OR_16M /* bank size */
1738 + | USIU_MEMC_OR_CSNT /* negate CS/WE early */
1739 + | USIU_MEMC_OR_ACS_HALF /* assert CS half cycle after address */
1740 + | USIU_MEMC_OR_SCY(15) /* wait states in first beat of burst */
1741 + | USIU_MEMC_OR_TRLX; /* relaxed timing */
1743 + usiu.memc[3]._br =
1744 + USIU_MEMC_BR_BA(&cpld) /* base address */
1745 + | USIU_MEMC_BR_PS16 /* 16-bit data bus */
1746 + | USIU_MEMC_BR_BI /* inhibit bursting */
1747 + | USIU_MEMC_BR_V; /* base register valid */
1750 + * Disable show cycles and serialization so that burst accesses will work
1751 + * properly. A different value, such as 0x0, may be more appropriate for
1752 + * debugging, but can be set with the debugger, if needed.
1754 + _write_ICTRL(0x00000007);
1757 + * Set up Burst Buffer Controller (BBC)
1760 + BBCMCR_ETRE /* enable exception relocation */
1761 + | BBCMCR_BE); /* enable burst accesses */
1764 + _CPU_MSR_GET(msr);
1765 + msr |= MSR_IP; /* set prefix for exception relocation */
1766 + _CPU_MSR_SET(msr);
1768 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
1769 ===================================================================
1771 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
1774 + * Linker command file for Intec SS555 board
1776 + * When debugging, we assume that the internal flash ROM will be replaced by
1777 + * the external RAM on the SS555 board. All sections are stacked starting
1778 + * at address zero. Nothing is placed in the internal RAM, since it's not
1779 + * contiguous with the external SRAM when the external RAM is placed at
1782 + * For final production, we assume that the .text section will be burned
1783 + * into flash ROM starting at address zero. The .data, .bss, heap, and
1784 + * workspace will reside in RAM, starting at the beginning of the internal
1785 + * RAM. The system startup code will configure the external RAM to begin
1786 + * where the internal RAM ends, so as to make one large RAM block.
1788 + * Debugging mode is chosen when the RTEMS_DEBUG symbol is defined. The
1789 + * RTEMS_DEBUG symbol is defined in the bsp_specs file whenever make(1) is
1790 + * invoked with VARIANT=DEBUG.
1792 + * $Id: linkcmds,v 1.1 2004/04/12 21:52:13 joel Exp $
1795 +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
1796 +OUTPUT_ARCH(powerpc)
1799 +int_ram_org = 0x003F9800; /* base of internal RAM */
1800 +int_ram_top = 0x00400000; /* top of internal RAM */
1801 +ext_ram_size = 0x00080000; /* size of external RAM */
1809 + * For the MPC555, we use the compressed vector table format which puts
1810 + * all of the exception vectors before 0x100.
1817 + /* Read-only sections, merged into text segment: */
1821 + /* Entry point is the .entry section */
1829 + /* C++ constructors/destructors */
1830 + *(.gnu.linkonce.t*)
1832 + /* Initialization and finalization code.
1834 + * Various files can provide initialization and finalization functions.
1835 + * The bodies of these functions are in .init and .fini sections. We
1836 + * accumulate the bodies here, and prepend function prologues from
1837 + * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
1838 + * first; ecrtn.o must be linked last. Because these are wildcards, it
1839 + * doesn't matter if the user does not actually link against ecrti.o and
1840 + * ecrtn.o; the linker won't look for a file to match a wildcard. The
1841 + * wildcard also means that it doesn't matter which directory ecrti.o
1842 + * and ecrtn.o are in.
1844 + PROVIDE (_init = .);
1849 + PROVIDE (_fini = .);
1855 + * C++ constructors and destructors for static objects.
1856 + * PowerPC EABI does not use crtstuff yet, so we build "old-style"
1857 + * constructor and destructor lists that begin with the list length
1858 + * end terminate with a NULL entry.
1860 + PROVIDE (__CTOR_LIST__ = .);
1861 + /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
1862 + *crtbegin.o(.ctors)
1866 + PROVIDE (__CTOR_END__ = .);
1868 + PROVIDE (__DTOR_LIST__ = .);
1869 + /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
1870 + *crtbegin.o(.dtors)
1874 + PROVIDE (__DTOR_END__ = .);
1877 + * Special FreeBSD sysctl sections.
1880 + __start_set_sysctl_set = .;
1882 + __stop_set_sysctl_set = ABSOLUTE(.);
1886 + /* Exception frame info */
1889 + /* Miscellaneous read-only data */
1890 + _rodata_start = . ;
1891 + *(.gnu.linkonce.r*)
1901 + /* Various possible names for the end of the .text section */
1902 + etext = ALIGN(0x10);
1906 + PROVIDE (etext = .);
1907 + PROVIDE (__etext = .);
1910 + * .data section contents, copied to RAM at system startup.
1913 + data.contents.start = .;
1915 + text.size = text.end - text.start;
1918 + * If debugging, stack the read/write sections directly after the text
1919 + * section. Otherwise, stack the read/write sections starting at base of
1922 + . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org;
1924 + .data : AT (data.contents.start)
1932 + PROVIDE (__SDATA_START__ = .);
1934 + *(.gnu.linkonce.d*)
1935 + *(.gnu.linkonce.s.*)
1936 + PROVIDE (__SDATA_END__ = .);
1938 + PROVIDE (__EXCEPT_START__ = .);
1939 + *(.gcc_except_table)
1940 + PROVIDE (__EXCEPT_END__ = .);
1942 + PROVIDE(__GOT_START__ = .);
1945 + PROVIDE(__GOT_END__ = .);
1949 + PROVIDE (__GOT2_START__ = .);
1950 + PROVIDE (_GOT2_START_ = .);
1952 + PROVIDE (__GOT2_END__ = .);
1953 + PROVIDE (_GOT2_END_ = .);
1955 + PROVIDE (__FIXUP_START__ = .);
1956 + PROVIDE (_FIXUP_START_ = .);
1958 + PROVIDE (_FIXUP_END_ = .);
1959 + PROVIDE (__FIXUP_END__ = .);
1961 + /* We want the small data sections together, so single-instruction
1962 + * offsets can access them all.
1964 + PROVIDE (__SDATA2_START__ = .);
1966 + *(.gnu.linkonce.s2.*)
1967 + PROVIDE (__SDATA2_END__ = .);
1971 + data.size = data.end - data.start;
1977 + PROVIDE (__SBSS2_START__ = .);
1979 + PROVIDE (__SBSS2_END__ = .);
1981 + PROVIDE (__SBSS_START__ = .);
1983 + PROVIDE (__SBSS_END__ = .);
1991 + bss.size = bss.end - bss.start;
1993 + PROVIDE(_end = bss.end);
1996 + * Initialization stack
1998 + InitStack_start = ALIGN(0x10);
2001 + PROVIDE(initStackPtr = initStack);
2006 + IntrStack_start = ALIGN(0x10);
2009 + PROVIDE(intrStackPtr = intrStack);
2011 + _WorkspaceBase = .;
2012 + __WorkspaceBase = .;
2017 + * The heap is configured at run-time to use all available memory. It
2018 + * begins just after the end of the Workspace and continues to the end of
2019 + * the external RAM.
2021 + . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size;
2027 + * Internal I/O devices
2029 + .usiu 0x002FC000: /* unified system interface unit */
2034 + .imb 0x00300000: /* inter-module bus and devices */
2039 + .sram 0x00380000: /* internal SRAM control registers */
2045 + * SS555 external devices managed by on-board CPLD
2047 + .cpld 0xFF000000: /* SS555 external CPLD devices */
2053 + /* Stabs debugging sections. */
2054 + .stab 0 : { *(.stab) }
2055 + .stabstr 0 : { *(.stabstr) }
2056 + .stab.excl 0 : { *(.stab.excl) }
2057 + .stab.exclstr 0 : { *(.stab.exclstr) }
2058 + .stab.index 0 : { *(.stab.index) }
2059 + .stab.indexstr 0 : { *(.stab.indexstr) }
2060 + .comment 0 : { *(.comment) }
2062 + /* DWARF debug sections.
2063 + Symbols in the DWARF debugging sections are relative to the beginning
2064 + of the section so we begin them at 0. */
2066 + .debug 0 : { *(.debug) }
2067 + .line 0 : { *(.line) }
2069 + /* GNU DWARF 1 extensions */
2070 + .debug_srcinfo 0 : { *(.debug_srcinfo) }
2071 + .debug_sfnames 0 : { *(.debug_sfnames) }
2073 + /* DWARF 1.1 and DWARF 2 */
2074 + .debug_aranges 0 : { *(.debug_aranges) }
2075 + .debug_pubnames 0 : { *(.debug_pubnames) }
2078 + .debug_info 0 : { *(.debug_info) }
2079 + .debug_abbrev 0 : { *(.debug_abbrev) }
2080 + .debug_line 0 : { *(.debug_line) }
2081 + .debug_frame 0 : { *(.debug_frame) }
2082 + .debug_str 0 : { *(.debug_str) }
2083 + .debug_loc 0 : { *(.debug_loc) }
2084 + .debug_macinfo 0 : { *(.debug_macinfo) }
2086 + /* SGI/MIPS DWARF 2 extensions */
2087 + .debug_weaknames 0 : { *(.debug_weaknames) }
2088 + .debug_funcnames 0 : { *(.debug_funcnames) }
2089 + .debug_typenames 0 : { *(.debug_typenames) }
2090 + .debug_varnames 0 : { *(.debug_varnames) }
2091 + /* These must appear regardless of . */
2093 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/startup/start.S
2094 ===================================================================
2096 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S
2100 + * This file contains the entry veneer for RTEMS programs on the Intec
2101 + * SS555 board. It jumps to the BSP which is responsible for performing
2102 + * all remaining initialization.
2104 + * This file is based on several others:
2106 + * (1) start360.s from the gen68360 BSP by
2107 + * W. Eric Norum (eric@skatter.usask.ca)
2108 + * with the following copyright and license:
2110 + * COPYRIGHT (c) 1989-1998.
2111 + * On-Line Applications Research Corporation (OAR).
2113 + * The license and distribution terms for this file may in
2114 + * the file LICENSE in this distribution or at
2115 + * http://www.rtems.com/license/LICENSE.
2117 + * (2) start.s for the eth_comm port by
2118 + * Jay Monkman (jmonkman@fracsa.com),
2119 + * which itself is based on the
2121 + * (3) dlentry.s for the Papyrus BSP, written by:
2122 + * Andrew Bray <andy@i-cubed.co.uk>
2123 + * with the following copyright and license:
2125 + * COPYRIGHT (c) 1995 by i-cubed ltd.
2127 + * (4) start860.S for the MBX821/MBX860, written by:
2128 + * Darlene A. Stewart <darlene.stewart@iit.nrc.ca>
2129 + * Copyright (c) 1999, National Research Council of Canada
2131 + * To anyone who acknowledges that this file is provided "AS IS"
2132 + * without any express or implied warranty:
2133 + * permission to use, copy, modify, and distribute this file
2134 + * for any purpose is hereby granted without fee, provided that
2135 + * the above copyright notice and this notice appears in all
2136 + * copies, and that the name of i-cubed limited not be used in
2137 + * advertising or publicity pertaining to distribution of the
2138 + * software without specific, written prior permission.
2139 + * i-cubed limited makes no representations about the suitability
2140 + * of this software for any purpose.
2142 + * (5) Modifications (for MBX8xx) of respective RTEMS files:
2143 + * Copyright (c) 1999, National Research Council of Canada
2145 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
2146 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
2149 +#include <rtems/asm.h>
2150 +#include <rtems/powerpc/registers.h>
2153 + * The initial stack is set to the top of the internal RAM.
2155 + * All the entry veneer has to do is to clear the .bss section and copy the
2156 + * initializers into the .data section.
2160 + * GDB likes to have debugging information for the entry veneer.
2161 + * Play compiler and provide some DWARF information.
2163 + * CHANGE TO SUIT YOUR SETUP!
2166 + .section .entry,"ax",@progbits
2171 +.section .debug_sfnames
2173 + .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2182 + .4byte .L_line_e-.L_line_b
2188 + .4byte .L_text_e-.L_text_b
2192 +.section .debug_srcinfo
2195 + .4byte .L_sfnames_b
2199 + .4byte .L_LE1-.L_line_b
2200 + .4byte .L_F0-.L_sfnames_b
2201 + .4byte .L_line_last-.L_line_b
2205 +.section .debug_pubnames
2214 +.section .debug_aranges
2217 + .4byte .L_text_e-.L_text_b
2231 + .4byte .L_D1_e-.L_D1
2232 + .2byte 0x11 /* TAG_compile_unit */
2233 + .2byte 0x12 /* AT_sibling */
2235 + .2byte 0x38 /* AT_name */
2238 + .2byte 0x258 /* AT_producer */
2241 + .2byte 0x111 /* AT_low_pc */
2243 + .2byte 0x121 /* AT_high_pc */
2245 + .2byte 0x106 /* AT_stmt_list */
2247 + .2byte 0x1b8 /* AT_comp_dir */
2248 + .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2250 + .2byte 0x8006 /* AT_sf_names */
2251 + .4byte .L_sfnames_b
2252 + .2byte 0x8016 /* AT_src_info */
2253 + .4byte .L_srcinfo_b
2257 + .4byte .L_D3_e-.L_D3
2258 + .2byte 0x6 /* TAG_global_subroutine */
2259 + .2byte 0x12 /* AT_sibling */
2261 + .2byte 0x38 /* AT_name */
2264 + .2byte 0x278 /* AT_prototyped */
2266 + .2byte 0x111 /* AT_low_pc */
2268 + .2byte 0x121 /* AT_high_pc */
2270 + .2byte 0x8041 /* AT_body_begin */
2272 + .2byte 0x8051 /* AT_body_end */
2277 + .4byte .L_D4_e-.L_D4
2284 + * Tell C's eabi-ctor's that we have an atexit function,
2285 + * and that it is to register __do_global_dtors.
2287 + EXTERN_PROC(atexit)
2288 + PUBLIC_VAR(__atexit)
2289 + .section ".sdata","aw"
2292 + EXT_PROC_REF(atexit)@fixup
2295 + .section ".fixup","aw"
2297 + EXT_SYM_REF(__atexit)
2300 +/* That should do it */
2303 + * Put the entry point in its own section. That way, we can guarantee
2304 + * to put it first in the .text section in the linker script.
2308 + PUBLIC_VAR (start)
2310 + bl .startup /* or bl .spin */
2314 + * Parameters from linker
2317 + .long initStackPtr
2320 + .long __GOT_START__
2332 + .long data.contents.start
2334 +PUBLIC_VAR (text_addr)
2338 +PUBLIC_VAR (text_length)
2343 + * Spin, if necessary, to acquire control from debugger (CodeWarrior).
2349 + lwz r3, spin@l(r3)
2354 + * Initialization code
2357 + /* Capture address of linker parameters. */
2360 + /* Set initial stack pointer to end of internal RAM - 56. */
2361 + lwz r1, stack_top-base_addr(r3)
2364 + /* Initialize essential registers. */
2367 + /* Set TOC pointer */
2368 + lwz r2, toc_pointer-base_addr(r3)
2370 + /* Initialize the memory mapped MPC555 registers (done in C). */
2371 + EXTERN_PROC (_InitSS555)
2372 + bl PROC (_InitSS555)
2374 + /* Clear the .bss section. */
2377 + /* Copy initializers into the .data section */
2380 + /* Enable floating point, since gcc sometimes uses the floating
2381 + * point registers for data moves, even if the C source code doesn't
2382 + * include floating point operations.
2385 + ori r0, r0, MSR_FP
2388 + /* Start system. */
2389 + lis r5, environ@ha
2390 + la r5,environ@l(r5) /* environp */
2391 + li r4, 0 /* argv */
2392 + li r3, 0 /* argc */
2393 + EXTERN_PROC (boot_card)
2394 + bl PROC (boot_card) /* call the first C routine */
2396 + /* We should never return from boot_card, but in case we do ... */
2397 + /* The next instructions are dependent on your runtime environment. */
2403 + * datacopy - copy initializers into .data section
2406 + lis r3, base_addr@ha /* point to linker data */
2407 + addi r3, r3, base_addr@l
2409 + lwz r4, contents_addr-base_addr(r3) /* .data contents in ROM */
2410 + lwz r5, data_addr-base_addr(r3) /* .data section in RAM */
2411 + lwz r6, data_length-base_addr(r3) /* length of .data */
2413 + rlwinm. r6, r6, 30, 0x3FFFFFFF /* form length / 4 */
2414 + beqlr /* no .data - return */
2416 + mtctr r6 /* set ctr reg */
2418 + lwz r6, 0(r4) /* get word */
2419 + stw r6, 0(r5) /* store word */
2420 + addi r4, r4, 0x4 /* next source */
2421 + addi r5, r5, 0x4 /* next target */
2422 + bdnz dc1 /* dec counter and loop */
2427 + * bssclr - zero out bss
2430 + lis r3, base_addr@ha /* point to linker data */
2431 + addi r3, r3, base_addr@l
2433 + lwz r4, bss_addr-base_addr(r3) /* Start of bss */
2434 + lwz r5, bss_length-base_addr(r3) /* Length of bss */
2436 + rlwinm. r5, r5, 30, 0x3FFFFFFF /* form length/4 */
2437 + beqlr /* no bss - return */
2439 + mtctr r5 /* set ctr reg */
2440 + li r5, 0x0000 /* r5 = 0 */
2442 + stw r5, 0(r4) /* store r6 */
2443 + addi r4, r4, 0x4 /* update r4 */
2444 + bdnz clear_bss /* dec counter and loop */
2450 + * Initialize the MSR and basic core PowerPC registers
2457 + * Set the processor for big-endian mode, exceptions vectored to
2458 + * 0x000n_nnnn, no execution tracing, machine check exceptions
2459 + * enabled, floating-point not available, supervisor priviledge
2460 + * level, external interrupts disabled, power management disabled
2461 + * (normal operation mode).
2463 + li r0, 0x1000 /* MSR_ME */
2464 + mtmsr r0 /* Context-synchronizing */
2468 + * Clear the exception handling registers.
2509 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
2510 ===================================================================
2512 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
2515 + * Support routines for TM27
2517 + * $Id: tm27supp.c,v 1.1 2004/04/21 20:24:36 joel Exp $
2535 +rtems_irq_connect_data tm27IrqData = {
2536 + CPU_USIU_EXT_IRQ_7,
2538 + (rtems_irq_enable)tm27On,
2539 + (rtems_irq_disable)tm27Off,
2540 + (rtems_irq_is_enabled)tm27IsOn
2543 Index: rtems-051009/c/src/lib/libbsp/powerpc/ec555/times
2544 ===================================================================
2546 +++ rtems/c/src/lib/libbsp/powerpc/ec555/times
2549 +# Timing Test Suite Results for the Intec SS555
2551 +# $Id: times,v 1.1 2004/04/12 21:52:13 joel Exp $
2556 +Clock Speed: 40 MHz
2557 +Memory Configuration: 512k external 2-1-1-1 SRAM
2560 +Times Reported in: microseconds
2561 +Timer Source: Timebase register (TMBCLK = (4 MHz crystal / 4) = 1.0 Mhz)
2564 +== ================================================================= ==== ====
2566 + 1 rtems_semaphore_create 21
2567 + rtems_semaphore_delete 22
2568 + rtems_semaphore_obtain: available 7
2569 + rtems_semaphore_obtain: not available -- NO_WAIT 7
2570 + rtems_semaphore_release: no waiting tasks 18
2572 + 2 rtems_semaphore_obtain: not available -- caller blocks 50
2574 + 3 rtems_semaphore_release: task readied -- preempts caller 41
2576 + 4 rtems_task_restart: blocked task -- preempts caller 69
2577 + rtems_task_restart: ready task -- preempts caller 67
2578 + rtems_semaphore_release: task readied -- returns to caller 23
2579 + rtems_task_create 75
2580 + rtems_task_start 30
2581 + rtems_task_restart: suspended task -- returns to caller 37
2582 + rtems_task_delete: suspended task 68
2583 + rtems_task_restart: ready task -- returns to caller 38
2584 + rtems_task_restart: blocked task -- returns to caller 44
2585 + rtems_task_delete: blocked task 70
2587 + 5 rtems_task_suspend: calling task 40
2588 + rtems_task_resume: task readied -- preempts caller 35
2590 + 6 rtems_task_restart: calling task 46
2591 + rtems_task_suspend: returns to caller 16
2592 + rtems_task_resume: task readied -- returns to caller 18
2593 + rtems_task_delete: ready task 71
2595 + 7 rtems_task_restart: suspended task -- preempts caller 64
2597 + 8 rtems_task_set_priority: obtain current priority 13
2598 + rtems_task_set_priority: returns to caller 24
2599 + rtems_task_mode: obtain current mode 4
2600 + rtems_task_mode: no reschedule 5
2601 + rtems_task_mode: reschedule -- returns to caller 7
2602 + rtems_task_mode: reschedule -- preempts caller 37
2603 + rtems_task_set_note 13
2604 + rtems_task_get_note 13
2605 + rtems_clock_set 27
2608 + 9 rtems_message_queue_create 34
2609 + rtems_message_queue_send: no waiting tasks 26
2610 + rtems_message_queue_urgent: no waiting tasks 26
2611 + rtems_message_queue_receive: available 24
2612 + rtems_message_queue_flush: no messages flushed 12
2613 + rtems_message_queue_flush: messages flushed 15
2614 + rtems_message_queue_delete 26
2616 +10 rtems_message_queue_receive: not available -- NO_WAIT 15
2617 + rtems_message_queue_receive: not available -- caller blocks 52
2619 +11 rtems_message_queue_send: task readied -- preempts caller 47
2621 +12 rtems_message_queue_send: task readied -- returns to caller 29
2623 +13 rtems_message_queue_urgent: task readied -- preempts caller 46
2625 +14 rtems_message_queue_urgent: task readied -- returns to caller 29
2627 +15 rtems_event_receive: obtain current events 1
2628 + rtems_event_receive: not available -- NO_WAIT 12
2629 + rtems_event_receive: not available -- caller blocks 44
2630 + rtems_event_send: no task readied 13
2631 + rtems_event_receive: available 13
2632 + rtems_event_send: task readied -- returns to caller 21
2634 +16 rtems_event_send: task readied -- preempts caller 41
2636 +17 rtems_task_set_priority: preempts caller 49
2638 +18 rtems_task_delete: calling task 95
2640 +19 rtems_signal_catch 10
2641 + rtems_signal_send: returns to caller 15
2642 + rtems_signal_send: signal to self 20
2643 + exit ASR overhead: returns to calling task 15
2644 + exit ASR overhead: returns to preempting task 30
2646 +20 rtems_partition_create 25
2647 + rtems_region_create 38
2648 + rtems_partition_get_buffer: available 14
2649 + rtems_partition_get_buffer: not available 13
2650 + rtems_partition_return_buffer 15
2651 + rtems_partition_delete 16
2652 + rtems_region_get_segment: available 34
2653 + rtems_region_get_segment: not available -- NO_WAIT 32
2654 + rtems_region_return_segment: no waiting tasks 33
2655 + rtems_region_get_segment: not available -- caller blocks 68
2656 + rtems_region_return_segment: task readied -- preempts caller 67
2657 + rtems_region_return_segment: task readied -- returns to caller 48
2658 + rtems_region_delete 30
2659 + rtems_io_initialize 2
2664 + rtems_io_control 1
2666 +21 rtems_task_ident 25
2667 + rtems_message_queue_ident 22
2668 + rtems_semaphore_ident 29
2669 + rtems_partition_ident 22
2670 + rtems_region_ident 24
2671 + rtems_port_ident 22
2672 + rtems_timer_ident 22
2673 + rtems_rate_monotonic_ident 22
2675 +22 rtems_message_queue_broadcast: task readied -- returns to caller 33
2676 + rtems_message_queue_broadcast: no waiting tasks 20
2677 + rtems_message_queue_broadcast: task readied -- preempts caller 50
2679 +23 rtems_timer_create 13
2680 + rtems_timer_fire_after: inactive 22
2681 + rtems_timer_fire_after: active 24
2682 + rtems_timer_cancel: active 13
2683 + rtems_timer_cancel: inactive 12
2684 + rtems_timer_reset: inactive 21
2685 + rtems_timer_reset: active 22
2686 + rtems_timer_fire_when: inactive 26
2687 + rtems_timer_fire_when: active 26
2688 + rtems_timer_delete: active 18
2689 + rtems_timer_delete: inactive 16
2690 + rtems_task_wake_when 49
2692 +24 rtems_task_wake_after: yield -- returns to caller 10
2693 + rtems_task_wake_after: yields -- preempts caller 36
2695 +25 rtems_clock_tick 8
2700 + _Thread_Disable_dispatch 1
2701 + _Thread_Enable_dispatch 7
2702 + _Thread_Set_state 7
2703 + _Thread_Disptach (NO FP) 32
2704 + context switch: no floating point contexts 25
2705 + context switch: self 11
2706 + context switch: to another task 12
2707 + fp context switch: restore 1st FP task 37
2708 + fp context switch: save idle, restore initialized 34
2709 + fp context switch: save idle, restore idle 48
2710 + fp context switch: save initialized, restore initialized 34
2716 + _Thread_Get: invalid id 1
2718 +27 interrupt entry overhead: returns to interrupted task 13
2719 + interrupt exit overhead: returns to interrupted task 11
2720 + interrupt entry overhead: returns to nested interrupt 12
2721 + interrupt exit overhead: returns to nested interrupt 10
2722 + interrupt entry overhead: returns to preempting task 12
2723 + interrupt exit overhead: returns to preempting task 38
2725 +28 rtems_port_create 16
2726 + rtems_port_external_to_internal 11
2727 + rtems_port_internal_to_external 11
2728 + rtems_port_delete 16
2730 +29 rtems_rate_monotonic_create 15
2731 + rtems_rate_monotonic_period: initiate period -- returns to caller 20
2732 + rtems_rate_monotonic_period: obtain status 12
2733 + rtems_rate_monotonic_cancel 15
2734 + rtems_rate_monotonic_delete: inactive 18
2735 + rtems_rate_monotonic_delete: active 20
2736 + rtems_rate_monotonic_period: conclude periods -- caller blocks 36