1 Index: rtems/c/src/lib/libbsp/powerpc/ec555/.cvsignore
2 ===================================================================
4 +++ rtems/c/src/lib/libbsp/powerpc/ec555/.cvsignore
20 Index: rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
21 ===================================================================
23 +++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
25 +2006-03-08 Joel Sherrill <joel@OARcorp.com>
27 + * startup/linkcmds: Add .gnu.linkonce.b.* section.
29 +2006-02-08 Joel Sherrill <joel@OARcorp.com>
31 + * startup/linkcmds: Add sections required by newer gcc versions.
33 +2006-01-11 Ralf Corsepius <ralf.corsepius@rtems.org>
35 + * configure.ac: Remove explicit ampolish3 support (now in
36 + RTEMS_BSP_CONFIGURE).
38 +2006-01-10 Ralf Corsepius <ralf.corsepius@rtems.org>
40 + * configure.ac: Add ampolish3 support.
41 + * Makefile.am: Add preinstall.am.
43 +2006-01-09 Ralf Corsepius <ralf.corsepius@rtems.org>
45 + * Makefile.am: Don't include subdirs.am.
47 +2005-05-26 Ralf Corsepius <ralf.corsepius@rtems.org>
49 + * include/bsp.h: New header guard.
51 +2005-05-10 Ralf Corsepius <ralf.corsepius@rtems.org>
53 + * console/console.c: Eliminate unsigned8.
55 +2005-04-26 Joel Sherrill <joel@OARcorp.com>
57 + * startup/bspstart.c: Eliminate warnings.
59 +2005-04-25 Jennifer Averett <jennifer.averett@oarcorp.com>
62 + * clock/p_clock.c: Add parameter to powerpc exception handler routines
64 +2005-02-17 Ralf Corsepius <ralf.corsepius@rtems.org>
66 + * startup/bspstart.c: include <rtems/powerpc/powerpc.h>.
67 + Use PPC_MINIMUM_STACK_FRAME_SIZE instead of
68 + CPU_MINIMUM_STACK_FRAME_SIZE.
70 +2005-02-16 Ralf Corsepius <ralf.corsepius@rtems.org>
72 + * configure.ac: Remove argument from RTEMS_PPC_EXCEPTIONS.
74 +2005-02-11 Ralf Corsepius <ralf.corsepius@rtems.org>
76 + * Makefile.am: Merge-in wrapup/Makefile.am.
77 + * wrapup/Makefile.am: Remove.
78 + * configure.ac: Reflect changes above.
80 +2005-01-07 Ralf Corsepius <ralf.corsepius@rtems.org>
82 + * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
84 +2005-01-02 Ralf Corsepius <ralf.corsepius@rtems.org>
86 + * Makefile.am, wrapup/Makefile.am: Remove build-variant support.
88 +2004-10-20 Ralf Corsepius <ralf_corsepius@rtems.org>
90 + * console/console.c, include/bsp.h, startup/bspstart.c,
91 + startup/iss555.c: Use POSIX fixed size types.
93 +2004-09-24 Ralf Corsepius <ralf_corsepius@rtems.org>
95 + * configure.ac: Require automake > 1.9.
97 +2004-04-23 Ralf Corsepius <ralf_corsepius@rtems.org>
100 + * Makefile.am: Add include/tm27.h, Cosmetics.
101 + * include/tm27.h: Final cosmetics.
103 +2004-04-22 Ralf Corsepius <ralf_corsepius@rtems.org>
105 + * include/bsp.h: Split out tmtest27 support.
106 + * include/tm27.h: New.
108 +2004-04-21 Joel Sherrill <joel@OARcorp.com>
111 + * Makefile.am, include/bsp.h, wrapup/Makefile.am: Follow conventions
112 + for tm27 and do not add another macro definition.
113 + * startup/tm27supp.c: New file.
115 +2004-04-21 Joel Sherrill <joel@OARcorp.com>
118 + * Makefile.am, include/bsp.h, wrapup/Makefile.am: Follow conventions
119 + for tm27 and do not add another macro definition.
120 + * startup/tm27supp.c: New file.
122 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
125 + * include/bsp.h: Remove MAX_LONG_TEST_DURATION.
127 +2004-04-21 Ralf Corsepius <ralf_corsepius@rtems.org>
130 + * include/bsp.h: Remove MAX_SHORT_TEST_DURATION (Unused).
132 +2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org>
134 + * include/bsp.h, startup/start.S: Reflect new locations of cpukit headers.
136 +2004-04-12 David Querbach <querbach@realtime.bc.ca>
138 + * .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
139 + times, clock/p_clock.c, console/console.c, include/.cvsignore,
140 + include/bsp.h, include/coverhd.h, irq/irq.h, startup/bspstart.c,
141 + startup/iss555.c, startup/linkcmds, startup/start.S,
142 + wrapup/.cvsignore, wrapup/Makefile.am: New files.
144 Index: rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am
145 ===================================================================
147 +++ rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am
150 +## $Id: Makefile.am,v 1.10 2006/01/12 10:12:30 ralf Exp $
153 +ACLOCAL_AMFLAGS = -I ../../../../aclocal
155 +include $(top_srcdir)/../../../../automake/compile.am
156 +include $(top_srcdir)/../../bsp.am
158 +dist_project_lib_DATA = bsp_specs
160 +include_HEADERS = include/bsp.h
161 +include_HEADERS += include/tm27.h
163 +nodist_include_HEADERS = include/bspopts.h
164 +DISTCLEANFILES = include/bspopts.h
168 +include_bspdir = $(includedir)/bsp
170 +include_HEADERS += include/coverhd.h
171 +include_bsp_HEADERS = irq/irq.h
175 +dist_project_lib_DATA += startup/linkcmds
177 +noinst_PROGRAMS += pclock.rel
178 +pclock_rel_SOURCES = clock/p_clock.c
179 +pclock_rel_CPPFLAGS = $(AM_CPPFLAGS)
180 +pclock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
182 +noinst_PROGRAMS += console.rel
183 +console_rel_SOURCES = console/console.c
184 +console_rel_CPPFLAGS = $(AM_CPPFLAGS)
185 +console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
187 +noinst_PROGRAMS += startup.rel
188 +startup_rel_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
189 + ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
190 + startup/iss555.c ../../shared/main.c ../../shared/sbrk.c \
191 + ../../shared/gnatinstallhandler.c startup/start.S
192 +startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
193 +startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
195 +noinst_PROGRAMS += tm27supp.rel
196 +tm27supp_rel_SOURCES = startup/tm27supp.c
197 +tm27supp_rel_CPPFLAGS = $(AM_CPPFLAGS)
198 +tm27supp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
200 +noinst_LIBRARIES = libbsp.a
202 +libbsp_a_LIBADD = pclock.rel console.rel startup.rel tm27supp.rel
203 +libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
204 + ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
205 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/clock.rel \
206 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/console-generic.rel \
207 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/exceptions.rel \
208 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/irq.rel \
209 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/timer.rel \
210 + ../../../libcpu/@RTEMS_CPU@/mpc5xx/vectors.rel
212 +include $(srcdir)/preinstall.am
213 +include $(top_srcdir)/../../../../automake/local.am
214 Index: rtems/c/src/lib/libbsp/powerpc/ec555/README
215 ===================================================================
217 +++ rtems/c/src/lib/libbsp/powerpc/ec555/README
220 +# $Id: README,v 1.1 2004/04/12 21:52:13 joel Exp $
223 +This is a README file for the Intec SS555 of RTEMS 4.6.0
225 +The SS555 port was sponsored by Defence Research and Development
226 +Canada - Suffield, and is Copyright (C) 2004, Real-Time Systems Inc.
228 +Please send any comments, improvements, or bug reports to:
231 +querbach@realtime.bc.ca
238 +BOARD: Intec Automation Inc. SS555
242 +COPROCESSORS: Built-in Motorola TPU
249 +TIMERS: PIT / Timebase
250 + RESOLUTION: 1 microsecond (4 MHz crystal / 4)
252 +REAL-TIME CLOCK: On-chip.
271 + SCI2 serial port (console)
273 + TB timing test support
275 + SWT watchdog timer -- enable in startup/iss555.c
276 + *CS0 external 512k 2-1-1-1 Burst SRAM
300 +Clock rate: 40 MHz development/embeddable board
301 +Bus width: 32-bit on-board RAM, 16-bit off-board I/O
303 +RAM: 512k 2-1-1-1 burst SRAM
309 +The ss555 port uses the Intec SS555's external RAM in two different ways,
310 +depending on whether or not it is built for debugging by giving the
311 +VARIANT=DEBUG switch to make:
313 + make VARIANT=DEBUG all
315 +1. In the debugging case, the linker script concanttenates the .text,
316 +.data, and .bss sections starting at location zero, so they all can be
317 +loaded into the external RAM for debugging. We assume that the debugger
318 +disables the internal Flash ROM and enables the external RAM before loading
319 +the code into the external RAM.
321 +2. In the normal (non-debugging) case, the linker script still places the
322 +.text section near zero, but places the start of the .data and .bss sections
323 +at the start location of the MPC555's internal RAM. The system startup code
324 +then configures the external RAM just after the internal RAM in memory,
325 +forming one large block from the two RAM devices.
331 +This BSP includes an termios-capable asynchronous serial line driver that
332 +supports SCI1 and SCI2. The RTEMS console is selected at configuration time
333 +with the CONSOLE_MINOR variable (see .../ss555/configure.ac). We default to
334 +SCI2 for the console, since SCI1 has some extra features which may be
335 +desired for application use.
337 +The BSP console supports three different modes of operation:
339 + 1. polled I/O done with termios support,
340 + 2. polled I/O done without termios support,
341 + 3. interrupt-driven I/O with termios support.
343 +The mode of operation of the serial driver is determined at configure time in
344 +part by the value of the UARTS_IO_MODE variable (see .../ss555/configure.ac).
347 + 1 - interrupt-driven I/O.
349 +Also, set the value of UARTS_USE_TERMIOS to select whether termios should be
350 +used to perform buffering and input/output processing. Without termios
351 +support, input processing is limited to the substitution of LF for a
352 +received CR, and output processing is limited to the transmission of a CR
353 +following the transmission of a LF. The choices for UARTS_USE_TERMIOS are:
355 + 0 - do not use termios
358 +In most real-time applications, the driver should be configured to use
359 +termios and interrupt-driven I/O. Special requirements may dictate otherwise.
361 +Polled I/O must be used when running the timing tests. It must also be used
362 +to run some other tests and some samples, such as the cdtest. Some tests
363 +change the interrupt mask and will hang interrupt-driven I/O indefinitely.
364 +Others, such as cdtest, perform console output from the static constructors
365 +before the console is opened, causing the test to hang. Still other tests
366 +produce output that is supposed to be in some specific order. For these
367 +tests, termios should not be used, as termios buffers output and the
368 +transmission of the buffers occur at somewhat unpredictable times.
370 +The real solution is to fix the tests so that they work with interrupt-driven
374 +printk() and debug output
375 +-----------------------
377 +The implementation of printk() in RTEMS is mostly independent of most system
378 +services. The printk() function can therefore be used to print messages to a
379 +debug console, particularly when debugging startup code or device drivers,
380 +i.e. code that runs before the console driver is opened or that runs with
381 +interrupts disabled.
383 +Support is provided to send printk output to either port. Specify the
384 +desired port at configure time by setting the value of PRINTK_MINOR to one
385 +of SCI1_MINOR or SCI2_MINOR.
387 +printk() always uses polled I/O, and never uses termios.
389 +If the printk() port is opened by RTEMS, then UARTS_IO_MODE must be set for
390 +polled I/O, otherwise the I/O functions will be in conflict. Using printk()
391 +before the port is initialized is, of course, not possible. This
392 +initialization occurs in console_initialize(), which is called by
393 +rtems_initialize_executive_early().
399 +The MPC555 watchdog timer can be enabled at configuration time by defining
400 +the WATCHDOG_TIMEOUT variable. This variable sets the watchdog timeout
404 + --------- = --------- = 51.2 usec
407 +or about 1/20 msec. When WATCHDOG_TIMEOUT is left undefined, the watchdog
414 +Most code came from the mbx8xx port, except for the floating-point handling
415 +which came from the mpc8260ads.
421 +The port was developed on an x86 box running Debian 3.0. The toolchain was
422 +built from the sources at rtems.org, except for the autotools which came
423 +from the Debian distribution.
429 +Board: Intec SS555 v1.1
430 +CPU: Motorola MPC555LFMZP40, mask 1K83H
431 +Clock Speed: Crystal 4.0 MHz, CPU 40.0 MHz
432 +RAM: 512K bytes of 2-1-1-1 Burst SRAM
433 +Times Reported in: Microseconds
434 +Timer Source: Timebase clock
435 +GCC Flags: -O4 -fno-keep-inline-functions -mcpu=(821/860)
436 +Console: Operates in polled mode on SMC2. No I/O through EPPC-Bug.
442 +Single processor tests:
443 + All tests passed, except that:
444 + - sp09 aborts due to memory shortage
445 + - sp20 needs to be run with output buffering enabled (see
448 +Multi-processor tests:
452 + All tests passed. Note that the termios test only works if the system is
453 + rebuilt with termios enabled.
456 + All tests passed, except that:
457 + - the message queue test failed with "errno (91 - File or path name too
461 + Due to memory limitations, many of the tests will not run unless you set
462 + OPERATION_COUNT=20 at configuration time.
464 + To run tm27 (the interrupt latency timer test), short CN5-48 to CN5-50 on
467 + All tests run cleanly, except for tm26, which gives a "PANIC 12" after it
468 + exits. This doesn't seem to cause a problem otherwise.
470 + See the times file for the results of the timing tests.
476 + These run correctly, except that:
477 + - The "minimum" sample is not designed to run properly on any system.
478 + - The loopback, fileio, unilimited, and pppd tests fail due to memory
480 + - The paranoia program dies on a floating-point assist exception.
481 Index: rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs
482 ===================================================================
484 +++ rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs
487 +%rename endfile old_endfile
488 +%rename startfile old_startfile
489 +%rename link old_link
492 +%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: --start-group \
493 +%{!qrtems_debug: -lrtemsbsp -lrtemscpu} %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
494 +%{qjava: -lffi -lgcjgc -lzgcj -lgcj} %{qc++: -lstdc++} -lc -lgcc --end-group \
495 +%{!qnolinkcmds: %{qrtems_debug: --defsym RTEMS_DEBUG=1} -T linkcmds%s -Map %b.map}}}
498 +%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s}}
501 +%{!qrtems: %(old_endfile)} %{qrtems: ecrtn%O%s}
504 +%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -N -u start -e start}
506 Index: rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
507 ===================================================================
509 +++ rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
512 + * Clock Tick interrupt conexion code.
514 + * COPYRIGHT (c) 1989-1997.
515 + * On-Line Applications Research Corporation (OAR).
517 + * The license and distribution terms for this file may in
518 + * the file LICENSE in this distribution or at
519 + * http://www.rtems.com/license/LICENSE.
521 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
522 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
524 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/clock/p_clock.c:
526 + * Modified to support the MPC750.
527 + * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
529 + * $Id: p_clock.c,v 1.3 2005/04/25 14:46:37 jennifer Exp $
533 +#include <bsp/irq.h>
534 +#include <rtems/bspIo.h>
536 +extern void clockOn(void*);
537 +extern void clockOff (void*);
538 +extern int clockIsOn(void*);
539 +extern void Clock_isr(void *);
541 +static rtems_irq_connect_data clockIrqData = {
542 + CPU_PERIODIC_TIMER,
543 + (rtems_irq_hdl)Clock_isr,
545 + (rtems_irq_enable)clockOn,
546 + (rtems_irq_disable)clockOff,
547 + (rtems_irq_is_enabled)clockIsOn
550 +int BSP_disconnect_clock_handler (void)
552 + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
553 + printk("Unable to stop system clock\n");
554 + rtems_fatal_error_occurred(1);
556 + return BSP_remove_rtems_irq_handler (&clockIrqData);
559 +int BSP_connect_clock_handler (rtems_irq_hdl hdl)
561 + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
562 + printk("Unable to get system clock handler\n");
563 + rtems_fatal_error_occurred(1);
565 + if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
566 + printk("Unable to remove current system clock handler\n");
567 + rtems_fatal_error_occurred(1);
572 + clockIrqData.name = CPU_PERIODIC_TIMER;
573 + clockIrqData.hdl = (rtems_irq_hdl) hdl;
574 + clockIrqData.on = (rtems_irq_enable)clockOn;
575 + clockIrqData.off = (rtems_irq_enable)clockOff;
576 + clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;
578 + return BSP_install_rtems_irq_handler (&clockIrqData);
580 Index: rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
581 ===================================================================
583 +++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
585 +## Process this file with autoconf to produce a configure script.
587 +## $Id: configure.ac,v 1.7 2006/01/11 04:52:39 ralf Exp $
590 +AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
591 +AC_CONFIG_SRCDIR([bsp_specs])
592 +RTEMS_TOP(../../../../../..)
594 +RTEMS_CANONICAL_TARGET_CPU
595 +AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.9])
598 +RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
599 +RTEMS_CANONICALIZE_TOOLS
602 +RTEMS_CHECK_NETWORKING
603 +AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
605 +RTEMS_BSPOPTS_SET([WATCHDOG_TIMEOUT],[*],[0xFFFF])
606 +RTEMS_BSPOPTS_HELP([WATCHDOG_TIMEOUT],
607 +[Define to the desired timeout (in steps of 1/20 msec) to enable the
608 + watchdog. Default is to disable the watchdog entirely.])
610 +RTEMS_BSPOPTS_SET([UARTS_USE_TERMIOS],[*],[0])
611 +RTEMS_BSPOPTS_HELP([UARTS_USE_TERMIOS],
612 +[Define to 1 if you want termios support for every port.
613 + Termios support is independent of the choice of UART I/O mode.])
615 +RTEMS_BSPOPTS_SET([CONSOLE_MINOR],[*],[SCI2_MINOR])
616 +RTEMS_BSPOPTS_HELP([CONSOLE_MINOR],
617 +[Must be defined to be one of SCI1_MINOR or SCI2_MINOR. Determines which
618 + device will be registered as /dev/console.])
620 +RTEMS_BSPOPTS_SET([UARTS_IO_MODE],[*],[0])
621 +RTEMS_BSPOPTS_HELP([UARTS_IO_MODE],
622 +[Define to 1 if you want interrupt-driven I/O for the SCI ports.])
624 +RTEMS_BSPOPTS_SET([PRINTK_MINOR],[*],[SCI2_MINOR])
625 +RTEMS_BSPOPTS_HELP([PRINTK_MINOR],
626 +[Must be defined to be one of SCI1_MINOR or SCI2_MINOR. Determines which
627 + device is used for output by printk(). The printk port always uses polled
628 + I/O. Don't open the printk port from RTEMS unless also using polled I/O
629 + for the SCI ports.])
631 +# Explicitly list a Makefile here
632 +AC_CONFIG_FILES([Makefile])
634 +RTEMS_PPC_EXCEPTIONS
637 Index: rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c
638 ===================================================================
640 +++ rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c
645 + * This file contains the Intec SS555 termios serial I/O package.
647 + * The SCI channels are assigned as follows
649 + * Channel Device Minor
653 + * All ports support termios. The use of termios is recommended for real-time
654 + * applications. Termios provides buffering and input processing. When not
655 + * using termios, processing is limited to the substitution of LF for CR on
656 + * input, and the output of a CR following the output of a LF character.
657 + * Note that the terminal should not send CR/LF pairs when the return key
658 + * is pressed, and that output lines are terminated with LF/CR, not CR/LF
659 + * (although that would be easy to change).
661 + * I/O may be interrupt-driven (recommended for real-time applications) or
666 + * It is not possible to use different I/O modes on the different ports. The
667 + * exception is with printk. The printk port can use a different mode from
668 + * the other ports. If this is done, it is important not to open the printk
669 + * port from an RTEMS application.
671 + * Currently, the I/O modes are determined at build time. It would be much
672 + * better to have the mode selected at boot time based on parameters in
675 + * Interrupt-driven I/O requires termios.
679 + * TO RUN THE TESTS, USE POLLED I/O WITHOUT TERMIOS SUPPORT. Some tests
680 + * play with the interrupt masks and turn off I/O. Those tests will hang
681 + * when interrupt-driven I/O is used. Other tests, such as cdtest, do I/O
682 + * from the static constructors before the console is open. This test
683 + * will not work with interrupt-driven I/O. Because of the buffering
684 + * performed in termios, test output may not be in sequence.The tests
685 + * should all be fixed to work with interrupt-driven I/O and to
686 + * produce output in the expected sequence. Obviously, the termios test
687 + * requires termios support in the driver.
689 + * Set CONSOLE_MINOR to the appropriate device minor number in the
690 + * config file. This allows the RTEMS application console to be different
691 + * from the GDB port.
693 + * This driver handles both available serial ports: it distinguishes
694 + * the sub-devices using minor device numbers. It is not possible to have
695 + * other protocols running on the other ports when this driver is used as
696 + * currently written.
699 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
700 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
702 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/console/console.c:
704 + * Based on code (alloc860.c in eth_comm port) by
705 + * Jay Monkman (jmonkman@frasca.com),
706 + * Copyright (C) 1998 by Frasca International, Inc.
708 + * Modifications by Darlene Stewart <Darlene.Stewart@iit.nrc.ca>
709 + * and Charles-Antoine Gauthier <charles.gauthier@iit.nrc.ca>.
710 + * Copyright (c) 2000, National Research Council of Canada
715 +#include <bsp.h> /* Must be before libio.h */
716 +#include <rtems/bspIo.h>
717 +#include <rtems/libio.h>
718 +#include <termios.h>
720 +static void _BSP_output_char( char c );
721 +static rtems_status_code do_poll_read( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
722 +static rtems_status_code do_poll_write( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
724 +static void _BSP_null_char( char c ) {return;}
726 +BSP_output_char_function_type BSP_output_char = _BSP_null_char;
731 + * Input characters through polled I/O. Returns as soon as a character has
732 + * been received. Otherwise, if we wait for the number of requested
733 + * characters, we could be here forever!
735 + * CR is converted to LF on input. The terminal should not send a CR/LF pair
736 + * when the return or enter key is pressed.
738 + * Input parameters:
739 + * major - ignored. Should be the major number for this driver.
740 + * minor - selected channel.
741 + * arg->buffer - where to put the received characters.
742 + * arg->count - number of characters to receive before returning--Ignored.
744 + * Output parameters:
745 + * arg->bytes_moved - the number of characters read. Always 1.
747 + * Return value: RTEMS_SUCCESSFUL
749 + * CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
751 +static rtems_status_code do_poll_read(
752 + rtems_device_major_number major,
753 + rtems_device_minor_number minor,
757 + rtems_libio_rw_args_t *rw_args = arg;
760 + while( (c = m5xx_uart_pollRead(minor)) == -1 );
761 + rw_args->buffer[0] = (uint8_t)c;
762 + if( rw_args->buffer[0] == '\r' )
763 + rw_args->buffer[0] = '\n';
764 + rw_args->bytes_moved = 1;
766 + return RTEMS_SUCCESSFUL;
772 + * Output characters through polled I/O. Returns only once every character has
775 + * CR is transmitted AFTER a LF on output.
777 + * Input parameters:
778 + * major - ignored. Should be the major number for this driver.
779 + * minor - selected channel
780 + * arg->buffer - where to get the characters to transmit.
781 + * arg->count - the number of characters to transmit before returning.
783 + * Output parameters:
784 + * arg->bytes_moved - the number of characters read
786 + * Return value: RTEMS_SUCCESSFUL
788 + * CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
790 +static rtems_status_code do_poll_write(
791 + rtems_device_major_number major,
792 + rtems_device_minor_number minor,
796 + rtems_libio_rw_args_t *rw_args = arg;
800 + for( i = 0; i < rw_args->count; i++ ) {
801 + m5xx_uart_pollWrite(minor, &(rw_args->buffer[i]), 1);
802 + if ( rw_args->buffer[i] == '\n' )
803 + m5xx_uart_pollWrite(minor, &cr, 1);
805 + rw_args->bytes_moved = i;
807 + return RTEMS_SUCCESSFUL;
811 + * Print functions prototyped in bspIo.h
814 +static void _BSP_output_char( char c )
819 + * Can't rely on console_initialize having been called before this
820 + * function is used, so it may fail.
823 + m5xx_uart_pollWrite( PRINTK_MINOR, &c, 1 );
825 + m5xx_uart_pollWrite( PRINTK_MINOR, &cr, 1 );
833 + * All these functions are prototyped in rtems/c/src/lib/include/console.h.
837 + * Initialize and register the device
839 +rtems_device_driver console_initialize(
840 + rtems_device_major_number major,
841 + rtems_device_minor_number minor,
845 + rtems_status_code status;
848 + * Set up TERMIOS if needed
850 + #if UARTS_USE_TERMIOS == 1
851 + rtems_termios_initialize ();
852 + #endif /* UARTS_USE_TERMIOS */
855 + * Do device-specific initialization
857 + BSP_output_char = _BSP_output_char;
859 + m5xx_uart_initialize(SCI1_MINOR);
860 + status = rtems_io_register_name ("/dev/tty0", major, SCI1_MINOR);
861 + if (status != RTEMS_SUCCESSFUL)
862 + rtems_fatal_error_occurred (status);
864 + m5xx_uart_initialize(SCI2_MINOR);
865 + status = rtems_io_register_name ("/dev/tty1", major, SCI2_MINOR);
866 + if (status != RTEMS_SUCCESSFUL)
867 + rtems_fatal_error_occurred (status);
869 + /* Now register the RTEMS console */
870 + status = rtems_io_register_name ("/dev/console", major, CONSOLE_MINOR);
871 + if (status != RTEMS_SUCCESSFUL)
872 + rtems_fatal_error_occurred (status);
874 + return RTEMS_SUCCESSFUL;
880 +rtems_device_driver console_open(
881 + rtems_device_major_number major,
882 + rtems_device_minor_number minor,
886 + rtems_status_code sc;
888 + if ( minor > NUM_PORTS - 1 )
889 + return RTEMS_INVALID_NUMBER;
891 + #if (UARTS_USE_TERMIOS == 1)
893 + #if (UARTS_IO_MODE == 1) /* RTEMS interrupt-driven I/O with termios */
895 + static const rtems_termios_callbacks callbacks = {
896 + m5xx_uart_firstOpen, /* firstOpen */
897 + m5xx_uart_lastClose, /* lastClose */
898 + NULL, /* pollRead */
899 + m5xx_uart_write, /* write */
900 + m5xx_uart_setAttributes, /* setAttributes */
901 + NULL, /* stopRemoteTx */
902 + NULL, /* startRemoteTx */
903 + TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */
905 + sc = rtems_termios_open( major, minor, arg, &callbacks );
907 + #else /* UARTS_IO_MODE != 1 */ /* RTEMS polled I/O with termios */
909 + static const rtems_termios_callbacks callbacks = {
910 + m5xx_uart_firstOpen, /* firstOpen */
911 + m5xx_uart_lastClose, /* lastClose */
912 + m5xx_uart_pollRead, /* pollRead */
913 + m5xx_uart_pollWrite, /* write */
914 + m5xx_uart_setAttributes, /* setAttributes */
915 + NULL, /* stopRemoteTx */
916 + NULL, /* startRemoteTx */
917 + TERMIOS_POLLED /* outputUsesInterrupts */
919 + sc = rtems_termios_open( major, minor, arg, &callbacks );
926 + #else /* no termios -- default to polled I/O */
928 + sc = RTEMS_SUCCESSFUL;
938 +rtems_device_driver console_close(
939 + rtems_device_major_number major,
940 + rtems_device_minor_number minor,
944 + if ( minor > NUM_PORTS-1 )
945 + return RTEMS_INVALID_NUMBER;
947 + #if UARTS_USE_TERMIOS == 1
948 + return rtems_termios_close( arg );
950 + return RTEMS_SUCCESSFUL;
955 + * Read from the device
957 +rtems_device_driver console_read(
958 + rtems_device_major_number major,
959 + rtems_device_minor_number minor,
963 + if ( minor > NUM_PORTS-1 )
964 + return RTEMS_INVALID_NUMBER;
966 + #if UARTS_USE_TERMIOS == 1
967 + return rtems_termios_read( arg );
969 + return do_poll_read( major, minor, arg );
974 + * Write to the device
976 +rtems_device_driver console_write(
977 + rtems_device_major_number major,
978 + rtems_device_minor_number minor,
982 + if ( minor > NUM_PORTS-1 )
983 + return RTEMS_INVALID_NUMBER;
985 + #if UARTS_USE_TERMIOS == 1
986 + return rtems_termios_write( arg );
988 + return do_poll_write( major, minor, arg );
993 + * Handle ioctl request.
995 +rtems_device_driver console_control(
996 + rtems_device_major_number major,
997 + rtems_device_minor_number minor,
1001 + if ( minor > NUM_PORTS-1 )
1002 + return RTEMS_INVALID_NUMBER;
1004 + #if UARTS_USE_TERMIOS == 1
1005 + return rtems_termios_ioctl( arg );
1007 + return RTEMS_SUCCESSFUL;
1010 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/.cvsignore
1011 ===================================================================
1013 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/.cvsignore
1019 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
1020 ===================================================================
1022 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
1026 + * This include file contains all board IO definitions.
1028 + * This file includes definitions for the Intec SS555.
1031 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1032 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1034 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h:
1036 + * COPYRIGHT (c) 1989-1998.
1037 + * On-Line Applications Research Corporation (OAR).
1039 + * The license and distribution terms for this file may be
1040 + * found in the file LICENSE in this distribution or at
1041 + * http://www.rtems.com/license/LICENSE.
1043 + * $Id: bsp.h,v 1.9 2005/05/26 05:36:48 ralf Exp $
1053 +#include <bspopts.h>
1056 +#include <rtems/console.h>
1057 +#include <rtems/clockdrv.h>
1058 +#include <mpc5xx.h>
1059 +#include <mpc5xx/console.h>
1060 +#include <libcpu/vectors.h>
1061 +#include <bsp/irq.h>
1064 + * Clock definitions
1067 +#define BSP_CRYSTAL_HZ 4000000 /* crystal frequency, Hz */
1068 +#define BSP_CLOCK_HZ 40000000 /* CPU clock frequency, Hz
1073 + * The SS555 board includes a CPLD to control on-board features and
1074 + * off-board devices.
1076 +typedef struct cpld_ {
1077 + uint8_t cs3a[32]; /* Chip select 3A */
1078 + uint8_t pad0[0x200000 - 0x000020];
1080 + uint8_t cs3b[32]; /* Chip select 3B */
1081 + uint8_t pad2[0x400000 - 0x200020];
1083 + uint8_t cs3c[32]; /* Chip select 3C */
1084 + uint8_t pad4[0x600000 - 0x400020];
1086 + uint8_t cs3d[32]; /* Chip select 3D */
1087 + uint8_t pad6[0x800000 - 0x600020];
1089 + uint8_t serial_ints; /* Enable/disable serial interrupts */
1090 + uint8_t serial_resets; /* Enable/disable serial resets */
1091 + uint8_t serial_ack; /* Acknowledge serial transfers */
1092 + uint8_t pad8[0xA00000 - 0x800003];
1094 + uint8_t iflash_writess; /* Enable/disable internal-flash writes */
1095 + uint8_t nflash_writess; /* Enable/disable NAND-flash writes */
1096 + uint8_t padA[0xC00000 - 0xA00002];
1099 +extern volatile cpld_t cpld; /* defined in linkcmds */
1101 +/* miscellaneous stuff assumed to exist */
1103 +extern rtems_configuration_table BSP_Configuration;
1106 + * Device Driver Table Entries
1110 + * NOTE: Use the standard Console driver entry
1114 + * NOTE: Use the standard Clock driver entry
1118 + * How many libio files we want
1121 +#define BSP_LIBIO_MAX_FDS 20
1125 +void bsp_cleanup( void );
1127 +rtems_isr_entry set_vector( /* returns old vector */
1128 + rtems_isr_entry handler, /* isr routine */
1129 + rtems_vector_number vector, /* vector number */
1130 + int type /* RTEMS or RAW intr */
1138 +/* end of include file */
1139 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
1140 ===================================================================
1142 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
1146 + * This include file has defines to represent the overhead associated
1147 + * with calling a particular directive from C. These are used in the
1148 + * Timing Test Suite to ignore the overhead required to pass arguments
1149 + * to directives. On some CPUs and/or target boards, this overhead
1150 + * is significant and makes it difficult to distinguish internal
1151 + * RTEMS execution time from that used to call the directive.
1152 + * This file should be updated after running the C overhead timing
1153 + * test. Once this update has been performed, the RTEMS Time Test
1154 + * Suite should be rebuilt to account for these overhead times in the
1157 + * NOTE: If these are all zero, then the times reported include
1158 + * all calling overhead including passing of arguments.
1160 + * COPYRIGHT (c) 1989-1998.
1161 + * On-Line Applications Research Corporation (OAR).
1163 + * The license and distribution terms for this file may be
1164 + * found in the file LICENSE in this distribution or at
1165 + * http://www.rtems.com/license/LICENSE.
1167 + * $Id: coverhd.h,v 1.1 2004/04/12 21:52:13 joel Exp $
1170 +#ifndef __COVERHD_h
1171 +#define __COVERHD_h
1178 + * 40 MHz processor, running from external 2-1-1-1 burst SRAM.
1180 +#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0
1181 +#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0
1182 +#define CALLING_OVERHEAD_TASK_CREATE 0
1183 +#define CALLING_OVERHEAD_TASK_IDENT 0
1184 +#define CALLING_OVERHEAD_TASK_START 0
1185 +#define CALLING_OVERHEAD_TASK_RESTART 0
1186 +#define CALLING_OVERHEAD_TASK_DELETE 0
1187 +#define CALLING_OVERHEAD_TASK_SUSPEND 0
1188 +#define CALLING_OVERHEAD_TASK_RESUME 0
1189 +#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0
1190 +#define CALLING_OVERHEAD_TASK_MODE 0
1191 +#define CALLING_OVERHEAD_TASK_GET_NOTE 0
1192 +#define CALLING_OVERHEAD_TASK_SET_NOTE 0
1193 +#define CALLING_OVERHEAD_TASK_WAKE_WHEN 2
1194 +#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0
1195 +#define CALLING_OVERHEAD_INTERRUPT_CATCH 0
1196 +#define CALLING_OVERHEAD_CLOCK_GET 2
1197 +#define CALLING_OVERHEAD_CLOCK_SET 3
1198 +#define CALLING_OVERHEAD_CLOCK_TICK 0
1200 +#define CALLING_OVERHEAD_TIMER_CREATE 0
1201 +#define CALLING_OVERHEAD_TIMER_IDENT 0
1202 +#define CALLING_OVERHEAD_TIMER_DELETE 0
1203 +#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0
1204 +#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 3
1205 +#define CALLING_OVERHEAD_TIMER_RESET 0
1206 +#define CALLING_OVERHEAD_TIMER_CANCEL 0
1207 +#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0
1208 +#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0
1209 +#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0
1210 +#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0
1211 +#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0
1212 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0
1213 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0
1214 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0
1215 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0
1216 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0
1217 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0
1218 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0
1219 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0
1221 +#define CALLING_OVERHEAD_EVENT_SEND 0
1222 +#define CALLING_OVERHEAD_EVENT_RECEIVE 0
1223 +#define CALLING_OVERHEAD_SIGNAL_CATCH 0
1224 +#define CALLING_OVERHEAD_SIGNAL_SEND 0
1225 +#define CALLING_OVERHEAD_PARTITION_CREATE 0
1226 +#define CALLING_OVERHEAD_PARTITION_IDENT 0
1227 +#define CALLING_OVERHEAD_PARTITION_DELETE 0
1228 +#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0
1229 +#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0
1230 +#define CALLING_OVERHEAD_REGION_CREATE 0
1231 +#define CALLING_OVERHEAD_REGION_IDENT 0
1232 +#define CALLING_OVERHEAD_REGION_DELETE 0
1233 +#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0
1234 +#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0
1235 +#define CALLING_OVERHEAD_PORT_CREATE 0
1236 +#define CALLING_OVERHEAD_PORT_IDENT 0
1237 +#define CALLING_OVERHEAD_PORT_DELETE 0
1238 +#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0
1239 +#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0
1241 +#define CALLING_OVERHEAD_IO_INITIALIZE 0
1242 +#define CALLING_OVERHEAD_IO_OPEN 0
1243 +#define CALLING_OVERHEAD_IO_CLOSE 0
1244 +#define CALLING_OVERHEAD_IO_READ 0
1245 +#define CALLING_OVERHEAD_IO_WRITE 0
1246 +#define CALLING_OVERHEAD_IO_CONTROL 0
1247 +#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0
1248 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0
1249 +#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0
1250 +#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0
1251 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0
1252 +#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0
1253 +#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0
1260 +/* end of include file */
1261 Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
1262 ===================================================================
1264 +++ rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
1269 + * The license and distribution terms for this file may be
1270 + * found in the file LICENSE in this distribution or at
1271 + * http://www.rtems.com/license/LICENSE.
1273 + * $Id: tm27.h,v 1.2 2004/04/23 04:47:38 ralf Exp $
1276 +#ifndef _RTEMS_TMTEST27
1277 +#error "This is an RTEMS internal file you must not include directly."
1284 + * Stuff for Time Test 27
1286 + * The following require that IRQ7 be jumpered to ground. On the SS555,
1287 + * this can be done by shorting together CN5 pin 48 and CN5 pin 50.
1290 +#define MUST_WAIT_FOR_INTERRUPT 1
1292 +#define Install_tm27_vector( handler ) \
1294 + extern rtems_irq_connect_data tm27IrqData; \
1295 + usiu.siel |= (1 << 17); \
1296 + usiu.sipend |= (1 << 17); \
1298 + tm27IrqData.hdl = (rtems_irq_hdl)handler; \
1299 + BSP_install_rtems_irq_handler (&tm27IrqData); \
1302 +#define Cause_tm27_intr() \
1304 + usiu.siel &= ~(1 << 17); \
1307 +#define Clear_tm27_intr() \
1309 + usiu.siel |= (1 << 17); \
1310 + usiu.sipend |= (1 << 17); \
1313 +#define Lower_tm27_intr() \
1315 + ppc_cached_irq_mask |= (1 << 17); \
1316 + usiu.simask = ppc_cached_irq_mask; \
1320 Index: rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
1321 ===================================================================
1323 +++ rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
1327 + * This include file describe the data structure and the functions implemented
1328 + * by rtems to write interrupt handlers.
1331 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1332 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1334 + * Derived from libbsp/powerpc/mbx8xx/irq/irq.h:
1336 + * CopyRight (C) 1999 valette@crf.canon.fr
1338 + * This code is heavilly inspired by the public specification of STREAM V2
1339 + * that can be found at :
1341 + * <http://www.chorus.com/Documentation/index.html> by following
1342 + * the STREAM API Specification Document link.
1344 + * The license and distribution terms for this file may be
1345 + * found in found in the file LICENSE in this distribution or at
1346 + * http://www.rtems.com/license/LICENSE.
1348 + * $Id: irq.h,v 1.2 2004/04/21 10:43:03 ralf Exp $
1351 +#ifndef LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1352 +#define LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1354 +#include <libcpu/irq.h>
1363 + * The SS555 has no external interrupt controller chip, so use the standard
1364 + * routines from the CPU-dependent code.
1366 +#define BSP_install_rtems_irq_handler(ptr) CPU_install_rtems_irq_handler(ptr)
1367 +#define BSP_get_current_rtems_irq_handler(ptr) CPU_get_current_rtems_irq_handler(ptr)
1368 +#define BSP_remove_rtems_irq_handler(ptr) CPU_remove_rtems_irq_handler(ptr)
1369 +#define BSP_rtems_irq_mngt_set(config) CPU_rtems_irq_mngt_set(config)
1370 +#define BSP_rtems_irq_mngt_get(config) CPU_rtems_irq_mngt_get(config)
1371 +#define BSP_rtems_irq_mng_init(cpuId) CPU_rtems_irq_mng_init(cpuId)
1379 +#endif /* LIBBSP_POWERPC_SS555_IRQ_IRQ_H */
1380 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
1381 ===================================================================
1383 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
1387 + * This set of routines starts the application. It includes application,
1388 + * board, and monitor specific initialization and configuration.
1389 + * The generic CPU dependent initialization has been performed
1390 + * before this routine is invoked.
1392 + * COPYRIGHT (c) 1989-1998.
1393 + * On-Line Applications Research Corporation (OAR).
1395 + * The license and distribution terms for this file may be
1396 + * found in the file LICENSE in this distribution or at
1397 + * http://www.rtems.com/license/LICENSE.
1399 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1400 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1402 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c:
1404 + * Modifications for MBX860:
1405 + * Copyright (c) 1999, National Research Council of Canada
1407 + * $Id: bspstart.c,v 1.7 2005/04/26 23:16:21 joel Exp $
1410 +#include <string.h>
1412 +#include <rtems/libio.h>
1413 +#include <rtems/libcsupport.h>
1414 +#include <rtems/bspIo.h>
1415 +#include <rtems/powerpc/powerpc.h>
1417 +#include <libcpu/cpuIdent.h>
1418 +#include <libcpu/spr.h>
1420 +#include <bsp/irq.h>
1427 + * The original table from the application (in ROM) and our copy of it with
1428 + * some changes. Configuration is defined in <confdefs.h>. Make sure that
1429 + * our configuration tables are uninitialized so that they get allocated in
1430 + * the .bss section (RAM).
1432 +extern rtems_configuration_table Configuration;
1433 +extern unsigned long intrStackPtr;
1434 +rtems_configuration_table BSP_Configuration;
1436 +rtems_cpu_table Cpu_table;
1438 +char *rtems_progname;
1441 + * Use the shared implementations of the following routines.
1442 + * Look in rtems/c/src/lib/libbsp/shared/bsppost.c and
1443 + * rtems/c/src/lib/libbsp/shared/bsplibc.c.
1445 +void bsp_postdriver_hook(void);
1446 +void bsp_libc_init( void *, uint32_t, int );
1448 +void BSP_panic(char *s)
1450 + printk("%s PANIC %s\n",_RTEMS_version, s);
1451 + __asm__ __volatile ("sc");
1454 +void _BSP_Fatal_error(unsigned int v)
1456 + printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
1457 + __asm__ __volatile ("sc");
1461 + * bsp_pretasking_hook
1463 + * Called when RTEMS initialization is complete but before interrupts and
1464 + * tasking are enabled. Used to setup libc and install any BSP extensions.
1466 + * Must not use libc (to do io) from here, since drivers are not yet
1469 + * Installed in the rtems_cpu_table defined in
1470 + * rtems/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h by main()
1471 + * below. Called from rtems_initialize_executive() defined in
1472 + * rtems/c/src/exec/sapi/src/init.c
1474 + * Input parameters: NONE
1476 + * Output parameters: NONE
1478 + * Return values: NONE
1480 +void bsp_pretasking_hook(void)
1483 + * These are assigned addresses in the linkcmds file for the BSP. This
1484 + * approach is better than having these defined as manifest constants and
1485 + * compiled into the kernel, but it is still not ideal when dealing with
1486 + * multiprocessor configuration in which each board as a different memory
1487 + * map. A better place for defining these symbols might be the makefiles.
1488 + * Consideration should also be given to developing an approach in which
1489 + * the kernel and the application can be linked and burned into ROM
1490 + * independently of each other.
1492 + uint8_t *_HeapStart =
1493 + (uint8_t *)BSP_Configuration.work_space_start
1494 + + BSP_Configuration.work_space_size;
1495 + extern uint8_t _HeapEnd[];
1497 + bsp_libc_init( _HeapStart, _HeapEnd - _HeapStart, 0 );
1500 + rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
1507 + * Board-specific initialization code. Called from the generic boot_card()
1508 + * function defined in rtems/c/src/lib/libbsp/shared/main.c. That function
1509 + * does some of the board independent initialization. It is called from the
1510 + * SS555 entry point _start() defined in
1511 + * rtems/c/src/lib/libbsp/powerpc/ss555/startup/start.S
1513 + * _start() has set up a stack, has zeroed the .bss section, has set up the
1514 + * .data section from contents stored in ROM, has turned off interrupts,
1515 + * and placed the processor in the supervisor mode. boot_card() has left
1516 + * the processor in that state when bsp_start() was called.
1518 + * Input parameters: NONE
1520 + * Output parameters: NONE
1522 + * Return values: NONE
1524 +void bsp_start(void)
1526 + extern char _WorkspaceBase[];
1528 + ppc_cpu_id_t myCpu;
1529 + ppc_cpu_revision_t myCpuRevision;
1530 + register unsigned char* intrStack;
1533 + * Get CPU identification dynamically. Note that the get_ppc_cpu_type()
1534 + * function stores the result in global variables so that it can be used
1537 + myCpu = get_ppc_cpu_type();
1538 + myCpuRevision = get_ppc_cpu_revision();
1541 + * Initialize some SPRG registers related to irq handling
1543 + intrStack = (((unsigned char*)&intrStackPtr) - PPC_MINIMUM_STACK_FRAME_SIZE);
1544 + _write_SPRG1((unsigned int)intrStack);
1545 + /* signal them that we have fixed PR288 - eventually, this should go away */
1546 + _write_SPRG0(PPC_BSP_HAS_FIXED_PR288);
1549 + * Install our own set of exception vectors
1551 + initialize_exceptions();
1554 + * Allocate the memory for the RTEMS Work Space. This can come from
1555 + * a variety of places: hard coded address, malloc'ed from outside
1556 + * RTEMS world (e.g. simulator or primitive memory manager), or (as
1557 + * typically done by stock BSPs) by subtracting the required amount
1558 + * of work space from the last physical address on the CPU board.
1560 + * In this case, the memory is not malloc'ed. It is just
1561 + * "pulled from the air".
1563 + BSP_Configuration.work_space_start = _WorkspaceBase;
1566 + * initialize the CPU table for this BSP
1568 + Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
1569 + Cpu_table.postdriver_hook = bsp_postdriver_hook;
1570 + if( Cpu_table.interrupt_stack_size < 4 * 1024 )
1571 + Cpu_table.interrupt_stack_size = 4 * 1024;
1573 + Cpu_table.clicks_per_usec = BSP_CRYSTAL_HZ / 4 / 1000000;
1574 + Cpu_table.clock_speed = BSP_CLOCK_HZ; /* for SCI baud rate generator */
1577 + * Call this in case we use TERMIOS for console I/O
1579 + m5xx_uart_reserve_resources( &BSP_Configuration );
1582 + * Initalize RTEMS IRQ system
1584 + BSP_rtems_irq_mng_init(0);
1586 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
1587 ===================================================================
1589 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
1594 + * Intec SS555 initialization routines.
1596 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
1597 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1599 + * Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c:
1601 + * Copyright (c) 1999, National Research Council of Canada
1603 + * The license and distribution terms for this file may be
1604 + * found in the file LICENSE in this distribution or at
1605 + * http://www.rtems.com/license/LICENSE.
1620 + * Initialize SS555
1622 +void _InitSS555 (void)
1624 + register uint32_t plprcr, msr;
1627 + * Initialize the System Protection Control Register (SYPCR).
1628 + * The SYPCR can only be written once after Reset.
1631 + USIU_SYPCR_SWTC(WATCHDOG_TIMEOUT) /* set watchdog timeout */
1632 + | USIU_SYPCR_BMT(0xFF) /* set bus monitor timeout */
1633 + | USIU_SYPCR_BME /* enable bus monitor */
1634 + | USIU_SYPCR_SWF /* watchdog halted in freeze */
1635 +#if WATCHDOG_TIMEOUT != 0xFFFF
1636 + | USIU_SYPCR_SWE /* enable watchdog */
1638 + | USIU_SYPCR_SWRI /* watchdog forces reset */
1639 + | USIU_SYPCR_SWP; /* prescale watchdog by 2048 */
1641 + TICKLE_WATCHDOG(); /* restart watchdog timer */
1644 + * Re-tune the PLL to the desired system clock frequency.
1646 + usiu.plprck = USIU_UNLOCK_KEY; /* unlock PLPRCR */
1648 + USIU_PLPRCR_TEXPS /* assert TEXP always */
1649 + | USIU_PLPRCR_MF(BSP_CLOCK_HZ / BSP_CRYSTAL_HZ);
1650 + /* PLL multiplication factor */
1651 + usiu.plprck = 0; /* lock PLPRCR */
1653 + while (((plprcr = usiu.plprcr) & USIU_PLPRCR_SPLS) == 0)
1654 + ; /* wait for PLL to re-lock */
1657 + * Enable the timebase and decrementer, then initialize decrementer
1658 + * register to a large value to guarantee that a decrementer interrupt
1659 + * will not be generated before the kernel is fully initialized.
1660 + * Initialize the timebase register to zero.
1662 + usiu.tbscrk = USIU_UNLOCK_KEY;
1663 + usiu.tbscr |= USIU_TBSCR_TBE; /* enable time base and decrementer */
1666 + usiu.tbk = USIU_UNLOCK_KEY;
1667 + _write_DEC(0x7FFFFFFF);
1668 + _write_TBWU(0x00000000 );
1669 + _write_TBWL(0x00000000 );
1673 + * Run the Inter-Module Bus at full speed.
1675 + imb.uimb.umcr &= ~UIMB_UMCR_HSPEED;
1678 + * Initialize Memory Controller for External RAM
1680 + * Initialize the Base and Option Registers (BR0-BR7 and OR0-OR7). Note
1681 + * that for all chip selects, ORx should be programmed before BRx.
1683 + * If booting from internal flash ROM, configure the external RAM to
1684 + * extend the internal RAM. If booting from external RAM, leave it at
1685 + * zero but set it up appropriately.
1687 + extern char int_ram_top[]; /* top of internal ram */
1689 + usiu.memc[0]._or =
1690 + USIU_MEMC_OR_512K /* bank size */
1691 + | USIU_MEMC_OR_SCY(0) /* wait states in first beat of burst */
1692 + | USIU_MEMC_OR_BSCY(0); /* wait states in subsequent beats */
1694 + usiu.memc[0]._br =
1695 + USIU_MEMC_BR_BA(_read_IMMR() & IMMR_FLEN
1696 + ? (uint32_t)int_ram_top : 0) /* base address */
1697 + | USIU_MEMC_BR_PS32 /* 32-bit data bus */
1698 + | USIU_MEMC_BR_TBDIP /* toggle bdip */
1699 + | USIU_MEMC_BR_V; /* base register valid */
1702 + * Initialize Memory Controller for External CPLD
1704 + * The SS555 board includes a CPLD to control on-board features and
1705 + * off-board devices. (Configuration taken from Intec's hwhook.c)
1707 + usiu.memc[3]._or =
1708 + USIU_MEMC_OR_16M /* bank size */
1709 + | USIU_MEMC_OR_CSNT /* negate CS/WE early */
1710 + | USIU_MEMC_OR_ACS_HALF /* assert CS half cycle after address */
1711 + | USIU_MEMC_OR_SCY(15) /* wait states in first beat of burst */
1712 + | USIU_MEMC_OR_TRLX; /* relaxed timing */
1714 + usiu.memc[3]._br =
1715 + USIU_MEMC_BR_BA(&cpld) /* base address */
1716 + | USIU_MEMC_BR_PS16 /* 16-bit data bus */
1717 + | USIU_MEMC_BR_BI /* inhibit bursting */
1718 + | USIU_MEMC_BR_V; /* base register valid */
1721 + * Disable show cycles and serialization so that burst accesses will work
1722 + * properly. A different value, such as 0x0, may be more appropriate for
1723 + * debugging, but can be set with the debugger, if needed.
1725 + _write_ICTRL(0x00000007);
1728 + * Set up Burst Buffer Controller (BBC)
1731 + BBCMCR_ETRE /* enable exception relocation */
1732 + | BBCMCR_BE); /* enable burst accesses */
1735 + _CPU_MSR_GET(msr);
1736 + msr |= MSR_IP; /* set prefix for exception relocation */
1737 + _CPU_MSR_SET(msr);
1739 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
1740 ===================================================================
1742 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
1745 + * Linker command file for Intec SS555 board
1747 + * When debugging, we assume that the internal flash ROM will be replaced by
1748 + * the external RAM on the SS555 board. All sections are stacked starting
1749 + * at address zero. Nothing is placed in the internal RAM, since it's not
1750 + * contiguous with the external SRAM when the external RAM is placed at
1753 + * For final production, we assume that the .text section will be burned
1754 + * into flash ROM starting at address zero. The .data, .bss, heap, and
1755 + * workspace will reside in RAM, starting at the beginning of the internal
1756 + * RAM. The system startup code will configure the external RAM to begin
1757 + * where the internal RAM ends, so as to make one large RAM block.
1759 + * Debugging mode is chosen when the RTEMS_DEBUG symbol is defined. The
1760 + * RTEMS_DEBUG symbol is defined in the bsp_specs file whenever make(1) is
1761 + * invoked with VARIANT=DEBUG.
1763 + * $Id: linkcmds,v 1.3 2006/03/08 18:50:12 joel Exp $
1766 +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
1767 +OUTPUT_ARCH(powerpc)
1770 +int_ram_org = 0x003F9800; /* base of internal RAM */
1771 +int_ram_top = 0x00400000; /* top of internal RAM */
1772 +ext_ram_size = 0x00080000; /* size of external RAM */
1780 + * For the MPC555, we use the compressed vector table format which puts
1781 + * all of the exception vectors before 0x100.
1788 + /* Read-only sections, merged into text segment: */
1792 + /* Entry point is the .entry section */
1799 + /* C++ constructors/destructors */
1800 + *(.gnu.linkonce.t*)
1802 + /* Initialization and finalization code.
1804 + * Various files can provide initialization and finalization functions.
1805 + * The bodies of these functions are in .init and .fini sections. We
1806 + * accumulate the bodies here, and prepend function prologues from
1807 + * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
1808 + * first; ecrtn.o must be linked last. Because these are wildcards, it
1809 + * doesn't matter if the user does not actually link against ecrti.o and
1810 + * ecrtn.o; the linker won't look for a file to match a wildcard. The
1811 + * wildcard also means that it doesn't matter which directory ecrti.o
1812 + * and ecrtn.o are in.
1814 + PROVIDE (_init = .);
1819 + PROVIDE (_fini = .);
1825 + * C++ constructors and destructors for static objects.
1826 + * PowerPC EABI does not use crtstuff yet, so we build "old-style"
1827 + * constructor and destructor lists that begin with the list length
1828 + * end terminate with a NULL entry.
1830 + PROVIDE (__CTOR_LIST__ = .);
1831 + /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
1832 + *crtbegin.o(.ctors)
1836 + PROVIDE (__CTOR_END__ = .);
1838 + PROVIDE (__DTOR_LIST__ = .);
1839 + /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
1840 + *crtbegin.o(.dtors)
1844 + PROVIDE (__DTOR_END__ = .);
1847 + * Special FreeBSD sysctl sections.
1850 + __start_set_sysctl_set = .;
1852 + __stop_set_sysctl_set = ABSOLUTE(.);
1856 + /* Exception frame info */
1859 + /* Miscellaneous read-only data */
1860 + _rodata_start = . ;
1861 + *(.gnu.linkonce.r*)
1871 + /* Various possible names for the end of the .text section */
1872 + etext = ALIGN(0x10);
1876 + PROVIDE (etext = .);
1877 + PROVIDE (__etext = .);
1880 + * .data section contents, copied to RAM at system startup.
1883 + data.contents.start = .;
1885 + text.size = text.end - text.start;
1888 + * If debugging, stack the read/write sections directly after the text
1889 + * section. Otherwise, stack the read/write sections starting at base of
1892 + . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org;
1894 + .data : AT (data.contents.start)
1902 + PROVIDE (__SDATA_START__ = .);
1904 + *(.gnu.linkonce.d*)
1905 + *(.gnu.linkonce.s.*)
1906 + PROVIDE (__SDATA_END__ = .);
1908 + PROVIDE (__EXCEPT_START__ = .);
1909 + *(.gcc_except_table)
1910 + PROVIDE (__EXCEPT_END__ = .);
1912 + PROVIDE(__GOT_START__ = .);
1915 + PROVIDE(__GOT_END__ = .);
1919 + PROVIDE (__GOT2_START__ = .);
1920 + PROVIDE (_GOT2_START_ = .);
1922 + PROVIDE (__GOT2_END__ = .);
1923 + PROVIDE (_GOT2_END_ = .);
1925 + PROVIDE (__FIXUP_START__ = .);
1926 + PROVIDE (_FIXUP_START_ = .);
1928 + PROVIDE (_FIXUP_END_ = .);
1929 + PROVIDE (__FIXUP_END__ = .);
1931 + /* We want the small data sections together, so single-instruction
1932 + * offsets can access them all.
1934 + PROVIDE (__SDATA2_START__ = .);
1936 + *(.gnu.linkonce.s2.*)
1937 + PROVIDE (__SDATA2_END__ = .);
1941 + data.size = data.end - data.start;
1947 + PROVIDE (__SBSS2_START__ = .);
1949 + PROVIDE (__SBSS2_END__ = .);
1951 + PROVIDE (__SBSS_START__ = .);
1953 + PROVIDE (__SBSS_END__ = .);
1955 + *(.bss .bss* .gnu.linkonce.b*)
1961 + bss.size = bss.end - bss.start;
1963 + PROVIDE(_end = bss.end);
1966 + * Initialization stack
1968 + InitStack_start = ALIGN(0x10);
1971 + PROVIDE(initStackPtr = initStack);
1976 + IntrStack_start = ALIGN(0x10);
1979 + PROVIDE(intrStackPtr = intrStack);
1981 + _WorkspaceBase = .;
1982 + __WorkspaceBase = .;
1987 + * The heap is configured at run-time to use all available memory. It
1988 + * begins just after the end of the Workspace and continues to the end of
1989 + * the external RAM.
1991 + . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size;
1997 + * Internal I/O devices
1999 + .usiu 0x002FC000: /* unified system interface unit */
2004 + .imb 0x00300000: /* inter-module bus and devices */
2009 + .sram 0x00380000: /* internal SRAM control registers */
2015 + * SS555 external devices managed by on-board CPLD
2017 + .cpld 0xFF000000: /* SS555 external CPLD devices */
2023 + /* Stabs debugging sections. */
2024 + .stab 0 : { *(.stab) }
2025 + .stabstr 0 : { *(.stabstr) }
2026 + .stab.excl 0 : { *(.stab.excl) }
2027 + .stab.exclstr 0 : { *(.stab.exclstr) }
2028 + .stab.index 0 : { *(.stab.index) }
2029 + .stab.indexstr 0 : { *(.stab.indexstr) }
2030 + .comment 0 : { *(.comment) }
2032 + /* DWARF debug sections.
2033 + Symbols in the DWARF debugging sections are relative to the beginning
2034 + of the section so we begin them at 0. */
2036 + .debug 0 : { *(.debug) }
2037 + .line 0 : { *(.line) }
2039 + /* GNU DWARF 1 extensions */
2040 + .debug_srcinfo 0 : { *(.debug_srcinfo) }
2041 + .debug_sfnames 0 : { *(.debug_sfnames) }
2043 + /* DWARF 1.1 and DWARF 2 */
2044 + .debug_aranges 0 : { *(.debug_aranges) }
2045 + .debug_pubnames 0 : { *(.debug_pubnames) }
2048 + .debug_info 0 : { *(.debug_info) }
2049 + .debug_abbrev 0 : { *(.debug_abbrev) }
2050 + .debug_line 0 : { *(.debug_line) }
2051 + .debug_frame 0 : { *(.debug_frame) }
2052 + .debug_str 0 : { *(.debug_str) }
2053 + .debug_loc 0 : { *(.debug_loc) }
2054 + .debug_macinfo 0 : { *(.debug_macinfo) }
2056 + /* SGI/MIPS DWARF 2 extensions */
2057 + .debug_weaknames 0 : { *(.debug_weaknames) }
2058 + .debug_funcnames 0 : { *(.debug_funcnames) }
2059 + .debug_typenames 0 : { *(.debug_typenames) }
2060 + .debug_varnames 0 : { *(.debug_varnames) }
2061 + /* These must appear regardless of . */
2063 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S
2064 ===================================================================
2066 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S
2070 + * This file contains the entry veneer for RTEMS programs on the Intec
2071 + * SS555 board. It jumps to the BSP which is responsible for performing
2072 + * all remaining initialization.
2074 + * This file is based on several others:
2076 + * (1) start360.s from the gen68360 BSP by
2077 + * W. Eric Norum (eric@skatter.usask.ca)
2078 + * with the following copyright and license:
2080 + * COPYRIGHT (c) 1989-1998.
2081 + * On-Line Applications Research Corporation (OAR).
2083 + * The license and distribution terms for this file may in
2084 + * the file LICENSE in this distribution or at
2085 + * http://www.rtems.com/license/LICENSE.
2087 + * (2) start.s for the eth_comm port by
2088 + * Jay Monkman (jmonkman@fracsa.com),
2089 + * which itself is based on the
2091 + * (3) dlentry.s for the Papyrus BSP, written by:
2092 + * Andrew Bray <andy@i-cubed.co.uk>
2093 + * with the following copyright and license:
2095 + * COPYRIGHT (c) 1995 by i-cubed ltd.
2097 + * (4) start860.S for the MBX821/MBX860, written by:
2098 + * Darlene A. Stewart <darlene.stewart@iit.nrc.ca>
2099 + * Copyright (c) 1999, National Research Council of Canada
2101 + * To anyone who acknowledges that this file is provided "AS IS"
2102 + * without any express or implied warranty:
2103 + * permission to use, copy, modify, and distribute this file
2104 + * for any purpose is hereby granted without fee, provided that
2105 + * the above copyright notice and this notice appears in all
2106 + * copies, and that the name of i-cubed limited not be used in
2107 + * advertising or publicity pertaining to distribution of the
2108 + * software without specific, written prior permission.
2109 + * i-cubed limited makes no representations about the suitability
2110 + * of this software for any purpose.
2112 + * (5) Modifications (for MBX8xx) of respective RTEMS files:
2113 + * Copyright (c) 1999, National Research Council of Canada
2115 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
2116 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
2119 +#include <rtems/asm.h>
2120 +#include <rtems/powerpc/registers.h>
2123 + * The initial stack is set to the top of the internal RAM.
2125 + * All the entry veneer has to do is to clear the .bss section and copy the
2126 + * initializers into the .data section.
2130 + * GDB likes to have debugging information for the entry veneer.
2131 + * Play compiler and provide some DWARF information.
2133 + * CHANGE TO SUIT YOUR SETUP!
2136 + .section .entry,"ax",@progbits
2141 +.section .debug_sfnames
2143 + .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2152 + .4byte .L_line_e-.L_line_b
2158 + .4byte .L_text_e-.L_text_b
2162 +.section .debug_srcinfo
2165 + .4byte .L_sfnames_b
2169 + .4byte .L_LE1-.L_line_b
2170 + .4byte .L_F0-.L_sfnames_b
2171 + .4byte .L_line_last-.L_line_b
2175 +.section .debug_pubnames
2184 +.section .debug_aranges
2187 + .4byte .L_text_e-.L_text_b
2201 + .4byte .L_D1_e-.L_D1
2202 + .2byte 0x11 /* TAG_compile_unit */
2203 + .2byte 0x12 /* AT_sibling */
2205 + .2byte 0x38 /* AT_name */
2208 + .2byte 0x258 /* AT_producer */
2211 + .2byte 0x111 /* AT_low_pc */
2213 + .2byte 0x121 /* AT_high_pc */
2215 + .2byte 0x106 /* AT_stmt_list */
2217 + .2byte 0x1b8 /* AT_comp_dir */
2218 + .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2220 + .2byte 0x8006 /* AT_sf_names */
2221 + .4byte .L_sfnames_b
2222 + .2byte 0x8016 /* AT_src_info */
2223 + .4byte .L_srcinfo_b
2227 + .4byte .L_D3_e-.L_D3
2228 + .2byte 0x6 /* TAG_global_subroutine */
2229 + .2byte 0x12 /* AT_sibling */
2231 + .2byte 0x38 /* AT_name */
2234 + .2byte 0x278 /* AT_prototyped */
2236 + .2byte 0x111 /* AT_low_pc */
2238 + .2byte 0x121 /* AT_high_pc */
2240 + .2byte 0x8041 /* AT_body_begin */
2242 + .2byte 0x8051 /* AT_body_end */
2247 + .4byte .L_D4_e-.L_D4
2254 + * Tell C's eabi-ctor's that we have an atexit function,
2255 + * and that it is to register __do_global_dtors.
2257 + EXTERN_PROC(atexit)
2258 + PUBLIC_VAR(__atexit)
2259 + .section ".sdata","aw"
2262 + EXT_PROC_REF(atexit)@fixup
2265 + .section ".fixup","aw"
2267 + EXT_SYM_REF(__atexit)
2270 +/* That should do it */
2273 + * Put the entry point in its own section. That way, we can guarantee
2274 + * to put it first in the .text section in the linker script.
2278 + PUBLIC_VAR (start)
2280 + bl .startup /* or bl .spin */
2284 + * Parameters from linker
2287 + .long initStackPtr
2290 + .long __GOT_START__
2302 + .long data.contents.start
2304 +PUBLIC_VAR (text_addr)
2308 +PUBLIC_VAR (text_length)
2313 + * Spin, if necessary, to acquire control from debugger (CodeWarrior).
2319 + lwz r3, spin@l(r3)
2324 + * Initialization code
2327 + /* Capture address of linker parameters. */
2330 + /* Set initial stack pointer to end of internal RAM - 56. */
2331 + lwz r1, stack_top-base_addr(r3)
2334 + /* Initialize essential registers. */
2337 + /* Set TOC pointer */
2338 + lwz r2, toc_pointer-base_addr(r3)
2340 + /* Initialize the memory mapped MPC555 registers (done in C). */
2341 + EXTERN_PROC (_InitSS555)
2342 + bl PROC (_InitSS555)
2344 + /* Clear the .bss section. */
2347 + /* Copy initializers into the .data section */
2350 + /* Enable floating point, since gcc sometimes uses the floating
2351 + * point registers for data moves, even if the C source code doesn't
2352 + * include floating point operations.
2355 + ori r0, r0, MSR_FP
2358 + /* Start system. */
2359 + lis r5, environ@ha
2360 + la r5,environ@l(r5) /* environp */
2361 + li r4, 0 /* argv */
2362 + li r3, 0 /* argc */
2363 + EXTERN_PROC (boot_card)
2364 + bl PROC (boot_card) /* call the first C routine */
2366 + /* We should never return from boot_card, but in case we do ... */
2367 + /* The next instructions are dependent on your runtime environment. */
2373 + * datacopy - copy initializers into .data section
2376 + lis r3, base_addr@ha /* point to linker data */
2377 + addi r3, r3, base_addr@l
2379 + lwz r4, contents_addr-base_addr(r3) /* .data contents in ROM */
2380 + lwz r5, data_addr-base_addr(r3) /* .data section in RAM */
2381 + lwz r6, data_length-base_addr(r3) /* length of .data */
2383 + rlwinm. r6, r6, 30, 0x3FFFFFFF /* form length / 4 */
2384 + beqlr /* no .data - return */
2386 + mtctr r6 /* set ctr reg */
2388 + lwz r6, 0(r4) /* get word */
2389 + stw r6, 0(r5) /* store word */
2390 + addi r4, r4, 0x4 /* next source */
2391 + addi r5, r5, 0x4 /* next target */
2392 + bdnz dc1 /* dec counter and loop */
2397 + * bssclr - zero out bss
2400 + lis r3, base_addr@ha /* point to linker data */
2401 + addi r3, r3, base_addr@l
2403 + lwz r4, bss_addr-base_addr(r3) /* Start of bss */
2404 + lwz r5, bss_length-base_addr(r3) /* Length of bss */
2406 + rlwinm. r5, r5, 30, 0x3FFFFFFF /* form length/4 */
2407 + beqlr /* no bss - return */
2409 + mtctr r5 /* set ctr reg */
2410 + li r5, 0x0000 /* r5 = 0 */
2412 + stw r5, 0(r4) /* store r6 */
2413 + addi r4, r4, 0x4 /* update r4 */
2414 + bdnz clear_bss /* dec counter and loop */
2420 + * Initialize the MSR and basic core PowerPC registers
2427 + * Set the processor for big-endian mode, exceptions vectored to
2428 + * 0x000n_nnnn, no execution tracing, machine check exceptions
2429 + * enabled, floating-point not available, supervisor priviledge
2430 + * level, external interrupts disabled, power management disabled
2431 + * (normal operation mode).
2433 + li r0, 0x1000 /* MSR_ME */
2434 + mtmsr r0 /* Context-synchronizing */
2438 + * Clear the exception handling registers.
2479 Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
2480 ===================================================================
2482 +++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
2485 + * Support routines for TM27
2487 + * $Id: tm27supp.c,v 1.1 2004/04/21 20:24:36 joel Exp $
2505 +rtems_irq_connect_data tm27IrqData = {
2506 + CPU_USIU_EXT_IRQ_7,
2508 + (rtems_irq_enable)tm27On,
2509 + (rtems_irq_disable)tm27Off,
2510 + (rtems_irq_is_enabled)tm27IsOn
2513 Index: rtems/c/src/lib/libbsp/powerpc/ec555/times
2514 ===================================================================
2516 +++ rtems/c/src/lib/libbsp/powerpc/ec555/times
2519 +# Timing Test Suite Results for the Intec SS555
2521 +# $Id: times,v 1.1 2004/04/12 21:52:13 joel Exp $
2526 +Clock Speed: 40 MHz
2527 +Memory Configuration: 512k external 2-1-1-1 SRAM
2530 +Times Reported in: microseconds
2531 +Timer Source: Timebase register (TMBCLK = (4 MHz crystal / 4) = 1.0 Mhz)
2534 +== ================================================================= ==== ====
2536 + 1 rtems_semaphore_create 21
2537 + rtems_semaphore_delete 22
2538 + rtems_semaphore_obtain: available 7
2539 + rtems_semaphore_obtain: not available -- NO_WAIT 7
2540 + rtems_semaphore_release: no waiting tasks 18
2542 + 2 rtems_semaphore_obtain: not available -- caller blocks 50
2544 + 3 rtems_semaphore_release: task readied -- preempts caller 41
2546 + 4 rtems_task_restart: blocked task -- preempts caller 69
2547 + rtems_task_restart: ready task -- preempts caller 67
2548 + rtems_semaphore_release: task readied -- returns to caller 23
2549 + rtems_task_create 75
2550 + rtems_task_start 30
2551 + rtems_task_restart: suspended task -- returns to caller 37
2552 + rtems_task_delete: suspended task 68
2553 + rtems_task_restart: ready task -- returns to caller 38
2554 + rtems_task_restart: blocked task -- returns to caller 44
2555 + rtems_task_delete: blocked task 70
2557 + 5 rtems_task_suspend: calling task 40
2558 + rtems_task_resume: task readied -- preempts caller 35
2560 + 6 rtems_task_restart: calling task 46
2561 + rtems_task_suspend: returns to caller 16
2562 + rtems_task_resume: task readied -- returns to caller 18
2563 + rtems_task_delete: ready task 71
2565 + 7 rtems_task_restart: suspended task -- preempts caller 64
2567 + 8 rtems_task_set_priority: obtain current priority 13
2568 + rtems_task_set_priority: returns to caller 24
2569 + rtems_task_mode: obtain current mode 4
2570 + rtems_task_mode: no reschedule 5
2571 + rtems_task_mode: reschedule -- returns to caller 7
2572 + rtems_task_mode: reschedule -- preempts caller 37
2573 + rtems_task_set_note 13
2574 + rtems_task_get_note 13
2575 + rtems_clock_set 27
2578 + 9 rtems_message_queue_create 34
2579 + rtems_message_queue_send: no waiting tasks 26
2580 + rtems_message_queue_urgent: no waiting tasks 26
2581 + rtems_message_queue_receive: available 24
2582 + rtems_message_queue_flush: no messages flushed 12
2583 + rtems_message_queue_flush: messages flushed 15
2584 + rtems_message_queue_delete 26
2586 +10 rtems_message_queue_receive: not available -- NO_WAIT 15
2587 + rtems_message_queue_receive: not available -- caller blocks 52
2589 +11 rtems_message_queue_send: task readied -- preempts caller 47
2591 +12 rtems_message_queue_send: task readied -- returns to caller 29
2593 +13 rtems_message_queue_urgent: task readied -- preempts caller 46
2595 +14 rtems_message_queue_urgent: task readied -- returns to caller 29
2597 +15 rtems_event_receive: obtain current events 1
2598 + rtems_event_receive: not available -- NO_WAIT 12
2599 + rtems_event_receive: not available -- caller blocks 44
2600 + rtems_event_send: no task readied 13
2601 + rtems_event_receive: available 13
2602 + rtems_event_send: task readied -- returns to caller 21
2604 +16 rtems_event_send: task readied -- preempts caller 41
2606 +17 rtems_task_set_priority: preempts caller 49
2608 +18 rtems_task_delete: calling task 95
2610 +19 rtems_signal_catch 10
2611 + rtems_signal_send: returns to caller 15
2612 + rtems_signal_send: signal to self 20
2613 + exit ASR overhead: returns to calling task 15
2614 + exit ASR overhead: returns to preempting task 30
2616 +20 rtems_partition_create 25
2617 + rtems_region_create 38
2618 + rtems_partition_get_buffer: available 14
2619 + rtems_partition_get_buffer: not available 13
2620 + rtems_partition_return_buffer 15
2621 + rtems_partition_delete 16
2622 + rtems_region_get_segment: available 34
2623 + rtems_region_get_segment: not available -- NO_WAIT 32
2624 + rtems_region_return_segment: no waiting tasks 33
2625 + rtems_region_get_segment: not available -- caller blocks 68
2626 + rtems_region_return_segment: task readied -- preempts caller 67
2627 + rtems_region_return_segment: task readied -- returns to caller 48
2628 + rtems_region_delete 30
2629 + rtems_io_initialize 2
2634 + rtems_io_control 1
2636 +21 rtems_task_ident 25
2637 + rtems_message_queue_ident 22
2638 + rtems_semaphore_ident 29
2639 + rtems_partition_ident 22
2640 + rtems_region_ident 24
2641 + rtems_port_ident 22
2642 + rtems_timer_ident 22
2643 + rtems_rate_monotonic_ident 22
2645 +22 rtems_message_queue_broadcast: task readied -- returns to caller 33
2646 + rtems_message_queue_broadcast: no waiting tasks 20
2647 + rtems_message_queue_broadcast: task readied -- preempts caller 50
2649 +23 rtems_timer_create 13
2650 + rtems_timer_fire_after: inactive 22
2651 + rtems_timer_fire_after: active 24
2652 + rtems_timer_cancel: active 13
2653 + rtems_timer_cancel: inactive 12
2654 + rtems_timer_reset: inactive 21
2655 + rtems_timer_reset: active 22
2656 + rtems_timer_fire_when: inactive 26
2657 + rtems_timer_fire_when: active 26
2658 + rtems_timer_delete: active 18
2659 + rtems_timer_delete: inactive 16
2660 + rtems_task_wake_when 49
2662 +24 rtems_task_wake_after: yield -- returns to caller 10
2663 + rtems_task_wake_after: yields -- preempts caller 36
2665 +25 rtems_clock_tick 8
2670 + _Thread_Disable_dispatch 1
2671 + _Thread_Enable_dispatch 7
2672 + _Thread_Set_state 7
2673 + _Thread_Disptach (NO FP) 32
2674 + context switch: no floating point contexts 25
2675 + context switch: self 11
2676 + context switch: to another task 12
2677 + fp context switch: restore 1st FP task 37
2678 + fp context switch: save idle, restore initialized 34
2679 + fp context switch: save idle, restore idle 48
2680 + fp context switch: save initialized, restore initialized 34
2686 + _Thread_Get: invalid id 1
2688 +27 interrupt entry overhead: returns to interrupted task 13
2689 + interrupt exit overhead: returns to interrupted task 11
2690 + interrupt entry overhead: returns to nested interrupt 12
2691 + interrupt exit overhead: returns to nested interrupt 10
2692 + interrupt entry overhead: returns to preempting task 12
2693 + interrupt exit overhead: returns to preempting task 38
2695 +28 rtems_port_create 16
2696 + rtems_port_external_to_internal 11
2697 + rtems_port_internal_to_external 11
2698 + rtems_port_delete 16
2700 +29 rtems_rate_monotonic_create 15
2701 + rtems_rate_monotonic_period: initiate period -- returns to caller 20
2702 + rtems_rate_monotonic_period: obtain status 12
2703 + rtems_rate_monotonic_cancel 15
2704 + rtems_rate_monotonic_delete: inactive 18
2705 + rtems_rate_monotonic_delete: active 20
2706 + rtems_rate_monotonic_period: conclude periods -- caller blocks 36
2707 Index: rtems/make/custom/ec555.cfg
2708 ===================================================================
2710 +++ rtems/make/custom/ec555.cfg
2713 +# Config file for an Intec Automation SS555 MPC555-based card
2715 +# This file is derived from:
2717 +# Config file for a PowerPC MPC860-based MBX821-001 card.
2718 +# Config file for a PowerPC 403 based helas403 card
2719 +# Config file for MPC860 based Ethernet Comm Board
2722 +include $(RTEMS_ROOT)/make/custom/default.cfg
2726 +RTEMS_CPU_MODEL=mpc555
2728 +# This is the actual bsp directory used during the build process.
2729 +RTEMS_BSP_FAMILY=ss555
2731 +# This contains the compiler options necessary to select the CPU model
2732 +# and (hopefully) optimize for it.
2734 +CPU_CFLAGS = -mcpu=$(GCC_CPU_MODEL) -D$(RTEMS_CPU_MODEL) -D$(RTEMS_BSP_FAMILY)
2736 +# Debugging flags: If we debug with optimization on, single-stepping
2737 +# sometimes looks a little odd, but there won't be any surprises later.
2738 +CFLAGS_DEBUG_V += -O4 -ggdb
2739 +CXXFLAGS_DEBUG_V += -O4 -ggdb
2741 +# optimize flag: typically -O, could use -O4 or -fast
2742 +# -O4 is ok for RTEMS
2743 +# NOTE: some level of -O may be actually required by inline assembler
2744 +CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
2745 +CXXFLAGS_OPTIMIZE_V=-O4
2748 + $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(SS555_LDFLAGS) \
2749 + -o $(basename $@)_sym.exe $(LINK_OBJS) $(LINK_LIBS)
2750 + $(NM) -g -n $(basename $@)_sym.exe > $(basename $@).nm
2751 + cp $(basename $@)_sym.exe $(basename $@).exe
2752 + $(STRIP) $(basename $@).exe
2753 + $(SIZE) $(basename $@)_sym.exe
2756 +# Miscellaneous additions go here
2758 +# Override default start file
2761 Index: rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am
2762 ===================================================================
2764 +++ rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am
2766 +## Automatically generated by ampolish3 - Do not edit
2769 +$(srcdir)/preinstall.am: Makefile.am
2770 + $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
2774 +DISTCLEANFILES += $(PREINSTALL_DIRS)
2776 +all-am: $(PREINSTALL_FILES)
2779 +CLEANFILES = $(PREINSTALL_FILES)
2781 +$(PROJECT_LIB)/$(dirstamp):
2782 + @$(mkdir_p) $(PROJECT_LIB)
2783 + @: > $(PROJECT_LIB)/$(dirstamp)
2784 +PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
2786 +$(PROJECT_INCLUDE)/$(dirstamp):
2787 + @$(mkdir_p) $(PROJECT_INCLUDE)
2788 + @: > $(PROJECT_INCLUDE)/$(dirstamp)
2789 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
2791 +$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
2792 + $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
2793 +PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
2795 +$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
2796 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
2797 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
2799 +$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
2800 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
2801 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
2803 +$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
2804 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
2805 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
2807 +$(PROJECT_INCLUDE)/bsp/$(dirstamp):
2808 + @$(mkdir_p) $(PROJECT_INCLUDE)/bsp
2809 + @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2810 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2812 +$(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
2813 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
2814 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
2816 +$(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2817 + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
2818 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
2820 +$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
2821 + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
2822 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds