]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - rtems-patches/current/rtems-clone-ss555-to-ec555.patch
be62d51ba9260bd5ba039288a6f06b4b6577fae6
[rtems-devel.git] / rtems-patches / current / rtems-clone-ss555-to-ec555.patch
1 ---
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(+)
22
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
27 @@ -0,0 +1,131 @@
28 +2007-04-06     Ralf Corsépius <ralf.corsepius@rtems.org>
29 +
30 +       * bsp_specs: Remove lib (Now expected to exist in GCC).
31 +
32 +2006-12-02     Ralf Corsépius <ralf.corsepius@rtems.org>
33 +
34 +       * configure.ac: New BUG-REPORT address.
35 +
36 +2006-10-19     Ralf Corsépius <ralf.corsepius@rtems.org>
37 +
38 +       * configure.ac: Require automake-1.10. Require autoconf-2.60.
39 +
40 +2006-03-08     Joel Sherrill <joel@OARcorp.com>
41 +
42 +       * startup/linkcmds: Add .gnu.linkonce.b.* section.
43 +
44 +2006-02-08     Joel Sherrill <joel@OARcorp.com>
45 +
46 +       * startup/linkcmds: Add sections required by newer gcc versions.
47 +
48 +2006-01-11     Ralf Corsepius <ralf.corsepius@rtems.org>
49 +
50 +       * configure.ac: Remove explicit ampolish3 support (now in
51 +       RTEMS_BSP_CONFIGURE).
52 +
53 +2006-01-10     Ralf Corsepius <ralf.corsepius@rtems.org>
54 +
55 +       * configure.ac: Add ampolish3 support.
56 +       * Makefile.am: Add preinstall.am.
57 +
58 +2006-01-09     Ralf Corsepius <ralf.corsepius@rtems.org>
59 +
60 +       * Makefile.am: Don't include subdirs.am.
61 +
62 +2005-05-26     Ralf Corsepius <ralf.corsepius@rtems.org>
63 +
64 +       * include/bsp.h: New header guard.
65 +
66 +2005-05-10     Ralf Corsepius <ralf.corsepius@rtems.org>
67 +
68 +       * console/console.c: Eliminate unsigned8.
69 +
70 +2005-04-26     Joel Sherrill <joel@OARcorp.com>
71 +
72 +       * startup/bspstart.c: Eliminate warnings.
73 +
74 +2005-04-25      Jennifer Averett <jennifer.averett@oarcorp.com>
75 +
76 +        PR 779/bsp
77 +        * clock/p_clock.c: Add parameter to powerpc exception handler routines
78 +
79 +2005-02-17     Ralf Corsepius <ralf.corsepius@rtems.org>
80 +
81 +       * startup/bspstart.c: include <rtems/powerpc/powerpc.h>.
82 +       Use PPC_MINIMUM_STACK_FRAME_SIZE instead of
83 +       CPU_MINIMUM_STACK_FRAME_SIZE.
84 +
85 +2005-02-16     Ralf Corsepius <ralf.corsepius@rtems.org>
86 +
87 +       * configure.ac: Remove argument from RTEMS_PPC_EXCEPTIONS.
88 +
89 +2005-02-11     Ralf Corsepius <ralf.corsepius@rtems.org>
90 +
91 +       * Makefile.am: Merge-in wrapup/Makefile.am.
92 +       * wrapup/Makefile.am: Remove.
93 +       * configure.ac: Reflect changes above.
94 +
95 +2005-01-07     Ralf Corsepius <ralf.corsepius@rtems.org>
96 +
97 +       * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
98 +
99 +2005-01-02     Ralf Corsepius <ralf.corsepius@rtems.org>
100 +
101 +       * Makefile.am, wrapup/Makefile.am: Remove build-variant support.
102 +
103 +2004-10-20     Ralf Corsepius <ralf_corsepius@rtems.org>
104 +
105 +       * console/console.c, include/bsp.h, startup/bspstart.c,
106 +       startup/iss555.c: Use POSIX fixed size types.
107 +
108 +2004-09-24     Ralf Corsepius <ralf_corsepius@rtems.org>
109 +
110 +       * configure.ac: Require automake > 1.9.
111 +
112 +2004-04-23     Ralf Corsepius <ralf_corsepius@rtems.org>
113 +
114 +       PR 610/bsps
115 +       * Makefile.am: Add include/tm27.h, Cosmetics.
116 +       * include/tm27.h: Final cosmetics.
117 +
118 +2004-04-22     Ralf Corsepius <ralf_corsepius@rtems.org>
119 +
120 +       * include/bsp.h: Split out tmtest27 support.
121 +       * include/tm27.h: New.
122 +
123 +2004-04-21     Joel Sherrill <joel@OARcorp.com>
124 +
125 +       PR 611/bsps
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.
129 +
130 +2004-04-21     Joel Sherrill <joel@OARcorp.com>
131 +
132 +       PR 611/bsps
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.
136 +
137 +2004-04-21     Ralf Corsepius <ralf_corsepius@rtems.org>
138 +
139 +       PR 613/bsps
140 +       * include/bsp.h: Remove MAX_LONG_TEST_DURATION.
141 +
142 +2004-04-21     Ralf Corsepius <ralf_corsepius@rtems.org>
143 +
144 +       PR 614/bsps
145 +       * include/bsp.h: Remove MAX_SHORT_TEST_DURATION (Unused).
146 +
147 +2004-04-13     Ralf Corsepius <ralf_corsepius@rtems.org>
148 +
149 +       * include/bsp.h, startup/start.S: Reflect new locations of cpukit headers.
150 +
151 +2004-04-12     David Querbach <querbach@realtime.bc.ca>
152 +
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.
158 +
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
163 @@ -0,0 +1,65 @@
164 +##
165 +## $Id: Makefile.am,v 1.10 2006/01/12 10:12:30 ralf Exp $
166 +##
167 +
168 +ACLOCAL_AMFLAGS = -I ../../../../aclocal
169 +
170 +include $(top_srcdir)/../../../../automake/compile.am
171 +include $(top_srcdir)/../../bsp.am
172 +
173 +dist_project_lib_DATA = bsp_specs
174 +
175 +include_HEADERS = include/bsp.h
176 +include_HEADERS += include/tm27.h
177 +
178 +nodist_include_HEADERS = include/bspopts.h
179 +DISTCLEANFILES = include/bspopts.h
180 +
181 +noinst_PROGRAMS =
182 +
183 +include_bspdir = $(includedir)/bsp
184 +
185 +include_HEADERS += include/coverhd.h
186 +include_bsp_HEADERS = irq/irq.h
187 +
188 +EXTRA_DIST = times
189 +
190 +dist_project_lib_DATA += startup/linkcmds
191 +
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)
196 +
197 +noinst_PROGRAMS += console.rel
198 +console_rel_SOURCES = console/console.c
199 +console_rel_CPPFLAGS = $(AM_CPPFLAGS)
200 +console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
201 +
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)
209 +
210 +noinst_PROGRAMS += tm27supp.rel
211 +tm27supp_rel_SOURCES = startup/tm27supp.c
212 +tm27supp_rel_CPPFLAGS = $(AM_CPPFLAGS)
213 +tm27supp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
214 +
215 +noinst_LIBRARIES = libbsp.a
216 +libbsp_a_SOURCES =
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
226 +
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
233 @@ -0,0 +1,262 @@
234 +#
235 +#  $Id: README,v 1.1 2004/04/12 21:52:13 joel Exp $
236 +#
237 +
238 +This is a README file for the Intec SS555 of RTEMS 4.6.0
239 +
240 +The SS555 port was sponsored by Defence Research and Development 
241 +Canada - Suffield, and is Copyright (C) 2004, Real-Time Systems Inc.
242 +
243 +Please send any comments, improvements, or bug reports to:
244 +
245 +David Querbach
246 +querbach@realtime.bc.ca
247 +
248 +
249 +Summary
250 +-------
251 +
252 +BSP NAME:           ss555
253 +BOARD:              Intec Automation Inc. SS555
254 +BUS:                None 
255 +CPU FAMILY:         PowerPC
256 +CPU:                PowerPC MPC555
257 +COPROCESSORS:       Built-in Motorola TPU
258 +MODE:               32 bit mode
259 +
260 +DEBUG MONITOR:      None
261 +
262 +PERIPHERALS
263 +===========
264 +TIMERS:             PIT / Timebase
265 +  RESOLUTION:       1 microsecond (4 MHz crystal / 4)
266 +SERIAL PORTS:       2 SCI
267 +REAL-TIME CLOCK:    On-chip.
268 +DMA:                None.
269 +VIDEO:              None.
270 +SCSI:               None.
271 +NETWORKING:         None.
272 +                  
273 +
274 +DRIVER INFORMATION
275 +==================
276 +CLOCK DRIVER:       yes
277 +CONSOLE DRIVER:     yes
278 +SHMSUPP:            N/A
279 +TIMER DRIVER:       yes
280 +NETWORK DRIVER:            no
281 +
282 +NOTES
283 +=====
284 +On-chip resources:
285 +       SCI1            serial port
286 +       SCI2            serial port (console)
287 +       PIT             clock
288 +       TB              timing test support
289 +       DEC
290 +       SWT             watchdog timer -- enable in startup/iss555.c
291 +       *CS0            external 512k 2-1-1-1 Burst SRAM
292 +       *CS1
293 +       *CS2
294 +       *CS3            CPLD
295 +       IRQ0
296 +       IRQ1
297 +       IRQ2            
298 +       IRQ3            
299 +       IRQ4            
300 +       IRQ5    
301 +       IRQ6
302 +       IRQ7
303 +       IRQ_LVL0        
304 +       IRQ_LVL1
305 +       IRQ_LVL2
306 +       IRQ_LVL3
307 +       IRQ_LVL4
308 +       IRQ_LVL5        SCI
309 +       IRQ_LVL6        PIT
310 +       IRQ_LVL7
311 +       
312 +
313 +Board description
314 +-----------------
315 +Clock rate:     40 MHz development/embeddable board
316 +Bus width:      32-bit on-board RAM, 16-bit off-board I/O
317 +FLASH:         512k on-chip
318 +RAM:            512k 2-1-1-1 burst SRAM
319 +
320 +
321 +Installation
322 +------------
323 +
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:
327 +
328 +       make VARIANT=DEBUG all
329 +
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.
335 +
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.
341 +
342 +
343 +Console driver
344 +---------------
345 +
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.
351 +
352 +The BSP console supports three different modes of operation:
353 +
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.
357 +     
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).
360 +
361 +  0 - polled I/O.
362 +  1 - interrupt-driven I/O.
363 +  
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:
369 +
370 +  0 - do not use termios
371 +  1 - use termios
372 +
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.
375 +
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.
384 +
385 +The real solution is to fix the tests so that they work with interrupt-driven
386 +I/O and termios.
387 +
388 +
389 +printk() and debug output
390 +-----------------------
391 +
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.
397 +
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.
401 +
402 +printk() always uses polled I/O, and never uses termios.
403 +
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().
409 +
410 +
411 +Watchdog Timer
412 +--------------
413 +
414 +The MPC555 watchdog timer can be enabled at configuration time by defining
415 +the WATCHDOG_TIMEOUT variable.  This variable sets the watchdog timeout
416 +period in steps of
417 +
418 +         2048          2048
419 +       ---------  =  ---------  =  51.2 usec
420 +        Fsystem       40 MHz
421 +
422 +or about 1/20 msec.  When WATCHDOG_TIMEOUT is left undefined, the watchdog
423 +timer is disabled.
424 +
425 +
426 +Miscellaneous
427 +-------------
428 +
429 +Most code came from the mbx8xx port, except for the floating-point handling
430 +which came from the mpc8260ads.
431 +
432 +
433 +Host System
434 +-----------
435 +
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.
439 +
440 +
441 +Test Configuration
442 +------------------
443 +
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.    
452 +
453 +
454 +Test Results
455 +------------
456 +
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
461 +      buffer_test_io.h)
462 +
463 +Multi-processor tests:  
464 +  Not applicable.
465 +
466 +Library tests:
467 +  All tests passed.  Note that the termios test only works if the system is
468 +  rebuilt with termios enabled.                         
469 +
470 +Posix tests:
471 +  All tests passed, except that:
472 +    - the message queue test failed with "errno (91 - File or path name too
473 +      long)"
474 +
475 +Timing tests:
476 +  Due to memory limitations, many of the tests will not run unless you set
477 +  OPERATION_COUNT=20 at configuration time.
478 +
479 +  To run tm27 (the interrupt latency timer test), short CN5-48 to CN5-50 on
480 +  the SS555 board.
481 +
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.
484 +
485 +  See the times file for the results of the timing tests.
486 +
487 +Network tests:  
488 +  Not applicable.
489 +
490 +Sample programs:
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
494 +      limitations.
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
500 @@ -0,0 +1,13 @@
501 +%rename endfile old_endfile
502 +%rename startfile old_startfile
503 +%rename link old_link
504 +
505 +*startfile:
506 +%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s}}
507 +
508 +*endfile:
509 +%{!qrtems: %(old_endfile)} %{qrtems: ecrtn%O%s}
510 +
511 +*link:
512 +%{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -N -u start -e start}
513 +
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
518 @@ -0,0 +1,69 @@
519 +/*
520 + *  Clock Tick interrupt conexion code.
521 + *
522 + *  COPYRIGHT (c) 1989-1997.
523 + *  On-Line Applications Research Corporation (OAR).
524 + *
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.
528 + *
529 + *  SS555 port sponsored by Defence Research and Development Canada - Suffield
530 + *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
531 + *
532 + *  Derived from c/src/lib/libbsp/powerpc/mbx8xx/clock/p_clock.c:
533 + *
534 + *  Modified to support the MPC750.
535 + *  Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
536 + *
537 + *  $Id: p_clock.c,v 1.3 2005/04/25 14:46:37 jennifer Exp $
538 + */
539 +
540 +#include <bsp.h>
541 +#include <bsp/irq.h>
542 +#include <rtems/bspIo.h>
543 +
544 +extern void clockOn(void*);
545 +extern void clockOff (void*);
546 +extern int clockIsOn(void*);
547 +extern void Clock_isr(void *);
548 +
549 +static rtems_irq_connect_data clockIrqData = {
550 +  CPU_PERIODIC_TIMER,
551 +  (rtems_irq_hdl)Clock_isr,
552 +  NULL,
553 +  (rtems_irq_enable)clockOn,
554 +  (rtems_irq_disable)clockOff,
555 +  (rtems_irq_is_enabled)clockIsOn
556 +};
557 +
558 +int BSP_disconnect_clock_handler (void)
559 +{
560 +  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
561 +     printk("Unable to stop system clock\n");
562 +    rtems_fatal_error_occurred(1);
563 +  }
564 +  return BSP_remove_rtems_irq_handler (&clockIrqData);
565 +}
566 +
567 +int BSP_connect_clock_handler (rtems_irq_hdl hdl)
568 +{
569 +  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
570 +     printk("Unable to get system clock handler\n");
571 +    rtems_fatal_error_occurred(1);
572 +  }
573 +  if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
574 +   printk("Unable to remove current system clock handler\n");
575 +    rtems_fatal_error_occurred(1);
576 +  }
577 +  /*
578 +   * Reinit structure
579 +   */
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;
585 +
586 +  return BSP_install_rtems_irq_handler (&clockIrqData);
587 +}
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
592 @@ -0,0 +1,52 @@
593 +## Process this file with autoconf to produce a configure script.
594 +## 
595 +## $Id: configure.ac,v 1.7.2.2 2006/12/02 06:06:51 ralf Exp $
596 +
597 +AC_PREREQ(2.60)
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(../../../../../..)
601 +
602 +RTEMS_CANONICAL_TARGET_CPU
603 +AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.10])
604 +RTEMS_BSP_CONFIGURE
605 +
606 +RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
607 +RTEMS_CANONICALIZE_TOOLS
608 +RTEMS_PROG_CCAS
609 +
610 +RTEMS_CHECK_NETWORKING
611 +AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
612 +
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.])
617 +
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.])
622 +
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.])
627 +
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.])
631 +
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.])
638 +
639 +# Explicitly list a Makefile here 
640 +AC_CONFIG_FILES([Makefile])
641 +
642 +RTEMS_PPC_EXCEPTIONS
643 +
644 +AC_OUTPUT
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
649 @@ -0,0 +1,368 @@
650 +/*
651 + *  console.c
652 + *
653 + *  This file contains the Intec SS555 termios serial I/O package.
654 + *
655 + *  The SCI channels are assigned as follows
656 + *
657 + *   Channel     Device      Minor
658 + *    SCI1      /dev/tty0      0
659 + *    SCI2      /dev/tty1      1
660 + *
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).
668 + *
669 + *  I/O may be interrupt-driven (recommended for real-time applications) or
670 + *  polled.
671 + *
672 + *  LIMITATIONS:
673 + *
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.
678 + *
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
681 + *  NVRAM.
682 + *
683 + *  Interrupt-driven I/O requires termios.
684 + *
685 + *  TESTS:
686 + *
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.
696 + *
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.
700 + *
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.
705 + *
706 + *
707 + *  SS555 port sponsored by Defence Research and Development Canada - Suffield
708 + *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
709 + *
710 + *  Derived from c/src/lib/libbsp/powerpc/mbx8xx/console/console.c:
711 + *
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.
715 + *
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
719 + *
720 + */
721 +#include <stdarg.h>
722 +#include <stdio.h>
723 +#include <bsp.h>                /* Must be before libio.h */
724 +#include <rtems/bspIo.h>
725 +#include <rtems/libio.h>
726 +#include <termios.h>
727 +
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);
731 +
732 +static void _BSP_null_char( char c ) {return;}
733 +
734 +BSP_output_char_function_type BSP_output_char = _BSP_null_char;
735 +
736 +/*
737 + *  do_poll_read
738 + *
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!
742 + *
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.
745 + *
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.
751 + *
752 + *  Output parameters:
753 + *    arg->bytes_moved - the number of characters read. Always 1.
754 + *
755 + *  Return value: RTEMS_SUCCESSFUL
756 + *
757 + *  CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
758 + */
759 +static rtems_status_code do_poll_read(
760 +  rtems_device_major_number major,
761 +  rtems_device_minor_number minor,
762 +  void                    * arg
763 +)
764 +{
765 +  rtems_libio_rw_args_t *rw_args = arg;
766 +  int c;
767 +
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;
773 +
774 +  return RTEMS_SUCCESSFUL;
775 +}
776 +
777 +/*
778 + *  do_poll_write
779 + *
780 + *  Output characters through polled I/O. Returns only once every character has
781 + *  been sent.
782 + *
783 + *  CR is transmitted AFTER a LF on output.
784 + *
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.
790 + *
791 + *  Output parameters:
792 + *    arg->bytes_moved - the number of characters read
793 + *
794 + *  Return value: RTEMS_SUCCESSFUL
795 + *
796 + *  CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
797 + */
798 +static rtems_status_code do_poll_write(
799 +  rtems_device_major_number major,
800 +  rtems_device_minor_number minor,
801 +  void                    * arg
802 +)
803 +{
804 +  rtems_libio_rw_args_t *rw_args = arg;
805 +  uint32_t i;
806 +  char cr ='\r';
807 +
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);
812 +  }
813 +  rw_args->bytes_moved = i;
814 +
815 +  return RTEMS_SUCCESSFUL;
816 +}
817 +
818 +/*
819 + *  Print functions prototyped in bspIo.h
820 + */
821 +
822 +static void _BSP_output_char( char c )
823 +{
824 +  char cr = '\r';
825 +
826 +  /*
827 +   *  Can't rely on console_initialize having been called before this
828 +   *  function is used, so it may fail.
829 +   */
830 +
831 +  m5xx_uart_pollWrite( PRINTK_MINOR, &c, 1 );
832 +  if( c == '\n' )
833 +    m5xx_uart_pollWrite( PRINTK_MINOR, &cr, 1 );
834 +}
835 +
836 +/*
837 + ***************
838 + * BOILERPLATE *
839 + ***************
840 + *
841 + *  All these functions are prototyped in rtems/c/src/lib/include/console.h.
842 + */
843 +
844 +/*
845 + * Initialize and register the device
846 + */
847 +rtems_device_driver console_initialize(
848 +  rtems_device_major_number major,
849 +  rtems_device_minor_number minor,
850 +  void *arg
851 +)
852 +{
853 +  rtems_status_code status;
854 +
855 +  /*
856 +   * Set up TERMIOS if needed
857 +   */
858 +  #if UARTS_USE_TERMIOS == 1
859 +    rtems_termios_initialize ();
860 +  #endif /* UARTS_USE_TERMIOS */
861 +
862 +  /*
863 +   * Do device-specific initialization
864 +   */
865 +  BSP_output_char = _BSP_output_char;
866 +
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);
871 +
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);
876 +
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);
881 +
882 +  return RTEMS_SUCCESSFUL;
883 +}
884 +
885 +/*
886 + * Open the device
887 + */
888 +rtems_device_driver console_open(
889 +  rtems_device_major_number major,
890 +  rtems_device_minor_number minor,
891 +  void *arg
892 +)
893 +{
894 +  rtems_status_code sc;
895 +
896 +  if ( minor > NUM_PORTS - 1 )
897 +    return RTEMS_INVALID_NUMBER;
898 +
899 +  #if (UARTS_USE_TERMIOS == 1)
900 +  {
901 +    #if (UARTS_IO_MODE == 1)    /* RTEMS interrupt-driven I/O with termios */
902 +
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 */
912 +      };
913 +      sc = rtems_termios_open( major, minor, arg, &callbacks );
914 +
915 +    #else /* UARTS_IO_MODE != 1        */      /* RTEMS polled I/O with termios */
916 +
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 */
926 +      };
927 +      sc = rtems_termios_open( major, minor, arg, &callbacks );
928 +
929 +    #endif
930 +
931 +    return sc;
932 +  }
933 +
934 +  #else                /* no termios -- default to polled I/O */
935 +  {
936 +    sc = RTEMS_SUCCESSFUL;
937 +  }
938 +  #endif
939 +
940 +  return sc;
941 +}
942 +
943 +/*
944 + * Close the device
945 + */
946 +rtems_device_driver console_close(
947 +  rtems_device_major_number major,
948 +  rtems_device_minor_number minor,
949 +  void *arg
950 +)
951 +{
952 +  if ( minor > NUM_PORTS-1 )
953 +    return RTEMS_INVALID_NUMBER;
954 +
955 +  #if UARTS_USE_TERMIOS == 1
956 +    return rtems_termios_close( arg );
957 +  #else
958 +    return RTEMS_SUCCESSFUL;
959 +  #endif
960 +}
961 +
962 +/*
963 + * Read from the device
964 + */
965 +rtems_device_driver console_read(
966 +  rtems_device_major_number major,
967 +  rtems_device_minor_number minor,
968 +  void *arg
969 +)
970 +{
971 +  if ( minor > NUM_PORTS-1 )
972 +    return RTEMS_INVALID_NUMBER;
973 +
974 +  #if UARTS_USE_TERMIOS == 1
975 +    return rtems_termios_read( arg );
976 +  #else
977 +    return do_poll_read( major, minor, arg );
978 +  #endif
979 +}
980 +
981 +/*
982 + * Write to the device
983 + */
984 +rtems_device_driver console_write(
985 +  rtems_device_major_number major,
986 +  rtems_device_minor_number minor,
987 +  void *arg
988 +)
989 +{
990 +  if ( minor > NUM_PORTS-1 )
991 +    return RTEMS_INVALID_NUMBER;
992 +
993 +  #if UARTS_USE_TERMIOS == 1
994 +    return rtems_termios_write( arg );
995 +  #else
996 +    return do_poll_write( major, minor, arg );
997 +  #endif
998 +}
999 +
1000 +/*
1001 + * Handle ioctl request.
1002 + */
1003 +rtems_device_driver console_control(
1004 +  rtems_device_major_number major,
1005 +  rtems_device_minor_number minor,
1006 +  void *arg
1007 +)
1008 +{
1009 +  if ( minor > NUM_PORTS-1 )
1010 +    return RTEMS_INVALID_NUMBER;
1011 +
1012 +  #if UARTS_USE_TERMIOS == 1
1013 +    return rtems_termios_ioctl( arg );
1014 +  #else
1015 +    return RTEMS_SUCCESSFUL;
1016 +  #endif
1017 +}
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
1022 @@ -0,0 +1,114 @@
1023 +/*  bsp.h
1024 + *
1025 + *  This include file contains all board IO definitions.
1026 + *
1027 + *  This file includes definitions for the Intec SS555.
1028 + *
1029 + *
1030 + *  SS555 port sponsored by Defence Research and Development Canada - Suffield
1031 + *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1032 + *
1033 + *  Derived from c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h:
1034 + *
1035 + *  COPYRIGHT (c) 1989-1998.
1036 + *  On-Line Applications Research Corporation (OAR).
1037 + *
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.
1041 + *
1042 + *  $Id: bsp.h,v 1.10 2006/03/17 10:11:37 ralf Exp $
1043 + */
1044 +
1045 +#ifndef _BSP_H
1046 +#define _BSP_H
1047 +
1048 +#ifdef __cplusplus
1049 +extern "C" {
1050 +#endif
1051 +
1052 +#include <bspopts.h>
1053 +
1054 +#include <rtems.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>
1061 +
1062 +/*
1063 + * Clock definitions
1064 + */
1065 +
1066 +#define BSP_CRYSTAL_HZ          4000000        /* crystal frequency, Hz */
1067 +#define BSP_CLOCK_HZ   40000000        /* CPU clock frequency, Hz
1068 +
1069 +/*
1070 + * I/O definitions
1071 + *
1072 + * The SS555 board includes a CPLD to control on-board features and
1073 + * off-board devices.
1074 + */
1075 +typedef struct cpld_ {
1076 +  uint8_t      cs3a[32];               /* Chip select 3A */
1077 +  uint8_t      pad0[0x200000 - 0x000020];
1078 +
1079 +  uint8_t      cs3b[32];               /* Chip select 3B */
1080 +  uint8_t      pad2[0x400000 - 0x200020];
1081 +
1082 +  uint8_t      cs3c[32];               /* Chip select 3C */
1083 +  uint8_t      pad4[0x600000 - 0x400020];
1084 +
1085 +  uint8_t      cs3d[32];               /* Chip select 3D */
1086 +  uint8_t      pad6[0x800000 - 0x600020];
1087 +
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];
1092 +
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];
1096 +} cpld_t;
1097 +
1098 +extern volatile cpld_t cpld;              /* defined in linkcmds */
1099 +
1100 +/* miscellaneous stuff assumed to exist */
1101 +
1102 +extern rtems_configuration_table BSP_Configuration;
1103 +
1104 +/*
1105 + *  Device Driver Table Entries
1106 + */
1107 +
1108 +/*
1109 + * NOTE: Use the standard Console driver entry
1110 + */
1111 +
1112 +/*
1113 + * NOTE: Use the standard Clock driver entry
1114 + */
1115 +
1116 +/*
1117 + * How many libio files we want
1118 + */
1119 +
1120 +#define BSP_LIBIO_MAX_FDS       20
1121 +
1122 +/* functions */
1123 +
1124 +void bsp_cleanup( void );
1125 +
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  */
1130 +);
1131 +
1132 +#ifdef __cplusplus
1133 +}
1134 +#endif
1135 +
1136 +#endif
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
1141 @@ -0,0 +1,116 @@
1142 +/*  coverhd.h
1143 + *
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
1153 + *  timing results.
1154 + *
1155 + *  NOTE:  If these are all zero, then the times reported include
1156 + *         all calling overhead including passing of arguments.
1157 + *
1158 + *  COPYRIGHT (c) 1989-1998.
1159 + *  On-Line Applications Research Corporation (OAR).
1160 + *
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.
1164 + *
1165 + *  $Id: coverhd.h,v 1.2 2006/03/17 10:11:37 ralf Exp $
1166 + */
1167 +
1168 +#ifndef __COVERHD_h
1169 +#define __COVERHD_h
1170 +
1171 +#ifdef __cplusplus
1172 +extern "C" {
1173 +#endif
1174 +
1175 +/*
1176 + * 40 MHz processor, running from external 2-1-1-1 burst SRAM.
1177 + */
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
1197 +
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
1218 +
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
1238 +
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
1252 +
1253 +#ifdef __cplusplus
1254 +}
1255 +#endif
1256 +
1257 +#endif
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
1262 @@ -0,0 +1,54 @@
1263 +/*
1264 + *  tm27.h
1265 + *
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.
1269 + *
1270 + *  $Id: tm27.h,v 1.2 2004/04/23 04:47:38 ralf Exp $
1271 + */
1272 +
1273 +#ifndef _RTEMS_TMTEST27
1274 +#error "This is an RTEMS internal file you must not include directly."
1275 +#endif
1276 +
1277 +#ifndef __tm27_h
1278 +#define __tm27_h
1279 +
1280 +/*
1281 + * Stuff for Time Test 27
1282 + *
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.
1285 + */
1286 +
1287 +#define MUST_WAIT_FOR_INTERRUPT 1
1288 +
1289 +#define Install_tm27_vector( handler )                                 \
1290 +{                                                                      \
1291 +  extern rtems_irq_connect_data tm27IrqData;                            \
1292 +  usiu.siel |= (1 << 17);                                              \
1293 +  usiu.sipend |= (1 << 17);                                            \
1294 +                                                                       \
1295 +  tm27IrqData.hdl = (rtems_irq_hdl)handler;                            \
1296 +  BSP_install_rtems_irq_handler (&tm27IrqData);                                \
1297 +}
1298 +
1299 +#define Cause_tm27_intr()                                              \
1300 +{                                                                      \
1301 +  usiu.siel &= ~(1 << 17);                                             \
1302 +}
1303 +
1304 +#define Clear_tm27_intr()                                              \
1305 +{                                                                      \
1306 +  usiu.siel |= (1 << 17);                                              \
1307 +  usiu.sipend |= (1 << 17);                                            \
1308 +}
1309 +
1310 +#define Lower_tm27_intr()                                              \
1311 +{                                                                      \
1312 +  ppc_cached_irq_mask |= (1 << 17);                                    \
1313 +  usiu.simask = ppc_cached_irq_mask;                                   \
1314 +}
1315 +
1316 +#endif
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
1321 @@ -0,0 +1,55 @@
1322 +/* irq.h
1323 + *
1324 + *  This include file describe the data structure and the functions implemented
1325 + *  by rtems to write interrupt handlers.
1326 + *
1327 + *
1328 + *  SS555 port sponsored by Defence Research and Development Canada - Suffield
1329 + *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1330 + *
1331 + *  Derived from libbsp/powerpc/mbx8xx/irq/irq.h:
1332 + *
1333 + *  CopyRight (C) 1999 valette@crf.canon.fr
1334 + *
1335 + *  This code is heavilly inspired by the public specification of STREAM V2
1336 + *  that can be found at :
1337 + *
1338 + *      <http://www.chorus.com/Documentation/index.html> by following
1339 + *  the STREAM API Specification Document link.
1340 + *
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.
1344 + *
1345 + *  $Id: irq.h,v 1.2 2004/04/21 10:43:03 ralf Exp $
1346 + */
1347 +
1348 +#ifndef LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1349 +#define LIBBSP_POWERPC_SS555_IRQ_IRQ_H
1350 +
1351 +#include <libcpu/irq.h>
1352 +
1353 +#ifndef ASM
1354 +
1355 +#ifdef __cplusplus
1356 +extern "C" {
1357 +#endif
1358 +
1359 +/*
1360 + * The SS555 has no external interrupt controller chip, so use the standard
1361 + * routines from the CPU-dependent code.
1362 + */
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)
1369 +
1370 +#ifdef __cplusplus
1371 +}
1372 +#endif
1373 +
1374 +#endif /* ASM */
1375 +
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
1381 @@ -0,0 +1,201 @@
1382 +/*  bspstart.c
1383 + *
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.
1388 + *
1389 + *  COPYRIGHT (c) 1989-1998.
1390 + *  On-Line Applications Research Corporation (OAR).
1391 + *
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.
1395 + *
1396 + *  SS555 port sponsored by Defence Research and Development Canada - Suffield
1397 + *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1398 + *
1399 + *  Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c:
1400 + *
1401 + *  Modifications for MBX860:
1402 + *  Copyright (c) 1999, National Research Council of Canada
1403 + *
1404 + *  $Id: bspstart.c,v 1.7 2005/04/26 23:16:21 joel Exp $
1405 + */
1406 +
1407 +#include <string.h>
1408 +
1409 +#include <rtems/libio.h>
1410 +#include <rtems/libcsupport.h>
1411 +#include <rtems/bspIo.h>
1412 +#include <rtems/powerpc/powerpc.h>
1413 +
1414 +#include <libcpu/cpuIdent.h>
1415 +#include <libcpu/spr.h>
1416 +
1417 +#include <bsp/irq.h>
1418 +#include <bsp.h>
1419 +
1420 +SPR_RW(SPRG0)
1421 +SPR_RW(SPRG1)
1422 +
1423 +/*
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).
1428 + */
1429 +extern rtems_configuration_table Configuration;
1430 +extern unsigned long intrStackPtr;
1431 +rtems_configuration_table  BSP_Configuration;
1432 +
1433 +rtems_cpu_table Cpu_table;
1434 +
1435 +char *rtems_progname;
1436 +
1437 +/*
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.
1441 + */
1442 +void bsp_postdriver_hook(void);
1443 +void bsp_libc_init( void *, uint32_t, int );
1444 +
1445 +void BSP_panic(char *s)
1446 +{
1447 +  printk("%s PANIC %s\n",_RTEMS_version, s);
1448 +  __asm__ __volatile ("sc");
1449 +}
1450 +
1451 +void _BSP_Fatal_error(unsigned int v)
1452 +{
1453 +  printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
1454 +  __asm__ __volatile ("sc");
1455 +}
1456 +
1457 +/*
1458 + *  bsp_pretasking_hook
1459 + *
1460 + *  Called when RTEMS initialization is complete but before interrupts and
1461 + *  tasking are enabled. Used to setup libc and install any BSP extensions.
1462 + *
1463 + *  Must not use libc (to do io) from here, since drivers are not yet
1464 + *  initialized.
1465 + *
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
1470 + *
1471 + *  Input parameters: NONE
1472 + *
1473 + *  Output parameters: NONE
1474 + *
1475 + *  Return values: NONE
1476 + */
1477 +void bsp_pretasking_hook(void)
1478 +{
1479 +  /*
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.
1488 +   */
1489 +    uint8_t *_HeapStart =
1490 +      (uint8_t *)BSP_Configuration.work_space_start
1491 +           + BSP_Configuration.work_space_size;
1492 +    extern uint8_t _HeapEnd[];
1493 +
1494 +    bsp_libc_init( _HeapStart, _HeapEnd - _HeapStart, 0 );
1495 +
1496 +#ifdef RTEMS_DEBUG
1497 +  rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
1498 +#endif
1499 +}
1500 +
1501 +/*
1502 + *  bsp_start()
1503 + *
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
1509 + *
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.
1514 + *
1515 + *  Input parameters: NONE
1516 + *
1517 + *  Output parameters: NONE
1518 + *
1519 + *  Return values: NONE
1520 + */
1521 +void bsp_start(void)
1522 +{
1523 +  extern char _WorkspaceBase[];
1524 +
1525 +  ppc_cpu_id_t myCpu;
1526 +  ppc_cpu_revision_t myCpuRevision;
1527 +  register unsigned char* intrStack;
1528 +
1529 +  /*
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
1532 +   * later.
1533 +   */
1534 +  myCpu        = get_ppc_cpu_type();
1535 +  myCpuRevision = get_ppc_cpu_revision();
1536 +
1537 +  /*
1538 +   * Initialize some SPRG registers related to irq handling
1539 +   */
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);
1544 +
1545 +  /*
1546 +   * Install our own set of exception vectors
1547 +   */
1548 +  initialize_exceptions();
1549 +
1550 +  /*
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.
1556 +   *
1557 +   *  In this case, the memory is not malloc'ed.  It is just
1558 +   *  "pulled from the air".
1559 +   */
1560 +  BSP_Configuration.work_space_start = _WorkspaceBase;
1561 +
1562 +  /*
1563 +   *  initialize the CPU table for this BSP
1564 +   */
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;
1569 +
1570 +  Cpu_table.clicks_per_usec = BSP_CRYSTAL_HZ / 4 / 1000000;
1571 +  Cpu_table.clock_speed = BSP_CLOCK_HZ;        /* for SCI baud rate generator */
1572 +
1573 +  /*
1574 +   * Call this in case we use TERMIOS for console I/O
1575 +   */
1576 +  m5xx_uart_reserve_resources( &BSP_Configuration );
1577 +
1578 +  /*
1579 +   * Initalize RTEMS IRQ system
1580 +   */
1581 +  BSP_rtems_irq_mng_init(0);
1582 +}
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
1587 @@ -0,0 +1,148 @@
1588 +/*
1589 + *  iss555.c
1590 + *
1591 + *  Intec SS555 initialization routines.
1592 + *
1593 + *  SS555 port sponsored by Defence Research and Development Canada - Suffield
1594 + *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
1595 + *
1596 + *  Derived from c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c:
1597 + *
1598 + *  Copyright (c) 1999, National Research Council of Canada
1599 + *
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.
1603 + */
1604 +
1605 +#include <bsp.h>
1606 +
1607 +SPR_RW(ICTRL);
1608 +SPR_RW(DEC);
1609 +SPR_RW(TBWU);
1610 +SPR_RW(TBWL);
1611 +SPR_RO(IMMR);
1612 +SPR_RW(MI_GRA);
1613 +SPR_RW(L2U_GRA);
1614 +SPR_RW(BBCMCR);
1615 +
1616 +/*
1617 + *  Initialize SS555
1618 + */
1619 +void _InitSS555 (void)
1620 +{
1621 +  register uint32_t plprcr, msr;
1622 +
1623 +  /*
1624 +   * Initialize the System Protection Control Register (SYPCR).
1625 +   * The SYPCR can only be written once after Reset.
1626 +   */
1627 +  usiu.sypcr =
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 */
1634 +#endif
1635 +    | USIU_SYPCR_SWRI                  /* watchdog forces reset */
1636 +    | USIU_SYPCR_SWP;                  /* prescale watchdog by 2048 */
1637 +
1638 +  TICKLE_WATCHDOG();                   /* restart watchdog timer */
1639 +
1640 +  /*
1641 +   * Re-tune the PLL to the desired system clock frequency.
1642 +   */
1643 +  usiu.plprck = USIU_UNLOCK_KEY;       /* unlock PLPRCR */
1644 +  usiu.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 */
1649 +
1650 +  while (((plprcr = usiu.plprcr) & USIU_PLPRCR_SPLS) == 0)
1651 +    ;                                  /* wait for PLL to re-lock */
1652 +
1653 +  /*
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.
1658 +   */
1659 +  usiu.tbscrk = USIU_UNLOCK_KEY;
1660 +  usiu.tbscr |= USIU_TBSCR_TBE;                /* enable time base and decrementer */
1661 +  usiu.tbscrk = 0;
1662 +
1663 +  usiu.tbk = USIU_UNLOCK_KEY;
1664 +  _write_DEC(0x7FFFFFFF);
1665 +  _write_TBWU(0x00000000 );
1666 +  _write_TBWL(0x00000000 );
1667 +  usiu.tbk = 0;
1668 +
1669 +  /*
1670 +   * Run the Inter-Module Bus at full speed.
1671 +   */
1672 +  imb.uimb.umcr &= ~UIMB_UMCR_HSPEED;
1673 +
1674 +  /*
1675 +   * Initialize Memory Controller for External RAM
1676 +   *
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.
1679 +   *
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.
1683 +   */
1684 +  extern char int_ram_top[];           /* top of internal ram */
1685 +
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 */
1690 +
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 */
1697 +
1698 +  /*
1699 +   * Initialize Memory Controller for External CPLD
1700 +   *
1701 +   * The SS555 board includes a CPLD to control on-board features and
1702 +   * off-board devices.  (Configuration taken from Intec's hwhook.c)
1703 +   */
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 */
1710 +
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 */
1716 +
1717 +  /*
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.
1721 +   */
1722 +  _write_ICTRL(0x00000007);
1723 +
1724 +  /*
1725 +   * Set up Burst Buffer Controller (BBC)
1726 +   */
1727 +  _write_BBCMCR(
1728 +      BBCMCR_ETRE                      /* enable exception relocation */
1729 +    | BBCMCR_BE);                      /* enable burst accesses */
1730 +  _isync;
1731 +
1732 +  _CPU_MSR_GET(msr);
1733 +  msr |= MSR_IP;               /* set prefix for exception relocation */
1734 +  _CPU_MSR_SET(msr);
1735 +}
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
1740 @@ -0,0 +1,319 @@
1741 +/*
1742 + * Linker command file for Intec SS555 board
1743 + *
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
1748 + * zero.
1749 + *
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.
1755 + *
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.
1759 + *
1760 + *  $Id: linkcmds,v 1.3 2006/03/08 18:50:12 joel Exp $
1761 + */
1762 +
1763 +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
1764 +OUTPUT_ARCH(powerpc) 
1765 +ENTRY(start)
1766 +
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 */
1770 +
1771 +
1772 +SECTIONS
1773 +{
1774 +  .vectors 0x0:
1775 +  {
1776 +    /*
1777 +     * For the MPC555, we use the compressed vector table format which puts
1778 +     * all of the exception vectors before 0x100.
1779 +     */ 
1780 +    *(.vectors)
1781 +  }
1782 +
1783 +  .text 0x100:
1784 +  {
1785 +    /* Read-only sections, merged into text segment: */
1786 +    
1787 +    text.start = .;
1788 +
1789 +    /* Entry point is the .entry section */
1790 +    *(.entry)
1791 +    *(.entry2)
1792 +
1793 +    /* Actual code */
1794 +    *(.text*)
1795 +
1796 +    /* C++ constructors/destructors */
1797 +    *(.gnu.linkonce.t*)
1798 +            
1799 +    /*  Initialization and finalization code.
1800 +     *
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. 
1810 +     */
1811 +    PROVIDE (_init = .);
1812 +    *ecrti.o(.init)
1813 +    *(.init)
1814 +    *ecrtn.o(.init)
1815 +    
1816 +    PROVIDE (_fini = .);
1817 +    *ecrti.o(.fini)
1818 +    *(.fini)
1819 +    *ecrtn.o(.init)
1820 +
1821 +    /* 
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.
1826 +     */
1827 +    PROVIDE (__CTOR_LIST__ = .);            
1828 +    /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
1829 +    *crtbegin.o(.ctors)
1830 +    *(.ctors)
1831 +    *crtend.o(.ctors)
1832 +    LONG(0)
1833 +    PROVIDE (__CTOR_END__ = .);
1834 +       
1835 +    PROVIDE (__DTOR_LIST__ = .);
1836 +    /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
1837 +    *crtbegin.o(.dtors)
1838 +    *(.dtors)
1839 +    *crtend.o(.dtors)
1840 +    LONG(0)
1841 +    PROVIDE (__DTOR_END__ = .);
1842 +       
1843 +    /*
1844 +     * Special FreeBSD sysctl sections.
1845 +     */
1846 +    . = ALIGN (16);
1847 +    __start_set_sysctl_set = .;
1848 +    *(set_sysctl_*);
1849 +    __stop_set_sysctl_set = ABSOLUTE(.);
1850 +    *(set_domain_*);
1851 +    *(set_pseudo_*);
1852 +
1853 +    /* Exception frame info */
1854 +    *(.eh_frame)
1855 +
1856 +    /* Miscellaneous read-only data */
1857 +    _rodata_start = . ;
1858 +    *(.gnu.linkonce.r*)
1859 +    *(.lit)
1860 +    *(.shdata)
1861 +    *(.rodata*)
1862 +    *(.rodata1)
1863 +    *.(eh_frame)
1864 +    *(.descriptors)
1865 +    *(rom_ver)
1866 +    _erodata = .;
1867 +
1868 +    /* Various possible names for the end of the .text section */
1869 +    etext = ALIGN(0x10);
1870 +    _etext = .;
1871 +    _endtext = .;
1872 +    text.end = .;
1873 +    PROVIDE (etext = .);
1874 +    PROVIDE (__etext = .);
1875 +
1876 +    /* 
1877 +     * .data section contents, copied to RAM at system startup. 
1878 +     */
1879 +    . = ALIGN(0x20);
1880 +    data.contents.start = .;
1881 +  }
1882 +  text.size = text.end - text.start;
1883 +
1884 +  /*
1885 +   * If debugging, stack the read/write sections directly after the text
1886 +   * section.  Otherwise, stack the read/write sections starting at base of
1887 +   * internal RAM.
1888 +   */
1889 +  . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org;
1890
1891 +  .data : AT (data.contents.start)
1892 +  {
1893 +    data.start = .;
1894 +    
1895 +    *(.data)
1896 +    *(.data.*)
1897 +    *(.data1)
1898 +    
1899 +    PROVIDE (__SDATA_START__ = .);
1900 +    *(.sdata*)
1901 +    *(.gnu.linkonce.d*)
1902 +    *(.gnu.linkonce.s.*)
1903 +    PROVIDE (__SDATA_END__ = .);
1904 +    
1905 +    PROVIDE (__EXCEPT_START__ = .);
1906 +    *(.gcc_except_table)
1907 +    PROVIDE (__EXCEPT_END__ = .);
1908 +    
1909 +    PROVIDE(__GOT_START__ = .);
1910 +    *(.got.plt) 
1911 +    *(.got)
1912 +    PROVIDE(__GOT_END__ = .);
1913 +       
1914 +    *(.got1)
1915 +    
1916 +    PROVIDE (__GOT2_START__ = .);
1917 +    PROVIDE (_GOT2_START_ = .);
1918 +    *(.got2)
1919 +    PROVIDE (__GOT2_END__ = .);
1920 +    PROVIDE (_GOT2_END_ = .);
1921 +       
1922 +    PROVIDE (__FIXUP_START__ = .);
1923 +    PROVIDE (_FIXUP_START_ = .);
1924 +    *(.fixup)
1925 +    PROVIDE (_FIXUP_END_ = .);
1926 +    PROVIDE (__FIXUP_END__ = .);
1927 +
1928 +    /*  We want the small data sections together, so single-instruction
1929 +     *   offsets can access them all.
1930 +     */
1931 +    PROVIDE (__SDATA2_START__ = .);
1932 +    *(.sdata2)
1933 +    *(.gnu.linkonce.s2.*)
1934 +    PROVIDE (__SDATA2_END__ = .);
1935 +
1936 +    data.end = .;
1937 +  }
1938 +  data.size = data.end - data.start;
1939 +       
1940 +  .bss :
1941 +  {
1942 +    bss.start = .;
1943 +       
1944 +    PROVIDE (__SBSS2_START__ = .);
1945 +    *(.sbss2)
1946 +    PROVIDE (__SBSS2_END__ = .);
1947 +       
1948 +    PROVIDE (__SBSS_START__ = .);
1949 +    *(.sbss*)
1950 +    PROVIDE (__SBSS_END__ = .);
1951 +
1952 +    *(.bss .bss* .gnu.linkonce.b*)
1953 +    *(COMMON)
1954 +
1955 +    . = ALIGN(4);
1956 +    bss.end = .;
1957 +  }
1958 +  bss.size = bss.end - bss.start;
1959 +
1960 +  PROVIDE(_end = bss.end);
1961 +
1962 +  /*
1963 +   * Initialization stack
1964 +   */
1965 +  InitStack_start = ALIGN(0x10);
1966 +  . += 0x1000;
1967 +  initStack = .;
1968 +  PROVIDE(initStackPtr = initStack);
1969 +
1970 +  /*
1971 +   * Interrupt stack
1972 +   */
1973 +  IntrStack_start = ALIGN(0x10);
1974 +  . += 0x4000;
1975 +  intrStack = .;
1976 +  PROVIDE(intrStackPtr = intrStack);
1977 +
1978 +  _WorkspaceBase = .;
1979 +  __WorkspaceBase = .;
1980 +       
1981 +  /*
1982 +   * Heap
1983 +   *
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.
1987 +   */
1988 +  . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size;
1989 +  _HeapEnd = .;
1990 +  __HeapEnd = .;
1991
1992 +        
1993 +  /* 
1994 +   * Internal I/O devices 
1995 +   */
1996 +  .usiu 0x002FC000:            /* unified system interface unit */
1997 +  {
1998 +    usiu = .;
1999 +  }
2000 +
2001 +  .imb 0x00300000:             /* inter-module bus and devices */
2002 +  {
2003 +    imb = .;
2004 +  }
2005 +
2006 +  .sram 0x00380000:            /* internal SRAM control registers */
2007 +  {
2008 +    sram = .;
2009 +  }
2010 +
2011 +  /*
2012 +   * SS555 external devices managed by on-board CPLD
2013 +   */
2014 +  .cpld 0xFF000000:            /* SS555 external CPLD devices */
2015 +  {
2016 +    cpld = .;
2017 +  }
2018 +
2019 +
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) }
2028 +  
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.  */
2032 +  /* DWARF 1 */
2033 +  .debug          0 : { *(.debug) }
2034 +  .line           0 : { *(.line) }
2035 +  
2036 +  /* GNU DWARF 1 extensions */
2037 +  .debug_srcinfo  0 : { *(.debug_srcinfo) }
2038 +  .debug_sfnames  0 : { *(.debug_sfnames) }
2039 +  
2040 +  /* DWARF 1.1 and DWARF 2 */
2041 +  .debug_aranges  0 : { *(.debug_aranges) }
2042 +  .debug_pubnames 0 : { *(.debug_pubnames) }
2043 +  
2044 +  /* DWARF 2 */
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) }
2052 +  
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  .  */
2059 +}
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
2064 @@ -0,0 +1,411 @@
2065 +/*  start.S
2066 + *
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.
2070 + *
2071 + * This file is based on several others:
2072 + *
2073 + * (1) start360.s from the gen68360 BSP by
2074 + *     W. Eric Norum (eric@skatter.usask.ca)
2075 + *     with the following copyright and license:
2076 + *
2077 + *     COPYRIGHT (c) 1989-1998.
2078 + *     On-Line Applications Research Corporation (OAR).
2079 + *
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.
2083 + *
2084 + * (2) start.s for the eth_comm port by
2085 + *     Jay Monkman (jmonkman@fracsa.com),
2086 + *     which itself is based on the
2087 + *
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:
2091 + *
2092 + *     COPYRIGHT (c) 1995 by i-cubed ltd.
2093 + *
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
2097 + *
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.
2108 + *
2109 + * (5) Modifications (for MBX8xx) of respective RTEMS files:
2110 + *     Copyright (c) 1999, National Research Council of Canada
2111 + *
2112 + * SS555 port sponsored by Defence Research and Development Canada - Suffield
2113 + * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
2114 + */
2115 +
2116 +#include <rtems/asm.h>
2117 +#include <rtems/powerpc/registers.h>
2118 +
2119 +/*
2120 + *  The initial stack is set to the top of the internal RAM.
2121 + *
2122 + *  All the entry veneer has to do is to clear the .bss section and copy the
2123 + *  initializers into the .data section.
2124 + */
2125 +
2126 +/*
2127 + *  GDB likes to have debugging information for the entry veneer.
2128 + *  Play compiler and provide some DWARF information.
2129 + *
2130 + *  CHANGE TO SUIT YOUR SETUP!
2131 + */
2132 +
2133 +        .section .entry,"ax",@progbits
2134 +.L_text_b:
2135 +.L_LC1:
2136 +       .previous
2137 +
2138 +.section       .debug_sfnames
2139 +.L_sfnames_b:
2140 +       .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2141 +       .byte 0
2142 +.L_F0:
2143 +       .byte "start.S"
2144 +       .byte 0
2145 +       .previous
2146 +
2147 +.section       .line
2148 +.L_line_b:
2149 +       .4byte  .L_line_e-.L_line_b
2150 +       .4byte  .L_text_b
2151 +.L_LE1:
2152 +.L_line_last:
2153 +       .4byte  0x0
2154 +       .2byte  0xffff
2155 +       .4byte  .L_text_e-.L_text_b
2156 +.L_line_e:
2157 +       .previous
2158 +
2159 +.section       .debug_srcinfo
2160 +.L_srcinfo_b:
2161 +       .4byte  .L_line_b
2162 +       .4byte  .L_sfnames_b
2163 +       .4byte  .L_text_b
2164 +       .4byte  .L_text_e
2165 +       .4byte  0xffffffff
2166 +       .4byte  .L_LE1-.L_line_b
2167 +       .4byte  .L_F0-.L_sfnames_b
2168 +       .4byte  .L_line_last-.L_line_b
2169 +       .4byte  0xffffffff
2170 +       .previous
2171 +
2172 +.section       .debug_pubnames
2173 +       .4byte  .L_debug_b
2174 +       .4byte  .L_P0
2175 +       .byte "start"
2176 +       .byte 0
2177 +       .4byte  0x0
2178 +       .byte 0
2179 +       .previous
2180 +
2181 +.section       .debug_aranges
2182 +       .4byte  .L_debug_b
2183 +       .4byte  .L_text_b
2184 +       .4byte  .L_text_e-.L_text_b
2185 +       .4byte  0
2186 +       .4byte  0
2187 +       .4byte  0
2188 +       .4byte  0
2189 +       .4byte  0
2190 +       .4byte  0
2191 +       .4byte  0x0
2192 +       .4byte  0x0
2193 +       .previous
2194 +
2195 +.section       .debug
2196 +.L_debug_b:
2197 +.L_D1:
2198 +       .4byte  .L_D1_e-.L_D1
2199 +       .2byte  0x11    /* TAG_compile_unit */
2200 +       .2byte  0x12    /* AT_sibling */
2201 +       .4byte  .L_D2
2202 +       .2byte  0x38    /* AT_name */
2203 +       .byte "start.S"
2204 +       .byte 0
2205 +       .2byte  0x258   /* AT_producer */
2206 +       .byte "GAS 2.5.2"
2207 +       .byte 0
2208 +       .2byte  0x111   /* AT_low_pc */
2209 +       .4byte  .L_text_b
2210 +       .2byte  0x121   /* AT_high_pc */
2211 +       .4byte  .L_text_e
2212 +       .2byte  0x106   /* AT_stmt_list */
2213 +       .4byte  .L_line_b
2214 +       .2byte  0x1b8   /* AT_comp_dir */
2215 +       .byte "rtems/c/src/lib/libbsp/powerpc/ss555/startup/"
2216 +       .byte 0
2217 +       .2byte  0x8006  /* AT_sf_names */
2218 +       .4byte  .L_sfnames_b
2219 +       .2byte  0x8016  /* AT_src_info */
2220 +       .4byte  .L_srcinfo_b
2221 +.L_D1_e:
2222 +.L_P0:
2223 +.L_D3:
2224 +       .4byte  .L_D3_e-.L_D3
2225 +       .2byte  0x6     /* TAG_global_subroutine */
2226 +       .2byte  0x12    /* AT_sibling */
2227 +       .4byte  .L_D4
2228 +       .2byte  0x38    /* AT_name */
2229 +       .byte "start"
2230 +       .byte 0
2231 +       .2byte  0x278   /* AT_prototyped */
2232 +       .byte 0
2233 +       .2byte  0x111   /* AT_low_pc */
2234 +       .4byte  .L_text_b
2235 +       .2byte  0x121   /* AT_high_pc */
2236 +       .4byte  .L_text_e
2237 +       .2byte  0x8041  /* AT_body_begin */
2238 +       .4byte  .L_text_b
2239 +       .2byte  0x8051  /* AT_body_end */
2240 +       .4byte  .L_text_e
2241 +.L_D3_e:
2242 +
2243 +.L_D4:
2244 +       .4byte  .L_D4_e-.L_D4
2245 +       .align 2
2246 +.L_D4_e:
2247 +.L_D2:
2248 +       .previous
2249 +
2250 +/*
2251 + * Tell C's eabi-ctor's that we have an atexit function,
2252 + * and that it is to register __do_global_dtors.
2253 + */
2254 +       EXTERN_PROC(atexit)
2255 +       PUBLIC_VAR(__atexit)
2256 +       .section ".sdata","aw"
2257 +       .align  2
2258 +SYM(__atexit):
2259 +       EXT_PROC_REF(atexit)@fixup
2260 +       .previous
2261 +
2262 +       .section ".fixup","aw"
2263 +       .align  2
2264 +       EXT_SYM_REF(__atexit)
2265 +       .previous
2266 +
2267 +/* That should do it */
2268 +
2269 +/*
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.
2272 + */
2273 +        .section .entry
2274 +
2275 +        PUBLIC_VAR (start)
2276 +SYM(start):
2277 +        bl      .startup       /* or bl .spin */
2278 +base_addr:
2279 +
2280 +/*
2281 + * Parameters from linker
2282 + */
2283 +stack_top:
2284 +       .long   initStackPtr
2285 +
2286 +toc_pointer:
2287 +        .long   __GOT_START__
2288 +
2289 +bss_length:
2290 +        .long   bss.size
2291 +bss_addr:
2292 +        .long   bss.start
2293 +
2294 +data_length:
2295 +        .long   data.size
2296 +data_addr:
2297 +        .long   data.start
2298 +contents_addr:
2299 +        .long   data.contents.start
2300 +
2301 +PUBLIC_VAR (text_addr)
2302 +text_addr:
2303 +        .long   text.start
2304 +
2305 +PUBLIC_VAR (text_length)
2306 +text_length:
2307 +        .long   text.size
2308 +
2309 +/*
2310 + * Spin, if necessary, to acquire control from debugger (CodeWarrior).
2311 + */
2312 +spin:
2313 +       .long   0x0001
2314 +.spin:
2315 +       lis     r3, spin@ha
2316 +       lwz     r3, spin@l(r3)
2317 +       cmpwi   r3, 0x1
2318 +       beq     .spin
2319 +
2320 +/*
2321 + * Initialization code
2322 + */
2323 +.startup:
2324 +        /* Capture address of linker parameters. */
2325 +        mflr    r3
2326 +
2327 +       /* Set initial stack pointer to end of internal RAM - 56. */
2328 +       lwz     r1, stack_top-base_addr(r3)
2329 +        addi    r1, r1, -56
2330 +
2331 +        /* Initialize essential registers. */
2332 +        bl      initregs
2333 +
2334 +        /* Set TOC pointer */
2335 +        lwz r2, toc_pointer-base_addr(r3)
2336 +
2337 +        /* Initialize the memory mapped MPC555 registers (done in C). */
2338 +        EXTERN_PROC (_InitSS555)
2339 +        bl     PROC (_InitSS555)
2340 +
2341 +        /* Clear the .bss section. */
2342 +        bl      bssclr
2343 +
2344 +       /* Copy initializers into the .data section */
2345 +       bl      datacopy
2346 +
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.
2350 +        */
2351 +       mfmsr   r0
2352 +       ori     r0, r0, MSR_FP
2353 +       mtmsr   r0
2354 +
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 */
2362 +
2363 +        /* We should never return from boot_card, but in case we do ... */
2364 +       /* The next instructions are dependent on your runtime environment. */
2365 +
2366 +stop_here:
2367 +       b       stop_here
2368 +
2369 +/*
2370 + * datacopy - copy initializers into .data section
2371 + */
2372 +datacopy:
2373 +       lis     r3, base_addr@ha                /* point to linker data */
2374 +       addi    r3, r3, base_addr@l
2375 +
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 */
2379 +
2380 +        rlwinm. r6, r6, 30, 0x3FFFFFFF          /* form length / 4 */
2381 +        beqlr                                   /* no .data - return */
2382 +
2383 +        mtctr   r6                              /* set ctr reg */
2384 +dc1:
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 */
2390 +
2391 +        blr                                     /* return */
2392 +
2393 +/*
2394 + * bssclr - zero out bss
2395 + */
2396 +bssclr:
2397 +       lis     r3, base_addr@ha                /* point to linker data */
2398 +       addi    r3, r3, base_addr@l
2399 +
2400 +        lwz     r4, bss_addr-base_addr(r3)      /* Start of bss */
2401 +        lwz     r5, bss_length-base_addr(r3)    /* Length of bss */
2402 +
2403 +        rlwinm. r5, r5, 30, 0x3FFFFFFF          /* form length/4 */
2404 +        beqlr                                   /* no bss - return */
2405 +
2406 +        mtctr   r5                              /* set ctr reg */
2407 +        li      r5, 0x0000                      /* r5 = 0 */
2408 +clear_bss:
2409 +        stw     r5, 0(r4)                       /* store r6 */
2410 +        addi    r4, r4, 0x4                     /* update r4 */
2411 +        bdnz    clear_bss                       /* dec counter and loop */
2412 +
2413 +        blr                                     /* return */
2414 +
2415 +/*
2416 + * initregs
2417 + *     Initialize the MSR and basic core PowerPC registers
2418 + *
2419 + * Register usage:
2420 + *     r0 - scratch
2421 + */
2422 +initregs:
2423 +       /*
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).
2429 +        */
2430 +       li      r0, 0x1000      /* MSR_ME */
2431 +       mtmsr   r0              /* Context-synchronizing */
2432 +       isync
2433 +
2434 +       /*
2435 +        * Clear the exception handling registers.
2436 +        */
2437 +       li      r0, 0x0000
2438 +       mtdar   r0
2439 +       mtspr   sprg0, r0
2440 +       mtspr   sprg1, r0
2441 +       mtspr   sprg2, r0
2442 +       mtspr   sprg3, r0
2443 +       mtspr   srr0, r0
2444 +       mtspr   srr1, r0
2445 +
2446 +       mr      r6, r0
2447 +       mr      r7, r0
2448 +       mr      r8, r0
2449 +       mr      r9, r0
2450 +       mr      r10, r0
2451 +       mr      r11, r0
2452 +       mr      r12, r0
2453 +       mr      r13, r0
2454 +       mr      r14, r0
2455 +       mr      r15, r0
2456 +       mr      r16, r0
2457 +       mr      r17, r0
2458 +       mr      r18, r0
2459 +       mr      r19, r0
2460 +       mr      r20, r0
2461 +       mr      r21, r0
2462 +       mr      r22, r0
2463 +       mr      r23, r0
2464 +       mr      r24, r0
2465 +       mr      r25, r0
2466 +       mr      r26, r0
2467 +       mr      r27, r0
2468 +       mr      r28, r0
2469 +       mr      r29, r0
2470 +       mr      r30, r0
2471 +       mr      r31, r0
2472 +
2473 +       blr                     /* return */
2474 +
2475 +.L_text_e:
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
2480 @@ -0,0 +1,29 @@
2481 +/*
2482 + *  Support routines for TM27
2483 + *
2484 + *  $Id: tm27supp.c,v 1.1 2004/04/21 20:24:36 joel Exp $
2485 + */
2486 +
2487 +#include <bsp.h>
2488 +
2489 +void tm27On()                                                          
2490 +{                                                                      
2491 +}                                                                      
2492 +                                                                       
2493 +void tm27Off()                                                         
2494 +{                                                                      
2495 +}                                                                      
2496 +                                                                       
2497 +int tm27IsOn()                                                         
2498 +{                                                                      
2499 +  return 1;                                                            
2500 +}                                                                      
2501 +                                                                       
2502 +rtems_irq_connect_data tm27IrqData = {                                 
2503 +  CPU_USIU_EXT_IRQ_7,                                                  
2504 +  (rtems_irq_hdl)0,                                                    
2505 +  (rtems_irq_enable)tm27On,                                            
2506 +  (rtems_irq_disable)tm27Off,                                          
2507 +  (rtems_irq_is_enabled)tm27IsOn                                       
2508 +};
2509 +
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
2514 @@ -0,0 +1,189 @@
2515 +#
2516 +#  Timing Test Suite Results for the Intec SS555
2517 +#
2518 +#  $Id: times,v 1.1 2004/04/12 21:52:13 joel Exp $
2519 +#
2520 +
2521 +Board: SS555
2522 +CPU: MPC555
2523 +Clock Speed: 40 MHz
2524 +Memory Configuration: 512k external 2-1-1-1 SRAM
2525 +Wait States: 0
2526 +
2527 +Times Reported in: microseconds
2528 +Timer Source: Timebase register (TMBCLK = (4 MHz crystal / 4) = 1.0 Mhz)
2529 +
2530 +#                          DESCRIPTION                                  A       B
2531 +== =================================================================   ====    ====
2532 +
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
2538 +
2539 + 2 rtems_semaphore_obtain: not available -- caller blocks               50
2540 +
2541 + 3 rtems_semaphore_release: task readied -- preempts caller             41
2542 +
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
2553 +
2554 + 5 rtems_task_suspend: calling task                                     40
2555 +   rtems_task_resume: task readied -- preempts caller                   35
2556 +
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
2561 +
2562 + 7 rtems_task_restart: suspended task -- preempts caller                64
2563 +
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
2573 +   rtems_clock_get                                                       1
2574 +
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
2582 +
2583 +10 rtems_message_queue_receive: not available -- NO_WAIT                15
2584 +   rtems_message_queue_receive: not available -- caller blocks          52
2585 +
2586 +11 rtems_message_queue_send: task readied -- preempts caller            47
2587 +
2588 +12 rtems_message_queue_send: task readied -- returns to caller          29
2589 +
2590 +13 rtems_message_queue_urgent: task readied -- preempts caller          46
2591 +
2592 +14 rtems_message_queue_urgent: task readied -- returns to caller        29
2593 +
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
2600 +
2601 +16 rtems_event_send: task readied -- preempts caller                    41
2602 +
2603 +17 rtems_task_set_priority: preempts caller                             49
2604 +
2605 +18 rtems_task_delete: calling task                                      95
2606 +
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
2612 +
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
2627 +   rtems_io_open                                                         1
2628 +   rtems_io_close                                                        1
2629 +   rtems_io_read                                                         1
2630 +   rtems_io_write                                                        1
2631 +   rtems_io_control                                                      1
2632 +
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
2641 +
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
2645 +
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
2658 +
2659 +24 rtems_task_wake_after: yield -- returns to caller                    10
2660 +   rtems_task_wake_after: yields -- preempts caller                     36
2661 +
2662 +25 rtems_clock_tick                                                      8
2663 +
2664 +26 _ISR_Disable                                                          1
2665 +   _ISR_Flash                                                            1
2666 +   _ISR_Enable                                                           1
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
2678 +   _Thread_Resume                                                        7
2679 +   _Thread_Unblock                                                       6
2680 +   _Thread_Ready                                                         7
2681 +   _Thread_Get                                                           4
2682 +   _Semaphore_Get                                                        2
2683 +   _Thread_Get: invalid id                                               1
2684 +
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
2691 +
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
2696 +
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
2708 @@ -0,0 +1,41 @@
2709 +#
2710 +#  Config file for an Intec Automation SS555 MPC555-based card
2711 +#
2712 +#  This file is derived from:
2713 +#
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
2717 +#
2718 +
2719 +include $(RTEMS_ROOT)/make/custom/default.cfg
2720 +
2721 +RTEMS_CPU=powerpc
2722 +GCC_CPU_MODEL=505
2723 +RTEMS_CPU_MODEL=mpc555
2724 +
2725 +# This is the actual bsp directory used during the build process.
2726 +RTEMS_BSP_FAMILY=ss555
2727 +
2728 +#  This contains the compiler options necessary to select the CPU model
2729 +#  and (hopefully) optimize for it.
2730 +#
2731 +CPU_CFLAGS = -mcpu=$(GCC_CPU_MODEL) -D$(RTEMS_CPU_MODEL) -D$(RTEMS_BSP_FAMILY)
2732 +
2733 +# optimize flag: typically -O2
2734 +CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions
2735 +
2736 +define make-exe
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
2743 +endef
2744 +
2745 +# Miscellaneous additions go here
2746 +
2747 +# Override default start file
2748 +START_BASE=
2749 +
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
2754 @@ -0,0 +1,58 @@
2755 +## Automatically generated by ampolish3 - Do not edit
2756 +
2757 +if AMPOLISH3
2758 +$(srcdir)/preinstall.am: Makefile.am
2759 +       $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
2760 +endif
2761 +
2762 +PREINSTALL_DIRS =
2763 +DISTCLEANFILES += $(PREINSTALL_DIRS)
2764 +
2765 +all-am: $(PREINSTALL_FILES)
2766 +
2767 +PREINSTALL_FILES =
2768 +CLEANFILES = $(PREINSTALL_FILES)
2769 +
2770 +$(PROJECT_LIB)/$(dirstamp):
2771 +       @$(MKDIR_P) $(PROJECT_LIB)
2772 +       @: > $(PROJECT_LIB)/$(dirstamp)
2773 +PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
2774 +
2775 +$(PROJECT_INCLUDE)/$(dirstamp):
2776 +       @$(MKDIR_P) $(PROJECT_INCLUDE)
2777 +       @: > $(PROJECT_INCLUDE)/$(dirstamp)
2778 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
2779 +
2780 +$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
2781 +       $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
2782 +PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
2783 +
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
2787 +
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
2791 +
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
2795 +
2796 +$(PROJECT_INCLUDE)/bsp/$(dirstamp):
2797 +       @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
2798 +       @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2799 +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
2800 +
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
2804 +
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
2808 +
2809 +$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
2810 +       $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
2811 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
2812 +