2 c/src/lib/libbsp/powerpc/ec555/ChangeLog | 131 +++++++
3 c/src/lib/libbsp/powerpc/ec555/Makefile.am | 65 +++
4 c/src/lib/libbsp/powerpc/ec555/README | 262 ++++++++++++++
5 c/src/lib/libbsp/powerpc/ec555/bsp_specs | 13
6 c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c | 69 +++
7 c/src/lib/libbsp/powerpc/ec555/configure.ac | 52 ++
8 c/src/lib/libbsp/powerpc/ec555/console/console.c | 368 +++++++++++++++++++
9 c/src/lib/libbsp/powerpc/ec555/include/bsp.h | 114 ++++++
10 c/src/lib/libbsp/powerpc/ec555/include/coverhd.h | 116 ++++++
11 c/src/lib/libbsp/powerpc/ec555/include/tm27.h | 54 ++
12 c/src/lib/libbsp/powerpc/ec555/irq/irq.h | 55 ++
13 c/src/lib/libbsp/powerpc/ec555/preinstall.am | 58 +++
14 c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c | 201 ++++++++++
15 c/src/lib/libbsp/powerpc/ec555/startup/iss555.c | 148 +++++++
16 c/src/lib/libbsp/powerpc/ec555/startup/linkcmds | 319 +++++++++++++++++
17 c/src/lib/libbsp/powerpc/ec555/startup/start.S | 411 ++++++++++++++++++++++
18 c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c | 29 +
19 c/src/lib/libbsp/powerpc/ec555/times | 189 ++++++++++
20 make/custom/ec555.cfg | 41 ++
21 19 files changed, 2695 insertions(+)
23 Index: rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
24 ===================================================================
25 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
26 +++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog 2007-08-14 17:51:38.000000000 +0200
28 +2007-04-06 Ralf Corsépius <ralf.corsepius@rtems.org>
30 + * bsp_specs: Remove lib (Now expected to exist in GCC).
32 +2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
34 + * configure.ac: New BUG-REPORT address.
36 +2006-10-19 Ralf Corsépius <ralf.corsepius@rtems.org>
38 + * configure.ac: Require automake-1.10. Require autoconf-2.60.
40 +2006-03-08 Joel Sherrill <joel@OARcorp.com>
42 + * startup/linkcmds: Add .gnu.linkonce.b.* section.
44 +2006-02-08 Joel Sherrill <joel@OARcorp.com>
46 + * startup/linkcmds: Add sections required by newer gcc versions.
48 +2006-01-11 Ralf Corsepius <ralf.corsepius@rtems.org>
50 + * configure.ac: Remove explicit ampolish3 support (now in
51 + RTEMS_BSP_CONFIGURE).
53 +2006-01-10 Ralf Corsepius <ralf.corsepius@rtems.org>
55 + * configure.ac: Add ampolish3 support.
56 + * Makefile.am: Add preinstall.am.
58 +2006-01-09 Ralf Corsepius <ralf.corsepius@rtems.org>
60 + * Makefile.am: Don't include subdirs.am.
62 +2005-05-26 Ralf Corsepius <ralf.corsepius@rtems.org>
64 + * include/bsp.h: New header guard.
66 +2005-05-10 Ralf Corsepius <ralf.corsepius@rtems.org>
68 + * console/console.c: Eliminate unsigned8.
70 +2005-04-26 Joel Sherrill <joel@OARcorp.com>
72 + * startup/bspstart.c: Eliminate warnings.
74 +2005-04-25 Jennifer Averett <jennifer.averett@oarcorp.com>
77 + * clock/p_clock.c: Add parameter to powerpc exception handler routines
79 +2005-02-17 Ralf Corsepius <ralf.corsepius@rtems.org>
81 + * startup/bspstart.c: include <rtems/powerpc/powerpc.h>.
82 + Use PPC_MINIMUM_STACK_FRAME_SIZE instead of
83 + CPU_MINIMUM_STACK_FRAME_SIZE.
85 +2005-02-16 Ralf Corsepius <ralf.corsepius@rtems.org>
87 + * configure.ac: Remove argument from RTEMS_PPC_EXCEPTIONS.
89 +2005-02-11 Ralf Corsepius <ralf.corsepius@rtems.org>
91 + * Makefile.am: Merge-in wrapup/Makefile.am.
92 + * wrapup/Makefile.am: Remove.
93 + * configure.ac: Reflect changes above.
95 +2005-01-07 Ralf Corsepius <ralf.corsepius@rtems.org>
97 + * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
99 +2005-01-02 Ralf Corsepius <ralf.corsepius@rtems.org>
101 + * Makefile.am, wrapup/Makefile.am: Remove build-variant support.
103 +2004-10-20 Ralf Corsepius <ralf_corsepius@rtems.org>
105 + * console/console.c, include/bsp.h, startup/bspstart.c,
106 + startup/iss555.c: Use POSIX fixed size types.
108 +2004-09-24 Ralf Corsepius <ralf_corsepius@rtems.org>
110 + * configure.ac: Require automake > 1.9.
112 +2004-04-23 Ralf Corsepius <ralf_corsepius@rtems.org>
115 + * Makefile.am: Add include/tm27.h, Cosmetics.
116 + * include/tm27.h: Final cosmetics.
118 +2004-04-22 Ralf Corsepius <ralf_corsepius@rtems.org>
120 + * include/bsp.h: Split out tmtest27 support.
121 + * include/tm27.h: New.
123 +2004-04-21 Joel Sherrill <joel@OARcorp.com>
126 + * Makefile.am, include/bsp.h, wrapup/Makefile.am: Follow conventions
127 + for tm27 and do not add another macro definition.
128 + * startup/tm27supp.c: New file.
130 +2004-04-21 Joel Sherrill <joel@OARcorp.com>
133 + * Makefile.am, include/bsp.h, wrapup/Makefile.am: Follow conventions
134 + for tm27 and do not add another macro definition.
135 + * startup/tm27supp.c: New file.
137 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
140 + * include/bsp.h: Remove MAX_LONG_TEST_DURATION.
142 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
145 + * include/bsp.h: Remove MAX_SHORT_TEST_DURATION (Unused).
147 +2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org>
149 + * include/bsp.h, startup/start.S: Reflect new locations of cpukit headers.
151 +2004-04-12 David Querbach <querbach@realtime.bc.ca>
153 + * .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
154 + times, clock/p_clock.c, console/console.c, include/.cvsignore,
155 + include/bsp.h, include/coverhd.h, irq/irq.h, startup/bspstart.c,
156 + startup/iss555.c, startup/linkcmds, startup/start.S,
157 + wrapup/.cvsignore, wrapup/Makefile.am: New files.
159 Index: rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am
160 ===================================================================
161 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
162 +++ rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am 2007-08-14 17:51:38.000000000 +0200
165 +## $Id: Makefile.am,v 1.10 2006/01/12 10:12:30 ralf Exp $
168 +ACLOCAL_AMFLAGS = -I ../../../../aclocal
170 +include $(top_srcdir)/../../../../automake/compile.am
171 +include $(top_srcdir)/../../bsp.am
173 +dist_project_lib_DATA = bsp_specs
175 +include_HEADERS = include/bsp.h
176 +include_HEADERS += include/tm27.h
178 +nodist_include_HEADERS = include/bspopts.h
179 +DISTCLEANFILES = include/bspopts.h
183 +include_bspdir = $(includedir)/bsp
185 +include_HEADERS += include/coverhd.h
186 +include_bsp_HEADERS = irq/irq.h
190 +dist_project_lib_DATA += startup/linkcmds
192 +noinst_PROGRAMS += pclock.rel
193 +pclock_rel_SOURCES = clock/p_clock.c
194 +pclock_rel_CPPFLAGS = $(AM_CPPFLAGS)
195 +pclock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
197 +noinst_PROGRAMS += console.rel
198 +console_rel_SOURCES = console/console.c
199 +console_rel_CPPFLAGS = $(AM_CPPFLAGS)
200 +console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
202 +noinst_PROGRAMS += startup.rel
203 +startup_rel_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
204 + ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
205 + startup/iss555.c ../../shared/main.c ../../shared/sbrk.c \
206 + ../../shared/gnatinstallhandler.c startup/start.S
207 +startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
208 +startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
210 +noinst_PROGRAMS += tm27supp.rel
211 +tm27supp_rel_SOURCES = startup/tm27supp.c
212 +tm27supp_rel_CPPFLAGS = $(AM_CPPFLAGS)
213 +tm27supp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
215 +noinst_LIBRARIES = libbsp.a
217 +libbsp_a_LIBADD = pclock.rel console.rel startup.rel tm27supp.rel
218 +libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
219 + ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
220 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/clock.rel \
221 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/console-generic.rel \
222 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/exceptions.rel \
223 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/irq.rel \
224 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/timer.rel \
225 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/vectors.rel
227 +include $(srcdir)/preinstall.am
228 +include $(top_srcdir)/../../../../automake/local.am
229 Index: rtems/c/src/lib/libbsp/powerpc/ec555/README
230 ===================================================================
231 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
232 +++ rtems/c/src/lib/libbsp/powerpc/ec555/README 2007-08-14 17:51:38.000000000 +0200
235 +# $Id: README,v 1.1 2004/04/12 21:52:13 joel Exp $
238 +This is a README file for the Intec SS555 of RTEMS 4.6.0
240 +The SS555 port was sponsored by Defence Research and Development
241 +Canada - Suffield, and is Copyright (C) 2004, Real-Time Systems Inc.
243 +Please send any comments, improvements, or bug reports to:
246 +querbach@realtime.bc.ca
253 +BOARD: Intec Automation Inc. SS555
257 +COPROCESSORS: Built-in Motorola TPU
264 +TIMERS: PIT / Timebase
265 + RESOLUTION: 1 microsecond (4 MHz crystal / 4)
267 +REAL-TIME CLOCK: On-chip.
286 + SCI2 serial port (console)
288 + TB timing test support
290 + SWT watchdog timer -- enable in startup/iss555.c
291 + *CS0 external 512k 2-1-1-1 Burst SRAM
315 +Clock rate: 40 MHz development/embeddable board
316 +Bus width: 32-bit on-board RAM, 16-bit off-board I/O
318 +RAM: 512k 2-1-1-1 burst SRAM
324 +The ss555 port uses the Intec SS555's external RAM in two different ways,
325 +depending on whether or not it is built for debugging by giving the
326 +VARIANT=DEBUG switch to make:
328 + make VARIANT=DEBUG all
330 +1. In the debugging case, the linker script concanttenates the .text,
331 +.data, and .bss sections starting at location zero, so they all can be
332 +loaded into the external RAM for debugging. We assume that the debugger
333 +disables the internal Flash ROM and enables the external RAM before loading
334 +the code into the external RAM.
336 +2. In the normal (non-debugging) case, the linker script still places the
337 +.text section near zero, but places the start of the .data and .bss sections
338 +at the start location of the MPC555's internal RAM. The system startup code
339 +then configures the external RAM just after the internal RAM in memory,
340 +forming one large block from the two RAM devices.
346 +This BSP includes an termios-capable asynchronous serial line driver that
347 +supports SCI1 and SCI2. The RTEMS console is selected at configuration time
348 +with the CONSOLE_MINOR variable (see .../ss555/configure.ac). We default to
349 +SCI2 for the console, since SCI1 has some extra features which may be
350 +desired for application use.
352 +The BSP console supports three different modes of operation:
354 + 1. polled I/O done with termios support,
355 + 2. polled I/O done without termios support,
356 + 3. interrupt-driven I/O with termios support.
358 +The mode of operation of the serial driver is determined at configure time in
359 +part by the value of the UARTS_IO_MODE variable (see .../ss555/configure.ac).
362 + 1 - interrupt-driven I/O.
364 +Also, set the value of UARTS_USE_TERMIOS to select whether termios should be
365 +used to perform buffering and input/output processing. Without termios
366 +support, input processing is limited to the substitution of LF for a
367 +received CR, and output processing is limited to the transmission of a CR
368 +following the transmission of a LF. The choices for UARTS_USE_TERMIOS are:
370 + 0 - do not use termios
373 +In most real-time applications, the driver should be configured to use
374 +termios and interrupt-driven I/O. Special requirements may dictate otherwise.
376 +Polled I/O must be used when running the timing tests. It must also be used
377 +to run some other tests and some samples, such as the cdtest. Some tests
378 +change the interrupt mask and will hang interrupt-driven I/O indefinitely.
379 +Others, such as cdtest, perform console output from the static constructors
380 +before the console is opened, causing the test to hang. Still other tests
381 +produce output that is supposed to be in some specific order. For these
382 +tests, termios should not be used, as termios buffers output and the
383 +transmission of the buffers occur at somewhat unpredictable times.
385 +The real solution is to fix the tests so that they work with interrupt-driven
389 +printk() and debug output
390 +-----------------------
392 +The implementation of printk() in RTEMS is mostly independent of most system
393 +services. The printk() function can therefore be used to print messages to a
394 +debug console, particularly when debugging startup code or device drivers,
395 +i.e. code that runs before the console driver is opened or that runs with
396 +interrupts disabled.
398 +Support is provided to send printk output to either port. Specify the
399 +desired port at configure time by setting the value of PRINTK_MINOR to one
400 +of SCI1_MINOR or SCI2_MINOR.
402 +printk() always uses polled I/O, and never uses termios.
404 +If the printk() port is opened by RTEMS, then UARTS_IO_MODE must be set for
405 +polled I/O, otherwise the I/O functions will be in conflict. Using printk()
406 +before the port is initialized is, of course, not possible. This
407 +initialization occurs in console_initialize(), which is called by
408 +rtems_initialize_executive_early().
414 +The MPC555 watchdog timer can be enabled at configuration time by defining
415 +the WATCHDOG_TIMEOUT variable. This variable sets the watchdog timeout
419 + --------- = --------- = 51.2 usec
422 +or about 1/20 msec. When WATCHDOG_TIMEOUT is left undefined, the watchdog
429 +Most code came from the mbx8xx port, except for the floating-point handling
430 +which came from the mpc8260ads.
436 +The port was developed on an x86 box running Debian 3.0. The toolchain was
437 +built from the sources at rtems.org, except for the autotools which came
438 +from the Debian distribution.
444 +Board: Intec SS555 v1.1
445 +CPU: Motorola MPC555LFMZP40, mask 1K83H
446 +Clock Speed: Crystal 4.0 MHz, CPU 40.0 MHz
447 +RAM: 512K bytes of 2-1-1-1 Burst SRAM
448 +Times Reported in: Microseconds
449 +Timer Source: Timebase clock
450 +GCC Flags: -O4 -fno-keep-inline-functions -mcpu=(821/860)
451 +Console: Operates in polled mode on SMC2. No I/O through EPPC-Bug.
457 +Single processor tests:
458 + All tests passed, except that:
459 + - sp09 aborts due to memory shortage
460 + - sp20 needs to be run with output buffering enabled (see
463 +Multi-processor tests:
467 + All tests passed. Note that the termios test only works if the system is
468 + rebuilt with termios enabled.
471 + All tests passed, except that:
472 + - the message queue test failed with "errno (91 - File or path name too
476 + Due to memory limitations, many of the tests will not run unless you set
477 + OPERATION_COUNT=20 at configuration time.
479 + To run tm27 (the interrupt latency timer test), short CN5-48 to CN5-50 on
482 + All tests run cleanly, except for tm26, which gives a "PANIC 12" after it
483 + exits. This doesn't seem to cause a problem otherwise.
485 + See the times file for the results of the timing tests.
491 + These run correctly, except that:
492 + - The "minimum" sample is not designed to run properly on any system.
493 + - The loopback, fileio, unilimited, and pppd tests fail due to memory
495 + - The paranoia program dies on a floating-point assist exception.
496 Index: rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs
497 ===================================================================
498 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
499 +++ rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs 2007-08-14 17:51:38.000000000 +0200
501 +%rename endfile old_endfile
502 +%rename startfile old_startfile
503 +%rename link old_link
506 +%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s}}
509 +%{!qrtems: %(old_endfile)} %{qrtems: ecrtn%O%s}
512 +%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -N -u start -e start}
514 Index: rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
515 ===================================================================
516 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
517 +++ rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c 2007-08-14 17:51:38.000000000 +0200
520 + * Clock Tick interrupt conexion code.
522 + * COPYRIGHT (c) 1989-1997.
523 + * On-Line Applications Research Corporation (OAR).
525 + * The license and distribution terms for this file may in
526 + * the file LICENSE in this distribution or at
527 + * http://www.rtems.com/license/LICENSE.
529 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
530 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
532 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/clock/p_clock.c:
534 + * Modified to support the MPC750.
535 + * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
537 + * $Id: p_clock.c,v 1.3 2005/04/25 14:46:37 jennifer Exp $
541 +#include <bsp/irq.h>
542 +#include <rtems/bspIo.h>
544 +extern void clockOn(void*);
545 +extern void clockOff (void*);
546 +extern int clockIsOn(void*);
547 +extern void Clock_isr(void *);
549 +static rtems_irq_connect_data clockIrqData = {
550 + CPU_PERIODIC_TIMER,
551 + (rtems_irq_hdl)Clock_isr,
553 + (rtems_irq_enable)clockOn,
554 + (rtems_irq_disable)clockOff,
555 + (rtems_irq_is_enabled)clockIsOn
558 +int BSP_disconnect_clock_handler (void)
560 + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
561 + printk("Unable to stop system clock\n");
562 + rtems_fatal_error_occurred(1);
564 + return BSP_remove_rtems_irq_handler (&clockIrqData);
567 +int BSP_connect_clock_handler (rtems_irq_hdl hdl)
569 + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
570 + printk("Unable to get system clock handler\n");
571 + rtems_fatal_error_occurred(1);
573 + if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
574 + printk("Unable to remove current system clock handler\n");
575 + rtems_fatal_error_occurred(1);
580 + clockIrqData.name = CPU_PERIODIC_TIMER;
581 + clockIrqData.hdl = (rtems_irq_hdl) hdl;
582 + clockIrqData.on = (rtems_irq_enable)clockOn;
583 + clockIrqData.off = (rtems_irq_enable)clockOff;
584 + clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;
586 + return BSP_install_rtems_irq_handler (&clockIrqData);
588 Index: rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
589 ===================================================================
590 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
591 +++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac 2007-08-14 17:51:38.000000000 +0200
593 +## Process this file with autoconf to produce a configure script.
595 +## $Id: configure.ac,v 1.7.2.2 2006/12/02 06:06:51 ralf Exp $
598 +AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
599 +AC_CONFIG_SRCDIR([bsp_specs])
600 +RTEMS_TOP(../../../../../..)
602 +RTEMS_CANONICAL_TARGET_CPU
603 +AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.10])
606 +RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
607 +RTEMS_CANONICALIZE_TOOLS
610 +RTEMS_CHECK_NETWORKING
611 +AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
613 +RTEMS_BSPOPTS_SET([WATCHDOG_TIMEOUT],[*],[0xFFFF])
614 +RTEMS_BSPOPTS_HELP([WATCHDOG_TIMEOUT],
615 +[Define to the desired timeout (in steps of 1/20 msec) to enable the
616 + watchdog. Default is to disable the watchdog entirely.])
618 +RTEMS_BSPOPTS_SET([UARTS_USE_TERMIOS],[*],[0])
619 +RTEMS_BSPOPTS_HELP([UARTS_USE_TERMIOS],
620 +[Define to 1 if you want termios support for every port.
621 + Termios support is independent of the choice of UART I/O mode.])
623 +RTEMS_BSPOPTS_SET([CONSOLE_MINOR],[*],[SCI2_MINOR])
624 +RTEMS_BSPOPTS_HELP([CONSOLE_MINOR],
625 +[Must be defined to be one of SCI1_MINOR or SCI2_MINOR. Determines which
626 + device will be registered as /dev/console.])
628 +RTEMS_BSPOPTS_SET([UARTS_IO_MODE],[*],[0])
629 +RTEMS_BSPOPTS_HELP([UARTS_IO_MODE],
630 +[Define to 1 if you want interrupt-driven I/O for the SCI ports.])
632 +RTEMS_BSPOPTS_SET([PRINTK_MINOR],[*],[SCI2_MINOR])
633 +RTEMS_BSPOPTS_HELP([PRINTK_MINOR],
634 +[Must be defined to be one of SCI1_MINOR or SCI2_MINOR. Determines which
635 + device is used for output by printk(). The printk port always uses polled
636 + I/O. Don't open the printk port from RTEMS unless also using polled I/O
637 + for the SCI ports.])
639 +# Explicitly list a Makefile here
640 +AC_CONFIG_FILES([Makefile])
642 +RTEMS_PPC_EXCEPTIONS
645 Index: rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c
646 ===================================================================
647 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
648 +++ rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c 2007-08-14 17:51:38.000000000 +0200
653 + * This file contains the Intec SS555 termios serial I/O package.
655 + * The SCI channels are assigned as follows
657 + * Channel Device Minor
661 + * All ports support termios. The use of termios is recommended for real-time
662 + * applications. Termios provides buffering and input processing. When not
663 + * using termios, processing is limited to the substitution of LF for CR on
664 + * input, and the output of a CR following the output of a LF character.
665 + * Note that the terminal should not send CR/LF pairs when the return key
666 + * is pressed, and that output lines are terminated with LF/CR, not CR/LF
667 + * (although that would be easy to change).
669 + * I/O may be interrupt-driven (recommended for real-time applications) or
674 + * It is not possible to use different I/O modes on the different ports. The
675 + * exception is with printk. The printk port can use a different mode from
676 + * the other ports. If this is done, it is important not to open the printk
677 + * port from an RTEMS application.
679 + * Currently, the I/O modes are determined at build time. It would be much
680 + * better to have the mode selected at boot time based on parameters in
683 + * Interrupt-driven I/O requires termios.
687 + * TO RUN THE TESTS, USE POLLED I/O WITHOUT TERMIOS SUPPORT. Some tests
688 + * play with the interrupt masks and turn off I/O. Those tests will hang
689 + * when interrupt-driven I/O is used. Other tests, such as cdtest, do I/O
690 + * from the static constructors before the console is open. This test
691 + * will not work with interrupt-driven I/O. Because of the buffering
692 + * performed in termios, test output may not be in sequence.The tests
693 + * should all be fixed to work with interrupt-driven I/O and to
694 + * produce output in the expected sequence. Obviously, the termios test
695 + * requires termios support in the driver.
697 + * Set CONSOLE_MINOR to the appropriate device minor number in the
698 + * config file. This allows the RTEMS application console to be different
699 + * from the GDB port.
701 + * This driver handles both available serial ports: it distinguishes
702 + * the sub-devices using minor device numbers. It is not possible to have
703 + * other protocols running on the other ports when this driver is used as
704 + * currently written.
707 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
708 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
710 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/console/console.c:
712 + * Based on code (alloc860.c in eth_comm port) by
713 + * Jay Monkman (jmonkman@frasca.com),
714 + * Copyright (C) 1998 by Frasca International, Inc.
716 + * Modifications by Darlene Stewart <Darlene.Stewart@iit.nrc.ca>
717 + * and Charles-Antoine Gauthier <charles.gauthier@iit.nrc.ca>.
718 + * Copyright (c) 2000, National Research Council of Canada
723 +#include <bsp.h> /* Must be before libio.h */
724 +#include <rtems/bspIo.h>
725 +#include <rtems/libio.h>
726 +#include <termios.h>
728 +static void _BSP_output_char( char c );
729 +static rtems_status_code do_poll_read( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
730 +static rtems_status_code do_poll_write( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
732 +static void _BSP_null_char( char c ) {return;}
734 +BSP_output_char_function_type BSP_output_char = _BSP_null_char;
739 + * Input characters through polled I/O. Returns as soon as a character has
740 + * been received. Otherwise, if we wait for the number of requested
741 + * characters, we could be here forever!
743 + * CR is converted to LF on input. The terminal should not send a CR/LF pair
744 + * when the return or enter key is pressed.
746 + * Input parameters:
747 + * major - ignored. Should be the major number for this driver.
748 + * minor - selected channel.
749 + * arg->buffer - where to put the received characters.
750 + * arg->count - number of characters to receive before returning--Ignored.
752 + * Output parameters:
753 + * arg->bytes_moved - the number of characters read. Always 1.
755 + * Return value: RTEMS_SUCCESSFUL
757 + * CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
759 +static rtems_status_code do_poll_read(
760 + rtems_device_major_number major,
761 + rtems_device_minor_number minor,
765 + rtems_libio_rw_args_t *rw_args = arg;
768 + while( (c = m5xx_uart_pollRead(minor)) == -1 );
769 + rw_args->buffer[0] = (uint8_t)c;
770 + if( rw_args->buffer[0] == '\r' )
771 + rw_args->buffer[0] = '\n';
772 + rw_args->bytes_moved = 1;
774 + return RTEMS_SUCCESSFUL;
780 + * Output characters through polled I/O. Returns only once every character has
783 + * CR is transmitted AFTER a LF on output.
785 + * Input parameters:
786 + * major - ignored. Should be the major number for this driver.
787 + * minor - selected channel
788 + * arg->buffer - where to get the characters to transmit.
789 + * arg->count - the number of characters to transmit before returning.
791 + * Output parameters:
792 + * arg->bytes_moved - the number of characters read
794 + * Return value: RTEMS_SUCCESSFUL
796 + * CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
798 +static rtems_status_code do_poll_write(
799 + rtems_device_major_number major,
800 + rtems_device_minor_number minor,
804 + rtems_libio_rw_args_t *rw_args = arg;
808 + for( i = 0; i < rw_args->count; i++ ) {
809 + m5xx_uart_pollWrite(minor, &(rw_args->buffer[i]), 1);
810 + if ( rw_args->buffer[i] == '\n' )
811 + m5xx_uart_pollWrite(minor, &cr, 1);
813 + rw_args->bytes_moved = i;
815 + return RTEMS_SUCCESSFUL;
819 + * Print functions prototyped in bspIo.h
822 +static void _BSP_output_char( char c )
827 + * Can't rely on console_initialize having been called before this
828 + * function is used, so it may fail.
831 + m5xx_uart_pollWrite( PRINTK_MINOR, &c, 1 );
833 + m5xx_uart_pollWrite( PRINTK_MINOR, &cr, 1 );
841 + * All these functions are prototyped in rtems/c/src/lib/include/console.h.
845 + * Initialize and register the device
847 +rtems_device_driver console_initialize(
848 + rtems_device_major_number major,
849 + rtems_device_minor_number minor,
853 + rtems_status_code status;
856 + * Set up TERMIOS if needed
858 + #if UARTS_USE_TERMIOS == 1
859 + rtems_termios_initialize ();
860 + #endif /* UARTS_USE_TERMIOS */
863 + * Do device-specific initialization
865 + BSP_output_char = _BSP_output_char;
867 + m5xx_uart_initialize(SCI1_MINOR);
868 + status = rtems_io_register_name ("/dev/tty0", major, SCI1_MINOR);
869 + if (status != RTEMS_SUCCESSFUL)
870 + rtems_fatal_error_occurred (status);
872 + m5xx_uart_initialize(SCI2_MINOR);
873 + status = rtems_io_register_name ("/dev/tty1", major, SCI2_MINOR);
874 + if (status != RTEMS_SUCCESSFUL)
875 + rtems_fatal_error_occurred (status);
877 + /* Now register the RTEMS console */
878 + status = rtems_io_register_name ("/dev/console", major, CONSOLE_MINOR);
879 + if (status != RTEMS_SUCCESSFUL)
880 + rtems_fatal_error_occurred (status);
882 + return RTEMS_SUCCESSFUL;
888 +rtems_device_driver console_open(
889 + rtems_device_major_number major,
890 + rtems_device_minor_number minor,
894 + rtems_status_code sc;
896 + if ( minor > NUM_PORTS - 1 )
897 + return RTEMS_INVALID_NUMBER;
899 + #if (UARTS_USE_TERMIOS == 1)
901 + #if (UARTS_IO_MODE == 1) /* RTEMS interrupt-driven I/O with termios */
903 + static const rtems_termios_callbacks callbacks = {
904 + m5xx_uart_firstOpen, /* firstOpen */
905 + m5xx_uart_lastClose, /* lastClose */
906 + NULL, /* pollRead */
907 + m5xx_uart_write, /* write */
908 + m5xx_uart_setAttributes, /* setAttributes */
909 + NULL, /* stopRemoteTx */
910 + NULL, /* startRemoteTx */
911 + TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */
913 + sc = rtems_termios_open( major, minor, arg, &callbacks );
915 + #else /* UARTS_IO_MODE != 1 */ /* RTEMS polled I/O with termios */
917 + static const rtems_termios_callbacks callbacks = {
918 + m5xx_uart_firstOpen, /* firstOpen */
919 + m5xx_uart_lastClose, /* lastClose */
920 + m5xx_uart_pollRead, /* pollRead */
921 + m5xx_uart_pollWrite, /* write */
922 + m5xx_uart_setAttributes, /* setAttributes */
923 + NULL, /* stopRemoteTx */
924 + NULL, /* startRemoteTx */
925 + TERMIOS_POLLED /* outputUsesInterrupts */
927 + sc = rtems_termios_open( major, minor, arg, &callbacks );
934 + #else /* no termios -- default to polled I/O */
936 + sc = RTEMS_SUCCESSFUL;
946 +rtems_device_driver console_close(
947 + rtems_device_major_number major,
948 + rtems_device_minor_number minor,
952 + if ( minor > NUM_PORTS-1 )
953 + return RTEMS_INVALID_NUMBER;
955 + #if UARTS_USE_TERMIOS == 1
956 + return rtems_termios_close( arg );
958 + return RTEMS_SUCCESSFUL;
963 + * Read from the device
965 +rtems_device_driver console_read(
966 + rtems_device_major_number major,
967 + rtems_device_minor_number minor,
971 + if ( minor > NUM_PORTS-1 )
972 + return RTEMS_INVALID_NUMBER;
974 + #if UARTS_USE_TERMIOS == 1
975 + return rtems_termios_read( arg );
977 + return do_poll_read( major, minor, arg );
982 + * Write to the device
984 +rtems_device_driver console_write(
985 + rtems_device_major_number major,
986 + rtems_device_minor_number minor,
990 + if ( minor > NUM_PORTS-1 )
991 + return RTEMS_INVALID_NUMBER;
993 + #if UARTS_USE_TERMIOS == 1
994 + return rtems_termios_write( arg );
996 + return do_poll_write( major, minor, arg );
1001 + * Handle ioctl request.
1003 +rtems_device_driver console_control(
1004 + rtems_device_major_number major,
1005 + rtems_device_minor_number minor,
1009 + if ( minor > NUM_PORTS-1 )
1010 + return RTEMS_INVALID_NUMBER;
1012 + #if UARTS_USE_TERMIOS == 1
1013 + return rtems_termios_ioctl( arg );
1015 + return RTEMS_SUCCESSFUL;
1018 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
1019 ===================================================================
1020 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1021 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h 2007-08-14 17:51:38.000000000 +0200
1025 + * This include file contains all board IO definitions.
1027 + * This file includes definitions for the Intec SS555.
1030 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1031 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1033 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h:
1035 + * COPYRIGHT (c) 1989-1998.
1036 + * On-Line Applications Research Corporation (OAR).
1038 + * The license and distribution terms for this file may be
1039 + * found in the file LICENSE in this distribution or at
1040 + * http://www.rtems.com/license/LICENSE.
1042 + * $Id: bsp.h,v 1.10 2006/03/17 10:11:37 ralf Exp $
1052 +#include <bspopts.h>
1055 +#include <rtems/console.h>
1056 +#include <rtems/clockdrv.h>
1057 +#include <mpc5xx.h>
1058 +#include <mpc5xx/console.h>
1059 +#include <libcpu/vectors.h>
1060 +#include <bsp/irq.h>
1063 + * Clock definitions
1066 +#define BSP_CRYSTAL_HZ 4000000 /* crystal frequency, Hz */
1067 +#define BSP_CLOCK_HZ 40000000 /* CPU clock frequency, Hz
1072 + * The SS555 board includes a CPLD to control on-board features and
1073 + * off-board devices.
1075 +typedef struct cpld_ {
1076 + uint8_t cs3a[32]; /* Chip select 3A */
1077 + uint8_t pad0[0x200000 - 0x000020];
1079 + uint8_t cs3b[32]; /* Chip select 3B */
1080 + uint8_t pad2[0x400000 - 0x200020];
1082 + uint8_t cs3c[32]; /* Chip select 3C */
1083 + uint8_t pad4[0x600000 - 0x400020];
1085 + uint8_t cs3d[32]; /* Chip select 3D */
1086 + uint8_t pad6[0x800000 - 0x600020];
1088 + uint8_t serial_ints; /* Enable/disable serial interrupts */
1089 + uint8_t serial_resets; /* Enable/disable serial resets */
1090 + uint8_t serial_ack; /* Acknowledge serial transfers */
1091 + uint8_t pad8[0xA00000 - 0x800003];
1093 + uint8_t iflash_writess; /* Enable/disable internal-flash writes */
1094 + uint8_t nflash_writess; /* Enable/disable NAND-flash writes */
1095 + uint8_t padA[0xC00000 - 0xA00002];
1098 +extern volatile cpld_t cpld; /* defined in linkcmds */
1100 +/* miscellaneous stuff assumed to exist */
1102 +extern rtems_configuration_table BSP_Configuration;
1105 + * Device Driver Table Entries
1109 + * NOTE: Use the standard Console driver entry
1113 + * NOTE: Use the standard Clock driver entry
1117 + * How many libio files we want
1120 +#define BSP_LIBIO_MAX_FDS 20
1124 +void bsp_cleanup( void );
1126 +rtems_isr_entry set_vector( /* returns old vector */
1127 + rtems_isr_entry handler, /* isr routine */
1128 + rtems_vector_number vector, /* vector number */
1129 + int type /* RTEMS or RAW intr */
1137 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
1138 ===================================================================
1139 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1140 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h 2007-08-14 17:51:38.000000000 +0200
1144 + * This include file has defines to represent the overhead associated
1145 + * with calling a particular directive from C. These are used in the
1146 + * Timing Test Suite to ignore the overhead required to pass arguments
1147 + * to directives. On some CPUs and/or target boards, this overhead
1148 + * is significant and makes it difficult to distinguish internal
1149 + * RTEMS execution time from that used to call the directive.
1150 + * This file should be updated after running the C overhead timing
1151 + * test. Once this update has been performed, the RTEMS Time Test
1152 + * Suite should be rebuilt to account for these overhead times in the
1155 + * NOTE: If these are all zero, then the times reported include
1156 + * all calling overhead including passing of arguments.
1158 + * COPYRIGHT (c) 1989-1998.
1159 + * On-Line Applications Research Corporation (OAR).
1161 + * The license and distribution terms for this file may be
1162 + * found in the file LICENSE in this distribution or at
1163 + * http://www.rtems.com/license/LICENSE.
1165 + * $Id: coverhd.h,v 1.2 2006/03/17 10:11:37 ralf Exp $
1168 +#ifndef __COVERHD_h
1169 +#define __COVERHD_h
1176 + * 40 MHz processor, running from external 2-1-1-1 burst SRAM.
1178 +#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
1179 +#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
1180 +#define CALLING_OVERHEAD_TASK_CREATE 0
1181 +#define CALLING_OVERHEAD_TASK_IDENT 0
1182 +#define CALLING_OVERHEAD_TASK_START 0
1183 +#define CALLING_OVERHEAD_TASK_RESTART 0
1184 +#define CALLING_OVERHEAD_TASK_DELETE 0
1185 +#define CALLING_OVERHEAD_TASK_SUSPEND 0
1186 +#define CALLING_OVERHEAD_TASK_RESUME 0
1187 +#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
1188 +#define CALLING_OVERHEAD_TASK_MODE 0
1189 +#define CALLING_OVERHEAD_TASK_GET_NOTE 0
1190 +#define CALLING_OVERHEAD_TASK_SET_NOTE 0
1191 +#define CALLING_OVERHEAD_TASK_WAKE_WHEN 2
1192 +#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
1193 +#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
1194 +#define CALLING_OVERHEAD_CLOCK_GET 2
1195 +#define CALLING_OVERHEAD_CLOCK_SET 3
1196 +#define CALLING_OVERHEAD_CLOCK_TICK 0
1198 +#define CALLING_OVERHEAD_TIMER_CREATE 0
1199 +#define CALLING_OVERHEAD_TIMER_IDENT 0
1200 +#define CALLING_OVERHEAD_TIMER_DELETE 0
1201 +#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
1202 +#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 3
1203 +#define CALLING_OVERHEAD_TIMER_RESET 0
1204 +#define CALLING_OVERHEAD_TIMER_CANCEL 0
1205 +#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
1206 +#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
1207 +#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
1208 +#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
1209 +#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
1210 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
1211 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
1212 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
1213 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
1214 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
1215 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
1216 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
1217 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
1219 +#define CALLING_OVERHEAD_EVENT_SEND 0
1220 +#define CALLING_OVERHEAD_EVENT_RECEIVE 0
1221 +#define CALLING_OVERHEAD_SIGNAL_CATCH 0
1222 +#define CALLING_OVERHEAD_SIGNAL_SEND 0
1223 +#define CALLING_OVERHEAD_PARTITION_CREATE 0
1224 +#define CALLING_OVERHEAD_PARTITION_IDENT 0
1225 +#define CALLING_OVERHEAD_PARTITION_DELETE 0
1226 +#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
1227 +#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
1228 +#define CALLING_OVERHEAD_REGION_CREATE 0
1229 +#define CALLING_OVERHEAD_REGION_IDENT 0
1230 +#define CALLING_OVERHEAD_REGION_DELETE 0
1231 +#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
1232 +#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
1233 +#define CALLING_OVERHEAD_PORT_CREATE 0
1234 +#define CALLING_OVERHEAD_PORT_IDENT 0
1235 +#define CALLING_OVERHEAD_PORT_DELETE 0
1236 +#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
1237 +#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
1239 +#define CALLING_OVERHEAD_IO_INITIALIZE 0
1240 +#define CALLING_OVERHEAD_IO_OPEN 0
1241 +#define CALLING_OVERHEAD_IO_CLOSE 0
1242 +#define CALLING_OVERHEAD_IO_READ 0
1243 +#define CALLING_OVERHEAD_IO_WRITE 0
1244 +#define CALLING_OVERHEAD_IO_CONTROL 0
1245 +#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
1246 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
1247 +#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
1248 +#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
1249 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
1250 +#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
1251 +#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
1258 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
1259 ===================================================================
1260 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1261 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h 2007-08-14 17:51:38.000000000 +0200
1266 + * The license and distribution terms for this file may be
1267 + * found in the file LICENSE in this distribution or at
1268 + * http://www.rtems.com/license/LICENSE.
1270 + * $Id: tm27.h,v 1.2 2004/04/23 04:47:38 ralf Exp $
1273 +#ifndef _RTEMS_TMTEST27
1274 +#error "This is an RTEMS internal file you must not include directly."
1281 + * Stuff for Time Test 27
1283 + * The following require that IRQ7 be jumpered to ground. On the SS555,
1284 + * this can be done by shorting together CN5 pin 48 and CN5 pin 50.
1287 +#define MUST_WAIT_FOR_INTERRUPT 1
1289 +#define Install_tm27_vector( handler ) \
1291 + extern rtems_irq_connect_data tm27IrqData; \
1292 + usiu.siel |= (1 << 17); \
1293 + usiu.sipend |= (1 << 17); \
1295 + tm27IrqData.hdl = (rtems_irq_hdl)handler; \
1296 + BSP_install_rtems_irq_handler (&tm27IrqData); \
1299 +#define Cause_tm27_intr() \
1301 + usiu.siel &= ~(1 << 17); \
1304 +#define Clear_tm27_intr() \
1306 + usiu.siel |= (1 << 17); \
1307 + usiu.sipend |= (1 << 17); \
1310 +#define Lower_tm27_intr() \
1312 + ppc_cached_irq_mask |= (1 << 17); \
1313 + usiu.simask = ppc_cached_irq_mask; \
1317 Index: rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
1318 ===================================================================
1319 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1320 +++ rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h 2007-08-14 17:51:38.000000000 +0200
1324 + * This include file describe the data structure and the functions implemented
1325 + * by rtems to write interrupt handlers.
1328 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1329 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1331 + * Derived from libbsp/powerpc/mbx8xx/irq/irq.h:
1333 + * CopyRight (C) 1999 valette@crf.canon.fr
1335 + * This code is heavilly inspired by the public specification of STREAM V2
1336 + * that can be found at :
1338 + * <http://www.chorus.com/Documentation/index.html> by following
1339 + * the STREAM API Specification Document link.
1341 + * The license and distribution terms for this file may be
1342 + * found in found in the file LICENSE in this distribution or at
1343 + * http://www.rtems.com/license/LICENSE.
1345 + * $Id: irq.h,v 1.2 2004/04/21 10:43:03 ralf Exp $
1348 +#ifndef LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1349 +#define LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1351 +#include <libcpu/irq.h>
1360 + * The SS555 has no external interrupt controller chip, so use the standard
1361 + * routines from the CPU-dependent code.
1363 +#define BSP_install_rtems_irq_handler(ptr) CPU_install_rtems_irq_handler(ptr)
1364 +#define BSP_get_current_rtems_irq_handler(ptr) CPU_get_current_rtems_irq_handler(ptr)
1365 +#define BSP_remove_rtems_irq_handler(ptr) CPU_remove_rtems_irq_handler(ptr)
1366 +#define BSP_rtems_irq_mngt_set(config) CPU_rtems_irq_mngt_set(config)
1367 +#define BSP_rtems_irq_mngt_get(config) CPU_rtems_irq_mngt_get(config)
1368 +#define BSP_rtems_irq_mng_init(cpuId) CPU_rtems_irq_mng_init(cpuId)
1376 +#endif /* LIBBSP_POWERPC_SS555_IRQ_IRQ_H */
1377 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
1378 ===================================================================
1379 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1380 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c 2007-08-14 17:51:38.000000000 +0200
1384 + * This set of routines starts the application. It includes application,
1385 + * board, and monitor specific initialization and configuration.
1386 + * The generic CPU dependent initialization has been performed
1387 + * before this routine is invoked.
1389 + * COPYRIGHT (c) 1989-1998.
1390 + * On-Line Applications Research Corporation (OAR).
1392 + * The license and distribution terms for this file may be
1393 + * found in the file LICENSE in this distribution or at
1394 + * http://www.rtems.com/license/LICENSE.
1396 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1397 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1399 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c:
1401 + * Modifications for MBX860:
1402 + * Copyright (c) 1999, National Research Council of Canada
1404 + * $Id: bspstart.c,v 1.7 2005/04/26 23:16:21 joel Exp $
1407 +#include <string.h>
1409 +#include <rtems/libio.h>
1410 +#include <rtems/libcsupport.h>
1411 +#include <rtems/bspIo.h>
1412 +#include <rtems/powerpc/powerpc.h>
1414 +#include <libcpu/cpuIdent.h>
1415 +#include <libcpu/spr.h>
1417 +#include <bsp/irq.h>
1424 + * The original table from the application (in ROM) and our copy of it with
1425 + * some changes. Configuration is defined in <confdefs.h>. Make sure that
1426 + * our configuration tables are uninitialized so that they get allocated in
1427 + * the .bss section (RAM).
1429 +extern rtems_configuration_table Configuration;
1430 +extern unsigned long intrStackPtr;
1431 +rtems_configuration_table BSP_Configuration;
1433 +rtems_cpu_table Cpu_table;
1435 +char *rtems_progname;
1438 + * Use the shared implementations of the following routines.
1439 + * Look in rtems/c/src/lib/libbsp/shared/bsppost.c and
1440 + * rtems/c/src/lib/libbsp/shared/bsplibc.c.
1442 +void bsp_postdriver_hook(void);
1443 +void bsp_libc_init( void *, uint32_t, int );
1445 +void BSP_panic(char *s)
1447 + printk("%s PANIC %s\n",_RTEMS_version, s);
1448 + __asm__ __volatile ("sc");
1451 +void _BSP_Fatal_error(unsigned int v)
1453 + printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
1454 + __asm__ __volatile ("sc");
1458 + * bsp_pretasking_hook
1460 + * Called when RTEMS initialization is complete but before interrupts and
1461 + * tasking are enabled. Used to setup libc and install any BSP extensions.
1463 + * Must not use libc (to do io) from here, since drivers are not yet
1466 + * Installed in the rtems_cpu_table defined in
1467 + * rtems/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h by main()
1468 + * below. Called from rtems_initialize_executive() defined in
1469 + * rtems/c/src/exec/sapi/src/init.c
1471 + * Input parameters: NONE
1473 + * Output parameters: NONE
1475 + * Return values: NONE
1477 +void bsp_pretasking_hook(void)
1480 + * These are assigned addresses in the linkcmds file for the BSP. This
1481 + * approach is better than having these defined as manifest constants and
1482 + * compiled into the kernel, but it is still not ideal when dealing with
1483 + * multiprocessor configuration in which each board as a different memory
1484 + * map. A better place for defining these symbols might be the makefiles.
1485 + * Consideration should also be given to developing an approach in which
1486 + * the kernel and the application can be linked and burned into ROM
1487 + * independently of each other.
1489 + uint8_t *_HeapStart =
1490 + (uint8_t *)BSP_Configuration.work_space_start
1491 + + BSP_Configuration.work_space_size;
1492 + extern uint8_t _HeapEnd[];
1494 + bsp_libc_init( _HeapStart, _HeapEnd - _HeapStart, 0 );
1497 + rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
1504 + * Board-specific initialization code. Called from the generic boot_card()
1505 + * function defined in rtems/c/src/lib/libbsp/shared/main.c. That function
1506 + * does some of the board independent initialization. It is called from the
1507 + * SS555 entry point _start() defined in
1508 + * rtems/c/src/lib/libbsp/powerpc/ss555/startup/start.S
1510 + * _start() has set up a stack, has zeroed the .bss section, has set up the
1511 + * .data section from contents stored in ROM, has turned off interrupts,
1512 + * and placed the processor in the supervisor mode. boot_card() has left
1513 + * the processor in that state when bsp_start() was called.
1515 + * Input parameters: NONE
1517 + * Output parameters: NONE
1519 + * Return values: NONE
1521 +void bsp_start(void)
1523 + extern char _WorkspaceBase[];
1525 + ppc_cpu_id_t myCpu;
1526 + ppc_cpu_revision_t myCpuRevision;
1527 + register unsigned char* intrStack;
1530 + * Get CPU identification dynamically. Note that the get_ppc_cpu_type()
1531 + * function stores the result in global variables so that it can be used
1534 + myCpu = get_ppc_cpu_type();
1535 + myCpuRevision = get_ppc_cpu_revision();
1538 + * Initialize some SPRG registers related to irq handling
1540 + intrStack = (((unsigned char*)&intrStackPtr) - PPC_MINIMUM_STACK_FRAME_SIZE);
1541 + _write_SPRG1((unsigned int)intrStack);
1542 + /* signal them that we have fixed PR288 - eventually, this should go away */
1543 + _write_SPRG0(PPC_BSP_HAS_FIXED_PR288);
1546 + * Install our own set of exception vectors
1548 + initialize_exceptions();
1551 + * Allocate the memory for the RTEMS Work Space. This can come from
1552 + * a variety of places: hard coded address, malloc'ed from outside
1553 + * RTEMS world (e.g. simulator or primitive memory manager), or (as
1554 + * typically done by stock BSPs) by subtracting the required amount
1555 + * of work space from the last physical address on the CPU board.
1557 + * In this case, the memory is not malloc'ed. It is just
1558 + * "pulled from the air".
1560 + BSP_Configuration.work_space_start = _WorkspaceBase;
1563 + * initialize the CPU table for this BSP
1565 + Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
1566 + Cpu_table.postdriver_hook = bsp_postdriver_hook;
1567 + if( Cpu_table.interrupt_stack_size < 4 * 1024 )
1568 + Cpu_table.interrupt_stack_size = 4 * 1024;
1570 + Cpu_table.clicks_per_usec = BSP_CRYSTAL_HZ / 4 / 1000000;
1571 + Cpu_table.clock_speed = BSP_CLOCK_HZ; /* for SCI baud rate generator */
1574 + * Call this in case we use TERMIOS for console I/O
1576 + m5xx_uart_reserve_resources( &BSP_Configuration );
1579 + * Initalize RTEMS IRQ system
1581 + BSP_rtems_irq_mng_init(0);
1583 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
1584 ===================================================================
1585 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1586 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c 2007-08-14 17:51:38.000000000 +0200
1591 + * Intec SS555 initialization routines.
1593 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1594 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1596 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c:
1598 + * Copyright (c) 1999, National Research Council of Canada
1600 + * The license and distribution terms for this file may be
1601 + * found in the file LICENSE in this distribution or at
1602 + * http://www.rtems.com/license/LICENSE.
1617 + * Initialize SS555
1619 +void _InitSS555 (void)
1621 + register uint32_t plprcr, msr;
1624 + * Initialize the System Protection Control Register (SYPCR).
1625 + * The SYPCR can only be written once after Reset.
1628 + USIU_SYPCR_SWTC(WATCHDOG_TIMEOUT) /* set watchdog timeout */
1629 + | USIU_SYPCR_BMT(0xFF) /* set bus monitor timeout */
1630 + | USIU_SYPCR_BME /* enable bus monitor */
1631 + | USIU_SYPCR_SWF /* watchdog halted in freeze */
1632 +#if WATCHDOG_TIMEOUT != 0xFFFF
1633 + | USIU_SYPCR_SWE /* enable watchdog */
1635 + | USIU_SYPCR_SWRI /* watchdog forces reset */
1636 + | USIU_SYPCR_SWP; /* prescale watchdog by 2048 */
1638 + TICKLE_WATCHDOG(); /* restart watchdog timer */
1641 + * Re-tune the PLL to the desired system clock frequency.
1643 + usiu.plprck = USIU_UNLOCK_KEY; /* unlock PLPRCR */
1645 + USIU_PLPRCR_TEXPS /* assert TEXP always */
1646 + | USIU_PLPRCR_MF(BSP_CLOCK_HZ / BSP_CRYSTAL_HZ);
1647 + /* PLL multiplication factor */
1648 + usiu.plprck = 0; /* lock PLPRCR */
1650 + while (((plprcr = usiu.plprcr) & USIU_PLPRCR_SPLS) == 0)
1651 + ; /* wait for PLL to re-lock */
1654 + * Enable the timebase and decrementer, then initialize decrementer
1655 + * register to a large value to guarantee that a decrementer interrupt
1656 + * will not be generated before the kernel is fully initialized.
1657 + * Initialize the timebase register to zero.
1659 + usiu.tbscrk = USIU_UNLOCK_KEY;
1660 + usiu.tbscr |= USIU_TBSCR_TBE; /* enable time base and decrementer */
1663 + usiu.tbk = USIU_UNLOCK_KEY;
1664 + _write_DEC(0x7FFFFFFF);
1665 + _write_TBWU(0x00000000 );
1666 + _write_TBWL(0x00000000 );
1670 + * Run the Inter-Module Bus at full speed.
1672 + imb.uimb.umcr &= ~UIMB_UMCR_HSPEED;
1675 + * Initialize Memory Controller for External RAM
1677 + * Initialize the Base and Option Registers (BR0-BR7 and OR0-OR7). Note
1678 + * that for all chip selects, ORx should be programmed before BRx.
1680 + * If booting from internal flash ROM, configure the external RAM to
1681 + * extend the internal RAM. If booting from external RAM, leave it at
1682 + * zero but set it up appropriately.
1684 + extern char int_ram_top[]; /* top of internal ram */
1686 + usiu.memc[0]._or =
1687 + USIU_MEMC_OR_512K /* bank size */
1688 + | USIU_MEMC_OR_SCY(0) /* wait states in first beat of burst */
1689 + | USIU_MEMC_OR_BSCY(0); /* wait states in subsequent beats */
1691 + usiu.memc[0]._br =
1692 + USIU_MEMC_BR_BA(_read_IMMR() & IMMR_FLEN
1693 + ? (uint32_t)int_ram_top : 0) /* base address */
1694 + | USIU_MEMC_BR_PS32 /* 32-bit data bus */
1695 + | USIU_MEMC_BR_TBDIP /* toggle bdip */
1696 + | USIU_MEMC_BR_V; /* base register valid */
1699 + * Initialize Memory Controller for External CPLD
1701 + * The SS555 board includes a CPLD to control on-board features and
1702 + * off-board devices. (Configuration taken from Intec's hwhook.c)
1704 + usiu.memc[3]._or =
1705 + USIU_MEMC_OR_16M /* bank size */
1706 + | USIU_MEMC_OR_CSNT /* negate CS/WE early */
1707 + | USIU_MEMC_OR_ACS_HALF /* assert CS half cycle after address */
1708 + | USIU_MEMC_OR_SCY(15) /* wait states in first beat of burst */
1709 + | USIU_MEMC_OR_TRLX; /* relaxed timing */
1711 + usiu.memc[3]._br =
1712 + USIU_MEMC_BR_BA(&cpld) /* base address */
1713 + | USIU_MEMC_BR_PS16 /* 16-bit data bus */
1714 + | USIU_MEMC_BR_BI /* inhibit bursting */
1715 + | USIU_MEMC_BR_V; /* base register valid */
1718 + * Disable show cycles and serialization so that burst accesses will work
1719 + * properly. A different value, such as 0x0, may be more appropriate for
1720 + * debugging, but can be set with the debugger, if needed.
1722 + _write_ICTRL(0x00000007);
1725 + * Set up Burst Buffer Controller (BBC)
1728 + BBCMCR_ETRE /* enable exception relocation */
1729 + | BBCMCR_BE); /* enable burst accesses */
1732 + _CPU_MSR_GET(msr);
1733 + msr |= MSR_IP; /* set prefix for exception relocation */
1734 + _CPU_MSR_SET(msr);
1736 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
1737 ===================================================================
1738 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1739 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds 2007-08-14 17:51:38.000000000 +0200
1742 + * Linker command file for Intec SS555 board
1744 + * When debugging, we assume that the internal flash ROM will be replaced by
1745 + * the external RAM on the SS555 board. All sections are stacked starting
1746 + * at address zero. Nothing is placed in the internal RAM, since it's not
1747 + * contiguous with the external SRAM when the external RAM is placed at
1750 + * For final production, we assume that the .text section will be burned
1751 + * into flash ROM starting at address zero. The .data, .bss, heap, and
1752 + * workspace will reside in RAM, starting at the beginning of the internal
1753 + * RAM. The system startup code will configure the external RAM to begin
1754 + * where the internal RAM ends, so as to make one large RAM block.
1756 + * Debugging mode is chosen when the RTEMS_DEBUG symbol is defined. The
1757 + * RTEMS_DEBUG symbol is defined in the bsp_specs file whenever make(1) is
1758 + * invoked with VARIANT=DEBUG.
1760 + * $Id: linkcmds,v 1.3 2006/03/08 18:50:12 joel Exp $
1763 +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
1764 +OUTPUT_ARCH(powerpc)
1767 +int_ram_org = 0x003F9800; /* base of internal RAM */
1768 +int_ram_top = 0x00400000; /* top of internal RAM */
1769 +ext_ram_size = 0x00080000; /* size of external RAM */
1777 + * For the MPC555, we use the compressed vector table format which puts
1778 + * all of the exception vectors before 0x100.
1785 + /* Read-only sections, merged into text segment: */
1789 + /* Entry point is the .entry section */
1796 + /* C++ constructors/destructors */
1797 + *(.gnu.linkonce.t*)
1799 + /* Initialization and finalization code.
1801 + * Various files can provide initialization and finalization functions.
1802 + * The bodies of these functions are in .init and .fini sections. We
1803 + * accumulate the bodies here, and prepend function prologues from
1804 + * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
1805 + * first; ecrtn.o must be linked last. Because these are wildcards, it
1806 + * doesn't matter if the user does not actually link against ecrti.o and
1807 + * ecrtn.o; the linker won't look for a file to match a wildcard. The
1808 + * wildcard also means that it doesn't matter which directory ecrti.o
1809 + * and ecrtn.o are in.
1811 + PROVIDE (_init = .);
1816 + PROVIDE (_fini = .);
1822 + * C++ constructors and destructors for static objects.
1823 + * PowerPC EABI does not use crtstuff yet, so we build "old-style"
1824 + * constructor and destructor lists that begin with the list length
1825 + * end terminate with a NULL entry.
1827 + PROVIDE (__CTOR_LIST__ = .);
1828 + /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
1829 + *crtbegin.o(.ctors)
1833 + PROVIDE (__CTOR_END__ = .);
1835 + PROVIDE (__DTOR_LIST__ = .);
1836 + /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
1837 + *crtbegin.o(.dtors)
1841 + PROVIDE (__DTOR_END__ = .);
1844 + * Special FreeBSD sysctl sections.
1847 + __start_set_sysctl_set = .;
1849 + __stop_set_sysctl_set = ABSOLUTE(.);
1853 + /* Exception frame info */
1856 + /* Miscellaneous read-only data */
1857 + _rodata_start = . ;
1858 + *(.gnu.linkonce.r*)
1868 + /* Various possible names for the end of the .text section */
1869 + etext = ALIGN(0x10);
1873 + PROVIDE (etext = .);
1874 + PROVIDE (__etext = .);
1877 + * .data section contents, copied to RAM at system startup.
1880 + data.contents.start = .;
1882 + text.size = text.end - text.start;
1885 + * If debugging, stack the read/write sections directly after the text
1886 + * section. Otherwise, stack the read/write sections starting at base of
1889 + . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org;
1891 + .data : AT (data.contents.start)
1899 + PROVIDE (__SDATA_START__ = .);
1901 + *(.gnu.linkonce.d*)
1902 + *(.gnu.linkonce.s.*)
1903 + PROVIDE (__SDATA_END__ = .);
1905 + PROVIDE (__EXCEPT_START__ = .);
1906 + *(.gcc_except_table)
1907 + PROVIDE (__EXCEPT_END__ = .);
1909 + PROVIDE(__GOT_START__ = .);
1912 + PROVIDE(__GOT_END__ = .);
1916 + PROVIDE (__GOT2_START__ = .);
1917 + PROVIDE (_GOT2_START_ = .);
1919 + PROVIDE (__GOT2_END__ = .);
1920 + PROVIDE (_GOT2_END_ = .);
1922 + PROVIDE (__FIXUP_START__ = .);
1923 + PROVIDE (_FIXUP_START_ = .);
1925 + PROVIDE (_FIXUP_END_ = .);
1926 + PROVIDE (__FIXUP_END__ = .);
1928 + /* We want the small data sections together, so single-instruction
1929 + * offsets can access them all.
1931 + PROVIDE (__SDATA2_START__ = .);
1933 + *(.gnu.linkonce.s2.*)
1934 + PROVIDE (__SDATA2_END__ = .);
1938 + data.size = data.end - data.start;
1944 + PROVIDE (__SBSS2_START__ = .);
1946 + PROVIDE (__SBSS2_END__ = .);
1948 + PROVIDE (__SBSS_START__ = .);
1950 + PROVIDE (__SBSS_END__ = .);
1952 + *(.bss .bss* .gnu.linkonce.b*)
1958 + bss.size = bss.end - bss.start;
1960 + PROVIDE(_end = bss.end);
1963 + * Initialization stack
1965 + InitStack_start = ALIGN(0x10);
1968 + PROVIDE(initStackPtr = initStack);
1973 + IntrStack_start = ALIGN(0x10);
1976 + PROVIDE(intrStackPtr = intrStack);
1978 + _WorkspaceBase = .;
1979 + __WorkspaceBase = .;
1984 + * The heap is configured at run-time to use all available memory. It
1985 + * begins just after the end of the Workspace and continues to the end of
1986 + * the external RAM.
1988 + . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size;
1994 + * Internal I/O devices
1996 + .usiu 0x002FC000: /* unified system interface unit */
2001 + .imb 0x00300000: /* inter-module bus and devices */
2006 + .sram 0x00380000: /* internal SRAM control registers */
2012 + * SS555 external devices managed by on-board CPLD
2014 + .cpld 0xFF000000: /* SS555 external CPLD devices */
2020 + /* Stabs debugging sections. */
2021 + .stab 0 : { *(.stab) }
2022 + .stabstr 0 : { *(.stabstr) }
2023 + .stab.excl 0 : { *(.stab.excl) }
2024 + .stab.exclstr 0 : { *(.stab.exclstr) }
2025 + .stab.index 0 : { *(.stab.index) }
2026 + .stab.indexstr 0 : { *(.stab.indexstr) }
2027 + .comment 0 : { *(.comment) }
2029 + /* DWARF debug sections.
2030 + Symbols in the DWARF debugging sections are relative to the beginning
2031 + of the section so we begin them at 0. */
2033 + .debug 0 : { *(.debug) }
2034 + .line 0 : { *(.line) }
2036 + /* GNU DWARF 1 extensions */
2037 + .debug_srcinfo 0 : { *(.debug_srcinfo) }
2038 + .debug_sfnames 0 : { *(.debug_sfnames) }
2040 + /* DWARF 1.1 and DWARF 2 */
2041 + .debug_aranges 0 : { *(.debug_aranges) }
2042 + .debug_pubnames 0 : { *(.debug_pubnames) }
2045 + .debug_info 0 : { *(.debug_info) }
2046 + .debug_abbrev 0 : { *(.debug_abbrev) }
2047 + .debug_line 0 : { *(.debug_line) }
2048 + .debug_frame 0 : { *(.debug_frame) }
2049 + .debug_str 0 : { *(.debug_str) }
2050 + .debug_loc 0 : { *(.debug_loc) }
2051 + .debug_macinfo 0 : { *(.debug_macinfo) }
2053 + /* SGI/MIPS DWARF 2 extensions */
2054 + .debug_weaknames 0 : { *(.debug_weaknames) }
2055 + .debug_funcnames 0 : { *(.debug_funcnames) }
2056 + .debug_typenames 0 : { *(.debug_typenames) }
2057 + .debug_varnames 0 : { *(.debug_varnames) }
2058 + /* These must appear regardless of . */
2060 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S
2061 ===================================================================
2062 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2063 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S 2007-08-14 17:51:38.000000000 +0200
2067 + * This file contains the entry veneer for RTEMS programs on the Intec
2068 + * SS555 board. It jumps to the BSP which is responsible for performing
2069 + * all remaining initialization.
2071 + * This file is based on several others:
2073 + * (1) start360.s from the gen68360 BSP by
2074 + * W. Eric Norum (eric@skatter.usask.ca)
2075 + * with the following copyright and license:
2077 + * COPYRIGHT (c) 1989-1998.
2078 + * On-Line Applications Research Corporation (OAR).
2080 + * The license and distribution terms for this file may in
2081 + * the file LICENSE in this distribution or at
2082 + * http://www.rtems.com/license/LICENSE.
2084 + * (2) start.s for the eth_comm port by
2085 + * Jay Monkman (jmonkman@fracsa.com),
2086 + * which itself is based on the
2088 + * (3) dlentry.s for the Papyrus BSP, written by:
2089 + * Andrew Bray <andy@i-cubed.co.uk>
2090 + * with the following copyright and license:
2092 + * COPYRIGHT (c) 1995 by i-cubed ltd.
2094 + * (4) start860.S for the MBX821/MBX860, written by:
2095 + * Darlene A. Stewart <darlene.stewart@iit.nrc.ca>
2096 + * Copyright (c) 1999, National Research Council of Canada
2098 + * To anyone who acknowledges that this file is provided "AS IS"
2099 + * without any express or implied warranty:
2100 + * permission to use, copy, modify, and distribute this file
2101 + * for any purpose is hereby granted without fee, provided that
2102 + * the above copyright notice and this notice appears in all
2103 + * copies, and that the name of i-cubed limited not be used in
2104 + * advertising or publicity pertaining to distribution of the
2105 + * software without specific, written prior permission.
2106 + * i-cubed limited makes no representations about the suitability
2107 + * of this software for any purpose.
2109 + * (5) Modifications (for MBX8xx) of respective RTEMS files:
2110 + * Copyright (c) 1999, National Research Council of Canada
2112 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
2113 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
2116 +#include <rtems/asm.h>
2117 +#include <rtems/powerpc/registers.h>
2120 + * The initial stack is set to the top of the internal RAM.
2122 + * All the entry veneer has to do is to clear the .bss section and copy the
2123 + * initializers into the .data section.
2127 + * GDB likes to have debugging information for the entry veneer.
2128 + * Play compiler and provide some DWARF information.
2130 + * CHANGE TO SUIT YOUR SETUP!
2133 + .section .entry,"ax",@progbits
2138 +.section .debug_sfnames
2140 + .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2149 + .4byte .L_line_e-.L_line_b
2155 + .4byte .L_text_e-.L_text_b
2159 +.section .debug_srcinfo
2162 + .4byte .L_sfnames_b
2166 + .4byte .L_LE1-.L_line_b
2167 + .4byte .L_F0-.L_sfnames_b
2168 + .4byte .L_line_last-.L_line_b
2172 +.section .debug_pubnames
2181 +.section .debug_aranges
2184 + .4byte .L_text_e-.L_text_b
2198 + .4byte .L_D1_e-.L_D1
2199 + .2byte 0x11 /* TAG_compile_unit */
2200 + .2byte 0x12 /* AT_sibling */
2202 + .2byte 0x38 /* AT_name */
2205 + .2byte 0x258 /* AT_producer */
2208 + .2byte 0x111 /* AT_low_pc */
2210 + .2byte 0x121 /* AT_high_pc */
2212 + .2byte 0x106 /* AT_stmt_list */
2214 + .2byte 0x1b8 /* AT_comp_dir */
2215 + .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2217 + .2byte 0x8006 /* AT_sf_names */
2218 + .4byte .L_sfnames_b
2219 + .2byte 0x8016 /* AT_src_info */
2220 + .4byte .L_srcinfo_b
2224 + .4byte .L_D3_e-.L_D3
2225 + .2byte 0x6 /* TAG_global_subroutine */
2226 + .2byte 0x12 /* AT_sibling */
2228 + .2byte 0x38 /* AT_name */
2231 + .2byte 0x278 /* AT_prototyped */
2233 + .2byte 0x111 /* AT_low_pc */
2235 + .2byte 0x121 /* AT_high_pc */
2237 + .2byte 0x8041 /* AT_body_begin */
2239 + .2byte 0x8051 /* AT_body_end */
2244 + .4byte .L_D4_e-.L_D4
2251 + * Tell C's eabi-ctor's that we have an atexit function,
2252 + * and that it is to register __do_global_dtors.
2254 + EXTERN_PROC(atexit)
2255 + PUBLIC_VAR(__atexit)
2256 + .section ".sdata","aw"
2259 + EXT_PROC_REF(atexit)@fixup
2262 + .section ".fixup","aw"
2264 + EXT_SYM_REF(__atexit)
2267 +/* That should do it */
2270 + * Put the entry point in its own section. That way, we can guarantee
2271 + * to put it first in the .text section in the linker script.
2275 + PUBLIC_VAR (start)
2277 + bl .startup /* or bl .spin */
2281 + * Parameters from linker
2284 + .long initStackPtr
2287 + .long __GOT_START__
2299 + .long data.contents.start
2301 +PUBLIC_VAR (text_addr)
2305 +PUBLIC_VAR (text_length)
2310 + * Spin, if necessary, to acquire control from debugger (CodeWarrior).
2316 + lwz r3, spin@l(r3)
2321 + * Initialization code
2324 + /* Capture address of linker parameters. */
2327 + /* Set initial stack pointer to end of internal RAM - 56. */
2328 + lwz r1, stack_top-base_addr(r3)
2331 + /* Initialize essential registers. */
2334 + /* Set TOC pointer */
2335 + lwz r2, toc_pointer-base_addr(r3)
2337 + /* Initialize the memory mapped MPC555 registers (done in C). */
2338 + EXTERN_PROC (_InitSS555)
2339 + bl PROC (_InitSS555)
2341 + /* Clear the .bss section. */
2344 + /* Copy initializers into the .data section */
2347 + /* Enable floating point, since gcc sometimes uses the floating
2348 + * point registers for data moves, even if the C source code doesn't
2349 + * include floating point operations.
2352 + ori r0, r0, MSR_FP
2355 + /* Start system. */
2356 + lis r5, environ@ha
2357 + la r5,environ@l(r5) /* environp */
2358 + li r4, 0 /* argv */
2359 + li r3, 0 /* argc */
2360 + EXTERN_PROC (boot_card)
2361 + bl PROC (boot_card) /* call the first C routine */
2363 + /* We should never return from boot_card, but in case we do ... */
2364 + /* The next instructions are dependent on your runtime environment. */
2370 + * datacopy - copy initializers into .data section
2373 + lis r3, base_addr@ha /* point to linker data */
2374 + addi r3, r3, base_addr@l
2376 + lwz r4, contents_addr-base_addr(r3) /* .data contents in ROM */
2377 + lwz r5, data_addr-base_addr(r3) /* .data section in RAM */
2378 + lwz r6, data_length-base_addr(r3) /* length of .data */
2380 + rlwinm. r6, r6, 30, 0x3FFFFFFF /* form length / 4 */
2381 + beqlr /* no .data - return */
2383 + mtctr r6 /* set ctr reg */
2385 + lwz r6, 0(r4) /* get word */
2386 + stw r6, 0(r5) /* store word */
2387 + addi r4, r4, 0x4 /* next source */
2388 + addi r5, r5, 0x4 /* next target */
2389 + bdnz dc1 /* dec counter and loop */
2394 + * bssclr - zero out bss
2397 + lis r3, base_addr@ha /* point to linker data */
2398 + addi r3, r3, base_addr@l
2400 + lwz r4, bss_addr-base_addr(r3) /* Start of bss */
2401 + lwz r5, bss_length-base_addr(r3) /* Length of bss */
2403 + rlwinm. r5, r5, 30, 0x3FFFFFFF /* form length/4 */
2404 + beqlr /* no bss - return */
2406 + mtctr r5 /* set ctr reg */
2407 + li r5, 0x0000 /* r5 = 0 */
2409 + stw r5, 0(r4) /* store r6 */
2410 + addi r4, r4, 0x4 /* update r4 */
2411 + bdnz clear_bss /* dec counter and loop */
2417 + * Initialize the MSR and basic core PowerPC registers
2424 + * Set the processor for big-endian mode, exceptions vectored to
2425 + * 0x000n_nnnn, no execution tracing, machine check exceptions
2426 + * enabled, floating-point not available, supervisor priviledge
2427 + * level, external interrupts disabled, power management disabled
2428 + * (normal operation mode).
2430 + li r0, 0x1000 /* MSR_ME */
2431 + mtmsr r0 /* Context-synchronizing */
2435 + * Clear the exception handling registers.
2476 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
2477 ===================================================================
2478 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2479 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c 2007-08-14 17:51:38.000000000 +0200
2482 + * Support routines for TM27
2484 + * $Id: tm27supp.c,v 1.1 2004/04/21 20:24:36 joel Exp $
2502 +rtems_irq_connect_data tm27IrqData = {
2503 + CPU_USIU_EXT_IRQ_7,
2505 + (rtems_irq_enable)tm27On,
2506 + (rtems_irq_disable)tm27Off,
2507 + (rtems_irq_is_enabled)tm27IsOn
2510 Index: rtems/c/src/lib/libbsp/powerpc/ec555/times
2511 ===================================================================
2512 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2513 +++ rtems/c/src/lib/libbsp/powerpc/ec555/times 2007-08-14 17:51:38.000000000 +0200
2516 +# Timing Test Suite Results for the Intec SS555
2518 +# $Id: times,v 1.1 2004/04/12 21:52:13 joel Exp $
2523 +Clock Speed: 40 MHz
2524 +Memory Configuration: 512k external 2-1-1-1 SRAM
2527 +Times Reported in: microseconds
2528 +Timer Source: Timebase register (TMBCLK = (4 MHz crystal / 4) = 1.0 Mhz)
2531 +== ================================================================= ==== ====
2533 + 1 rtems_semaphore_create 21
2534 + rtems_semaphore_delete 22
2535 + rtems_semaphore_obtain: available 7
2536 + rtems_semaphore_obtain: not available -- NO_WAIT 7
2537 + rtems_semaphore_release: no waiting tasks 18
2539 + 2 rtems_semaphore_obtain: not available -- caller blocks 50
2541 + 3 rtems_semaphore_release: task readied -- preempts caller 41
2543 + 4 rtems_task_restart: blocked task -- preempts caller 69
2544 + rtems_task_restart: ready task -- preempts caller 67
2545 + rtems_semaphore_release: task readied -- returns to caller 23
2546 + rtems_task_create 75
2547 + rtems_task_start 30
2548 + rtems_task_restart: suspended task -- returns to caller 37
2549 + rtems_task_delete: suspended task 68
2550 + rtems_task_restart: ready task -- returns to caller 38
2551 + rtems_task_restart: blocked task -- returns to caller 44
2552 + rtems_task_delete: blocked task 70
2554 + 5 rtems_task_suspend: calling task 40
2555 + rtems_task_resume: task readied -- preempts caller 35
2557 + 6 rtems_task_restart: calling task 46
2558 + rtems_task_suspend: returns to caller 16
2559 + rtems_task_resume: task readied -- returns to caller 18
2560 + rtems_task_delete: ready task 71
2562 + 7 rtems_task_restart: suspended task -- preempts caller 64
2564 + 8 rtems_task_set_priority: obtain current priority 13
2565 + rtems_task_set_priority: returns to caller 24
2566 + rtems_task_mode: obtain current mode 4
2567 + rtems_task_mode: no reschedule 5
2568 + rtems_task_mode: reschedule -- returns to caller 7
2569 + rtems_task_mode: reschedule -- preempts caller 37
2570 + rtems_task_set_note 13
2571 + rtems_task_get_note 13
2572 + rtems_clock_set 27
2575 + 9 rtems_message_queue_create 34
2576 + rtems_message_queue_send: no waiting tasks 26
2577 + rtems_message_queue_urgent: no waiting tasks 26
2578 + rtems_message_queue_receive: available 24
2579 + rtems_message_queue_flush: no messages flushed 12
2580 + rtems_message_queue_flush: messages flushed 15
2581 + rtems_message_queue_delete 26
2583 +10 rtems_message_queue_receive: not available -- NO_WAIT 15
2584 + rtems_message_queue_receive: not available -- caller blocks 52
2586 +11 rtems_message_queue_send: task readied -- preempts caller 47
2588 +12 rtems_message_queue_send: task readied -- returns to caller 29
2590 +13 rtems_message_queue_urgent: task readied -- preempts caller 46
2592 +14 rtems_message_queue_urgent: task readied -- returns to caller 29
2594 +15 rtems_event_receive: obtain current events 1
2595 + rtems_event_receive: not available -- NO_WAIT 12
2596 + rtems_event_receive: not available -- caller blocks 44
2597 + rtems_event_send: no task readied 13
2598 + rtems_event_receive: available 13
2599 + rtems_event_send: task readied -- returns to caller 21
2601 +16 rtems_event_send: task readied -- preempts caller 41
2603 +17 rtems_task_set_priority: preempts caller 49
2605 +18 rtems_task_delete: calling task 95
2607 +19 rtems_signal_catch 10
2608 + rtems_signal_send: returns to caller 15
2609 + rtems_signal_send: signal to self 20
2610 + exit ASR overhead: returns to calling task 15
2611 + exit ASR overhead: returns to preempting task 30
2613 +20 rtems_partition_create 25
2614 + rtems_region_create 38
2615 + rtems_partition_get_buffer: available 14
2616 + rtems_partition_get_buffer: not available 13
2617 + rtems_partition_return_buffer 15
2618 + rtems_partition_delete 16
2619 + rtems_region_get_segment: available 34
2620 + rtems_region_get_segment: not available -- NO_WAIT 32
2621 + rtems_region_return_segment: no waiting tasks 33
2622 + rtems_region_get_segment: not available -- caller blocks 68
2623 + rtems_region_return_segment: task readied -- preempts caller 67
2624 + rtems_region_return_segment: task readied -- returns to caller 48
2625 + rtems_region_delete 30
2626 + rtems_io_initialize 2
2631 + rtems_io_control 1
2633 +21 rtems_task_ident 25
2634 + rtems_message_queue_ident 22
2635 + rtems_semaphore_ident 29
2636 + rtems_partition_ident 22
2637 + rtems_region_ident 24
2638 + rtems_port_ident 22
2639 + rtems_timer_ident 22
2640 + rtems_rate_monotonic_ident 22
2642 +22 rtems_message_queue_broadcast: task readied -- returns to caller 33
2643 + rtems_message_queue_broadcast: no waiting tasks 20
2644 + rtems_message_queue_broadcast: task readied -- preempts caller 50
2646 +23 rtems_timer_create 13
2647 + rtems_timer_fire_after: inactive 22
2648 + rtems_timer_fire_after: active 24
2649 + rtems_timer_cancel: active 13
2650 + rtems_timer_cancel: inactive 12
2651 + rtems_timer_reset: inactive 21
2652 + rtems_timer_reset: active 22
2653 + rtems_timer_fire_when: inactive 26
2654 + rtems_timer_fire_when: active 26
2655 + rtems_timer_delete: active 18
2656 + rtems_timer_delete: inactive 16
2657 + rtems_task_wake_when 49
2659 +24 rtems_task_wake_after: yield -- returns to caller 10
2660 + rtems_task_wake_after: yields -- preempts caller 36
2662 +25 rtems_clock_tick 8
2667 + _Thread_Disable_dispatch 1
2668 + _Thread_Enable_dispatch 7
2669 + _Thread_Set_state 7
2670 + _Thread_Disptach (NO FP) 32
2671 + context switch: no floating point contexts 25
2672 + context switch: self 11
2673 + context switch: to another task 12
2674 + fp context switch: restore 1st FP task 37
2675 + fp context switch: save idle, restore initialized 34
2676 + fp context switch: save idle, restore idle 48
2677 + fp context switch: save initialized, restore initialized 34
2683 + _Thread_Get: invalid id 1
2685 +27 interrupt entry overhead: returns to interrupted task 13
2686 + interrupt exit overhead: returns to interrupted task 11
2687 + interrupt entry overhead: returns to nested interrupt 12
2688 + interrupt exit overhead: returns to nested interrupt 10
2689 + interrupt entry overhead: returns to preempting task 12
2690 + interrupt exit overhead: returns to preempting task 38
2692 +28 rtems_port_create 16
2693 + rtems_port_external_to_internal 11
2694 + rtems_port_internal_to_external 11
2695 + rtems_port_delete 16
2697 +29 rtems_rate_monotonic_create 15
2698 + rtems_rate_monotonic_period: initiate period -- returns to caller 20
2699 + rtems_rate_monotonic_period: obtain status 12
2700 + rtems_rate_monotonic_cancel 15
2701 + rtems_rate_monotonic_delete: inactive 18
2702 + rtems_rate_monotonic_delete: active 20
2703 + rtems_rate_monotonic_period: conclude periods -- caller blocks 36
2704 Index: rtems/make/custom/ec555.cfg
2705 ===================================================================
2706 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2707 +++ rtems/make/custom/ec555.cfg 2007-08-14 17:51:38.000000000 +0200
2710 +# Config file for an Intec Automation SS555 MPC555-based card
2712 +# This file is derived from:
2714 +# Config file for a PowerPC MPC860-based MBX821-001 card.
2715 +# Config file for a PowerPC 403 based helas403 card
2716 +# Config file for MPC860 based Ethernet Comm Board
2719 +include $(RTEMS_ROOT)/make/custom/default.cfg
2723 +RTEMS_CPU_MODEL=mpc555
2725 +# This is the actual bsp directory used during the build process.
2726 +RTEMS_BSP_FAMILY=ss555
2728 +# This contains the compiler options necessary to select the CPU model
2729 +# and (hopefully) optimize for it.
2731 +CPU_CFLAGS = -mcpu=$(GCC_CPU_MODEL) -D$(RTEMS_CPU_MODEL) -D$(RTEMS_BSP_FAMILY)
2733 +# optimize flag: typically -O2
2734 +CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions
2737 + $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(SS555_LDFLAGS) \
2738 + -o $(basename $@)_sym.exe $(LINK_OBJS) $(LINK_LIBS)
2739 + $(NM) -g -n $(basename $@)_sym.exe > $(basename $@).nm
2740 + cp $(basename $@)_sym.exe $(basename $@).exe
2741 + $(STRIP) $(basename $@).exe
2742 + $(SIZE) $(basename $@)_sym.exe
2745 +# Miscellaneous additions go here
2747 +# Override default start file
2750 Index: rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am
2751 ===================================================================
2752 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2753 +++ rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am 2007-08-14 17:51:38.000000000 +0200
2755 +## Automatically generated by ampolish3 - Do not edit
2758 +$(srcdir)/preinstall.am: Makefile.am
2759 + $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
2763 +DISTCLEANFILES += $(PREINSTALL_DIRS)
2765 +all-am: $(PREINSTALL_FILES)
2768 +CLEANFILES = $(PREINSTALL_FILES)
2770 +$(PROJECT_LIB)/$(dirstamp):
2771 + @$(MKDIR_P) $(PROJECT_LIB)
2772 + @: > $(PROJECT_LIB)/$(dirstamp)
2773 +PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
2775 +$(PROJECT_INCLUDE)/$(dirstamp):
2776 + @$(MKDIR_P) $(PROJECT_INCLUDE)
2777 + @: > $(PROJECT_INCLUDE)/$(dirstamp)
2778 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
2780 +$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
2781 + $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
2782 +PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
2784 +$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
2785 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
2786 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
2788 +$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
2789 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
2790 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
2792 +$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
2793 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
2794 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
2796 +$(PROJECT_INCLUDE)/bsp/$(dirstamp):
2797 + @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
2798 + @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2799 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2801 +$(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
2802 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
2803 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
2805 +$(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2806 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
2807 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
2809 +$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
2810 + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
2811 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds