Compare commits

..

246 Commits

Author SHA1 Message Date
cvs2git
058277d133 This commit was manufactured by cvs2svn to create tag 'rtems-4-8-1'.
Sprout from rtems-4-8-branch 2008-08-13 14:03:54 UTC Joel Sherrill <joel.sherrill@OARcorp.com> '2008-08-12	Joel Sherrill <joel.sherrill@OARcorp.com>'
Cherrypick from rtems-4-8-branch 2009-07-13 14:20:37 UTC cvs2git <rtems-devel@rtems.org> 'This commit was manufactured by cvs2svn to create branch 'rtems-4-8-branch'.':
    contrib/crossrpms/patches/binutils-2.17.50-cygwin-20060817-1.diff
    contrib/crossrpms/patches/gdb-6.5-bfinrtems-20071114.diff
    cpukit/libnetworking/ifaddrs.h
    cpukit/libnetworking/libc/getifaddrs.c
    cpukit/libnetworking/libc/if_indextoname.c
    cpukit/libnetworking/libc/if_nameindex.c
2009-07-13 14:20:39 +00:00
Joel Sherrill
1572e389ff 2008-08-12 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am: Install cplb.h
2008-08-13 14:03:54 +00:00
Joel Sherrill
cabc362915 Upgrade to 4.8.1 2008-08-13 14:01:05 +00:00
Joel Sherrill
c657ad5b9f 2008-08-12 Joel Sherrill <joel.sherrill@OARcorp.com>
* custom/hurricane.cfg, custom/simsh4.cfg: Now build and link class
	examples.
2008-08-13 13:47:49 +00:00
Joel Sherrill
3c5939074c 2008-08-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* runtest: Major update. Now more likely not to run away.
2008-08-12 13:05:08 +00:00
Joel Sherrill
77c5e9120d 2008-08-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* custom/rbtx4925.cfg, custom/rbtx4938.cfg: Fix so all C++ example code
	compiles and links.
2008-08-11 18:38:37 +00:00
Joel Sherrill
b335275de0 2008-08-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* rtems/include/rtems.h, sapi/Makefile.am: Add simple helper to get
	RTEMS version string.
	* sapi/src/getversionstring.c: New file.
2008-08-11 16:52:40 +00:00
Joel Sherrill
1256de38bf 2008-08-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: All SPARC executables should include
	rtems_get_version_string so the monitor used can provide RTEMS
	awareness based upon the version.
2008-08-08 15:55:10 +00:00
Joel Sherrill
6676f1de16 2008-08-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* user/datatypes.t: Add rtems_name. Add comment about
	rtems_task_argument changing from simple unsigned thirty two bit
	integer to being derived from a C99 uintptr_t in 4.8 and newer.
2008-08-07 13:45:10 +00:00
Joel Sherrill
b8fa0b1266 2008-08-06 Brett Swimley <brett.swimley@aedbozeman.com>
PR 1192/filesystem
	* libblock/src/diskdevs.c: Update the disktap pointer after the
	realloc.
2008-08-06 21:02:30 +00:00
Joel Sherrill
eab373a2d7 2008-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 741/networking
	* libmisc/dummy/dummy.c: Add dummy network configuration.
2008-08-05 16:33:12 +00:00
Joel Sherrill
a7a9e1938a 2008-08-05 Xudong Guan <xudong.guan@criticalsoftware.com>
PR 1212/cpukit
	* Makefile.am, configure.ac: Time slicing will not happen if the task
	mode is changed from a non-timeslicing mode to timeslicing mode if it
	is done by the executing thread (e.g. in its task body). This change
	includes sp44 to demonstrate the problem and verify the correction.
	* sp44/.cvsignore, sp44/Makefile.am, sp44/init.c, sp44/sp44.scn: New files.
2008-08-05 13:11:09 +00:00
Joel Sherrill
c25cea9bee 2008-08-05 Xudong Guan <xudong.guan@criticalsoftware.com>
PR 1212/cpukit
	* rtems/src/taskmode.c, score/src/threadtickletimeslice.c: Time slicing
	will not happen if the task mode is changed from a non-timeslicing
	mode to timeslicing mode if it is done by the executing thread (e.g.
	in its task body). This change includes sp44 to demonstrate the
	problem and verify the correction.
2008-08-05 13:11:01 +00:00
Joel Sherrill
014d541f37 2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1263/doc
	* user/part.t: Improve discussion of alignment and minimum buffer
	sizes.
2008-08-04 20:45:31 +00:00
Joel Sherrill
9f170c9e84 2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1294/bsps
	* startup/spurious.c: Correct prototype and usage of
	sparc_disable_interrupts.
2008-08-04 20:36:38 +00:00
Joel Sherrill
b72e847b3f 2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1294/bsps
	* rtems/score/cpu.h, rtems/score/sparc.h: Correct prototype and usage
	of sparc_disable_interrupts.
2008-08-04 20:35:25 +00:00
Joel Sherrill
bd029d8779 2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1265/cpukit
	* score/include/rtems/score/object.h,
	score/src/objectallocatebyindex.c: Rename index argument to avoid
	warning when rtems.h and string.h are included at the same time by
	user code.
2008-08-04 19:49:33 +00:00
Joel Sherrill
9cda660388 2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1282/misc
	* src/rtemsInterrupt.cc: Correct vec/vector variable confusion.
2008-08-04 19:24:38 +00:00
Joel Sherrill
bdfdb0b3ca 2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1288/doc
	* user/intr.t: Update callable from ISR section.
2008-08-04 19:09:38 +00:00
Joel Sherrill
c0694b0637 2008-08-04 Tim FitzGeorge <tim.fitzgeorge@astrium.eads.net>
PR 1293/tests
	* psx10/init.c: Make sure we do not let tv_nsec go to -1.
2008-08-04 14:39:37 +00:00
Joel Sherrill
7f46d43d3d 2008-08-01 Joel Sherrill <joel.sherrill@OARcorp.com>
* user/msg.t: Parameter is size not count. Spotted by Sebastian Huber.
2008-08-01 15:29:45 +00:00
Joel Sherrill
1016b77514 2008-07-22 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1291/cpukit
	* psx05/init.c, psxmsgq01/init.c: Update tests to reflect absolute
	time.
2008-07-22 17:21:59 +00:00
Joel Sherrill
e5c0540d6a 2008-07-22 Joel Sherrill <joel.sherrill@OARcorp.com>
pr1291/cpukit
	* posix_users/mutex.t: Add ETIMEDOUT.
	* posix_users/semaphores.t: Clarify text to say absolute timeout.
2008-07-22 17:18:09 +00:00
Joel Sherrill
a2cf229615 2008-07-18 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1291/cpukit
	* itron/inline/rtems/itron/semaphore.inl, itron/src/twai_sem.c,
	posix/include/mqueue.h, posix/include/rtems/posix/mqueue.h,
	posix/include/rtems/posix/semaphore.h,
	posix/include/rtems/posix/time.h, posix/src/condtimedwait.c,
	posix/src/mqueuereceive.c, posix/src/mqueuerecvsupp.c,
	posix/src/mqueuesend.c, posix/src/mqueuesendsupp.c,
	posix/src/mqueuetimedreceive.c, posix/src/mqueuetimedsend.c,
	posix/src/mutextimedlock.c, posix/src/mutextranslatereturncode.c,
	posix/src/posixtimespecabsolutetimeout.c,
	posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c,
	posix/src/semaphoretranslatereturncode.c,
	posix/src/semaphorewaitsupp.c, posix/src/semtimedwait.c,
	posix/src/semtrywait.c, posix/src/semwait.c,
	posix/src/sigtimedwait.c, posix/src/timersettime.c,
	posix/src/ualarm.c, rtems/src/semobtain.c,
	rtems/src/semtranslatereturncode.c,
	score/include/rtems/score/coremutex.h,
	score/include/rtems/score/coresem.h, score/src/coresemseize.c: This
	patch addresses issues on implementation of the timeout on the
	following POSIX services. Some of these services incorrectly took a
	timeout as a relative time. Others would compute a 0 delta to timeout
	if the absolute time and the current time were equal and thus
	incorrectly block the caller forever. The root of the confusion is
	that POSIX specifies that if the timeout is incorrect (e.g. in the
	past, is now, or is numerically invalid), that it does not matter if
	the call would succeed without blocking. This is in contrast to RTEMS
	programming style where all errors are checked before any critical
	sections are entered. This fix implemented a more uniform way of
	handling POSIX absolute time timeouts.
	    + pthread_cond_timedwait - could block forever
	    + mq_timedreceive - used relative not absolute time
	    + mq_timedsend - used relative not absolute time
	    + pthread_mutex_timedlock - used relative not absolute time
	    + pthread_rwlock_timedrdlock- used relative not absolute time
	    + pthread_rwlock_timedwrlock- used relative not absolute time
	    + sem_timedwait - could block forever
2008-07-22 17:17:12 +00:00
Joel Sherrill
a570a14004 2008-07-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* user/barrier.t, user/clock.t, user/dpmem.t, user/msg.t, user/part.t,
	user/region.t, user/rtmon.t, user/sem.t, user/task.t, user/timer.t:
	Correct documentation typos noticed and thankfully reported by
	Fabrício de Novaes Kucinskis <fabricio@dea.inpe.br>
2008-07-15 21:49:59 +00:00
Joel Sherrill
95b674ccd6 2008-06-20 Joel Sherrill <joel.sherrill@OARcorp.com>
* user/io.t: Fix typos for IO unregister reported by Catalin Morosan
	<catalin.morosan at gmail.com>.
2008-06-20 17:14:14 +00:00
Joel Sherrill
ada1918f45 2008-06-20 Joel Sherrill <joel.sherrill@OARcorp.com>
* user/conf.t: Fix text on CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER.
2008-06-20 17:06:01 +00:00
Ralf Corsepius
530d307f58 Abandon freebsd. 2008-06-04 04:14:06 +00:00
Ralf Corsepius
05e808763e Update to gcc-4.2.4 2008-05-26 08:45:19 +00:00
Ralf Corsepius
4cf3275ac0 Add gcc-4.2.4 2008-05-26 08:43:06 +00:00
Ralf Corsepius
fc19fcbd69 New. 2008-05-26 08:41:48 +00:00
Joel Sherrill
eaab3cd497 2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am: Install cplb.h
2008-05-23 16:33:40 +00:00
Ralf Corsepius
37c77c5c00 Upgrade to gcc-4.2.3 2008-05-09 12:33:23 +00:00
Ralf Corsepius
01ab562f82 GCC_RPMREL = 29. 2008-05-08 05:07:27 +00:00
Ralf Corsepius
7567f4d580 Back out to gcc-4.2.2. 2008-05-08 05:06:24 +00:00
Ralf Corsepius
492e450891 Add support for gcc-4.3.0, gcc-4.2.3.
Update to newlib-1.15.0-rtems4.8-20080508.diff.
2008-05-08 05:04:59 +00:00
Ralf Corsepius
84d31bc518 Sync with CVS HEAD. 2008-05-08 05:01:27 +00:00
Ralf Corsepius
b61c8cca57 Add SIZE_MAX fix. 2008-05-08 04:58:00 +00:00
Ralf Corsepius
9a73a4c94d Rebase patch against gcc-core-4.2.3.
Disable building libiberty.
2008-05-08 04:57:32 +00:00
Ralf Corsepius
f79feff8fc Enable --with-system-readline only for gdb >= 6.7 2008-05-08 02:50:24 +00:00
Joel Sherrill
ef83c4c70f 2008-05-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/ckinit.c: Add nanoseconds clock tick granularity support.
2008-05-07 17:39:10 +00:00
Joel Sherrill
f58d7d8ac5 2008-05-06 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1285/rtems
	* sapi/include/rtems/config.h: Remove obsolete
	rtems_configuration_get_maximum_devices().
2008-05-06 15:16:26 +00:00
Ralf Corsepius
8c0a48d754 Remove (Obsolete). 2008-05-02 05:00:14 +00:00
Ralf Corsepius
0c4dd1c8f1 Regenerate. 2008-05-02 04:57:58 +00:00
Ralf Corsepius
83ea84b6ae Sync with RTEMS CVS-HEAD. 2008-05-02 04:56:36 +00:00
Ralf Corsepius
1f567f2692 Upgrade to gdb-6.8. 2008-05-02 04:55:06 +00:00
Ralf Corsepius
355d23b708 New.
Include erc32 hacks from RTEMS CVS-HEAD.
2008-04-29 15:00:41 +00:00
Ralf Corsepius
433f6890b8 Update gdb packaging. 2008-04-29 14:50:12 +00:00
Ralf Corsepius
269f5a23c1 gdb-6.7.1-rtems4.8-20080429.diff. 2008-04-29 14:49:15 +00:00
Ralf Corsepius
9d2aae8b51 Bump GDB_RPMREL. 2008-04-29 14:43:30 +00:00
Ralf Corsepius
90c85d5bf7 Sync with CVS-HEAD. 2008-04-29 11:38:26 +00:00
Ralf Corsepius
b0f67b53f6 Use rtems_api. 2008-04-26 05:46:39 +00:00
Ralf Corsepius
229c0470d1 Add rtems_api. 2008-04-26 05:33:51 +00:00
Till Straumann
2bd2aba6c9 2008-04-25 Till Straumann <strauman@slac.stanford.edu>
* nfsclient/Changelog.slac, nfsclient/src/nfs.c:
	BUGFIX (PR#1284) -- possible memory corruption if
	server connectivity is lost.
2008-04-26 00:03:17 +00:00
Ralf Corsepius
5bb8ddf6b0 Remove stray blank line. 2008-04-25 15:30:46 +00:00
Ralf Corsepius
e3ad8494ef Add mpfr for gcc-4.3.0. 2008-04-25 15:29:12 +00:00
Joel Sherrill
280ef6eefd 2008-04-25 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/system.h: Fix typo in comment.
2008-04-25 15:24:38 +00:00
Joel Sherrill
7d032fc6bc 2008-04-16 Joel Sherrill <joel.sherrill@OARcorp.com>
* user/bsp.t, user/conf.t, user/init.t, user/intr.t, user/overview.t,
	user/timer.t: Correct default values. Make it clear that confdefs.h
	calculates the memory required for you.
2008-04-16 18:30:13 +00:00
Ralf Corsepius
48776cdbb0 2008-04-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* bootstrap: Use find . ... preinstall.am for portability reasons.
2008-04-14 07:42:27 +00:00
Ralf Corsepius
0b770037ef Add _host_rpmprefix. 2008-03-28 05:45:41 +00:00
Ralf Corsepius
4c081642b0 Remove stray line. 2008-03-26 17:54:59 +00:00
Ralf Corsepius
c2a5fa56d5 BuildRequire: @rpmprefix@%{_host}-gcc for CdnX. 2008-03-25 07:27:33 +00:00
Ralf Corsepius
bf33c69e2f Add _bindir to PATH. 2008-03-25 07:26:09 +00:00
Ralf Corsepius
1187fce8b8 Add cygwin hacks from CVS-HEAD. 2008-03-20 08:33:07 +00:00
Ralf Corsepius
5ee16abd07 Add %{_bindir} to PATH to cater CdnX-builds.
Set CFLAGS_FOR_BUILD.
2008-03-18 06:12:56 +00:00
Ralf Corsepius
10d6b97a0d Add %{_bindir} to PATH to cater CdnX-builds. 2008-03-18 06:11:28 +00:00
Ralf Corsepius
1ded262be0 BR: @rpmprefix@%{_host}-gcc for CdnX-builds. 2008-03-18 06:09:49 +00:00
Ralf Corsepius
1e2a76e8e9 Sync with CVS-HEAD. 2008-03-18 06:07:14 +00:00
Ralf Corsepius
9ee9a7d6a6 Set CFLAGS_FOR_BUILD and CC for CdnX-builds. 2008-03-18 05:39:28 +00:00
Ralf Corsepius
c8ecbf9c1e BR: @rpmprefix@@tool_target@-gcc and @rpmprefix@%{_host}-gcc for CdnX-builds. 2008-03-18 05:37:48 +00:00
Ralf Corsepius
44303a8fbd BR: @rpmprefix@@tool_target@-gcc-c++ for CdnX-builds. 2008-03-18 05:36:22 +00:00
Ralf Corsepius
a967c7357b Abandon freebsd6.1 2008-03-17 15:07:46 +00:00
Ralf Corsepius
3438bc3a2f Abandon freebsd6.0. 2008-03-15 05:30:59 +00:00
Ralf Corsepius
847c7e3b09 Abandon freebsd5.2 2008-03-14 10:11:14 +00:00
Joel Sherrill
ad62077db9 2008-03-07 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1280/tools
	* shttpd/log.c: Broaden logic so all gcc versions < 4.3.0 will enable
	work around.
2008-03-07 18:58:39 +00:00
Joel Sherrill
789c49080b 2008-03-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* shared/startup/linkcmds: Add wildcard to gcc_except_table section so
	programs compiled with gcc 4.3.x can link.
2008-03-04 22:35:13 +00:00
Joel Sherrill
102295eba7 2008-03-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Add wildcard to gcc_except_table section so
	programs compiled with gcc 4.3.x can link.
2008-03-04 22:35:09 +00:00
Joel Sherrill
a4d9a11e2d 2008-03-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds.hsc_cm01,
	startup/linkcmds.mpc8349eamds: Add wildcard to gcc_except_table
	section so programs compiled with gcc 4.3.x can link.
2008-03-04 22:34:57 +00:00
Joel Sherrill
8ae2a26e24 2008-03-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds.brs5l, startup/linkcmds.icecube,
	startup/linkcmds.pm520: Add wildcard to gcc_except_table section so
	programs compiled with gcc 4.3.x can link.
2008-03-04 22:34:55 +00:00
Joel Sherrill
ff1e20f46a 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds-le, startup/linkcmds-le.coff: Add
	wildcard to gcc_except_table section so programs compiled with gcc
	4.3.x can link.
2008-03-03 23:02:14 +00:00
Joel Sherrill
bb1dbc8255 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds.sim: Add wildcard to
	gcc_except_table section so programs compiled with gcc 4.3.x can
	link.
2008-03-03 23:02:12 +00:00
Joel Sherrill
1f0fde99c5 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Add wildcard to gcc_except_table section so
	programs compiled with gcc 4.3.x can link.
2008-03-03 23:02:10 +00:00
Joel Sherrill
b6f188ff15 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds_ROM: Add wildcard to
	gcc_except_table section so programs compiled with gcc 4.3.x can
	link.
2008-03-03 23:01:00 +00:00
Joel Sherrill
d5b4a68520 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmdsflash, startup/linkcmdsram: Add
	wildcard to gcc_except_table section so programs compiled with gcc
	4.3.x can link.
2008-03-03 23:00:59 +00:00
Joel Sherrill
cf118868e7 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds.flash: Add wildcard to
	gcc_except_table section so programs compiled with gcc 4.3.x can
	link.
2008-03-03 23:00:57 +00:00
Joel Sherrill
734e053691 2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds.bootp, startup/linkcmds.prom: Add
	wildcard to gcc_except_table section so programs compiled with gcc
	4.3.x can link.
2008-03-03 23:00:54 +00:00
Joel Sherrill
35305b59e8 2008-02-20 Alexandru Bugnar <a-bugnar@criticalsoftware.com>
PR 1278/cpukit
	* cpu.c: Fix incorrect bit manipulation on returning old address of raw
	trap handler.
2008-02-20 21:54:13 +00:00
Ralf Corsepius
174eea53d5 2008-02-19 Ralf Corsepius <ralf.corsepius@rtems.org>
* aclocal.m4: Remove (bogusly checked in).
2008-02-19 08:58:49 +00:00
Ralf Corsepius
2928e82995 2008-02-15 Ralf Corsépius <ralf.corsepius@rtems.org>
* clock/ckinit.c, console/duart.c, timer/timer.c: Reflect changes
	  to rtems/motorola/*.h.
2008-02-15 07:10:49 +00:00
Ralf Corsepius
56535aaae2 2008-02-15 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/motorola/mc68230.h: Prefix defines with
	  MC68230_ to avoid preprocessor clashes.
2008-02-15 07:10:09 +00:00
Joel Sherrill
dc709596a5 2008-02-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am: Spacing.
2008-02-14 17:31:53 +00:00
Joel Sherrill
876c5d9eb4 2008-02-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am: Include cplb.h
2008-02-14 17:31:17 +00:00
Joel Sherrill
7947987c78 Upgrade to 4.8.0 2008-02-14 17:29:18 +00:00
Joel Sherrill
52e97570a8 2008-02-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds.brs5l: Change .bss to .bss*.
2008-02-14 15:36:34 +00:00
Joel Sherrill
d89da6eca7 2008-02-06 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1277/networking
	* libnetworking/netinet/in_cksum_i386.h: Use q instead of r in
	constraint for assembly language. This restricts the register choice
	to the a-d registers.
2008-02-06 16:58:46 +00:00
Joel Sherrill
163a1047c2 2008-02-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* posix/Makefile.am: Remove these. They were proposed but never
	standardized.
	* posix/src/pthreadgetcputime.c, posix/src/pthreadsetcputime.c: Removed.
2008-02-05 22:35:08 +00:00
Ralf Corsepius
bb4a8ad296 Bump version to 0.10. 2008-01-19 05:34:47 +00:00
Ralf Corsepius
f95a584bbe Remove ftp:// URLs (OAR's ftp: is too unreliable.) 2008-01-19 05:34:38 +00:00
Ralf Corsepius
f2bcb618b8 Sync with HEAD.
Add mirrors.
2008-01-14 07:43:26 +00:00
Chris Johns
d24a72f220 2008-01-11 Chris Johns <chisj@rtems.org>
* expat-version: New.

        * build-exes.sh: Fix the size calculation.

        * build-rpms.sh: Add expax support. Clean the BUILD, RPM and SRPM
        directories. Delete the RPM database if cleaning.

        * msys-path.nsi: Add comments.

        * rtems-tools.nsi: Fix the uninstall targets check.

        * target-section-text, targets: Add bfin target.

        * upload.sh: Upload only the specific version of files.

        * version: Build 17.
2008-01-11 22:38:36 +00:00
Ralf Corsepius
713d79e3aa 2007-12-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/sync.c: Make sync() POSIX-compliant.
	* libcsupport/src/__gettod.c: Make gettimeofday() POSIX-compliant.
2007-12-23 07:14:23 +00:00
Ralf Corsepius
c752e84935 Make gettimeofday() POSIX-compliant. 2007-12-23 07:14:12 +00:00
Ralf Corsepius
e9a9bdd1e5 Make sync() POSIX-compliant. 2007-12-23 07:13:55 +00:00
Ralf Corsepius
2bf27202ea Regenerate. 2007-12-22 00:29:06 +00:00
Joel Sherrill
5881d06cb9 2007-12-21 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1268/cpukit
	* libcsupport/include/rtems/assoc.h,
	rtems/src/semtranslatereturncode.c: There is no
	rtems_assoc_ptr_by_value method.
2007-12-21 15:23:01 +00:00
Ralf Corsepius
7d25764ef3 newlib-1.15.0-rtems4.8-20071221.diff 2007-12-21 11:31:44 +00:00
Ralf Corsepius
faa0950d4d Apply %{?_smp_mflags}. 2007-12-21 11:31:06 +00:00
Ralf Corsepius
f5cc928819 Reflect API changes from newlib-1.16.0 2007-12-21 11:30:36 +00:00
Ralf Corsepius
d475f9d7d0 Regenerate. 2007-12-17 07:52:25 +00:00
Ralf Corsepius
e945d6b9c9 Backport from HEAD. 2007-12-17 07:51:52 +00:00
Ralf Corsepius
50f25ace20 Sync. 2007-12-17 03:57:46 +00:00
Ralf Corsepius
7875d408be 2007-12-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Revert Joel's 2007-06-13 NDEBUG patch.
2007-12-16 18:14:09 +00:00
Ralf Corsepius
ed36c3513d Bump GDB_RPMREL. 2007-12-16 12:45:35 +00:00
Ralf Corsepius
5dd2ecbbc9 gdb-6.6-rtems4.8-20071216.diff. 2007-12-16 12:45:16 +00:00
Ralf Corsepius
ce195afa2f New. 2007-12-16 12:38:14 +00:00
Ralf Corsepius
bd025cde6b Remove. 2007-12-16 12:37:49 +00:00
Ralf Corsepius
1ecaae4972 Back port from HEAD. 2007-12-16 12:35:49 +00:00
Ralf Corsepius
16b5fa3163 Remove cpukit. 2007-12-16 12:29:29 +00:00
Ralf Corsepius
ae8600f335 Add %{?_smp_mflags}. 2007-12-16 12:18:51 +00:00
Joel Sherrill
49bf16a322 2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/pheapallocatealigned.c, score/src/pheapgetblocksize.c:
	Reverse file contents.
2007-12-11 23:44:29 +00:00
Ralf Corsepius
87f08a6b37 Remove from rtems-4-8-branch. 2007-12-10 04:03:24 +00:00
Ralf Corsepius
c3bb858209 2007-12-10 Ralf Corsépius <ralf.corsepius@rtems.org>
* cpu_supplement/tic4x.t: Remove.
2007-12-10 04:00:24 +00:00
Ralf Corsepius
06b8ba0ac5 Remove. 2007-12-10 03:59:49 +00:00
Ralf Corsepius
3402633033 2007-12-10 Ralf Corsépius <ralf.corsepius@rtems.org>
* cpu_supplement/Makefile.am, cpu_supplement/cpu_supplement.texi:
	Remove refs to tic4x/c4x.
2007-12-10 03:59:18 +00:00
Ralf Corsepius
372cdd515f 2007-12-10 Ralf Corsepius <ralf.corsepius@rtems.org>
* address.h, address.inl, chain.c, chain.h, system.h:
	Eliminate unsigned8, unsigned16, unsigned32.
	Use size_t, ptrdiff_t, intptr_t for 64bit compliance.
	* chain.c: Reflect removal of isr.h.
	* isr.h: Remove.
	* Makefile.am: Remove isr.h.
2007-12-10 03:44:06 +00:00
Joel Sherrill
aa56c20114 2007-12-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* httpd/Makefile.am, httpd/preinstall.am,
	rtems/src/semtranslatereturncode.c: rtems_webserver.h must be
	installed. It is the initialization interface for both GoAhead and
	Simple HTTPD.
2007-12-06 15:18:42 +00:00
Joel Sherrill
2e3199e9ca 2007-12-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* shared/include/grcan_spwrtc.h: Removed.
2007-12-06 14:21:05 +00:00
Joel Sherrill
1b0c3e6cff 2007-12-05 Daniel Hellstrom <daniel@gaisler.com>
* Makefile.am: i2c should be on branch as well as CVS head.
	* shared/i2c/i2cmst.c, shared/include/i2cmst.h: New files.
2007-12-05 15:49:40 +00:00
Joel Sherrill
7e15770cda 2007-12-05 Daniel Hellstrom <daniel@gaisler.com>
* Makefile.am, preinstall.am: i2c should be on branch as well as CVS
	head.
2007-12-05 15:49:38 +00:00
Joel Sherrill
e5ce943eb9 2007-12-05 Daniel Hellstrom <daniel@gaisler.com>
* shared/include/ambapp.h: Sync head and 4.8 branch.
2007-12-05 15:41:28 +00:00
Ralf Corsepius
8ffd6be0ea 2007-12-05 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Remove score/cpu/avr/Makefile,
	score/cpu/nios2/Makefile, score/cpu/avr/Makefile.
	* score/cpu/Makefile.am: Remove avr, nios2, c4x.
2007-12-05 09:37:57 +00:00
Ralf Corsepius
dea5bb944e Remove score/cpu/avr/Makefile, score/cpu/nios2/Makefile, score/cpu/avr/Makefile. 2007-12-05 09:37:49 +00:00
Ralf Corsepius
76fb8a6c19 Remove avr, nios2, c4x. 2007-12-05 09:37:28 +00:00
Ralf Corsepius
abc81aa749 2007-12-05 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Remove nios2.
2007-12-05 05:14:05 +00:00
Ralf Corsepius
54e05e1169 Remove nios2. 2007-12-05 05:13:18 +00:00
Ralf Corsepius
bec1af03d4 Remove from rtems-4-8-branch. 2007-12-05 05:12:33 +00:00
Ralf Corsepius
ad8f26a766 Remove nios, tic4x family BSPs. 2007-12-04 16:27:14 +00:00
Ralf Corsepius
ccdfdb203d Remove tic4x, avr. 2007-12-04 16:24:06 +00:00
Ralf Corsepius
3753b0076f Remove tic4x, avr from rtems-4-8-branch. 2007-12-04 16:23:21 +00:00
Ralf Corsepius
29cce4be45 Remove from rtems-4-8-branch. 2007-12-04 16:22:31 +00:00
Ralf Corsepius
8abda6510f Revert previous change. 2007-12-04 16:15:55 +00:00
Ralf Corsepius
01a9d2c308 2007-10-15 Ralf Corsépius <ralf.corsepius@rtems.org>
* libnetworking/netdb.h, libnetworking/libc/gethostnamadr.c,
	libnetworking/libc/getnetnamadr.c: Adjust to POSIX.
	Minor updates from FreeBSD.
2007-12-04 16:15:22 +00:00
Ralf Corsepius
be39e03665 2007-12-04 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/cpu/nios2, score/cpu/c4x, score/cpu/avr: Remove from
	  rtems-4-8-branch.
2007-12-04 16:14:51 +00:00
Ralf Corsepius
1992eff989 Remove from rtems-4-8-branch. 2007-12-04 16:13:25 +00:00
Joel Sherrill
e1cc416af0 2007-11-30 Joel Sherrill <joel.sherrill@OARcorp.com>
* irq/GT64260Int.c, network/if_100MHz/Makefile.am,
	network/if_1GHz/Makefile.am: Removed.
2007-11-30 23:00:05 +00:00
Joel Sherrill
38f3ce540a 2007-11-30 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c: BSP_DIRTY_MEMORY should be tested for zero not
	just defined.
2007-11-30 18:17:44 +00:00
Joel Sherrill
b25b7da807 2007-11-30 Daniel Hellstrom <daniel@gaisler.com>
* shared/include/grspw.h, shared/spw/grspw.c: GRSPW SpaceWire Driver.
	Fixes typecast to volatile integer instead of to integer. Added
	scanning for GRSPW2 Core, The GRSPW2 core is run in legacy mode.
2007-11-30 16:53:44 +00:00
Joel Sherrill
125d4c61b7 2007-11-30 Daniel Hellstrom <daniel@gaisler.com>
* shared/can/occan.c: LEON2/3 OCCAN CAN driver. Fixes typecast to
	volatile integer where needed. Fixes bug where closing the driver and
	opening it again could make the driver not starting transmission due
	to the software fifo was not cleared.
2007-11-30 16:52:23 +00:00
Joel Sherrill
0cec037ece 2007-11-30 Daniel Hellstrom <daniel@gaisler.com>
* rasta/rasta.c: LEON2 PCI RASTA driver. Changes RASTA PCI interrupt to
	5 from 4. This is to avoid conflict with the LAN9C111 network MAC
	driver using interrupt 4.
2007-11-30 16:51:10 +00:00
Joel Sherrill
d805da0ef1 2007-11-30 Daniel Hellstrom <daniel@gaisler.com>
* shared/can/grcan.c, shared/can/grcan_rasta.c,
	shared/include/ambapp.h: GRCAN CAN driver. Fixes Interrupt
	enabling/disabling in the driver, interrupt may not be restored
	correctly. Implements the baud rate calculation routine. Removed
	unnecessary printk. Fixed scanning to support GRCAN and GRHCAN
	hardware. Added GRCAN device number to ambapp.h.
2007-11-30 16:48:06 +00:00
Ralf Corsepius
cf148c70b0 Regnerate. 2007-11-30 06:02:22 +00:00
Ralf Corsepius
b32338aba0 GCC_RPMREL = 27. 2007-11-30 06:00:40 +00:00
Ralf Corsepius
afb21a9997 Upgrade to gcc-4.2.2 2007-11-29 17:24:15 +00:00
Ralf Corsepius
eb5b37d6c0 Copy from CVS-HEAD/rtems-4.9 2007-11-29 17:20:26 +00:00
Glenn Humphrey
fc121ce659 2007-11-29 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* develenv/direct.t, develenv/sample.t: Corrected various errors in the
	documentation.
2007-11-29 16:13:32 +00:00
Ralf Corsepius
b5273f01dd gcc-core-4.2.1-rtems4.8-20071129. 2007-11-29 13:38:44 +00:00
Ralf Corsepius
385451bd5c Backport from CVS-HEAD/rtems-4.9 2007-11-29 13:37:27 +00:00
Joel Sherrill
f52af242aa 2007-11-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* custom/mvme5500.cfg: Fix typo.
2007-11-28 21:15:35 +00:00
Glenn Humphrey
ef47c44f50 2007-11-28 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* user/barrier.t, user/clock.t, user/concepts.t, user/conf.t,
	user/datatypes.t, user/dpmem.t, user/fatal.t, user/init.t, user/mp.t,
	user/msg.t, user/part.t, user/region.t, user/rtmon.t, user/sem.t,
	user/task.t, user/timer.t: Corrected various errors in the
	documentation.
2007-11-28 16:24:39 +00:00
Glenn Humphrey
bd58b13034 2007-11-27 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* rtems.adb, rtems.ads: Fixed errors in the barrier binding.
2007-11-27 21:23:13 +00:00
Joel Sherrill
32daf5dbef 2007-11-27 Kate Feng <feng1@bnl.gov>
* custom/mvme5500.cfg: Add compiler arguments sine without them, the
	BSP has issues.
2007-11-27 20:47:15 +00:00
Glenn Humphrey
a74aefea2c 2007-11-27 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* sp33/init.c, sp33/sp33.scn: Added several test cases to improve test
	coverage.
2007-11-27 20:42:42 +00:00
Glenn Humphrey
7301b37101 2007-11-27 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* psxbarrier01/psxbarrier01.scn, psxbarrier01/test.c,
	psxrwlock01/psxrwlock01.scn, psxrwlock01/test.c: Added several test
	cases to improve test coverage.
2007-11-27 20:13:09 +00:00
Joel Sherrill
d9779bda42 2007-11-27 Joel Sherrill <joel.sherrill@OARcorp.com>
* develenv/develenv.texi, develenv/direct.t, develenv/intro.texi,
	develenv/sample.t, develenv/utils.t: Update directory tree.
2007-11-27 19:30:59 +00:00
Glenn Humphrey
5d55a0b242 2007-11-27 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c,
	rtems/include/rtems/rtems/barrier.h,
	score/src/corerwlockobtainread.c, score/src/corerwlockobtainwrite.c,
	score/src/corerwlockrelease.c: Fixed several implementation errors.
2007-11-27 18:45:03 +00:00
Joel Sherrill
6bca11e8d6 2007-11-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* user/conf.t: Add CONFIGURE_APPLICATION_EXTRA_DRIVERS.
2007-11-27 15:36:18 +00:00
Joel Sherrill
4b650b58a6 2007-11-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* sapi/include/confdefs.h: Add CONFIGURE_APPLICATION_EXTRA_DRIVERS.
2007-11-27 15:36:12 +00:00
Joel Sherrill
325a4df0a3 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* bootcard.c: Add comment.
2007-11-26 22:09:45 +00:00
Joel Sherrill
7fd0bc4df5 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* shmsupp/getcfg.c: Fix spacing.
2007-11-26 21:53:16 +00:00
Joel Sherrill
0519e2c13f 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* clock/ckinit.c, include/bsp.h: Fix spacing.
2007-11-26 21:53:14 +00:00
Joel Sherrill
c4254e957f 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/printk.c, score/src/objectget.c: Fix spacing.
2007-11-26 21:13:35 +00:00
Joel Sherrill
8802a9b3d1 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc.c: Do not assert on free of bad pointer.
2007-11-26 21:13:02 +00:00
Joel Sherrill
3a9e70c16b 2007-11-26 Joel Sherrill <joel.sherrill@OARcorp.com>
* runtest.in: Filter out Memory exception error messages.
2007-11-26 19:46:24 +00:00
Joel Sherrill
e2f429f144 2007-11-26 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/score/thread.h: Fix spelling error.
2007-11-26 19:35:48 +00:00
Joel Sherrill
8545a7eafc 2007-11-26 Joel Sherrill <joel.sherrill@OARcorp.com>
* shared/console/uart.c: Fix typo.
2007-11-26 19:34:21 +00:00
Joel Sherrill
5cc0c0d3a1 2007-11-26 Eric Norum <norume@aps.anl.gov>
* network/network.c: Fix LED configuration to match uCDIMM.
2007-11-26 17:48:39 +00:00
Ralf Corsepius
08988b7d3d Remove. 2007-11-15 04:38:18 +00:00
Ralf Corsepius
27de0e70fd Update. 2007-11-14 14:37:33 +00:00
Ralf Corsepius
72c04e843d Remove. 2007-11-14 14:35:06 +00:00
Ralf Corsepius
6dba71ebcb backup. 2007-11-13 15:09:07 +00:00
Ralf Corsepius
02058598d4 Backport from HEAD. 2007-11-13 09:29:15 +00:00
Ralf Corsepius
be4e5f6967 GCC_RPMREL = 14. 2007-11-13 09:26:55 +00:00
Ralf Corsepius
fc98297639 New. 2007-11-13 09:26:17 +00:00
Ralf Corsepius
425cb26a52 More makeinfo hacks. 2007-11-11 16:58:15 +00:00
Ralf Corsepius
484d126a28 New. 2007-11-11 13:19:55 +00:00
Ralf Corsepius
e55f7f714e Remove gcc-3.4.6. 2007-11-11 13:19:12 +00:00
Ralf Corsepius
3254133b45 Remove gcc-4.2.0. 2007-11-11 13:17:20 +00:00
Ralf Corsepius
02e1bdbfa7 Remove gcc-4.0.3. 2007-11-11 13:16:07 +00:00
Ralf Corsepius
a3459e847b Remove gcc-4.1.2. 2007-11-11 13:14:31 +00:00
Ralf Corsepius
501a675ab2 Remove gcc-4.1.1. 2007-11-11 13:13:51 +00:00
Ralf Corsepius
7894589578 gcc-core-4.2.1-rtems4.8-20071111.diff. 2007-11-11 13:11:41 +00:00
Ralf Corsepius
4ee3225ebb GCC_RPMREL = 25. 2007-11-11 13:11:05 +00:00
Ralf Corsepius
cfa08cf05a Regenerate. 2007-11-10 07:05:17 +00:00
Ralf Corsepius
2b6a100aee gdb-6.6-rtems4.8-20071110.diff 2007-11-10 07:04:57 +00:00
Ralf Corsepius
70a276acc3 New. 2007-11-10 07:03:42 +00:00
Ralf Corsepius
42561520ea GDB_RPMREL = 10 2007-11-10 07:02:16 +00:00
Ralf Corsepius
116826e77d Remove (Unused). 2007-11-10 05:47:54 +00:00
Ralf Corsepius
66a55224a9 Remove gdb-6.5 2007-11-10 05:46:40 +00:00
Ralf Corsepius
001c1508c8 Update gdb-6.6 patch. 2007-11-10 05:43:14 +00:00
Joel Sherrill
57a483cf41 2007-11-06 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1266/cpukit
	* posix/src/keycreate.c, posix/src/keyrundestructors.c: Use API instead
	of class for key indexing.
2007-11-06 21:38:58 +00:00
Joel Sherrill
2a65626503 2007-11-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp13/system.h: We need 32K of message buffer memory not 32 bytes.
2007-11-06 20:23:01 +00:00
Glenn Humphrey
2211225438 2007-11-06 Glenn Humphrey <glenn.humphrey@OARcorp.com>
Miscellaneous changes made after a review against the POSIX spec.
	* posix/src/pbarrierinit.c, posix/src/prwlockinit.c: If the caller
	passes a NULL in the attributes parameter, default attributes are used.
	* posix/src/prwlockdestroy.c: If there is at least one thread
	waiting, do not allow deletion.
	* posix/src/prwlockwrlock.c: Corrected parameter passed to the core
	operation used to obtain a RWLock for writing.
	* posix/src/pspinlocktranslatereturncode.c,
	score/include/rtems/score/corespinlock.h,
	score/src/corespinlockrelease.c: If the current thread is not the
	holder of the lock, do not allow an unlock and return EPERM.
	* score/src/corerwlockobtainwrite.c: Corrected to use the operation
	for queueing with a timeout handler.
2007-11-06 19:54:22 +00:00
Ralf Corsepius
0e95f1e57d Regenerate. 2007-11-04 09:36:15 +00:00
Ralf Corsepius
7d1ca2ac60 BINUTILS_RPMREL = 2. 2007-11-04 09:34:49 +00:00
Ralf Corsepius
6dc5431424 binutils-2.18-rtems4.8-20071104.diff. 2007-11-04 09:34:31 +00:00
Ralf Corsepius
7eb30458c4 New. 2007-11-04 09:31:43 +00:00
Joel Sherrill
334573e372 2007-11-02 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/cpu/sparc/cpu.c, score/cpu/sparc/rtems/score/cpu.h,
	score/include/rtems/score/context.h, score/src/threadhandler.c: Fix
	stack so gdb backtrace does not print corrupted frame message after
	_Thread_Handler. Daniel Hellstrom <daniel@gaisler.com> provided the
	SPARC implementation and I made it more general.
2007-11-02 13:35:12 +00:00
Ralf Corsepius
0e7cee45c0 Upgrade to gdb-4.7.1 2007-11-01 07:47:41 +00:00
Ralf Corsepius
547657c34f Remove ref to rtems4.9 2007-11-01 07:46:19 +00:00
Ralf Corsepius
6d837a6273 New (from TRUNK). 2007-11-01 07:36:50 +00:00
Ralf Corsepius
aa26724ca5 Sync with trunk 2007-11-01 07:35:16 +00:00
Ralf Corsepius
21b3f3b114 Remove GDB. 2007-11-01 07:29:05 +00:00
Glenn Humphrey
8294a5d9f6 2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* rtems.adb, rtems.ads: Merge binding updates from CVS head. Bindings
	should now be reasonably in sync with C Classic API.
2007-10-26 21:37:07 +00:00
Glenn Humphrey
1b03eed0e5 2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* user/rtmon.t: Fix report output.

2007-10-25	Glenn Humphrey <glenn.humphrey@OARcorp.com>

	* user/barrier.t, user/clock.t, user/concepts.t, user/cpuuse.t,
	user/init.t, user/intr.t, user/io.t, user/mp.t, user/rtmon.t,
	user/sem.t, user/stackchk.t, user/task.t, user/timer.t: Updated the
	Ada documentation to reflect the current binding.
2007-10-26 21:34:57 +00:00
Glenn Humphrey
c4215bad1f 2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* cpuuse/task2.c, rtmonuse/rtmonuse.scn, rtmonuse/task1.c: Add new
	cases for untested routines.
2007-10-26 21:32:09 +00:00
Glenn Humphrey
0f4f543279 2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* libmisc/cpuuse/cpuusagereport.c, rtems/src/ratemonreportstatistics.c:
	Cleaned up reports and fixed a bug related the printf format which
	resulted in lack of leading zeroes and misleading magnitude.
	* score/src/timespecdivide.c: Fixed bugs related to zero divide case.
2007-10-26 21:31:04 +00:00
Joel Sherrill
3ab4ba719a 2007-10-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* telnetd/icmds.c: Add header to file.
2007-10-19 21:34:34 +00:00
Joel Sherrill
f3b1d6851d Fix typo. 2007-10-19 21:34:28 +00:00
Joel Sherrill
0afb968bad 2007-10-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/assoc.c: Removed.  Accidentally included routine
	also in another file.  Mistake after splitting.
	* libcsrc/Makefile.am: Reflect file removal.
2007-10-19 14:38:25 +00:00
Joel Sherrill
9fe54b2469 2007-10-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/assoc.c: Removed.  Accidentally included routine
	also in another file.  Mistake after splitting.
2007-10-19 14:37:12 +00:00
Joel Sherrill
814986ce3e 2007-10-14 Eric Norum <norume@aps.anl.gov>
* clock/clock.c: Add nanoseconds since tick support.
2007-10-16 17:14:38 +00:00
Ralf Corsepius
df3055aa6f 2007-10-15 Ralf Corsépius <ralf.corsepius@rtems.org>
* libnetworking/netdb.h, libnetworking/libc/gethostnamadr.c,
	libnetworking/libc/getnetnamadr.c: Adjust to POSIX.
	Minor updates from FreeBSD.
2007-10-15 08:00:49 +00:00
Ralf Corsepius
d9a8aa054a Adjust to POSIX. Minor updates from FreeBSD. 2007-10-15 08:00:38 +00:00
Ralf Corsepius
8e1da2b644 Add if_nameindex (from FreeBSD). 2007-10-15 06:53:08 +00:00
Ralf Corsepius
a38723dd1e New. 2007-10-12 02:39:00 +00:00
Ralf Corsepius
2e4aab8738 Remove. 2007-10-12 02:36:58 +00:00
Joel Sherrill
6c64bcc365 2007-10-11 Daniel Hellstrom <daniel@gaisler.com>
* shared/can/occan.c: Fixes bug in OC-CAN baud rate calculator. The
	BTR1 8-bit value was swapped.
2007-10-11 12:54:30 +00:00
Joel Sherrill
ad8c2e6cbf 2007-10-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/score/copyrt.h: Update year.
2007-10-11 12:50:27 +00:00
Joel Sherrill
26ca309c2e 2007-10-11 Daniel Hellstrom <daniel@gaisler.com>
* libi2c/libi2c.c, libi2c/libi2c.h: Add message about needing IMFS.
	Fixed check of status when registering driver. Add use of strerror().
2007-10-11 12:46:58 +00:00
Joel Sherrill
22f39fc0dc 2007-10-05 Ray Xu <xr@trasin.net>
* lpc22xx/clock/clockdrv.c, lpc22xx/irq/irq.c, lpc22xx/irq/irq.h: Now
	runs in Skyeye.
2007-10-05 18:58:02 +00:00
Ralf Corsepius
5f3b50c779 Regenerate. 2007-10-04 16:07:27 +00:00
Ralf Corsepius
98c8d080c1 2007-10-04 Keith Robertson <kjrobert@alumni.uwaterloo.ca>,
Ralf Corsépius <ralf.corsepius@rtems.org>

	* libnetworking/ifaddrs.h, libnetworking/libc/getifaddrs.c,
	libnetworking/libc/if_indextoname.c,
	libnetworking/libc/if_nameindex.c: New (from FreeBSD)
	* Makefile.am: Add files above.
	* libnetworking/net/if.h: Add if_nameindex (from FreeBSD).
2007-10-04 16:06:49 +00:00
Joel Sherrill
470775b284 2007-10-02 Jukka Pietarinen <jukka.pietarinen@mrf.fi>
* startup/linkcmds: Move definition of _end so memory is not corrupted.
2007-10-02 13:54:19 +00:00
Ralf Corsepius
433c7cad67 Remove. 2007-10-01 03:56:46 +00:00
Joel Sherrill
11d617593f 2007-09-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/stackchk/check.c: Eliminate output with little information.
	Always print a blown message using the same routine. Now works with
	GNAT RTS -fstack-checking if you have patch for the RTEMS specific
	support in your GCC version.
2007-09-28 15:03:48 +00:00
Ralf Corsepius
e463596fc9 Update. 2007-09-28 07:47:33 +00:00
Joel Sherrill
27f0a73aa2 2007-09-25 Joel Sherrill <joel.sherrill@OARcorp.com>
* nfsclient/Makefile.am: Fix errors.
2007-09-25 21:33:11 +00:00
Joel Sherrill
77a152c74b 2007-09-25 Joel Sherrill <joel.sherrill@OARcorp.com>
* nfsclient/Makefile.am, nfsclient/preinstall.am: Install libnfs.a.
2007-09-25 16:56:09 +00:00
Joel Sherrill
6f5abc6638 2007-09-24 Chris Johns <chrisj@rtems.org>
* include/bsp.h: Do not use C++ comments.
2007-09-24 21:40:49 +00:00
Joel Sherrill
c2ac7e9df5 2007-09-21 Daniel Hellstrom <daniel@gaisler.com>
* shared/can/occan.c: Fix warning on Diab compiler.
2007-09-21 15:47:53 +00:00
Joel Sherrill
b9f17f8a41 2007-09-21 Joel Sherrill <joel.sherrill@OARcorp.com>
* network_5200/network.c: Add multicast support.
2007-09-21 15:45:11 +00:00
Joel Sherrill
6fe3bb36d6 2007-09-20 Joel Sherrill <joel.sherrill@OARcorp.com>
* preinstall.am: Add cplb.h.
	* startup/bspstart.c: Add cast of constant.
2007-09-20 21:44:38 +00:00
Joel Sherrill
ae6b44f55c 2007-09-20 Kate Feng <feng1@bnl.gov>
* network/if_100MHz/GT64260eth.c: Add else.
2007-09-20 16:35:23 +00:00
Joel Sherrill
81a54e64f7 2007-09-19 Daniel Hellstrom <daniel@gaisler.com>
* shared/can/occan.c: Fix Reenable command and fix typo.
2007-09-19 15:14:52 +00:00
Joel Sherrill
a925b871a0 2007-09-19 Kate Feng <feng1@bnl.gov>
* README: Update.
2007-09-19 14:47:26 +00:00
cvs2git
a24f7003ab This commit was manufactured by cvs2svn to create branch 'rtems-4-8-branch'.
Sprout from master 2007-09-19 06:34:25 UTC Ralf Corsepius <ralf.corsepius@rtems.org> 'Regenerate.'
Cherrypick from shttpd 2007-06-11 13:24:29 UTC Ralf Corsepius <ralf.corsepius@rtems.org> 'Import from shttpd-1.37.':
    cpukit/shttpd/auth.c
    cpukit/shttpd/cgi.c
    cpukit/shttpd/compat_unix.c
    cpukit/shttpd/compat_unix.h
    cpukit/shttpd/compat_win32.c
    cpukit/shttpd/compat_win32.h
    cpukit/shttpd/compat_wince.c
    cpukit/shttpd/compat_wince.h
    cpukit/shttpd/config.c
    cpukit/shttpd/io.h
    cpukit/shttpd/io_cgi.c
    cpukit/shttpd/io_dir.c
    cpukit/shttpd/io_emb.c
    cpukit/shttpd/io_file.c
    cpukit/shttpd/io_socket.c
    cpukit/shttpd/io_ssl.c
    cpukit/shttpd/llist.h
    cpukit/shttpd/md5.c
    cpukit/shttpd/md5.h
    cpukit/shttpd/mime_type.c
    cpukit/shttpd/shttpd.1
    cpukit/shttpd/shttpd.c
    cpukit/shttpd/shttpd.h
    cpukit/shttpd/ssl.h
    cpukit/shttpd/standalone.c
    cpukit/shttpd/std_includes.h
Cherrypick from SLAC 2007-07-25 05:22:23 UTC Ralf Corsepius <ralf.corsepius@rtems.org> 'Import from rtems-nfs-1.5.tgz.':
    c/src/nfsclient/LICENSE
    c/src/nfsclient/README
    c/src/nfsclient/proto/mount_prot.h
    c/src/nfsclient/proto/mount_prot.x
    c/src/nfsclient/proto/mount_prot_xdr.c
    c/src/nfsclient/proto/nfs_prot.h
    c/src/nfsclient/proto/nfs_prot.x
    c/src/nfsclient/proto/nfs_prot_xdr.c
    c/src/nfsclient/rfc1094.txt
    c/src/nfsclient/rtems-filesystem-patch
    c/src/nfsclient/src/cexphelp.c
    c/src/nfsclient/src/librtemsNfs.h
    c/src/nfsclient/src/nfs.c
    c/src/nfsclient/src/nfs.modini.c
    c/src/nfsclient/src/nfsTest.c
    c/src/nfsclient/src/rpcio.h
    c/src/nfsclient/src/rpcio.modini.c
    c/src/nfsclient/src/sock_mbuf.c
    c/src/nfsclient/src/xdr_mbuf.c
Cherrypick from zlib 2005-10-28 07:22:42 UTC Ralf Corsepius <ralf.corsepius@rtems.org> 'Import of zlib-1.2.2.2.tar.gz':
    cpukit/zlib/FAQ
    cpukit/zlib/INDEX
    cpukit/zlib/README
    cpukit/zlib/algorithm.txt
    cpukit/zlib/crc32.h
    cpukit/zlib/infback.c
    cpukit/zlib/inffast.c
    cpukit/zlib/inffast.h
    cpukit/zlib/inffixed.h
    cpukit/zlib/inflate.c
    cpukit/zlib/inflate.h
    cpukit/zlib/trees.h
    cpukit/zlib/zlib.3
    cpukit/zlib/zlib.h
Cherrypick from rtemsdoc-4-5-branch 1997-05-27 12:40:10 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'base RTEMS documentation':
    doc/common/treedef.tex
Delete:
    contrib/crossrpms/cygwin/.cvsignore
    contrib/crossrpms/cygwin/Makefile.am
    contrib/crossrpms/cygwin/binutils.am
    contrib/crossrpms/cygwin/gcc-prep.add
    contrib/crossrpms/cygwin/gcc.am
    contrib/crossrpms/cygwin/i686/.cvsignore
    contrib/crossrpms/cygwin/i686/Makefile.am
    contrib/crossrpms/cygwin/i686/binutils-sources.add
    contrib/crossrpms/cygwin/i686/gcc-sources.add
    contrib/crossrpms/cygwin/i686/libncurses-devel.add
    contrib/crossrpms/cygwin/i686/libs.add
    contrib/crossrpms/cygwin/i686/target-libncurses-devel.add
    contrib/crossrpms/cygwin/i686/target-libs.add
    contrib/crossrpms/cygwin/i686/target-w32api.add
    contrib/crossrpms/cygwin/i686/target-zlib.add
    contrib/crossrpms/cygwin/i686/w32api.add
    contrib/crossrpms/cygwin/i686/zlib.add
    contrib/crossrpms/freebsd5.2/.cvsignore
    contrib/crossrpms/freebsd5.2/Makefile.am
    contrib/crossrpms/freebsd5.2/binutils.am
    contrib/crossrpms/freebsd5.2/gcc-prep.add
    contrib/crossrpms/freebsd5.2/gcc.am
    contrib/crossrpms/freebsd5.2/i586/.cvsignore
    contrib/crossrpms/freebsd5.2/i586/Makefile.am
    contrib/crossrpms/freebsd5.2/i586/binutils-sources.add
    contrib/crossrpms/freebsd5.2/i586/gcc-prep.add
    contrib/crossrpms/freebsd5.2/i586/gcc-sources.add
    contrib/crossrpms/freebsd5.2/i586/libs.add
    contrib/crossrpms/freebsd5.2/i586/target-libs.add
    contrib/crossrpms/freebsd6.0/.cvsignore
    contrib/crossrpms/freebsd6.0/Makefile.am
    contrib/crossrpms/freebsd6.0/binutils.am
    contrib/crossrpms/freebsd6.0/gcc-prep.add
    contrib/crossrpms/freebsd6.0/gcc.am
    contrib/crossrpms/freebsd6.0/i586/.cvsignore
    contrib/crossrpms/freebsd6.0/i586/Makefile.am
    contrib/crossrpms/freebsd6.0/i586/binutils-sources.add
    contrib/crossrpms/freebsd6.0/i586/gcc-sources.add
    contrib/crossrpms/freebsd6.0/i586/libs.add
    contrib/crossrpms/freebsd6.0/i586/target-libs.add
    contrib/crossrpms/freebsd6.1/.cvsignore
    contrib/crossrpms/freebsd6.1/Makefile.am
    contrib/crossrpms/freebsd6.1/binutils.am
    contrib/crossrpms/freebsd6.1/gcc-prep.add
    contrib/crossrpms/freebsd6.1/gcc.am
    contrib/crossrpms/freebsd6.1/i586/.cvsignore
    contrib/crossrpms/freebsd6.1/i586/Makefile.am
    contrib/crossrpms/freebsd6.1/i586/binutils-sources.add
    contrib/crossrpms/freebsd6.1/i586/gcc-sources.add
    contrib/crossrpms/freebsd6.1/i586/libs.add
    contrib/crossrpms/freebsd6.1/i586/target-libs.add
    contrib/crossrpms/freebsd6.2/.cvsignore
    contrib/crossrpms/freebsd6.2/Makefile.am
    contrib/crossrpms/freebsd6.2/binutils.am
    contrib/crossrpms/freebsd6.2/gcc-prep.add
    contrib/crossrpms/freebsd6.2/gcc.am
    contrib/crossrpms/freebsd6.2/i586/.cvsignore
    contrib/crossrpms/freebsd6.2/i586/Makefile.am
    contrib/crossrpms/freebsd6.2/i586/binutils-sources.add
    contrib/crossrpms/freebsd6.2/i586/gcc-sources.add
    contrib/crossrpms/freebsd6.2/i586/libs.add
    contrib/crossrpms/freebsd6.2/i586/target-libs.add
    contrib/crossrpms/mingw32/.cvsignore
    contrib/crossrpms/mingw32/Makefile.am
    contrib/crossrpms/mingw32/binutils.am
    contrib/crossrpms/mingw32/gcc-prep.add
    contrib/crossrpms/mingw32/gcc.am
    contrib/crossrpms/mingw32/i686/.cvsignore
    contrib/crossrpms/mingw32/i686/Makefile.am
    contrib/crossrpms/mingw32/i686/binutils-sources.add
    contrib/crossrpms/mingw32/i686/gcc-sources.add
    contrib/crossrpms/mingw32/i686/libs.add
    contrib/crossrpms/mingw32/i686/target-libs.add
    contrib/crossrpms/mingw32/i686/target-w32api.add
    contrib/crossrpms/mingw32/i686/w32api.add
    contrib/crossrpms/solaris2.7/.cvsignore
    contrib/crossrpms/solaris2.7/Makefile.am
    contrib/crossrpms/solaris2.7/binutils.am
    contrib/crossrpms/solaris2.7/gcc-prep.add
    contrib/crossrpms/solaris2.7/gcc.am
    contrib/crossrpms/solaris2.7/sparc/.cvsignore
    contrib/crossrpms/solaris2.7/sparc/Makefile.am
    contrib/crossrpms/solaris2.7/sparc/binutils-sources.add
    contrib/crossrpms/solaris2.7/sparc/gcc-sources.add
    contrib/crossrpms/solaris2.7/sparc/libs.add
    contrib/crossrpms/solaris2.7/sparc/target-libs.add
    cpukit/zlib/doc/rfc1950.txt
    cpukit/zlib/doc/rfc1951.txt
    cpukit/zlib/doc/rfc1952.txt
    cpukit/zlib/doc/txtvsbin.txt
    cpukit/zlib/examples/zran.c
    cpukit/zlib/old/as400/bndsrc
    cpukit/zlib/old/as400/compile.clp
    cpukit/zlib/old/as400/readme.txt
    cpukit/zlib/old/visualc6/README.txt
    cpukit/zlib/old/visualc6/example.dsp
    cpukit/zlib/old/visualc6/minigzip.dsp
    cpukit/zlib/old/visualc6/zlib.dsw
    cpukit/zlib/zlib.pc.in
    cpukit/zlib/zlib2ansi
2007-09-19 06:34:26 +00:00
19185 changed files with 969987 additions and 3924420 deletions

17
.cvsignore Normal file
View File

@@ -0,0 +1,17 @@
aclocal.m4
autom4te*.cache
compile
config.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
install.sh
Makefile
Makefile.in
mdate-sh
missing
texinfo.tex

6
.gitignore vendored
View File

@@ -1,6 +0,0 @@
/build
doc
/*.ini
.lock*
*.pyc
.waf*

View File

@@ -1,4 +0,0 @@
include:
- project: 'administration/integration'
file:
- 'ci/config/rtems.yml'

View File

@@ -1,288 +0,0 @@
["defaults"]
exclude = ["format", "spell"]
[[ignore."cpukit/dev"]]
files = ["cpukit/dev/iovprintf.c"]
[[ignore."cpukit/include"]]
files = [
"cpukit/include/arpa/ftp.h",
"cpukit/include/crypt.h",
"cpukit/include/dlfcn.h",
"cpukit/include/fdt.h",
"cpukit/include/libfdt_env.h",
"cpukit/include/libfdt.h",
"cpukit/include/link_elf.h",
"cpukit/include/link.h",
"cpukit/include/md4.h",
"cpukit/include/md5.h",
"cpukit/include/rtems/jffs2.h",
"cpukit/include/rtems/mouse_parser.h",
"cpukit/include/sha224.h",
"cpukit/include/sha256.h",
"cpukit/include/sha384.h",
"cpukit/include/sha512.h",
"cpukit/include/sha512t.h",
"cpukit/include/sys/_ffcounter.h",
"cpukit/include/sys/cdefs_elf.h",
"cpukit/include/sys/endian.h",
"cpukit/include/sys/event.h",
"cpukit/include/sys/exec_elf.h",
"cpukit/include/sys/priority.h",
"cpukit/include/sys/statvfs.h",
"cpukit/include/sys/timeffc.h",
"cpukit/include/sys/timepps.h",
"cpukit/include/sys/timetc.h",
"cpukit/include/sys/timex.h",
"cpukit/include/sys/utsname.h",
"cpukit/include/uuid/uuid.h",
"cpukit/include/xz.h",
"cpukit/include/zconf.h",
"cpukit/include/zlib.h"
]
[[ignore."cpukit/include/machine"]]
files = ["cpukit/include/machine/*.h"]
[[ignore."cpukit/jffs2"]]
files = [
"cpukit/libfs/src/jffs2/include/linux/jffs2.h",
"cpukit/libfs/src/jffs2/src/acl.h",
"cpukit/libfs/src/jffs2/src/build.c",
"cpukit/libfs/src/jffs2/src/compat-crc32.c",
"cpukit/libfs/src/jffs2/src/compr_rtime.c",
"cpukit/libfs/src/jffs2/src/compr_zlib.c",
"cpukit/libfs/src/jffs2/src/compr_rubin.c",
"cpukit/libfs/src/jffs2/src/compr.c",
"cpukit/libfs/src/jffs2/src/compr.h",
"cpukit/libfs/src/jffs2/src/debug.c",
"cpukit/libfs/src/jffs2/src/debug.h",
"cpukit/libfs/src/jffs2/src/dir-rtems.c",
"cpukit/libfs/src/jffs2/src/erase.c",
"cpukit/libfs/src/jffs2/src/flashio.c",
"cpukit/libfs/src/jffs2/src/fs-rtems.c",
"cpukit/libfs/src/jffs2/src/gc.c",
"cpukit/libfs/src/jffs2/src/jffs2_fs_i.h",
"cpukit/libfs/src/jffs2/src/jffs2_fs_sb.h",
"cpukit/libfs/src/jffs2/src/malloc-rtems.c",
"cpukit/libfs/src/jffs2/src/nodelist.c",
"cpukit/libfs/src/jffs2/src/nodelist.h",
"cpukit/libfs/src/jffs2/src/nodemgmt.c",
"cpukit/libfs/src/jffs2/src/read.c",
"cpukit/libfs/src/jffs2/src/readinode.c",
"cpukit/libfs/src/jffs2/src/scan.c",
"cpukit/libfs/src/jffs2/src/summary.h",
"cpukit/libfs/src/jffs2/src/wbuf.c",
"cpukit/libfs/src/jffs2/src/write.c",
"cpukit/libfs/src/jffs2/src/xattr.h"
]
[[ignore."cpukit/libcrypt"]]
files = ["cpukit/libcrypt/*.c"]
[[ignore."cpukit/libcsupport"]]
files = [
"cpukit/libcsupport/src/cfmakeraw.c",
"cpukit/libcsupport/src/cfmakesane.c",
"cpukit/libcsupport/src/realpath.c"
]
[[ignore."cpukit/libmd"]]
files = ["cpukit/libmd/*.c"]
[[ignore."cpukit/libdl"]]
files = [
"cpukit/libdl/fastlz.c",
"cpukit/libdl/fastlz.h"
]
[[ignore."cpukit/dtc"]]
files = [
"cpukit/dtc/libfdt/*.c",
"cpukit/dtc/libfdt/*.h",
"cpukit/dtc/README.license",
"cpukit/dtc/VERSION"
]
[[ignore."cpukit/mouse"]]
files = ["cpukit/libmisc/mouse/mouse_parser.c"]
[[ignore."cpukit/score/cpu"]]
files = [
"cpukit/score/cpu/i386/include/machine/elf_machdep.h",
"cpukit/score/cpu/m68k/include/machine/elf_machdep.h",
"cpukit/score/cpu/mips/include/machine/elf_machdep.h",
"cpukit/score/cpu/nios2/include/machine/elf_machdep.h",
"cpukit/score/cpu/sparc/include/machine/elf_machdep.h",
"cpukit/score/cpu/x86_64/include/machine/elf_machdep.h"
]
[[ignore."cpukit/score/kern"]]
files = [
"cpukit/score/src/kern_ntptime.c",
"cpukit/score/src/kern_tc.c"
]
[[ignore."cpukit/shell"]]
files = [
"cpukit/libmisc/shell/cat_file.c",
"cpukit/libmisc/shell/cmds.c",
"cpukit/libmisc/shell/cmp-ls.c",
"cpukit/libmisc/shell/dd-args.c",
"cpukit/libmisc/shell/dd-conv_tab.c",
"cpukit/libmisc/shell/dd-conv.c",
"cpukit/libmisc/shell/dd-misc.c",
"cpukit/libmisc/shell/dd-position.c",
"cpukit/libmisc/shell/dd.h",
"cpukit/libmisc/shell/err.c",
"cpukit/libmisc/shell/err.h",
"cpukit/libmisc/shell/errx.c",
"cpukit/libmisc/shell/extern-cp.h",
"cpukit/libmisc/shell/extern-dd.h",
"cpukit/libmisc/shell/extern-ls.h",
"cpukit/libmisc/shell/fdisk.c",
"cpukit/libmisc/shell/filemode.c",
"cpukit/libmisc/shell/fts.c",
"cpukit/libmisc/shell/fts.h",
"cpukit/libmisc/shell/hexdump-conv.c",
"cpukit/libmisc/shell/hexdump-display.c",
"cpukit/libmisc/shell/hexdump-odsyntax.c",
"cpukit/libmisc/shell/hexdump-parse.c",
"cpukit/libmisc/shell/hexdump.h",
"cpukit/libmisc/shell/hexsyntax.c",
"cpukit/libmisc/shell/login_check.c",
"cpukit/libmisc/shell/login_prompt.c",
"cpukit/libmisc/shell/main_alias.c",
"cpukit/libmisc/shell/main_blkstats.c",
"cpukit/libmisc/shell/main_blksync.c",
"cpukit/libmisc/shell/main_cat.c",
"cpukit/libmisc/shell/main_cd.c",
"cpukit/libmisc/shell/main_chdir.c",
"cpukit/libmisc/shell/main_chmod.c",
"cpukit/libmisc/shell/main_chroot.c",
"cpukit/libmisc/shell/main_cmdchmod.c",
"cpukit/libmisc/shell/main_cmdchown.c",
"cpukit/libmisc/shell/main_cmdls.c",
"cpukit/libmisc/shell/main_cp.c",
"cpukit/libmisc/shell/main_cpuinfo.c",
"cpukit/libmisc/shell/main_cpuuse.c",
"cpukit/libmisc/shell/main_date.c",
"cpukit/libmisc/shell/main_dd.c",
"cpukit/libmisc/shell/main_debugrfs.c",
"cpukit/libmisc/shell/main_df.c",
"cpukit/libmisc/shell/main_dir.c",
"cpukit/libmisc/shell/main_echo.c",
"cpukit/libmisc/shell/main_edit.c",
"cpukit/libmisc/shell/main_exit.c",
"cpukit/libmisc/shell/main_flashdev.c",
"cpukit/libmisc/shell/main_getenv.c",
"cpukit/libmisc/shell/main_halt.c",
"cpukit/libmisc/shell/main_help.c",
"cpukit/libmisc/shell/main_hexdump.c",
"cpukit/libmisc/shell/main_i2cdetect.c",
"cpukit/libmisc/shell/main_i2cget.c",
"cpukit/libmisc/shell/main_i2cset.c",
"cpukit/libmisc/shell/main_id.c",
"cpukit/libmisc/shell/main_ln.c",
"cpukit/libmisc/shell/main_logoff.c",
"cpukit/libmisc/shell/main_ls.c",
"cpukit/libmisc/shell/main_lsof.c",
"cpukit/libmisc/shell/main_mallocinfo.c",
"cpukit/libmisc/shell/main_md5.c",
"cpukit/libmisc/shell/main_mdump.c",
"cpukit/libmisc/shell/main_medit.c",
"cpukit/libmisc/shell/main_mfill.c",
"cpukit/libmisc/shell/main_mkdir.c",
"cpukit/libmisc/shell/main_mknod.c",
"cpukit/libmisc/shell/main_mkrfs.c",
"cpukit/libmisc/shell/main_mmove.c",
"cpukit/libmisc/shell/main_mount.c",
"cpukit/libmisc/shell/main_msdosfmt.c",
"cpukit/libmisc/shell/main_mv.c",
"cpukit/libmisc/shell/main_perioduse.c",
"cpukit/libmisc/shell/main_profreport.c",
"cpukit/libmisc/shell/main_pwd.c",
"cpukit/libmisc/shell/main_rm.c",
"cpukit/libmisc/shell/main_rmdir.c",
"cpukit/libmisc/shell/main_rtc.c",
"cpukit/libmisc/shell/main_rtems.c",
"cpukit/libmisc/shell/main_rtrace.c",
"cpukit/libmisc/shell/main_setenv.c",
"cpukit/libmisc/shell/main_sleep.c",
"cpukit/libmisc/shell/main_spi.c",
"cpukit/libmisc/shell/main_stackuse.c",
"cpukit/libmisc/shell/main_time.c",
"cpukit/libmisc/shell/main_top.c",
"cpukit/libmisc/shell/main_tty.c",
"cpukit/libmisc/shell/main_umask.c",
"cpukit/libmisc/shell/main_unmount.c",
"cpukit/libmisc/shell/main_unsetenv.c",
"cpukit/libmisc/shell/main_whoami.c",
"cpukit/libmisc/shell/main_wkspaceinfo.c",
"cpukit/libmisc/shell/mknod-pack_dev.h",
"cpukit/libmisc/shell/pathnames-mv.h",
"cpukit/libmisc/shell/print_heapinfo.c",
"cpukit/libmisc/shell/print-ls.c",
"cpukit/libmisc/shell/pwcache.c",
"cpukit/libmisc/shell/shell_cmdset.c",
"cpukit/libmisc/shell/shell_getchar.c",
"cpukit/libmisc/shell/shell_getprompt.c",
"cpukit/libmisc/shell/shell_makeargs.c",
"cpukit/libmisc/shell/shell_script.c",
"cpukit/libmisc/shell/shell-wait-for-input.c",
"cpukit/libmisc/shell/shell.c",
"cpukit/libmisc/shell/shellconfig.c",
"cpukit/libmisc/shell/sysexits.h",
"cpukit/libmisc/shell/utils-cp.c",
"cpukit/libmisc/shell/utils-ls.c",
"cpukit/libmisc/shell/verr.c",
"cpukit/libmisc/shell/verrx.c",
"cpukit/libmisc/shell/vis.c",
"cpukit/libmisc/shell/vis.h",
"cpukit/libmisc/shell/vwarn.c",
"cpukit/libmisc/shell/vwarnx.c",
"cpukit/libmisc/shell/warn.c",
"cpukit/libmisc/shell/warnx.c",
"cpukit/libmisc/shell/write_file.c",
"cpukit/libmisc/uuid/clear.c",
"cpukit/libmisc/uuid/compare.c",
"cpukit/libmisc/uuid/copy.c",
"cpukit/libmisc/uuid/gen_uuid.c",
"cpukit/libmisc/uuid/isnull.c",
"cpukit/libmisc/uuid/pack.c",
"cpukit/libmisc/uuid/parse.c",
"cpukit/libmisc/uuid/unpack.c",
"cpukit/libmisc/uuid/unparse.c",
"cpukit/libmisc/uuid/uuid_time.c",
"cpukit/libmisc/uuid/uuidd.h",
"cpukit/libmisc/uuid/uuidP.h"
]
[[ignore."cpukit/xz"]]
files = [
"cpukit/compression/xz/*.h",
"cpukit/compression/xz/*.c"
]
[[ignore."cpukit/zlib"]]
files = [
"cpukit/compression/zlib/*.c",
"cpukit/compression/zlib/*.h",
"cpukit/compression/zlib/doc/*",
"cpukit/compression/zlib/ChangeLog.zlib",
"cpukit/compression/zlib/FAQ"
]
# These files have test characters that fail the char test
[[ignore."testsuites/fstests/fsdosfsname01"]]
exclude = ["char"]
files = [
"testsuites/fstests/fsdosfsname01/init.c",
"testsuites/fstests/fsdosfsname01/create_files.cs",
"testsuites/fstests/fsdosfsname01/files.h"
]
[[ignore."yaml"]]
files = [
"yaml/*"
]

View File

@@ -1,261 +0,0 @@
# Please keep users, directories and files sorted alphabetically.
# Directories first
#
# If there is more than 1 user in a section it must be promoted to a group in
# /approvers
[General Maintainer] @approvers/general/maintainer
*
[Documentation] @approvers/docs
*/README
*.md
*.rst
*.txt
# CPUKit
########
[CPUKit libdebugger] @approvers/cpukit/libdebugger
/cpukit/libdebugger
[CPUKit libdl] @approvers/cpukit/libdl
/cpukit/libdl
[CPUKit libdrvmgr] @approvers/cpukit/libdrvmgr
/cpukit/libdrvmgr
[CPUKit libgnat] @joel
/cpukit/libgnat
[CPUKit librtemscxx] @approvers/cpukit/librtemscxx
/cpukit/librtemscxx
[CPUKit libstdthreads] @approvers/cpukit/libstdthreads
/cpukit/libstdthreads
# Architectures
###############
[Arch AArch64] @approvers/arch/aarch64
/bsps/aarch64/
/cpukit/score/cpu/aarch64/
/spec/build/bsps/aarch64/
/cpukit/libdebugger/rtems-debugger-aarch64.v
/cpukit/libdl/rtl-mdreloc-aarch64.c
/spec/build/cpukit/*aarch64.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch ARM] @approvers/arch/arm
/bsps/arm/
/bsps/include/arm/
/bsps/include/xil/arm/
/bsps/shared/freebsd/sys/arm/
/bsps/shared/xil/arm/
/cpukit/score/cpu/arm/
/spec/build/bsps/arm/
/cpukit/libdebugger/rtems-debugger-arm.c
/cpukit/libdl/*arm*
/spec/build/cpukit/*arm.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Blackfin] @approvers/arch/bfin
/bsps/bfin/
/cpukit/score/cpu/bfin/
/spec/build/bsps/bfin/
/cpukit/libdl/rtl-mdreloc-bfin.c
/spec/build/cpukit/cpubfin.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch i386] @approvers/arch/i386
/bsps/i386/
/cpukit/score/cpu/i386/
/spec/build/bsps/i386/
/cpukit/libdebugger/rtems-debugger-i386.c
/cpukit/libdl/rtl-mdreloc-i386.c
/spec/build/cpukit/*i386*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch LatticeMico32] @approvers/arch/lm32
/bsps/lm32/
/cpukit/score/cpu/lm32/
/spec/build/bsps/lm32/
/cpukit/libdl/rtl-mdreloc-lm32.c
/spec/build/cpukit/cpulm32.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Motorola 68000] @approvers/arch/m68k
/bsps/m68k/
/cpukit/score/cpu/m68k/
/spec/build/bsps/m68k/
/cpukit/libdl/rtl-mdreloc-m68k.c
/spec/build/cpukit/*m68k*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch MicroBlaze] @approvers/arch/microblaze
/bsps/include/xil/microblaze/
/bsps/microblaze/
/cpukit/score/cpu/microblaze/
/spec/build/bsps/microblaze/
/cpukit/libdebugger/rtems-debugger-microblaze.c
/cpukit/libdl/rtl-mdreloc-microblaze.c
/spec/build/cpukit/*microblaze*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch MIPS] @approvers/arch/mips
/bsps/mips/
/cpukit/score/cpu/mips/
/spec/build/bsps/mips/
/cpukit/libdl/rtl-mdreloc-mips.c
/spec/build/cpukit/*mips.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Moxie] @approvers/arch/moxie
/bsps/moxie/
/cpukit/score/cpu/moxie/
/spec/build/bsps/moxie/
/cpukit/libdl/rtl-mdreloc-moxie.c
/spec/build/cpukit/*moxie.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Nios II] @approvers/arch/nios2
/bsps/nios2/
/cpukit/score/cpu/nios2/
/spec/build/bsps/nios2/
/spec/build/cpukit/*nios2.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch OpenRISC 1000] @approvers/arch/or1k
/bsps/or1k/
/cpukit/score/cpu/or1k/
/spec/build/bsps/or1k/
/spec/build/cpukit/*or1k.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch PowerPC] @approvers/arch/powerpc
/bsps/powerpc/
/cpukit/score/cpu/powerpc/
/spec/build/bsps/powerpc/
/cpukit/libdl/rtl-mdreloc-powerpc.c
/spec/build/cpukit/*powerpc.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch RISC-V] @approvers/arch/risc-v
/bsps/riscv
/cpukit/score/cpu/riscv
/spec/build/bsps/riscv
/cpukit/libdl/rtl-mdreloc-riscv.c
/spec/build/cpukit/*riscv.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch SuperH] @approvers/arch/superh
/bsps/sh/
/cpukit/score/cpu/sh/
/spec/build/bsps/sh/
/spec/build/cpukit/cpush.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch SPARC] @approvers/arch/sparc
/bsps/sparc/
/cpukit/score/cpu/sparc/
/spec/build/bsps/sparc/
/spec/build/cpukit/cpusparc.yml
/spec/build/cpukit/objdlsparc.yml
/spec/build/testsuites/validation/bsps/*-sparc-*
/testsuites/validation/bsps/*-sparc-*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch SPARC64] @approvers/arch/sparc64
/bsps/sparc64/
/cpukit/score/cpu/sparc64/
/spec/build/bsps/sparc64/
/spec/build/cpukit/*sparc64.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch V850] @approvers/arch/v850
/bsps/v850/
/cpukit/score/cpu/v850/
/spec/build/bsps/v850/
/cpukit/libdl/rtl-mdreloc-v850.c
/spec/build/cpukit/*v850.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch X86_64] @approvers/arch/x86_64
/bsps/x86_64/
/cpukit/score/cpu/x86_64/
/spec/build/bsps/x86_64/
/spec/build/cpukit/*x8664.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs

343
COPYING Normal file
View File

@@ -0,0 +1,343 @@
#
# $RTEMS$
#
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

1662
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

2538
Doxyfile

File diff suppressed because it is too large Load Diff

51
INSTALL Normal file
View File

@@ -0,0 +1,51 @@
#
# $Id$
#
Building RTEMS
==============
See the file README.configure.
UNCOMPRESSING .tgz FILES
===========================
Many of the files found in this directory and its subdirectories
are gzip'ed, tar archive files. These files have the ".tgz"
extension. They were compressed with gzip version 1.2.4.
Use a command sequence similar to the following to uncompress each
file:
gzcat FILE.tgz | tar xvof -
where FILE.tgz is the file to be installed. This procedure will
extract the files in the archive into the current directory.
All of the .tgz files associated with this release RTEMS will
place their contents in a subdirectory rtems-<release> in the current
directory.
If you are unsure of what is in an RTEMS archive file, then use
the following command sequence to get a listing of the contents:
gzcat FILE.tgz | tar tvf -
NOTES:
(1) The "-o" option to tar is included on the tar command line
so that the user extracting the tar archive will own the extracted
files.
(2) gzcat is sometimes installed as zcat. Be warned that on many
(most) UNIX machines, zcat is associated with compress (.Z files).
(3) If you do not have gzip 1.2.4, it is available from numerous sites
including this one. Other sites include ftp.gnu.org and ftp.cdrom.com.
(4) The GNU archive files included in this distribution are packaged
exactly like they are on official GNU ftp sites. When extracting
GNU archives, they will not extract under a rtems-<version>
directory. They will extract themselves under a directory which
is the name and version of the tool in question. For example,
gcc-2.5.8.tgz will extract its contents into the subdirectory
gcc-2.5.8.

23
LICENSE Normal file
View File

@@ -0,0 +1,23 @@
#
# $Id$
#
LICENSE INFORMATION
RTEMS is free software; you can redistribute it and/or modify it under
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version. RTEMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. You should have received
a copy of the GNU General Public License along with RTEMS; see
file COPYING. If not, write to the Free Software Foundation, 675
Mass Ave, Cambridge, MA 02139, USA.
As a special exception, including RTEMS header files in a file,
instantiating RTEMS generics or templates, or linking other files
with RTEMS objects to produce an executable application, does not
by itself cause the resulting executable application to be covered
by the GNU General Public License. This exception does not
however invalidate any other reasons why the executable file might be
covered by the GNU Public License.

63
LICENSE.NET Normal file
View File

@@ -0,0 +1,63 @@
#
# $Id$
#
The RTEMS TCP/IP stack is a port of the FreeBSD TCP/IP stack. The following
copyright and licensing information applies to this code.
This code is found under the c/src/libnetworking directory but does not
constitute the entire contents of that subdirectory.
=============================================================================
Copyright (c) 1980, 1983, 1988, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgment:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
=============================================================================

44
LICENSE.RPCXDR Normal file
View File

@@ -0,0 +1,44 @@
#
# $Id$
#
The RTEMS RPC/XDR support is a port of the freely distributed
Sun Microsystems implementation. The following copyright and
licensing information applies to this code.
This code is in the c/src/librpc directory.
=============================================================================
Copyright (C) 1984, Sun Microsystems, Inc.
Sun RPC is a product of Sun Microsystems, Inc. and is provided for
unrestricted use provided that this legend is included on all tape
media and as a part of the software program in whole or part. Users
may copy or modify Sun RPC without charge, but are not authorized
to license or distribute it to anyone else except as part of a product or
program developed by the user.
SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
Sun RPC is provided with no support and without any obligation on the
part of Sun Microsystems, Inc. to assist in its use, correction,
modification or enhancement.
SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
OR ANY PART THEREOF.
In no event will Sun Microsystems, Inc. be liable for any lost revenue
or profits or other special, indirect and consequential damages, even if
Sun has been advised of the possibility of such damages.
Sun Microsystems, Inc.
2550 Garcia Avenue
Mountain View, California 94043
=============================================================================

8
LICENSE.WEBSERVER Normal file
View File

@@ -0,0 +1,8 @@
#
# $Id$
#
The source code in c/src/libnetworking/rtems_webserver is a port
of the Go Ahead Software, Inc. WebServer. Their copyright and
licensing terms apply. See c/src/libnetworking/rtems_webserver/license.txt
for details.

1321
LICENSE.md

File diff suppressed because it is too large Load Diff

55
MAINTAINERS Normal file
View File

@@ -0,0 +1,55 @@
Note
====
This file contains information about people who are permitted to make
changes to various parts of RTEMS and its associated components and
add-ons.
Please do not contact the people in this file directly to report
problems with RTEMS.
For general information about RTEMS, please visit:
http://www.rtems.com
To report problems in RTEMS, please visit:
http://www.rtems.com/bugs.html
Maintainers
===========
Blanket Write Privileges (alphabetical order)
Jennifer Averett jennifer@oarcorp.com
Ralf Corsepius ralf.corsepius@rtems.org
Chris Johns chris.johns@rtems.com
Eric Norum eric.norum@rtems.com
Joel Sherrill joel.sherrill@oarcorp.com
Various Component Maintainers
Networking NAME-TBD EMAIL-TBD
CPU Port Maintainers (CPU alphabetical order)
arm Jay Monkman jtm@lopingdog.com
avr Ralf Corsepius ralf.corsepius@rtems.org
c4x Joel Sherrill joel.sherrill@OARcorp.com
h8300 NAME-TBD EMAIL-TBD
i386 NAME-TBD EMAIL-TBD
m68k NAME-TBD EMAIL-TBD
mips NAME-TBD EMAIL-TBD
no_cpu NAME-TBD EMAIL-TBD
or32 NAME-TBD EMAIL-TBD
powerpc NAME-TBD EMAIL-TBD
sh NAME-TBD EMAIL-TBD
sparc NAME-TBD EMAIL-TBD
unix NAME-TBD EMAIL-TBD
BSP Maintainers (CPU/BSP alphabetical order)
CPU/BSP NAME-TBD EMAIL-TBD
arm/edb7312 Jay Monkman jtm@lopingdog.com
arm/gp32 Philippe Simons loki_666@fastmail.fm

44
Makefile.am Normal file
View File

@@ -0,0 +1,44 @@
#
# top level directory for RTEMS build tree
#
##
## $Id$
##
ACLOCAL_AMFLAGS = -I aclocal
SUBDIRS = make $(build_SUBDIRS) $(host_SUBDIRS) $(target_SUBDIRS)
DIST_SUBDIRS = $(SUBDIRS)
noinst_SCRIPTS = bootstrap
EXTRA_DIST = README.configure SUPPORT VERSION LICENSE $(noinst_SCRIPTS)
EXTRA_DIST += config-ml.in
EXTRA_DIST += ampolish3
dist-hook:
@files=`(cd $(srcdir); find doc cpukit c testsuites tools \
-name configure.ac -print | sed 's,/configure.ac,,' | sort)`; \
for i in $$files; do \
if test -f $(distdir)/$$i/configure.ac; then : ; \
else \
d=`dirname $(distdir)/$$i`; \
$(MKDIR_P) $$d;\
echo "cp -pR $(srcdir)/$$i $(distdir)/$$i"; \
cp -pR $(srcdir)/$$i $(distdir)/$$i; \
fi; \
done
rm -rf `find $(distdir) -name 'autom4te*'`
rm -rf `find $(distdir) -name CVS`
rm -f `find $(distdir) \( -name .cvsignore \
-o -name config.status \
-o -name config.log \)`
rm -f `find $(distdir) \( -name '*.bak' \
-o -name 'changes' -o -name 'diff' -o -name 'tmp' -o -name 'log' \
-o -name '*~' -o -name '.*~' -o -name '.#*' \)`
find $(distdir) -name '*.in' -print | while read a; do \
f=`echo $$a | sed 's,\.in$$,,'`; \
if test -f $$f; then echo "rm $$f"; rm $$f; fi; done
include $(top_srcdir)/automake/subdirs.am
include $(top_srcdir)/automake/host.am

145
Makefile.maint Normal file
View File

@@ -0,0 +1,145 @@
#
# Maintainer Makefile
#
# WARNING:
# THIS IS EXPERIMENTAL - DO NOT USE (YET) !
# * This Makefile is only useful to RTEMS maintainers
# * You must have write access to RTEMS CVS
# * Running this Makefile modifies RTEMS CVS
# * Watch out for warning and error messages - Do NOT IGNORE them!
# MAINTAINER notes:
# Cutting a new release:
# 1. Perform a non-anonymous cvs checkout of the BRANCH
# you want to cut a release tarball from
# 2. Run "make -f Makefile.maint new-revision"
# (rsp. "make -f Makefile.maint new-minor").
# 3. Run "make -f Makefile.maint commit"
# 4. Run "make -f Makefile.maint tag"
# 5. Run "make -f Makefile.maint tarball"
# -----------------
# SECURITY: Append a string to tag to avoid accidentially screwing up cvs-tags
# For "hot runs" you will want to use "make -f Makefile.maint TAG_SUFFIX= <command>"
TAG_SUFFIX = -test1
rtems_version := $(shell cat VERSION | sed -n '/.* Version /{s/^.*Version[ ]*\([0-9\.]\+\)/\1/p};')
rtems_tag := $(shell echo "rtems-$(rtems_version)" | tr . -)
rtems_api := 4.8
PATH := /opt/rtems-$(rtems_api)/bin:$(PATH)
# -----------------
# Cleanup check out and cvs-tag the files inside
tag:
cvs -q -z9 up -dP
./bootstrap -p >/dev/null
cvs -q tag -c $(rtems_tag)$(TAG_SUFFIX)
# -----------------
# Different stages of cvs-exporting
rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX):
rm -rf rtems-$(rtems_version)
@cvs -q -z9 export -d rtems-$(rtems_version) -r $(rtems_tag)$(TAG_SUFFIX) rtems
@if ! test -f rtems-$(rtems_version)/VERSION; then \
echo "ERROR export failed"; \
echo " Did you run 'make -f Makefile.maint tag' ?"; exit 1; fi
echo "$(rtems_tag)$(TAG_SUFFIX)" > rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX)
rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2: rtems-$(rtems_version)/stamp.autofiles \
rtems-$(rtems_version)/excludes \
rtems-$(rtems_version)/TOOL_VERSIONS
cd rtems-$(rtems_version) ; \
touch doc/ada_user/ada_user.texi doc/bsp_howto/bsp_howto.texi \
doc/cpu_supplement/cpu_supplement.texi \
doc/develenv/develenv.texi doc/filesystem/filesystem.texi \
doc/itron3.0/itron.texi doc/networking/networking.texi \
doc/new_chapters/new_chapters.texi doc/porting/porting.texi \
doc/posix1003.1/posix1003_1.texi doc/posix_users/posix_users.texi \
doc/relnotes/relnotes.texi doc/started_ada/started_ada.texi \
doc/started/started.texi doc/user/c_user.texi
tar -cj -X rtems-$(rtems_version)/excludes \
-f rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2 rtems-$(rtems_version)
## Touching the top pages in the various manuals results in the date
## on their title page matching the release date.
rtems-$(rtems_version)/stamp.cleanup: rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX)
find rtems-$(rtems_version) -name .cvsignore -exec rm -f {} \;
find rtems-$(rtems_version) -name preinstall.am -exec touch {} \;
rm -rf rtems-$(rtems_version)/contrib
touch rtems-$(rtems_version)/stamp.cleanup
rtems-$(rtems_version)/stamp.autofiles: rtems-$(rtems_version)/stamp.cleanup
cd rtems-$(rtems_version) && ./bootstrap -r
touch rtems-$(rtems_version)/stamp.autofiles
rtems-$(rtems_version)/excludes: Makefile.maint
@echo "Generating $@"
@echo "excludes" > $@
@echo "stamp.*" >> $@
@echo "autom4te.cache" >> $@
@echo "Makefile.maint" >> $@
tarball: rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2
rtems-$(rtems_version)/TOOL_VERSIONS: Makefile.maint
( \
date ; \
echo ; \
echo "This file contains configuration information on the " ; \
echo "primary computer used to test and make the $(rtems_version)" ; \
echo "version of RTEMS" ; \
echo ; \
echo "OS Version: " `head -1 /etc/issue` ; \
echo ; \
echo "The following RTEMS RPMs were installed on the machine" ; \
echo "where this release was made:" ; \
echo ; \
rpm -qa 'rtems-$(rtems_api)-*' | sort | sed -e 's/^/ /' ; \
echo \
) > $@
# -----------------
# Create a new minor release
# increments the 2nd digit of the version number
# set the 3rd digit of the version number to 0
# Example: 4.6.99.4 -> 4.7.0
new-minor:
@v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \
r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \
r=$$(($$r + 1)); version="$$v.$$r.0"; \
echo "New minor release: $$version"; \
sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
$(VERSION_FILES); \
sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
# Create a new revision release
# increments the last digit of the version number
# Examples: 4.6.99.4 -> 4.6.99.5
# 4.7.0 -> 4.7.1
new-revision:
@m=$$(echo $(rtems_version) | sed 's,^\(.*\)\.[0-9]\+,\1,'); \
n=$$(echo $(rtems_version) | sed 's,^.*\.\([0-9]\+\),\1,'); \
n=$$(($$n + 1)); version="$$m.$$n";\
echo "New revision release: $$version"; \
sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
$(VERSION_FILES); \
sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
VERSION_FILES += aclocal/version.m4
VERSION_FILES += cpukit/aclocal/version.m4
VERSION_FILES += c/src/aclocal/version.m4
VERSION_FILES += testsuites/aclocal/version.m4
CVS_RUN := $(shell if [ -n "$(TAG_SUFFIX)" ]; then echo "cvs -n"; else echo "cvs"; fi)
commit:
$(CVS_RUN) commit -m "Upgrade to $(rtems_version)" \
$(VERSION_FILES) VERSION
.PHONY: commit new-minor new-revision tag tarball

97
README Normal file
View File

@@ -0,0 +1,97 @@
#
# $Id$
#
Building RTEMS
==============
See the file README.configure.
Directory Overview
==================
This is the top level of the RTEMS directory structure. The following
is a description of the files and directories in this directory:
INSTALL
Rudimentary installation instructions. For more detailed
information please see the Release Notes. The Postscript
version of this manual can be found in the file
c_or_ada/doc/relnotes.tgz.
LICENSE
Required legalese.
README
This file.
c
This directory contains the source code for the C
implementation of RTEMS as well as the test suites, sample
applications, Board Support Packages, Device Drivers, and
support libraries.
doc
This directory contains the PDL for the RTEMS executive.
Ada versus C
============
There are two implementations of RTEMS in this source tree --
in Ada and in C. These two implementations are functionally
and structurally equivalent. The C implementation follows
the packaging conventions and hierarchical nature of the Ada
implementation. In addition, a style has been followed which
allows one to easily find the corresponding Ada and C
implementations.
File names in C and code placement was carefully designed to insure
a close mapping to the Ada implementation. The following file name
extensions are used:
.adb - Ada body
.ads - Ada specification
.adp - Ada body requiring preprocessing
.inc - include file for .adp files
.c - C body (non-inlined routines)
.inl - C body (inlined routines)
.h - C specification
In the executive source, XYZ.c and XYZ.inl correspond directly to a
single XYZ.adb or XYZ.adp file. A .h file corresponds directly to
the .ads file. There are only a handful of .inc files in the
Ada source and these are used to insure that the desired simple
inline textual expansion is performed. This avoids scoping and
calling convention side-effects in carefully constructed tests
which usually test context switch behavior.
In addition, in Ada code and data name references are always fully
qualified as PACKAGE.NAME. In C, this convention is followed
by having the package name as part of the name itself and using a
capital letter to indicate the presence of a "." level. So we have
PACKAGE.NAME in Ada and _Package_Name in C. The leading "_" in C
is used to avoid naming conflicts between RTEMS and user variables.
By using these conventions, one can easily compare the C and Ada
implementations.
The most noticeable difference between the C and Ada83 code is
the inability to easily obtain a "typed pointer" in Ada83.
Using the "&" operator in C yields a pointer with a specific type.
The 'Address attribute is the closest feature in Ada83. This
returns a System.Address and this must be coerced via Unchecked_Conversion
into an access type of the desired type. It is easy to view
System.Address as similar to a "void *" in C, but this is not the case.
A "void *" can be assigned to any other pointer type without an
explicit conversion.
The solution adopted to this problem was to provide two routines for
each access type in the Ada implementation -- one to convert from
System.Address to the access type and another to go the opposite
direction. This results in code which accomplishes the same thing
as the corresponding C but it is easier to get lost in the clutter
of the apparent subprogram invocations than the "less bulky"
C equivalent.
A related difference is the types which are only in Ada which are used
for pointers to arrays. These types do not exist and are not needed
in the C implementation.

73
README.cdn-X Normal file
View File

@@ -0,0 +1,73 @@
Building RTEMS Canadian Cross
=============================
RTEMS now contains experimental and yet incomplete support for building
it Canadian Cross.
1. Introduction
---------------
If you don't know what Canadian Cross Building means, you probably don't want
to apply it and should consider stop reading here.
Interested readers might want to read Ian Lance Taylor's article at
http://www.airs.com/ian/configure for underlaying details and working
principles.
2. RTEMS
--------
Example: Building RTEMS for sparc-rtems under i386-pc-linux-gnu to be hosted
on a i386-cygwin platform.
2.1 Required tools
------------------
* A i386-pc-linux-gnu cross sparc-rtems toolchain.
* A i386-pc-linux-gnu cross i386-cygwin toolchain.
* A i386-pc-linux-gnu native toolchain.
We further on assume these to be installed to these locations:
/opt/rtems .. linux cross sparc-rtems toolchain
/opt/cygwin .. linux cross i386-cygwin cross-toolchain
/usr .. linux native toolchain and further tools.
2.2 Building sparc-rtems
------------------------
The first step is to build RTEMS for sparc-rtems under linux.
mkdir build
cd build
<path>/rtems/configure [options] \
--target=sparc-rtems \
--prefix=/opt/cygwin
make
make install
This will build a standard sparc-rtems RTEMS and install it to the given
PREFIX.
2.3 Building i386-cygwin host support
-------------------------------------
The next step is to build RTEMS host support for i386-cygwin.
This basically means to cross-build the host tools contained in RTEMS.
mkdir host
cd host
<path>/rtems/configure [options] \
--target=sparc-rtems \
--build=`<path>/rtems/config.guess` \
--host=i386-cygwin \
--prefix=/opt/cygwin
make
make install
This will build RTEMS host-tools for i386-cygwin and install them to the given
PREFIX.
3. Known issues
---------------
* At present time, building RTEMS Canadian Cross is known to be immature, and
to require additional work. Do not expect this to work.
* The <toplevel>/make/ directory hierarchy is not treated correctly.

269
README.configure Normal file
View File

@@ -0,0 +1,269 @@
#
# $Id$
#
1. Autoconf support
===================
This version of RTEMS is configured with GNU autoconf. RTEMS can be
configured and built either standalone or together with the compiler
tools in the Cygnus one-tree structure. Using autoconf also means
that RTEMS now can be built in a separate build directory.
To re-generate auto*tool generated files (configure, Makefile.in etc),
autoconf-2.59 and automake-1.8 are required.
2. Installation
===============
2.1 Standalone build
To configure RTEMS for a specific target, run configure in the build
directory. In addition to the standard configure options, the following
RTEMS-specific option are supported:
--disable-rtems-inlines
--disable-posix
--disable-itron
--disable-networking
--enable-cxx
--enable-bare-cpu-model=<MODEL>
--enable-bare-cpu-cflags=<FLAGS>
--enable-multiprocessing
--enable-rtemsbsp="bsp1 bsp2 ..."
--enable-tests
--enable-rdbg (only valid for i386 and some PowerPC BSPs)
--enable-docs
In addition, the following standard autoconf options are frequently
used when configuring RTEMS installations:
--prefix=INSTALL_DIRECTORY
By default, inline routines are used instead of macros where possible.
Macros can be selected using the --disable-inlines option. [NOTE:
Some APIs may not support macro versions of their inline routines.]
By default, the RTEMS POSIX 1003.1b interface is built for targets that support
it. It can be disabled with the --disable-posix option.
By default, the RTEMS uITRON interface is built for targets that support
it. It can be disabled with the --disable-itron option.
By default, the RTEMS networking support is built for targets which
support it. It can be specifically disabled for those targets
with the --disable-networking option.
By default, the RTEMS remote debugger server support is not built.
It can be specifically enabled for the targets that support it.
with the --enable-rdbg option. NB : the RTEMS networking support
must be enabled to support the remote debugger server.
By default, the RTEMS support of C++ is disabled. It can be enabled
with the --enable-cxx option. If the rtems++ C++ library is installed
it will also be build.
By default, the RTEMS test suites are NOT configured -- only the
sample tests are built. --enable-tests will configure
the RTEMS test suite. The default speeds up the build
and configure process when the tests are not desired.
By default, RTEMS is built using arguments and build rules which require a
gcc supporting the -specs option, ie. a gcc >= 2.8.
[The --disable-gcc28 option, which has been present in former releases, has
been removed.]
By default, multiprocessing is is not built. It can be enabled
for those BSPs supporting it by the --enable-multiprocessing option.
By default, all bsps for a target are built. The bare BSP is not built
unless directly specified. There are two ways of changing this:
+ use the --enable-rtemsbsp option which will set the specified
bsps as the default bsps, or
+ set the RTEMS_BSP variable during make (see below).
The --enable-rtemsbsp= option configures RTEMS for a specific board
within a target architecture. Remember that the target specifies the
CPU family while the BSP specifies the precise board you will be using.
The following targets are supported:
(none) will build the host-based version on Linux,
Solaris and HPUX.
arm-rtems
c4x-rtems
h8300-rtems
i386-rtems
m68k-rtems
mips-rtems
no_cpu-rtems
or32-rtems
powerpc-rtems
sh-rtems
sparc-rtems
bare see notes
The cross-compiler is set to $(target)-gcc by default. This can be
overridden by:
+ using the --program-prefix option to configure to specify the
string which will prepended to the tool names. Be sure to include
a trailing "-". For example, to use a m68k-coff toolset, use the
--program-prefix=m68k-coff- option.
To build, run make in the build directory. To specify which bsps to build,
add the RTEMS_BSP="bsp1 bsp2 .." to the make command. Specifying multiple
BSPs to build only works from the top level build directory.
Installation is done under $(prefix)/rtems.
As an example, to build and install the mvme136 and mvme162 bsps for m68k do:
(path_to_rtems_src)/configure --target=m68k-rtems
make RTEMS_BSP="mvme136 mvme162"
make install RTEMS_BSP="mvme136 mvme162"
The sample tests are built by 'make all', do a 'make test' to build the full
test suite.
By default, --enable-docs is disabled and documentation is not built.
2.2 Build with Cygnus one-tree release
[NOTE: This section does not apply anymore.]
To build and install RTEMS with the one-tree structure, just copy the rtems
directory to the tree. The one-tree configure.in and Makefile.in has to be
replaced with the RTEMS-aware versions. The build options are the same as
for the standalone build.
2.3 Target Dependent Notes
bare:
1. See the README in the bare bsp source directory. This should
contain all info you need.
2. The bare bsp source contains a script to show how to build it.
3. The configure flags must be used to get the bare bsp to work.
The --enable-bare-cpu-model and --enable-bare-cpu-cflags are the
only pieces of information. The module is usually a gcc module
such as m68302 or mcpu32. The flags are passed directly to gcc.
Use "" if more than one option is specified.
3. To use the installed RTEMS library
=====================================
To use the installed RTEMS bsps to build applications, the application
makefile has to include a bsp-specific makefile that will define the
RTEMS variables necessary to find include files and libraries. The
bsp-specific makefile is installed at
$(RTEMS_MAKEFILE_PATH)/Makefile.inc
For the erc32 bsp installed at /usr/local/cross, the environment
variable RTEMS_MAKEFILE_PATH would be set as follows to the
following:
/usr/local/cross/sparc-rtems/rtems/erc32/Makefile.inc
4. Supported target bsps
========================
The following bsps are supported:
host-based : posix (on Linux, FreeBSD, Cygwin, Solaris, and HPUX)
arm : csb336 csb337 edb7312 gba gp32 rtl22x
avr: : none
bfin : eZKit533
c4x : c3xsim c4xsim
h8300 : h8sim
i386 : 386ex pc386 pc386dx pc486 pc586 pc686 pck6 ts_386ex
NOTE: The "pc386" BSP can be compiled to support a
variety of PC configurations including PC-104
based solutions.
m68k : gen68360 gen68360_040 mvme136 mvme147s mvme162 mvme162lx
mvme167 ods68302 sim68000 mcf5206elite uC5282
gen68302 csb360 simcpu32 mrm332 av5282 gen68340 mcf5235 idp
no_cpu : no_bsp (porting example)
mips : csb350 genmongoosev hurricane jmr3904 rbtx4925 rbtx4938
powerpc : psim score603e mcp750 mvme2100 mvme2307 mpc8260ads ss555
mvme5500 ep1a pm520_cr825 pm520_ze30 gen405 helas403
mbx821_001 mbx821_002 mbx821_002b mbx860_001b
mbx860_002 mbx860_005b mtx603e brs5l gen5200 ep5200
virtex gen83xx mpc8349eamds
mbx860_002 mbx860_005b mtx603e brs5l gen5200 icecube
virtex gen83xx mpc8349eamds hsc_cm01
NOTE: The "motorola_powerpc" BSP is a single BSP which
can be conditionally compiled to support most Motorola
VMEbus, CompactPCI, and MTX boards.)
NOTE: The ep5200 is a clone of the 5200Lite a.k.a. IceCube.
sh : gensh1 gensh2 gensh4 shsim simsh4 simsh7045
sparc : erc32 sis leon2 leon3
any : bare
The following ports were considered obsoleted after the 4.6 releases
and were removed: a29k, hppa, i960, mips64orion, and or32.
5. Makefile structure
=====================
The makefiles have been re-organized. Most gnu-based bsps now use three
main makefiles:
+ custom/default.cfg,
+ custom/bsp.cfg and
+ compilers/gcc-target-default.cfg.
Default.cfg sets the default values of certain common build options.
Bsp.cfg set bsp-specific build options and can also override the
default settings.
Gcc-target-default.cfg contains the common gcc definitions.
6. Adding a bsp
===============
Please refer to the BSP and Device Driver Guide.
7. Tested configurations
========================
All gnu-based bsps have been built on Linux.
The native (posix) ports have been built and run only on Linux.
The following configurations have NOT been tested:
+ Anything on Nextstep, HPUX and Irix.
+ The C4x and OR32 ports (requires specially patched toolchain)
8. Prerequisites
================
Gawk version 2 or higher.
GNU make version 3.72 or higher.
Bash.
gcc version > 2.8
NOTE: These prerequisites are probably out of date but autoconf should detect
any problems.

View File

@@ -1,46 +0,0 @@
Real-Time Executive for Multiprocessing Systems
===============================================
RTEMS is a real-time executive (kernel) which provides a high performance
environment for embedded applications with the following features:
* Standards based user interfaces.
* Multitasking capabilities.
* Homogeneous and heterogeneous multiprocessor systems.
* Event-driven, priority-based, preemptive scheduling.
* Optional rate monotonic scheduling.
* Intertask communication and synchronisation.
* Priority inheritance.
* Responsive interrupt management.
* Dynamic memory allocation.
* High level of user configurability.
* Open source with a friendly user license.
Project git repositories are located at:
* https://gitlab.rtems.org/rtems/
Online documentation is available at:
* https://docs.rtems.org/
RTEMS Doxygen for CPUKit:
* https://docs.rtems.org/doxygen/branches/master/
RTEMS POSIX 1003.1 Compliance Guide:
* https://docs.rtems.org/branches/master/posix-compliance/
RTEMS Mailing Lists for general purpose use the users list and for developers
use the devel list.
* https://lists.rtems.org/mailman/listinfo
The version number for this software is indicated in the VERSION file.

22
SUPPORT Normal file
View File

@@ -0,0 +1,22 @@
#
# $Id$
#
On-Line Applications Research Corporation (OAR) offers support,
customization, and training for RTEMS. Custom RTEMS development services
includes porting RTEMS to new processors and the development of custom board
support packages and device drivers. In addition, OAR is available
to assist in the development of your real-time embedded application.
For more information, email Mark Johannes at mark.johannes@OARcorp.com
or contact OAR at:
On-Line Applications Research Corporation
4910-L Corporate Drive
Huntsville AL 35805
Voice: (205) 722-9985
Fax: (205 722-0985
RTEMS maintenance and development is funded solely by RTEMS users.
The future of RTEMS depends on its user base.

7
VERSION Normal file
View File

@@ -0,0 +1,7 @@
#
# This file is automatically generated -- DO NOT EDIT!!!
#
# $Id$
#
RTEMS Version 4.8.1

399
acinclude.m4 Normal file
View File

@@ -0,0 +1,399 @@
## All directories belong in one of 3 categories.
## ${HOST_CONFIGDIRS_LIST} is directories we build using the host tools.
## ${TARGET_CONFIGDIRS_LIST} is directories we build using the target tools.
## ${BUILD_CONFIGDIRS_LIST} is directories we build using the build tools
AC_PREREQ(2.60)
dnl RTEMS_ARG_VAR(VAR,HELP-STRING)
dnl An internal macros to have help strings pretty
dnl printed with configure --help, without letting autoconf spoil config subdir
dnl environments by trying to propagate them
dnl Stripped down version of autoconf-2.52's AC_ARG_VAR.
AC_DEFUN([_RTEMS_ARG_VAR],
[
m4_expand_once([m4_divert_once([HELP_VAR],
[AC_HELP_STRING([$1], [$2], [ ])])],
[$0($1)])dnl
])
AC_DEFUN([_RTEMS_SUBST_IFNOT],
[AS_IF([`echo " [$]$1 " | grep " $2 " > /dev/null`],
[],
[AC_SUBST([$1],["[$]$1 $2"])])
])
AC_DEFUN([_RTEMS_TOOLS],
[
m4_ifdef([_RTEMS_$2_CONFIGDIRS_LIST],
[
_RTEMS_ARG_VAR([CC_FOR_$2],
[c-compiler to be used for $1 subdirs (default: auto-detected)])
_RTEMS_ARG_VAR([CFLAGS_FOR_$2],
[c-flags to be used for $1 subdirs (default: provided by autoconf)])
_RTEMS_ARG_VAR([CXX_FOR_$2],
[c++-compiler to be used for $1 subdirs (default: auto-detected)])
_RTEMS_ARG_VAR([CXXFLAGS_FOR_$2],
[c++-flags to be used for $1 subdirs (default: provided by autoconf)])
])
])
AC_DEFUN([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS],
[
AC_CONFIG_COMMANDS_PRE([
if test -z "${build_alias}"; then
# build_alias is empty
if test -z "${host_alias}"; then
# host_alias is empty
if test -z "${target_alias}"; then
: target_alias is empty
else
: target_alias is not empty
fi
else
# host_alias is not empty
if test -z "${target_alias}"; then
: target_alias is empty
target_alias="${host_alias}"
else
: target_alias is not empty
fi
fi
else
# build_alias is not empty
if test -z "${host_alias}"; then
# host_alias is empty
if test -z "${target_alias}"; then
: target_alias is empty
else
: target_alias is not empty
fi
else
# host_alias is not empty
if test -z "${target_alias}"; then
: target_alias is empty
target_alias="${host_alias}"
else
: target_alias is not empty
fi
fi
fi
_RTEMS_BUILD_CONFIG_PREPARE
_RTEMS_HOST_CONFIG_PREPARE
_RTEMS_TARGET_CONFIG_PREPARE
build_subdir="."
build_SUBDIRS="${build_configdirs}"
build_configdirs="${build_configdirs}"
AS_IF([test $build != $host],
[dnl
host_subdir="${host_alias-$host}"
host_SUBDIRS=`echo "${host_configdirs}" | \
sed -e "s%\([[^ ]][[^ ]]*\)%$host_subdir/\1%g"`
host_configdirs="${host_configdirs}"
],[dnl
host_SUBDIRS="${host_configdirs}"
host_configdirs="${host_configdirs}"
])
AS_IF([test $build != $target],
[dnl
target_subdir="${target_alias-$target}"
target_SUBDIRS=`echo "${target_configdirs}" | \
sed -e "s%\([[^ ]][[^ ]]*\)%$target_subdir/\1%g"`
target_configdirs="${target_configdirs}"
],[dnl
target_SUBDIRS="${target_configdirs}"
target_configdirs="${target_configdirs}"
])
AC_SUBST(host_SUBDIRS)
AC_SUBST(target_SUBDIRS)
AC_SUBST(build_SUBDIRS)
])
AC_CONFIG_COMMANDS_POST([
_RTEMS_OUTPUT_SUBDIRS([build],[BUILD])
_RTEMS_OUTPUT_SUBDIRS([host],[HOST])
_RTEMS_OUTPUT_SUBDIRS([target],[TARGET])
])
])
dnl _RTEMS_SRCPATHS(BUILD-DIR-NAME)
dnl ----------------------------
dnl Inputs:
dnl - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
dnl - `$srcdir' is `top-build -> top-src'
dnl
dnl Outputs:
dnl - `ac_builddir' is `.', for symmetry only.
dnl - `ac_top_builddir' is `build -> top_build'.
dnl If not empty, has a trailing slash.
dnl - `ac_srcdir' is `build -> src'.
dnl - `ac_top_srcdir' is `build -> top-src'.
dnl
dnl and `ac_buildpath' etc., the absolute paths.
m4_define([_RTEMS_SRCPATHS],
[
m4_if([$2],,
[dstdir=$1],
[case "$2" in
"." | "" ) # No subdir was given
dstdir=$1;;
* ) # A subdir was given
dstdir=$2/$1;;
esac])
ac_builddir=.
AS_IF([test $dstdir != .],
[ # Strip off leading ./
ac_builddir_suffix=/`echo $dstdir | sed 's,^\.[[\\/]],,'`
ac_srcdir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'`
# A "../" for each directory in $ac_dir_suffix.
ac_top_builddir=`echo "$ac_builddir_suffix" | sed 's,/[[^\\/]]*,../,g'`
],[
ac_dir_suffix= ac_top_builddir=
])
case $srcdir in
.) # No --srcdir option. We are building in place.
ac_srcdir=.
if test -z "$ac_top_builddir"; then
ac_top_srcdir=.
else
ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
fi ;;
[[\\/]]* | ?:[[\\/]]* ) # Absolute path.
ac_srcdir=$srcdir$ac_srcdir_suffix;
ac_top_srcdir=$srcdir;
;;
*) # Relative path.
ac_srcdir=$ac_top_builddir$srcdir$ac_srcdir_suffix;
ac_top_srcdir=$ac_top_builddir$srcdir;
;;
esac
dnl Don't blindly perform a `cd $1/$ac_foo && pwd` since $ac_foo can be
dnl absolute.
ac_buildpath=`cd $dstdir && cd $ac_builddir && pwd`
ac_top_buildpath=`cd $dstdir && cd $ac_top_builddir && pwd`
ac_srcpath=`cd $dstdir && cd $ac_srcdir && pwd`
ac_top_srcpath=`cd $dstdir && cd $ac_top_srcdir && pwd`
])# _AC_SRCPATHS
dnl _RTEMS_OUTPUT_SUBDIRS([host|target|build],[HOST|TARGET|BUILD])
AC_DEFUN([_RTEMS_OUTPUT_SUBDIRS],[
m4_ifdef([_RTEMS_$2_CONFIGDIRS_LIST],
[
if test "$no_recursion" != yes; then
if test -n "${$1_SUBDIRS}"; then
ac_sub_configure_args="[$]$1args"
# Always prepend --prefix to ensure using the same prefix
# in subdir configurations.
ac_sub_configure_args="'--prefix=$prefix' $ac_sub_configure_args"
# make sure that $1_subdir is not empty
test -n "$$1_subdir" || $1_subdir="."
case "$$1_subdir" in
"." ) ;;
* )
ac_sub_configure_args="$ac_sub_configure_args '--with-target-subdir=$$1_subdir'"
ac_sub_configure_args="$ac_sub_configure_args '--exec-prefix=${prefix}/$$1_subdir'"
ac_sub_configure_args="$ac_sub_configure_args '--includedir=${prefix}/$$1_subdir/include'"
;;
esac
ac_popdir=`pwd`
for ac_dir in $$1_configdirs; do
# Do not complain, so a configure script can configure whichever
# parts of a large source tree are present.
test -d $srcdir/$ac_dir || continue
AC_MSG_NOTICE([configuring in $$1_subdir/$ac_dir])
AS_MKDIR_P(["$$1_subdir/$ac_dir"])
_RTEMS_SRCPATHS(["$ac_dir"],["$$1_subdir"])
cd $$1_subdir/$ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
if test -f $ac_srcdir/configure.gnu; then
ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
elif test -f $ac_srcdir/configure; then
ac_sub_configure="$SHELL '$ac_srcdir/configure'"
elif test -f $ac_srcdir/configure.in; then
ac_sub_configure=$ac_configure
else
AC_MSG_WARN([no configuration information is in $ac_dir])
ac_sub_configure=
fi
# The recursion is here.
if test -n "$ac_sub_configure"; then
# Make the cache file name correct relative to the subdirectory.
case $cache_file in
[[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
*) # Relative path.
ac_sub_cache_file=$ac_top_builddir$cache_file ;;
esac
ac_sub_configure_vars=
ac_sub_configure_vars="$ac_sub_configure_vars '--cache-file=$ac_sub_cache_file'"
ac_sub_configure_vars="$ac_sub_configure_vars '--srcdir=$ac_srcdir'"
test -n "[$]CC_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CC=[$]CC_FOR_$2'"
test -n "[$]CXX_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CXX=[$]CXX_FOR_$2'"
test -n "[$]CFLAGS_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CFLAGS=[$]CFLAGS_FOR_$2'"
test -n "[$]CXXFLAGS_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CXXFLAGS=[$]CXXFLAGS_FOR_$2'"
# The eval makes quoting arguments work.
AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args $ac_sub_configure_vars])
eval $ac_sub_configure $ac_sub_configure_args $ac_sub_configure_vars ||
AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
fi
cd "$ac_popdir"
done
fi
fi
])
])
AC_DEFUN([_RTEMS_CONFIGURE_ARGS_PRUNE],
[
$1_prune()
{
$1=
for ac_arg
do
if test -n "$ac_prev"; then
ac_prev=
continue
fi
case $ac_arg in
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
| --c=*)
;;
--config-cache | -C)
;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
-host* | --host* );;
-host | --host )
ac_prev=host_alias;;
-target* | --target* );;
-target | --target )
ac_prev=target_alias;;
-build* | --build* );;
-build | --build )
ac_prev=build_alias;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
;;
*_alias=* );;
m4_if([$2],,,[$2])
*) $1="$$1 '$ac_arg'" ;;
esac
done
export $1
}
])
## PUBLIC: RTEMS_BUILD_CONFIG_SUBDIRS(build_subdir)
# subdirs to be built for the build environment
AC_DEFUN([RTEMS_BUILD_CONFIG_SUBDIRS],[
m4_append([_RTEMS_BUILD_CONFIGDIRS_LIST],[ $1])
dnl Always append to build_configdirs
AC_SUBST(build_configdirs,"$build_configdirs $1")
m4_divert_text([DEFAULTS],
[ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
])
AC_DEFUN([_RTEMS_BUILD_CONFIG_PREPARE],[
## # Record the configure arguments in Makefile.
m4_ifdef([_RTEMS_BUILD_CONFIGDIRS_LIST],
[
m4_expand_once([_RTEMS_TOOLS([build],[BUILD])])
m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([buildargs])])
eval buildargs_prune $ac_configure_args
buildargs="'--host=${build_alias-$build}' '--build=${build_alias-$build}' ${buildargs}"
buildargs="${buildargs} '--target=${target_alias-$target}'"
],[])
AC_SUBST(buildargs)
AC_SUBST(build_subdir)
])
## PUBLIC: RTEMS_HOST_CONFIG_SUBDIRS(host_subdir)
# subdirs to be build for the host environment
AC_DEFUN([RTEMS_HOST_CONFIG_SUBDIRS],[
m4_append([_RTEMS_HOST_CONFIGDIRS_LIST],[ $1])dnl
_RTEMS_SUBST_IFNOT([host_configdirs],[$1])
m4_divert_text([DEFAULTS],
[ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
])
AC_DEFUN([_RTEMS_HOST_CONFIG_PREPARE],[
m4_ifdef([_RTEMS_HOST_CONFIGDIRS_LIST],
[
m4_expand_once([_RTEMS_TOOLS([host],[HOST])])
m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([hostargs])])
eval hostargs_prune $ac_configure_args
hostargs="'--host=${host_alias-$host}' '--build=${build_alias-$build}' '--target=${target_alias-$target}' ${hostargs}"
],[])
AC_SUBST(hostargs)
AC_SUBST(host_subdir)
])
## PUBLIC: RTEMS_TARGET_CONFIG_SUBDIRS(target_subdir)
# subdirs to be build for the target environment
AC_DEFUN([RTEMS_TARGET_CONFIG_SUBDIRS],[
AS_IF([test -d ${srcdir}/$1],[
m4_append([_RTEMS_TARGET_CONFIGDIRS_LIST],[ $1])
_RTEMS_SUBST_IFNOT([target_configdirs],[$1])
m4_divert_text([DEFAULTS],
[ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
])
])
AC_DEFUN([_RTEMS_TARGET_CONFIG_PREPARE],[
m4_ifdef([_RTEMS_TARGET_CONFIGDIRS_LIST],
[
m4_expand_once([_RTEMS_TOOLS([target],[TARGET])])
m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([targetargs])])
eval targetargs_prune $ac_configure_args
targetargs="'--host=${target_alias-$target}' '--build=${build_alias-$build}' '--target=${target_alias-$target}' ${targetargs}"
],[])
AC_SUBST(targetargs)
AC_SUBST(target_subdir)
])

44
aclocal/bsp-alias.m4 Normal file
View File

@@ -0,0 +1,44 @@
dnl
dnl $Id$
dnl
dnl _RTEMS_BSP_ALIAS(BSP_ALIAS,RTEMS_BSP_FAMILY)
dnl Internal subroutine to RTEMS_BSP_ALIAS
AC_DEFUN([_RTEMS_BSP_ALIAS],
[# account for "aliased" bsps which share source code
case $1 in
bare*) $2=bare ;; # EXP: bare-aliases
c3xsim) $2=c4xsim ;; # TI C3x Simulator in gdb
gen68360_040) $2=gen68360 ;; # m68k - 68360 in companion mode
mbx8*) $2=mbx8xx ;; # MBX821/MBX860 board
mcp750) $2=motorola_powerpc ;; # Motorola PPC board variant
mtx603e) $2=motorola_powerpc ;; # Motorola PPC board variant
mvme162lx) $2=mvme162 ;; # m68k - mvme162 board variant
mvme2100) $2=motorola_powerpc ;; # Motorola PPC board variant
mvme2307) $2=motorola_powerpc ;; # Motorola PPC board variant
p4600) $2=p4000 ;; # mips - p4000 board w/IDT 4600
p4650) $2=p4000 ;; # mips - p4000 board w/IDT 4650
pc386dx) $2=pc386 ;; # i386 - PC w/o FPU
pc486) $2=pc386 ;; # i386 - PC with i486DX
pc586) $2=pc386 ;; # i386 - PC with Pentium
pc686) $2=pc386 ;; # i386 - PC with PentiumPro
pck6) $2=pc386 ;; # i386 - PC with K6
brs5l*) $2=gen5200 ;; # MPC5200 based board
pm520*) $2=gen5200 ;; # MPC5200 based board
icecube) $2=gen5200 ;; # MPC5200 based board - LITE5200B
mpc8349eamds) $2=gen83xx ;; # MPC8349 based board
hsc_cm01) $2=gen83xx ;; # MPC8349 based board
simcpu32) $2=sim68000 ;; # BSVC CPU32 variant
simsh7032) $2=shsim ;; # SH7032 simulator
simsh7045) $2=shsim ;; # SH7045 simulator
sis) $2=erc32 ;; # erc32 SIS simulator
*) $2=$1;;
esac]
)
dnl RTEMS_BSP_ALIAS(BSP_ALIAS,RTEMS_BSP_FAMILY)
dnl convert a bsp alias $1 into its bsp directory RTEMS_BSP_FAMILY
AC_DEFUN([RTEMS_BSP_ALIAS],
[_RTEMS_BSP_ALIAS(m4_if([$1],,[$RTEMS_BSP],[$1]),
m4_if([$2],,[RTEMS_BSP_FAMILY],[$2]))]
)

View File

@@ -0,0 +1,41 @@
dnl
dnl $Id$
dnl
dnl canonicalize target cpu
dnl NOTE: Most rtems targets do not fullfil autoconf's
dnl target naming conventions "processor-vendor-os"
dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
dnl and we have to fix it for rtems ourselves
AC_DEFUN([RTEMS_CANONICAL_TARGET_CPU],
[
AC_CANONICAL_TARGET
AC_MSG_CHECKING(rtems target cpu)
case "${target}" in
# hpux unix port should go here
i[[34567]]86-*linux*) # unix "simulator" port
RTEMS_CPU=unix
;;
i[[34567]]86-*freebsd*) # unix "simulator" port
RTEMS_CPU=unix
;;
i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :)
RTEMS_CPU=unix
;;
no_cpu-*rtems*)
RTEMS_CPU=no_cpu
;;
sparc-sun-solaris*) # unix "simulator" port
RTEMS_CPU=unix
;;
tic4x-*rtems*) # gcc changed the name
RTEMS_CPU=c4x
;;
*)
RTEMS_CPU=`echo $target | sed 's%^\([[^-]]*\)-\(.*\)$%\1%'`
;;
esac
AC_SUBST(RTEMS_CPU)
AC_MSG_RESULT($RTEMS_CPU)
])

42
aclocal/check-bsps.m4 Normal file
View File

@@ -0,0 +1,42 @@
dnl $Id$
dnl Report all available bsps for a target within the source tree
dnl
dnl RTEMS_CHECK_BSPS(bsp_list)
AC_DEFUN([RTEMS_CHECK_BSPS],
[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
AC_MSG_CHECKING([for available BSPs])
$1=
for bsp_spec in `ls "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU"/*/bsp_specs 2>/dev/null`; do
bsp_family=`echo "$bsp_spec" | sed \
-e "s,^$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/,," \
-e "s,/bsp_specs$,,"`
case $bsp_family in
# Now account for BSPs with build variants
c4xsim) bsps="c4xsim c3xsim";;
gen68360) bsps="gen68360 gen68360_040";;
p4000) bsps="p4600 p4650";;
mvme162) bsps="mvme162 mvme162lx";;
mbx8xx) bsps="mbx821_001 mbx860_001b"
bsps="$bsps mbx821_002 mbx821_002b"
bsps="$bsps mbx860_002"
bsps="$bsps mbx860_005b"
;;
gen5200) bsps="pm520_cr825 pm520_ze30 brs5l";;
gen83xx) bsps="mpc8349eamds hsc_cm01";;
motorola_powerpc) bsps="mvme2307 mcp750 mtx603e mvme2100";;
pc386) bsps="pc386 pc386dx pc486 pc586 pc686 pck6";;
erc32) bsps="erc32 sis";;
sim68000) bsps="sim68000 simcpu32";;
shsim) bsps="simsh7032 simsh7045";;
*) bsps="$bsp_family";;
esac;
$1="[$]$1 $bsps"
done
AS_IF([test -z "[$]$1"],
[AC_MSG_RESULT([none])],
[AC_MSG_RESULT([$]$1)])
])dnl

View File

@@ -0,0 +1,24 @@
dnl $Id$
AC_DEFUN([_RTEMS_CHECK_CUSTOM_BSP],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
$2=
AC_MSG_CHECKING([for $1])
for i in "${srcdir}/${RTEMS_TOPdir}/bspkit/${RTEMS_CPU}"/*/cfg/"$1" \
"${srcdir}/${RTEMS_TOPdir}/make/custom/$1";
do
AS_IF([test -r $i],[
$2="$i"
break;
])
done
AS_IF([test -n "[$]$2"],
[AC_MSG_RESULT([[$]$2])],
[AC_MSG_RESULT([no])])
])
AC_DEFUN([RTEMS_CHECK_CUSTOM_BSP],[
AC_REQUIRE([RTEMS_TOP])
_RTEMS_CHECK_CUSTOM_BSP([[$]$1.cfg],[BSP_FOUND])
])

13
aclocal/enable-cxx.m4 Normal file
View File

@@ -0,0 +1,13 @@
dnl $Id$
AC_DEFUN([RTEMS_ENABLE_CXX],
[
AC_ARG_ENABLE(cxx,
[AC_HELP_STRING([--enable-cxx],
[enable C++ support and build the rtems++ library])],
[case "${enable_cxx}" in
yes) RTEMS_HAS_CPLUSPLUS=yes ;;
no) RTEMS_HAS_CPLUSPLUS=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
esac], [RTEMS_HAS_CPLUSPLUS=no])
])

14
aclocal/enable-itron.m4 Normal file
View File

@@ -0,0 +1,14 @@
dnl $Id$
AC_DEFUN([RTEMS_ENABLE_ITRON],
[
## AC_BEFORE([$0], [RTEMS_CHECK_ITRON_API])dnl
AC_ARG_ENABLE(itron,
[AC_HELP_STRING([--enable-itron],[enable itron interface])],
[case "${enableval}" in
yes) RTEMS_HAS_ITRON_API=yes ;;
no) RTEMS_HAS_ITRON_API=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-itron option) ;;
esac],[RTEMS_HAS_ITRON_API=yes])
])

View File

@@ -0,0 +1,13 @@
dnl $Id$
AC_DEFUN([RTEMS_ENABLE_MULTIPROCESSING],
[
AC_ARG_ENABLE(multiprocessing,
[AC_HELP_STRING([--enable-multiprocessing],
[enable multiprocessing interface])],
[case "${enable_multiprocessing}" in
yes) ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
esac],[enable_multiprocessing=no])
])

View File

@@ -0,0 +1,15 @@
dnl $Id$
AC_DEFUN([RTEMS_ENABLE_NETWORKING],
[
## AC_BEFORE([$0], [RTEMS_CHECK_NETWORKING])dnl
AC_ARG_ENABLE(networking,
[AC_HELP_STRING([--enable-networking],[enable TCP/IP stack])],
[case "${enableval}" in
yes) RTEMS_HAS_NETWORKING=yes ;;
no) RTEMS_HAS_NETWORKING=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
esac],[RTEMS_HAS_NETWORKING=yes])
AC_SUBST(RTEMS_HAS_NETWORKING)dnl
])

33
aclocal/enable-posix.m4 Normal file
View File

@@ -0,0 +1,33 @@
dnl $Id$
AC_DEFUN([RTEMS_ENABLE_POSIX],
[
## AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
AC_ARG_ENABLE(posix,
[AC_HELP_STRING([--enable-posix],[enable posix interface])],
[case "${enableval}" in
yes) RTEMS_HAS_POSIX_API=yes ;;
no) RTEMS_HAS_POSIX_API=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
esac],[RTEMS_HAS_POSIX_API=yes])
case "${host}" in
# hpux unix port should go here
i[[34567]]86-pc-linux*) # unix "simulator" port
RTEMS_HAS_POSIX_API=no
;;
i[[34567]]86-*freebsd*) # unix "simulator" port
RTEMS_HAS_POSIX_API=no
;;
no_cpu-*rtems*)
RTEMS_HAS_POSIX_API=no
;;
sparc-sun-solaris*) # unix "simulator" port
RTEMS_HAS_POSIX_API=no
;;
*)
;;
esac
AC_SUBST(RTEMS_HAS_POSIX_API)
])

View File

@@ -0,0 +1,12 @@
## $Id$
AC_DEFUN([RTEMS_ENABLE_RTEMS_DEBUG],
[
AC_ARG_ENABLE(rtems-debug,
AC_HELP_STRING([--enable-rtems-debug],[enable RTEMS_DEBUG]),
[case "${enable_rtems_debug}" in
yes) enable_rtems_debug=yes ;;
no) enable_rtems_debug=no ;;
*) AC_MSG_ERROR([bad value ${enable_rtems_debug} for RTEMS_DEBUG]) ;;
esac],[enable_rtems_debug=no])
])

View File

@@ -0,0 +1,17 @@
dnl $Id$
dnl Override the set of BSPs to be built.
dnl used by the toplevel configure script
dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
AC_DEFUN([RTEMS_ENABLE_RTEMSBSP],
[
AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])
AC_ARG_ENABLE(rtemsbsp,
[AC_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."],
[BSPs to include in build])],
[case "${enable_rtemsbsp}" in
yes ) enable_rtemsbsp="" ;;
no ) enable_rtemsbsp="no" ;;
*) enable_rtemsbsp="$enable_rtemsbsp" ;;
esac],[enable_rtemsbsp=""])
])

13
aclocal/enable-tests.m4 Normal file
View File

@@ -0,0 +1,13 @@
dnl $Id$
AC_DEFUN([RTEMS_ENABLE_TESTS],
[
AC_ARG_ENABLE(tests,
[AC_HELP_STRING([--enable-tests],[enable tests (default:samples)])],
[case "${enableval}" in
samples) enable_tests=samples;;
yes) enable_tests=yes ;;
no) enable_tests=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-tests]) ;;
esac], [enable_tests=samples])
])

17
aclocal/multilib.m4 Normal file
View File

@@ -0,0 +1,17 @@
dnl This provides configure definitions used for multilib support
dnl parts of these macros are derived from newlib-1.8.2's multilib support
AC_DEFUN([RTEMS_ENABLE_MULTILIB],
[
AC_ARG_ENABLE(multilib,
AC_HELP_STRING([--enable-multilib],
[build many library versions (default=no)]),
[case "${enableval}" in
yes) multilib=yes ;;
no) multilib=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [multilib=no])dnl
AM_CONDITIONAL(MULTILIB,test x"${multilib}" = x"yes")
])

14
aclocal/path-ksh.m4 Normal file
View File

@@ -0,0 +1,14 @@
dnl $Id$
AC_DEFUN([RTEMS_PATH_KSH],
[
dnl NOTE: prefer bash over ksh over sh
AC_PATH_PROGS(KSH,bash ksh sh)
if test -z "$KSH"; then
dnl NOTE: This cannot happen -- /bin/sh must always exist
AC_MSG_ERROR(
[***]
[ Cannot determine a usable shell bash/ksh/sh]
[ Please contact your system administrator] );
fi
])

22
aclocal/project-root.m4 Normal file
View File

@@ -0,0 +1,22 @@
dnl
dnl $Id$
dnl
dnl
dnl PROJECT_TOPdir .. relative path to the top of the build-tree
dnl PROJECT_ROOT .. relative path to the top of the temporary
dnl installation directory inside the build-tree
dnl RTEMS_TOPdir .. relative path of a subpackage's configure.in to the
dnl toplevel configure.in of the source-tree
dnl RTEMS_ROOT .. path to the top of a bsp's build directory
dnl [Applied by custom/*.cfg, depredicated otherwise]
dnl
AC_DEFUN([RTEMS_PROJECT_ROOT],
[dnl
AC_REQUIRE([RTEMS_TOP])
PACKHEX="\$(PROJECT_TOPdir)/tools/build/packhex"
AC_SUBST(PACKHEX)
])

41
aclocal/quoting.m4 Normal file
View File

@@ -0,0 +1,41 @@
dnl RTEMS_CONFIGURE_ARGS_QUOTE(dnl RETURN_VAR, [ADDITIONAL_CASES], [VAR_TO_PROCESS]])
dnl
AC_DEFUN([_RTEMS_CONFIGURE_ARGS_QUOTE],
[
$1_prune()
{
# Remove --cache-file and --srcdir arguments so they do not pile up.
$1=
ac_prev=
for ac_arg
do
if test -n "$ac_prev"; then
ac_prev=
continue
fi
case $ac_arg in
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
| --c=*)
;;
--config-cache | -C)
;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
m4_if([$2],,,[$2])
*) $1="$$1 '$ac_arg'" ;;
esac
done
export $1
}
])
AC_DEFUN([RTEMS_CONFIGURE_ARGS_QUOTE],[
m4_expand_once([_RTEMS_CONFIGURE_ARGS_QUOTE([$1],[$2])])
eval $1_prune m4_if([$3],,[$ac_configure_args],[[$]$3])
])

20
aclocal/rpm.m4 Normal file
View File

@@ -0,0 +1,20 @@
AC_DEFUN([RTEMS_ENABLE_RPMPREFIX],[
AC_ARG_ENABLE([rpmprefix],
[ --enable-rpmprefix=<rpmprefix> prefix rpms],
[case $enable_rpmprefix in
yes ) rpmprefix="rtems-"]RTEMS_API["-";;
no ) rpmprefix="%{nil}";;
* ) AS_IF([test -z "$enable_rpmprefix"],
[rpmprefix="%{nil}"],
[rpmprefix="$enable_rpmprefix"]);;
esac],
[rpmprefix="rtems-"]RTEMS_API["-"])
AC_ARG_ENABLE([osversions],
[ --enable-osversions whether to use version numbers in os-tripples],
[case $enable_osversions in
yes ) osversion=RTEMS_API;;
* ) osversion=;;
esac],
[osversion=RTEMS_API])
])

30
aclocal/rtems-top.m4 Normal file
View File

@@ -0,0 +1,30 @@
dnl $Id$
dnl
dnl RTEMS_TOP($1)
dnl
dnl $1 .. relative path from this configure.in to the toplevel configure.in
dnl
AC_DEFUN([RTEMS_TOP],
[dnl
AC_REQUIRE([RTEMS_VERSIONING])
AC_CONFIG_AUX_DIR([$1])
AC_CHECK_PROGS(MAKE, gmake make)
AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API])
RTEMS_TOPdir="$1";
AC_SUBST(RTEMS_TOPdir)
dots=`echo $with_target_subdir|\
sed -e 's,^\.$,,' -e 's%^\./%%' -e 's%[[^/]]$%&/%' -e 's%[[^/]]*/%../%g'`
PROJECT_TOPdir=${dots}${RTEMS_TOPdir}/'$(top_builddir)'
AC_SUBST(PROJECT_TOPdir)
PROJECT_ROOT="${RTEMS_TOPdir}/\$(top_builddir)"
AC_SUBST(PROJECT_ROOT)
AC_MSG_CHECKING([for RTEMS Version])
AC_MSG_RESULT([_RTEMS_VERSION])
])dnl

23
aclocal/tool-paths.m4 Normal file
View File

@@ -0,0 +1,23 @@
AC_DEFUN([RTEMS_TOOLPATHS],
[
# tooldir='$(exec_prefix)/'$target_alias
# Temporary work-around until building in source tree is supported
AC_REQUIRE([RTEMS_PROJECT_ROOT])
tooldir='$(PROJECT_ROOT)'
AC_SUBST(tooldir)
project_includedir='$(tooldir)'/include
AC_SUBST(project_includedir)
project_libdir='$(tooldir)/lib$(MULTISUBDIR)'
AC_SUBST(project_libdir)
project_bindir='$(tooldir)/bin'
AC_SUBST(project_bindir)
rtems_bspdir='$(prefix)/${RTEMS_BSP}'
AC_SUBST(rtems_bspdir)
rtems_makedir='$(prefix)/make'
AC_SUBST(rtems_makedir)
])

4
aclocal/version.m4 Normal file
View File

@@ -0,0 +1,4 @@
AC_DEFUN([RTEMS_VERSIONING],
m4_define([_RTEMS_VERSION],[4.8.1]))
m4_define([RTEMS_API],[4.8])

276
ampolish3 Executable file
View File

@@ -0,0 +1,276 @@
#! /usr/bin/perl -w
# $Id$
# Copyright (C) 2005, 2006 Ralf Corsépius, Ulm, Germany
#
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
# Helper script to generate pre/tmpinstall rules for RTEMS Makefile.am.
#
# Usage: ampolish3 Makefile.am > preinstall.am
#
# Reads a Makefile.am from stdin and writes corresponding
# pre/tmpinstall rules to stdout.
sub replace($);
sub print_dirstamp($$$);
# Predefined directory mappings:
#
# final-installation directory => temp installation directory
my %dirmap = (
'$(includedir)' => '$(PROJECT_INCLUDE)',
'$(libdir)' => '$(PROJECT_LIB)',
'$(project_libdir)' => '$(PROJECT_LIB)',
'$(project_includedir)' => '$(PROJECT_INCLUDE)'
);
# Conventions on automake primaries:
#
# *_HEADERS -> preinstall
# noinst*_HEADERS -> noinst
# noinst_*_LIBRARIES -> noinst
# project_*_LIBRARIES -> tmpinstall
# *_LIBRARIES -> ignore (no preinstallation)
# dist_project_*_DATA -> preinstall (bsp_specs,linkcmds)
# project_*_DATA -> tmpinstall (*.o, *.a)
# dist_*_DATA -> ignore (no preinstallation)
# *SCRIPTS -> ignore (no preinstallation)
# noinst_*_PROGRAMS -> noinst
# project_*_PROGRAMS -> tmpinstall
# *_PROGRAMS -> ignore (no preinstallation)
## 1st pass: read in file
my @buffer1 = () ;
my %seen = ();
my %predefs = ();
{
my $mode = 0 ;
my $line = '';
while ( <> )
{
if ( $mode == 0 )
{
if ( /^([a-zA-Z0-9_]+\s*[\+]?[:=].*)\\$/o )
{
$line = "$1" ;
$mode = 1;
} else {
push @buffer1, $_ ;
}
} elsif ( $mode == 1 ) {
if ( /^(.*)\\$/o ) {
$line .= $1;
} else {
$line .= $_ ;
push @buffer1, $line ;
$line = '';
$mode = 0 ;
}
}
}
}
#foreach my $l ( @buffer1 ) { print STDERR "1:<$l>"; }
# Filter out all Makefile code not relevant here
my @buffer2 = ();
foreach my $l ( @buffer1 ) {
if ( $l=~ /^\t.*$/o )
{ #ignore: Production of a make rule.
} elsif ( $l =~ /^\s*([a-zA-Z0-9_]*dir)\s*\=\s*(.*)\s*$/o )
{ # dirs
push @buffer2, "$l";
$dirmap{"\$\($1\)"} = replace($2);
} elsif ( $l =~ /^\s*noinst_(.*)\s*[\+]?\=(.*)$/o )
{
#ignore: noinst_* are not relevant here.
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_(HEADERS|LIBRARIES|DATA|SCRIPTS|PROGRAMS)\s*([\+]?\=)\s*(.*)/o )
{
if ( ( "$5" eq '=' ) ) {
my $v = $dirmap{"\$\($3dir\)"};
if ( $v =~ /\$\(PROJECT_[^\)]+\)$/ )
{
$predefs{"$v"} = 1;
}
}
foreach my $f ( split(' ',$6) ) {
push @buffer2, "$1$2$3_$4 +=$f\n";
}
} elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
{ # conditionals
push @buffer2, "$l";
}
# Check if Makefile.am already contains CLEANFILES or DISTCLEANFILES
if ( $l =~ /^\s*(CLEANFILES|DISTCLEANFILES|SUBDIRS)\s*\=.*$/o )
{
$predefs{"$1"} = 1;
}
}
if ( $predefs{"\$(PROJECT_INCLUDE)"} ){
unshift @buffer2, "includedir = \$(includedir)\n";
}
if ( $predefs{"\$(PROJECT_LIB)"} ){
unshift @buffer2, "libdir = \$(libdir)\n";
}
# foreach my $l ( @buffer2 ) { print STDERR "2:<$l>"; }
my @buffer3 = ();
foreach my $l ( @buffer2 ) {
if ( $l =~ /^\s*([a-zA-Z0-9_]*dir)\s*\=\s*(.*)\s*$/o )
{ # dirs
my $v = $dirmap{"\$\($1\)"};
print_dirstamp(\@buffer3,$v,"PREINSTALL_DIRS");
$seen{"PREINSTALL_DIRS"} = 1;
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_|)([a-zA-Z0-9_]+)_HEADERS\s*\+\=(.*)/o )
{ # preinstall
my $v = $dirmap{"\$\($3dir\)"};
my $f = $4;
my $x ; my $i = rindex($f,'/');
if ($i < 0) { $x="$f";
} else { $x = substr($f,$i+1);
}
push @buffer3,
"$v/$x: $f $v/\$(dirstamp)\n",
"\t\$(INSTALL_DATA) \$< $v/$x\n",
"PREINSTALL_FILES += $v/$x\n\n";
$seen{"PREINSTALL_FILES"} = 1;
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_)([a-zA-Z0-9_]+)_LIBRARIES\s*\+\=(.*)/o )
{ # tmpinstall
my $v = $dirmap{"\$\($3dir\)"};
my $f = $4;
my $x ; my $i = rindex($f,'/');
if ($i < 0) { $x="$f";
} else { $x = substr($f,$i+1);
}
push @buffer3,
"$v/$x: $f $v/\$(dirstamp)\n",
"\t\$(INSTALL_DATA) \$< $v/$x\n",
"TMPINSTALL_FILES += $v/$x\n\n";
$seen{"TMPINSTALL_FILES"} = 1;
} elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_LIBRARIES\s*\+\=(.*)/o )
{ # ignore
} elsif ( $l =~ /^\s*(dist_)(project_)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
{ # preinstall
my $v = $dirmap{"\$\($3dir\)"};
my $f = $4;
my $x ; my $i = rindex($f,'/');
if ($i < 0) { $x="$f";
} else { $x = substr($f,$i+1);
}
push @buffer3,
"$v/$x: $f $v/\$(dirstamp)\n",
"\t\$(INSTALL_DATA) \$< $v/$x\n",
"PREINSTALL_FILES += $v/$x\n\n";
$seen{"PREINSTALL_FILES"} = 1;
} elsif ( $l =~ /^\s*(nodist_|)(project_)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
{ # tmpinstall
my $v = $dirmap{"\$\($3dir\)"};
my $f = $4;
my $x ; my $i = rindex($f,'/');
if ($i < 0) { $x="$f";
} else { $x = substr($f,$i+1);
}
push @buffer3,
"$v/$x: $f $v/\$(dirstamp)\n",
"\t\$(INSTALL_DATA) \$< $v/$x\n",
"TMPINSTALL_FILES += $v/$x\n\n";
$seen{"TMPINSTALL_FILES"} = 1;
} elsif ( $l =~ /^\s*(dist_|)([a-zA-Z0-9_]+)_DATA\s*\+\=(.*)/o )
{ # ignore
} elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_SCRIPTS\s*\+\=(.*)/o )
{ # ignore
} elsif ( $l =~ /^\s*(nodist_|dist_|)(project_)([a-zA-Z0-9_]+)_PROGRAMS\s*\+\=(.*)/o )
{ # tmpinstall
my $v = $dirmap{"\$\($3dir\)"};
my $f = $4;
my $x ; my $i = rindex($f,'/');
if ($i < 0) { $x="$f";
} else { $x = substr($f,$i+1);
}
push @buffer3,
"$v/$x: $f $v/\$(dirstamp)\n",
"\t\$(INSTALL_PROGRAM) \$< $v/$x\n",
"TMPINSTALL_FILES += $v/$x\n\n";
$seen{"TMPINSTALL_FILES"} = 1;
} elsif ( $l =~ /^\s*(nodist_|dist_|)([a-zA-Z0-9_]+)_PROGRAMS\s*\+\=(.*)/o )
{ # ignore
} elsif ( $l =~ /^\s*(if|else|endif)\s*.*$/o )
{ # conditionals
push @buffer3, "$l";
}
}
# foreach my $l ( @buffer3 ) { print STDERR "3:<$l>"; }
my $output;
$output .= "## Automatically generated by ampolish3 - Do not edit\n\n";
$output .= "if AMPOLISH3\n";
$output .= "\$(srcdir)/preinstall.am: Makefile.am\n";
$output .= "\t\$(AMPOLISH3) \$(srcdir)/Makefile.am > \$(srcdir)/preinstall.am\n";
$output .= "endif\n\n";
foreach my $k ( keys %seen )
{
if ( $k =~ /PREINSTALL_FILES/o ) {
$output .= "all-am: \$(PREINSTALL_FILES)\n\n";
$output .= "$k =\n";
$output .= "CLEANFILES ";
if ( $predefs{"CLEANFILES"} ) { $output .= "+"; }
$output .= "= \$($k)\n";
$predefs{"CLEANFILES"} = 1;
} elsif ( $k =~ /TMPINSTALL_FILES/o ) {
$output .= "all-local: \$(TMPINSTALL_FILES)\n\n";
$output .= "$k =\n";
$output .= "CLEANFILES ";
if ( $predefs{"CLEANFILES"} ) { $output .= "+"; }
$output .= "= \$($k)\n";
$predefs{"CLEANFILES"} = 1;
} elsif ( $k =~ /.*DIRS/o ) {
$output .= "$k =\n";
$output .= "DISTCLEANFILES ";
if ( $predefs{"DISTCLEANFILES"} ) { $output .= "+"; }
$output .= "= \$($k)\n";
$predefs{"DISTCLEANFILES"} = 1;
}
$output .= "\n";
}
# Pretty printing
$output .= join ( '', @buffer3 );
$output =~ s/\nelse\n+endif/\nendif/g;
$output =~ s/\n\n+endif/\nendif/g;
$output =~ s/\nif [a-zA-Z0-9_!]+\n+endif//g;
print STDOUT $output;
exit 0;
sub replace($)
{
my ($v) = @_;
foreach my $i ( keys %dirmap )
{
$v =~ s/\Q$i/$dirmap{$i}/g;
}
return $v;
}
sub print_dirstamp($$$)
{
my ($obuf,$file,$inst) = @_ ;
push @{$obuf}, "$file/\$(dirstamp):\n\t\@\$\(MKDIR_P\) $file\n" ;
push @{$obuf}, "\t\@: \> $file/\$(dirstamp)\n" ;
push @{$obuf}, "$inst += $file/\$(dirstamp)\n\n" ;
}

10
automake/host.am Normal file
View File

@@ -0,0 +1,10 @@
## $Id$
## NOTE: This is a temporary work-around to keep
## RTEMS's non automake standard make targets working.
## Once automake is fully integrated these make targets
## and this file will probably be removed
preinstall-am: $(PREINSTALL_FILES)
preinstall: preinstall-am
.PHONY: preinstall preinstall-am

7
automake/local.am Normal file
View File

@@ -0,0 +1,7 @@
## $Id$
preinstall-am: $(PREINSTALL_FILES)
preinstall: preinstall-am
.PHONY: preinstall preinstall-am
PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools

32
automake/subdirs.am Normal file
View File

@@ -0,0 +1,32 @@
## $Id$
## Borrowed from automake-1.4 and adapted to RTEMS
## NOTE: This is a temporary work-around to keep
## RTEMS's non automake standard make targets working.
## Once automake is fully integrated these make targets
## and this file will probably be removed
preinstall-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
## This trick allows "-k" to keep its natural meaning when running a
## recursive rule.
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
preinstall: preinstall-recursive
.PHONY: preinstall-recursive

228
bootstrap Executable file
View File

@@ -0,0 +1,228 @@
#! /bin/sh
#
# helps bootstrapping, when checked out from CVS
# requires GNU autoconf and GNU automake
#
# $Id$
# this is not meant to be exported outside the source tree
# NOTE: Inspired by libtool's autogen script
# to be run from the toplevel directory of RTEMS'
# source tree
progname=`basename $0`
top_srcdir=`dirname $0`
verbose="";
quiet="false"
mode="generate"
usage()
{
echo
echo "usage: ${progname} [-c|-p|-h] [-q][-v]"
echo
echo "options:"
echo " -c .. clean, remove all aclocal/autoconf/automake generated files"
echo " -h .. display this message and exit"
echo " -p .. regenerate preinstall.am files"
echo " -q .. quiet, don't display directories"
echo " -v .. verbose, pass -v to autotools"
echo
exit 1;
}
generate_bspdir_acinclude()
{
cat << EOF > acinclude.m4~
# RTEMS_CHECK_BSPDIR(RTEMS_BSP_FAMILY)
AC_DEFUN([RTEMS_CHECK_BSPDIR],
[
case "\$1" in
EOF
for i in */bsp_specs; do
d=`dirname $i`
cat << EOF >> acinclude.m4~
$d )
AC_CONFIG_SUBDIRS([$d]);;
EOF
done
cat << EOF >> acinclude.m4~
*)
AC_MSG_ERROR([Invalid BSP]);;
esac
])
EOF
if cmp -s acinclude.m4 acinclude.m4~ 2>/dev/null; then
echo "acinclude.m4 is unchanged";
else
cp acinclude.m4~ acinclude.m4
fi
rm -f acinclude.m4~
}
if test ! -f $top_srcdir/aclocal/version.m4; then
echo "${progname}:"
echo " Installation problem: Can't find file aclocal/version.m4"
exit 1;
fi
while test $# -gt 0; do
case $1 in
-h|--he|--hel|--help)
usage ;;
-q|--qu|--qui|--quie|--quiet)
quiet="true";
shift;;
-v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
verbose="-v";
shift;;
-c|--cl|--cle|--clea|--clean)
mode="clean";
shift;;
-p|--pr|--pre|--prei|--prein|--preins|--preinst)
mode="preinstall";
shift;;
-r|--re|--rec|--reco|--recon|--reconf)
mode="autoreconf";
shift;;
-*) echo "unknown option $1" ;
usage ;;
*) echo "invalid parameter $1" ;
usage ;;
esac
done
case $mode in
preinstall)
confs=`find -name Makefile.am -exec grep -l 'include .*/preinstall\.am' {} \;`
for i in $confs; do
dir=$(dirname $i);
test "$quite" = "true" || echo "Generating $dir/preinstall.am"
${top_srcdir}/ampolish3 "$dir/Makefile.am" > "$dir/preinstall.am"
done
;;
generate)
AUTOCONF=${AUTOCONF-autoconf}
if test -z "$AUTOCONF"; then
echo "You must have autoconf installed to run $program"
exit 1
fi
AUTOHEADER=${AUTOHEADER-autoheader}
if test -z "$AUTOHEADER"; then
echo "You must have autoconf installed to run $program"
exit 1
fi
AUTOMAKE=${AUTOMAKE-automake}
if test -z "$AUTOMAKE"; then
echo "You must have automake installed to run $program"
exit 1
fi
ACLOCAL=${ACLOCAL-aclocal}
if test -z "$ACLOCAL"; then
echo "You must have automake installed to run $program"
exit 1
fi
case $top_srcdir in
/* ) aclocal_dir=$top_srcdir
;;
*) aclocal_dir=`pwd`/$top_srcdir
;;
esac
confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
for i in $confs; do
dir=`dirname $i`;
configure=`basename $i`;
( test "$quiet" = "true" || echo "$dir";
cd $dir;
test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
generate_bspdir_acinclude;
pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g"
aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \
sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat ` ;
test "$verbose" = "-v" && echo "${ACLOCAL} $aclocal_args"
${ACLOCAL} $aclocal_args;
test -n "`grep CONFIG_HEADER ${configure}`" && ${AUTOHEADER} \
&& test "$verbose" = "-v" && echo "${AUTOHEADER}";
test -n "`grep RTEMS_BSP_CONFIGURE ${configure}`" && ${AUTOHEADER} \
&& test "$verbose" = "-v" && echo "${AUTOHEADER}";
test -f Makefile.am && ${AUTOMAKE} -a -c $verbose ;
${AUTOCONF};
test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
&& echo timestamp > stamp-h.in
)
done
;;
autoreconf)
AUTORECONF=${AUTORECONF-autoreconf}
if test -z "$AUTORECONF"; then
echo "You must have autoreconf installed to run $program"
exit 1
fi
confs=`find . -name 'configure.ac' -print`
for i in $confs; do
dir=`dirname $i`;
configure=`basename $i`;
( test "$quiet" = "true" || echo "$dir";
cd $dir;
test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
generate_bspdir_acinclude;
${AUTORECONF} -i --no-recursive $verbose;
test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
&& echo timestamp > stamp-h.in
)
done
;;
clean)
test "$quiet" = "true" || echo "removing automake generated Makefile.in files"
files=`find . -name 'Makefile.am' -print | sed -e 's%\.am%\.in%g'` ;
for i in $files; do if test -f $i; then
rm -f $i
test "$verbose" = "-v" && echo "$i"
fi; done
test "$quiet" = "true" || echo "removing configure files"
files=`find . -name 'configure' -print` ;
test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
for i in $files; do if test -f $i; then
rm -f $i config.sub config.guess depcomp install-sh mdate-sh missing \
mkinstalldirs texinfo.tex compile
test "$verbose" = "-v" && echo "$i"
fi; done
test "$quiet" = "true" || echo "removing aclocal.m4 files"
files=`find . -name 'aclocal.m4' -print` ;
test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
for i in $files; do if test -f $i; then
rm -f $i
test "$verbose" = "-v" && echo "$i"
fi; done
find . -name '*~' -print | xargs rm -f
find . -name 'bspopts.h.in' -print | xargs rm -f
find . -name '*.orig' -print | xargs rm -f
find . -name '*.rej' -print | xargs rm -f
find . -name 'config.status' -print | xargs rm -f
find . -name 'config.log' -print | xargs rm -f
find . -name 'config.cache' -print | xargs rm -f
find . -name 'Makefile' -print | xargs rm -f
find . -name '.deps' -print | xargs rm -rf
find . -name '.libs' -print | xargs rm -rf
find . -name 'stamp-h.in' | xargs rm -rf
find . -name 'autom4te*.cache' | xargs rm -rf
;;
esac
exit 0

6
bspkit/README Normal file
View File

@@ -0,0 +1,6 @@
WARNING
=======
All files in here are considered to be unstable and experimental.
They are subject to change at any time without prior notice.

View File

@@ -0,0 +1,3 @@
2004-10-22 Ralf Corsepius <ralf_corsepius@rtems.org>
* cfg/bare-avr3.cfg, cfg/bare-avr5.cfg: New.

View File

@@ -0,0 +1,39 @@
#
# Config file for the "bare" BSP
#
# $Id$
#
# This is the actual bsp directory used during the build process.
RTEMS_BSP_FAMILY=bare
RTEMS_CPU_MODEL=avr3
CPU_CFLAGS=-mmcu=avr3
include $(RTEMS_ROOT)/make/custom/default.cfg
# optimize flag: typically -0, could use -O4 or -fast
# -O4 is ok for RTEMS
CFLAGS_OPTIMIZE_V=-Os -fomit-frame-pointer
# this target has no start file
START_BASE=
# The following are definitions of make-exe which will work using ld as
# is currently required. It is expected that as of gcc 2.8, the end user
# will be able to override parts of the compilers specs and link using gcc.
define make-exe
@echo "*** Cannot do a link with the bare bsp. ***"
@echo "#!/bin/sh" > $(basename $@).exe
@echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe
endef
define make-cxx-exe
@echo "*** Cannot do a link with the bare bsp. ***"
@echo "#!/bin/sh" > $(basename $@).exe
@echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe
endef
# Miscellaneous additions go here

View File

@@ -0,0 +1,39 @@
#
# Config file for the "bare" BSP
#
# $Id$
#
# This is the actual bsp directory used during the build process.
RTEMS_BSP_FAMILY=bare
RTEMS_CPU_MODEL=avr5
CPU_CFLAGS=-mmcu=avr5
include $(RTEMS_ROOT)/make/custom/default.cfg
# optimize flag: typically -0, could use -O4 or -fast
# -O4 is ok for RTEMS
CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
# this target has no start file
START_BASE=
# The following are definitions of make-exe which will work using ld as
# is currently required. It is expected that as of gcc 2.8, the end user
# will be able to override parts of the compilers specs and link using gcc.
define make-exe
@echo "*** Cannot do a link with the bare bsp. ***"
@echo "#!/bin/sh" > $(basename $@).exe
@echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe
endef
define make-cxx-exe
@echo "*** Cannot do a link with the bare bsp. ***"
@echo "#!/bin/sh" > $(basename $@).exe
@echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe
endef
# Miscellaneous additions go here

View File

@@ -1,70 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/console-termios.h>
#include <bspopts.h>
arm_pl011_context a53_qemu_vpl011_context = {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
.regs = (arm_pl011_uart *) BSP_A53_QEMU_VPL011_BASE,
.initial_baud = 115200,
.clock = 24000000
};
const console_device console_device_table[] = {
{
.device_file = "/dev/ttyS0",
.probe = console_device_probe_default,
.handler = &arm_pl011_fns,
.context = &a53_qemu_vpl011_context.base
}
};
const size_t console_device_count = RTEMS_ARRAY_SIZE(console_device_table);
static void output_char( char c )
{
arm_pl011_write_polled(&a53_qemu_vpl011_context.base, c);
}
BSP_output_char_function_type BSP_output_char = output_char;
BSP_polling_getchar_function_type BSP_poll_char = NULL;

View File

@@ -1,74 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief Core BSP definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A53_QEMU_BSP_H
#define LIBBSP_AARCH64_A53_QEMU_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/start.h>
#include <rtems.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_ARM_GIC_CPUIF_BASE 0x08010000
#define BSP_ARM_GIC_DIST_BASE 0x08000000
#define BSP_ARM_GIC_REDIST_BASE 0x080A0000
#define BSP_A53_QEMU_VPL011_BASE 0x9000000
#define BSP_A53_QEMU_VPL011_LENGTH 0x1000
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_A53_QEMU_BSP_H */

View File

@@ -1,66 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP IRQ definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A53_IRQ_H
#define LIBBSP_AARCH64_A53_IRQ_H
#ifndef ASM
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
#include <dev/irq/arm-gic-irq.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_INTERRUPT_VECTOR_COUNT 256
/* Interrupts vectors */
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_NS_PPI 30
#define BSP_VPL011_SPI 32
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
#endif /* LIBBSP_AARCH64_A53_IRQ_H */

View File

@@ -1,46 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP tm27 header
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -1,49 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -1,52 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup Hooks
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/start.h>
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
/* Do nothing */
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
bsp_start_clear_bss();
}

View File

@@ -1,70 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/console-termios.h>
#include <bspopts.h>
arm_pl011_context a72_qemu_vpl011_context = {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
.regs = (arm_pl011_uart *) BSP_A72_QEMU_VPL011_BASE,
.initial_baud = 115200,
.clock = 24000000
};
const console_device console_device_table[] = {
{
.device_file = "/dev/ttyS0",
.probe = console_device_probe_default,
.handler = &arm_pl011_fns,
.context = &a72_qemu_vpl011_context.base
}
};
const size_t console_device_count = RTEMS_ARRAY_SIZE(console_device_table);
static void output_char( char c )
{
arm_pl011_write_polled(&a72_qemu_vpl011_context.base, c);
}
BSP_output_char_function_type BSP_output_char = output_char;
BSP_polling_getchar_function_type BSP_poll_char = NULL;

View File

@@ -1,74 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief Core BSP definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A72_QEMU_BSP_H
#define LIBBSP_AARCH64_A72_QEMU_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/start.h>
#include <rtems.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_ARM_GIC_CPUIF_BASE 0x08010000
#define BSP_ARM_GIC_DIST_BASE 0x08000000
#define BSP_ARM_GIC_REDIST_BASE 0x080A0000
#define BSP_A72_QEMU_VPL011_BASE 0x9000000
#define BSP_A72_QEMU_VPL011_LENGTH 0x1000
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_A72_QEMU_BSP_H */

View File

@@ -1,66 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief BSP IRQ definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A72_IRQ_H
#define LIBBSP_AARCH64_A72_IRQ_H
#ifndef ASM
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
#include <dev/irq/arm-gic-irq.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_INTERRUPT_VECTOR_COUNT 1020
/* Interrupts vectors */
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_NS_PPI 30
#define BSP_VPL011_SPI 32
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
#endif /* LIBBSP_AARCH64_A72_IRQ_H */

View File

@@ -1,46 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief BSP tm27 header
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -1,49 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -1,52 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup Hooks
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/start.h>
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
/* Do nothing */
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
bsp_start_clear_bss();
}

View File

@@ -1,267 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup aarch64_start
*
* @brief AArch64 MMU configuration.
*/
/*
* Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_SHARED_AARCH64_MMU_H
#define LIBBSP_AARCH64_SHARED_AARCH64_MMU_H
#include <bsp/fatal.h>
#include <bsp/linker-symbols.h>
#include <bsp/start.h>
#include <bsp/utility.h>
#include <bspopts.h>
#include <libcpu/mmu-vmsav8-64.h>
#include <rtems/score/aarch64-system-registers.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct {
uintptr_t begin;
uintptr_t end;
uint64_t flags;
} aarch64_mmu_config_entry;
#define AARCH64_MMU_DEFAULT_SECTIONS \
{ \
.begin = (uintptr_t) bsp_section_fast_text_begin, \
.end = (uintptr_t) bsp_section_fast_text_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_fast_data_begin, \
.end = (uintptr_t) bsp_section_fast_data_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_start_begin, \
.end = (uintptr_t) bsp_section_start_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_vector_begin, \
.end = (uintptr_t) bsp_section_vector_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_text_begin, \
.end = (uintptr_t) bsp_section_text_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_rodata_begin, \
.end = (uintptr_t) bsp_section_rodata_end, \
.flags = AARCH64_MMU_DATA_RO_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_data_begin, \
.end = (uintptr_t) bsp_section_data_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_bss_begin, \
.end = (uintptr_t) bsp_section_bss_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_rtemsstack_begin, \
.end = (uintptr_t) bsp_section_rtemsstack_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_noinit_begin, \
.end = (uintptr_t) bsp_section_noinit_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_work_begin, \
.end = (uintptr_t) bsp_section_work_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_stack_begin, \
.end = (uintptr_t) bsp_section_stack_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_nocache_begin, \
.end = (uintptr_t) bsp_section_nocache_end, \
.flags = AARCH64_MMU_DEVICE \
}, { \
.begin = (uintptr_t) bsp_section_nocachenoload_begin, \
.end = (uintptr_t) bsp_section_nocachenoload_end, \
.flags = AARCH64_MMU_DEVICE \
}, { \
.begin = (uintptr_t) bsp_translation_table_base, \
.end = (uintptr_t) bsp_translation_table_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_start_vector_table_begin, \
.end = (uintptr_t) bsp_start_vector_table_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}
/**
* @brief This is the AArch64 MMU configuration table.
*
* The default table is provided by the BSP. Applications may provide their
* own.
*/
extern const aarch64_mmu_config_entry aarch64_mmu_config_table[];
/**
* @brief This is the count of entries in the AArch64 MMU configuration table.
*
* The default table is provided by the BSP. Applications may provide their
* own.
*/
extern const size_t aarch64_mmu_config_table_size;
/**
* @brief This structure represents the state to maintain the MMU translation
* tables.
*/
typedef struct {
/**
* @brief This member references the translation table base.
*/
uint64_t *ttb;
/**
* @brief This member contains the count of used page tables.
*
* A maximum of ::AARCH64_MMU_TRANSLATION_TABLE_PAGES can be used.
*/
size_t used_page_tables;
} aarch64_mmu_control;
/**
* @brief This object is used to maintain the MMU translation tables.
*/
extern aarch64_mmu_control aarch64_mmu_instance;
/**
* @brief Sets the MMU translation table entries associated with the memory
* region.
*
* @param[in, out] control is a reference to the MMU control state.
*
* @param[in] config is the configuration entry with the memory region and
* region attributes.
*
* @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
*
* @retval ::RTEMS_INVALID_ADDRESS The begin address of the memory region
* cannot be mapped by the MMU.
*
* @retval ::RTEMS_INVALID_SIZE The end address of the memory region cannot be
* mapped by the MMU.
*
* @retval ::RTEMS_TOO_MANY There was no page table entry available to perform
* the mapping.
*/
rtems_status_code aarch64_mmu_set_translation_table_entries(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config
);
/**
* @brief Sets up the MMU translation table.
*
* The memory regions of the configuration table are mapped by the MMU. If a
* mapping is infeasible, then the BSP fatal error
* ::AARCH64_FATAL_MMU_CANNOT_MAP_BLOCK will be issued.
*
* @param[in, out] control is a reference to the MMU control state.
*
* @param[in] config_table is the configuration table with memory regions and
* region attributes.
*
* @param config_count is the count of configuration table entries.
*/
void aarch64_mmu_setup_translation_table(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config_table,
size_t config_count
);
BSP_START_TEXT_SECTION static inline void
aarch64_mmu_enable( const aarch64_mmu_control *control )
{
uint64_t sctlr;
/* CPUECTLR_EL1.SMPEN is already set on ZynqMP and is not writable */
/* Flush and invalidate cache */
rtems_cache_flush_entire_data();
_AArch64_Write_ttbr0_el1( (uintptr_t) control->ttb );
_AARCH64_Instruction_synchronization_barrier();
/* Enable MMU and cache */
sctlr = _AArch64_Read_sctlr_el1();
sctlr |= AARCH64_SCTLR_EL1_I | AARCH64_SCTLR_EL1_C | AARCH64_SCTLR_EL1_M;
_AArch64_Write_sctlr_el1( sctlr );
}
BSP_START_TEXT_SECTION static inline void
aarch64_mmu_disable( void )
{
uint64_t sctlr;
/*
* Flush data cache before disabling the MMU. While the MMU is disabled, all
* accesses are treated as uncached device memory.
*/
rtems_cache_flush_entire_data();
/* Disable MMU */
sctlr = _AArch64_Read_sctlr_el1();
sctlr &= ~(AARCH64_SCTLR_EL1_M);
_AArch64_Write_sctlr_el1( sctlr );
}
BSP_START_TEXT_SECTION static inline void aarch64_mmu_setup( void )
{
/* Set TCR */
/* 256TB/48 bits mappable (64-0x10) */
_AArch64_Write_tcr_el1(
AARCH64_TCR_EL1_T0SZ( 0x10 ) | AARCH64_TCR_EL1_IRGN0( 0x1 ) |
AARCH64_TCR_EL1_ORGN0( 0x1 ) | AARCH64_TCR_EL1_SH0( 0x3 ) |
AARCH64_TCR_EL1_TG0( 0x0 ) | AARCH64_TCR_EL1_IPS( 0x5ULL ) |
AARCH64_TCR_EL1_EPD1
);
/* Set MAIR */
_AArch64_Write_mair_el1(
AARCH64_MAIR_EL1_ATTR0( 0x0 ) | AARCH64_MAIR_EL1_ATTR1( 0x4 ) |
AARCH64_MAIR_EL1_ATTR2( 0x44 ) | AARCH64_MAIR_EL1_ATTR3( 0xFF )
);
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_SHARED_AARCH64_MMU_H */

View File

@@ -1,86 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsLinkerSymbolsAArch64
*
* @brief This header file provides interfaces to AArch64-specific linker
* symbols and sections.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_SHARED_LINKER_SYMBOLS_H
#define LIBBSP_AARCH64_SHARED_LINKER_SYMBOLS_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup RTEMSBSPsLinkerSymbolsAArch64 AArch64 Linker Symbols
*
* @ingroup RTEMSBSPsLinkerSymbols
*
* @brief This group provides support for AArch64-specific linker symbols and
* sections.
*
* @{
*/
#ifndef ASM
#define LINKER_SYMBOL(sym) extern char sym [];
#else
#define LINKER_SYMBOL(sym) .extern sym
#endif
LINKER_SYMBOL(bsp_stack_exception_size)
LINKER_SYMBOL(bsp_stack_hyp_size)
LINKER_SYMBOL(bsp_section_vector_begin)
LINKER_SYMBOL(bsp_section_vector_end)
LINKER_SYMBOL(bsp_section_vector_size)
LINKER_SYMBOL(bsp_vector_table_begin)
LINKER_SYMBOL(bsp_vector_table_end)
LINKER_SYMBOL(bsp_vector_table_size)
LINKER_SYMBOL(bsp_start_vector_table_begin)
LINKER_SYMBOL(bsp_start_vector_table_end)
LINKER_SYMBOL(bsp_start_vector_table_size)
LINKER_SYMBOL(bsp_translation_table_base)
LINKER_SYMBOL(bsp_translation_table_end)
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_SHARED_LINKER_SYMBOLS_H */

View File

@@ -1,184 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup aarch64_start
*
* @brief Aarch64 system low level start.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_SHARED_START_H
#define LIBBSP_AARCH64_SHARED_START_H
#include <string.h>
#include <bsp/linker-symbols.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup aarch64_start System Start
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief Aarch64 system low level start.
*
* @{
*/
#define BSP_START_TEXT_SECTION __attribute__((section(".bsp_start_text")))
#define BSP_START_DATA_SECTION __attribute__((section(".bsp_start_data")))
/**
* @brief System start entry.
*/
void _start(void);
/**
* @brief Start entry hook 0.
*
* This hook will be called from the start entry code after all modes and
* stack pointers are initialized but before the copying of the exception
* vectors.
*/
void bsp_start_hook_0(void);
/**
* @brief Start entry hook 1.
*
* This hook will be called from the start entry code after copying of the
* exception vectors but before the call to boot_card().
*/
void bsp_start_hook_1(void);
BSP_START_TEXT_SECTION static inline void
bsp_start_memcpy_libc(void *dest, const void *src, size_t n)
{
if (dest != src) {
memcpy(dest, src, n);
}
}
/**
* @brief Copies all standard sections from the load to the runtime area.
*/
BSP_START_TEXT_SECTION static inline void bsp_start_copy_sections(void)
{
/* Copy .text section */
bsp_start_memcpy_libc(
(int *) bsp_section_text_begin,
(const int *) bsp_section_text_load_begin,
(size_t) bsp_section_text_size
);
/* Copy .rodata section */
bsp_start_memcpy_libc(
(int *) bsp_section_rodata_begin,
(const int *) bsp_section_rodata_load_begin,
(size_t) bsp_section_rodata_size
);
/* Copy .data section */
bsp_start_memcpy_libc(
(int *) bsp_section_data_begin,
(const int *) bsp_section_data_load_begin,
(size_t) bsp_section_data_size
);
/* Copy .fast_text section */
bsp_start_memcpy_libc(
(int *) bsp_section_fast_text_begin,
(const int *) bsp_section_fast_text_load_begin,
(size_t) bsp_section_fast_text_size
);
/* Copy .fast_data section */
bsp_start_memcpy_libc(
(int *) bsp_section_fast_data_begin,
(const int *) bsp_section_fast_data_load_begin,
(size_t) bsp_section_fast_data_size
);
}
/**
* @brief Copies the .data, .fast_text and .fast_data sections from the load to
* the runtime area using the C library memcpy().
*
* Works only in case the .start, .text and .rodata sections reside in one
* memory region.
*/
BSP_START_TEXT_SECTION static inline void bsp_start_copy_sections_compact(void)
{
/* Copy .data section */
bsp_start_memcpy_libc(
bsp_section_data_begin,
bsp_section_data_load_begin,
(size_t) bsp_section_data_size
);
/* Copy .fast_text section */
bsp_start_memcpy_libc(
bsp_section_fast_text_begin,
bsp_section_fast_text_load_begin,
(size_t) bsp_section_fast_text_size
);
/* Copy .fast_data section */
bsp_start_memcpy_libc(
bsp_section_fast_data_begin,
bsp_section_fast_data_load_begin,
(size_t) bsp_section_fast_data_size
);
}
BSP_START_TEXT_SECTION static inline void bsp_start_clear_bss(void)
{
memset(bsp_section_bss_begin, 0, (size_t) bsp_section_bss_size);
}
BSP_START_TEXT_SECTION static inline void
AArch64_start_set_vector_base(void)
{
__asm__ volatile (
"msr VBAR_EL1, %[vtable]\n"
: : [vtable] "r" (bsp_start_vector_table_begin)
);
}
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_SHARED_START_H */

View File

@@ -1,88 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup DevIRQGIC
*
* @brief This header file provides interfaces of the ARM Generic Interrupt
* Controller (GIC) support specific to the AArch64 architecture.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_DEV_IRQ_ARM_GIC_AARCH64_H
#define _RTEMS_DEV_IRQ_ARM_GIC_AARCH64_H
#include <rtems/score/cpu.h>
#include <rtems/score/cpu_irq.h>
#include <bsp/irq-generic.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup DevIRQGIC
*
* @{
*/
static inline uint32_t arm_interrupt_enable_interrupts(void)
{
uint32_t status = _CPU_ISR_Get_level();
/* Enable interrupts for nesting */
_CPU_ISR_Set_level(0);
return status;
}
static inline void arm_interrupt_restore_interrupts(uint32_t status)
{
/* Restore interrupts to previous level */
_CPU_ISR_Set_level(status);
}
static inline void arm_interrupt_facility_set_exception_handler(void)
{
AArch64_set_exception_handler(
AARCH64_EXCEPTION_SPx_IRQ,
_AArch64_Exception_interrupt_no_nest
);
AArch64_set_exception_handler(
AARCH64_EXCEPTION_SP0_IRQ,
_AArch64_Exception_interrupt_nest
);
}
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* _RTEMS_DEV_IRQ_ARM_GIC_AARCH64_H */

View File

@@ -1,180 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
* Copyright (C) 2023 Utkarsh Verma
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/irq.h>
#include <bsp/console.h>
#include <bsp/fatal.h>
#include <bsp/rpi-gpio.h>
#include <bspopts.h>
#include <rtems/console.h>
#include <rtems/rtems/status.h>
#include <rtems/termiosdevice.h>
#include <stdint.h>
#define CONSOLE_DEVICE_CONTEXT_NAME(port_no) uart##port_no##_context
#define CONSOLE_DEVICE_CONTEXT( \
port_no, _file_name, regs_base, _size, clock_freq, irq_no, \
context_type, ... \
) \
static context_type CONSOLE_DEVICE_CONTEXT_NAME(port_no) = { \
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("UART" #port_no), \
.regs = (volatile arm_pl011_uart *) regs_base, \
.clock = clock_freq, \
.initial_baud = 115200, \
.irq = irq_no, \
};
#define CONSOLE_DEVICE( \
port_no, file_name, _base, _size, _clock, _irq,_context_type, dev_handler, \
write_char_func, rx_pin, tx_pin, gpio_func, ... \
) \
[CONSOLE_DEVICE_PORT2ENUM(port_no)] = { \
.file = file_name, \
.context = &CONSOLE_DEVICE_CONTEXT_NAME(port_no).base, \
.gpio = {.rx = rx_pin, .tx = tx_pin, .function = gpio_func}, \
.handler = dev_handler, \
.write_char_polled = write_char_func, \
},
typedef struct {
const unsigned int rx;
const unsigned int tx;
const raspberrypi_gpio_function function;
} raspberrypi_console_device_gpio_config;
typedef struct {
const char* file;
rtems_termios_device_context* context;
const raspberrypi_console_device_gpio_config gpio;
const rtems_termios_device_handler* handler;
void (*write_char_polled)(rtems_termios_device_context*, char);
} raspberrypi_console_device;
/* Initialize all console device contexts */
CONSOLE_DEVICES(CONSOLE_DEVICE_CONTEXT)
/* Initialize all device configurations */
static const raspberrypi_console_device devices[CONSOLE_DEVICE_COUNT] = {
CONSOLE_DEVICES(CONSOLE_DEVICE)
};
static rtems_status_code console_device_init_gpio(
const raspberrypi_console_device_gpio_config *gpio
)
{
rtems_status_code status = raspberrypi_gpio_set_function(
gpio->rx,
gpio->function
);
if (status != RTEMS_SUCCESSFUL)
return status;
status = raspberrypi_gpio_set_function(gpio->tx, gpio->function);
if (status != RTEMS_SUCCESSFUL)
return status;
status = raspberrypi_gpio_set_pull(gpio->rx, GPIO_PULL_NONE);
if (status != RTEMS_SUCCESSFUL)
return status;
status = raspberrypi_gpio_set_pull(gpio->tx, GPIO_PULL_NONE);
return status;
}
static void output_char(const char ch) {
const raspberrypi_console_device* device = &devices[BSP_CONSOLE_PORT];
device->write_char_polled(device->context, ch);
}
static int poll_char(void) {
const raspberrypi_console_device* device = &devices[BSP_CONSOLE_PORT];
return device->handler->poll_read(device->context);
}
rtems_status_code raspberrypi_uart_init(
raspberrypi_console_device_port uart_num
)
{
const raspberrypi_console_device *device = &devices[uart_num];
rtems_status_code status = console_device_init_gpio(&device->gpio);
if (status != RTEMS_SUCCESSFUL) {
return status;
}
status = rtems_termios_device_install(
device->file, device->handler, NULL, device->context
);
return status;
}
rtems_device_driver console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg
)
{
(void) major;
(void) minor;
(void) arg;
const raspberrypi_console_device* device = &devices[BSP_CONSOLE_PORT];
rtems_status_code status = raspberrypi_uart_init(BSP_CONSOLE_PORT);
if (status != RTEMS_SUCCESSFUL) {
bsp_fatal(BSP_FATAL_CONSOLE_INSTALL_0);
}
rtems_termios_initialize();
if (link(device->file, CONSOLE_DEVICE_NAME) != 0) {
bsp_fatal(BSP_FATAL_CONSOLE_INSTALL_1);
}
return RTEMS_SUCCESSFUL;
}
BSP_output_char_function_type BSP_output_char = output_char;
BSP_polling_getchar_function_type BSP_poll_char = poll_char;

View File

@@ -1,300 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief Raspberry Pi specific DMA definitions.
*/
/*
* Copyright (C) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp/raspberrypi-dma.h>
#define DMA4_AD_SHIFT( addr ) ( addr >> 5 )
#define DMA4_AD_UNSHIFT( addr ) ( addr << 5 )
#define ADDRESS_LOW( addr ) ( (uintptr_t) ( addr ) & 0xFFFFFFFF )
#define ADDRESS_HIGH( addr ) ( ( (uintptr_t) ( addr ) >> 32 ) & 0xFF )
#define BUS_ADDR( addr ) ( ( ( addr ) & ~0xC0000000 ) | 0xC0000000 )
typedef struct {
uint32_t transfer_info; /**< Control register */
uint32_t source_addr; /**< Source address register */
uint32_t destination_addr; /**< Destination address register */
uint32_t transfer_length; /**< Transfer length register */
uint32_t mode_2d_stride; /**< Stride register */
uint32_t next_cb; /**< Next control block address register */
uint32_t reserved[ 2 ]; /**< Reserved */
} rpi_dma_control_block;
typedef struct {
uint32_t transfer_info; /**< Control register */
uint32_t source_addr; /**< Source address register */
uint32_t destination_addr; /**< Destination address register */
uint32_t transfer_length; /**< Transfer length register */
uint32_t reserved_bit; /**< Reserved */
uint32_t next_cb; /**< Next control block address register */
uint32_t reserved[ 2 ]; /**< Reserved */
} rpi_dma_lite_control_block;
typedef struct {
uint32_t transfer_info; /**< Control register */
uint32_t source_addr; /**< Source address register */
uint32_t source_info; /**< Source information */
uint32_t destination_addr; /**< Destination address register */
uint32_t destination_info; /**< Destination information */
uint32_t transfer_length; /**< Transfer length register */
uint32_t next_cb; /**< Next control block address register */
uint32_t reserved; /**< Reserved */
} rpi_dma4_control_block;
static const uint32_t dma_base_addresses[] = {
BCM2711_DMA0_BASE,
BCM2711_DMA1_BASE,
BCM2711_DMA2_BASE,
BCM2711_DMA3_BASE,
BCM2711_DMA4_BASE,
BCM2711_DMA5_BASE,
BCM2711_DMA6_BASE,
BCM2711_DMA7_BASE,
BCM2711_DMA8_BASE,
BCM2711_DMA9_BASE,
BCM2711_DMA10_BASE,
BCM2711_DMA11_BASE,
BCM2711_DMA12_BASE,
BCM2711_DMA13_BASE,
BCM2711_DMA14_BASE
};
static inline uint32_t get_base_address( rpi_dma_channel channel )
{
if ( channel >= 0 && channel <= DMA4_CHANNEL_14 ) {
return dma_base_addresses[ channel ];
}
return 0;
}
static rpi_dma_control_block *rpi_dma_init_cb(
void *source_address,
void *destination_address,
uint32_t transfer_length
)
{
rpi_dma_control_block *cb = (rpi_dma_control_block *)
rtems_heap_allocate_aligned_with_boundary(
sizeof( rpi_dma_control_block ),
CPU_CACHE_LINE_BYTES,
0
);
if ( cb == NULL ) {
return NULL;
}
cb->source_addr = BUS_ADDR( (uint32_t) (uintptr_t) source_address );
cb->destination_addr = BUS_ADDR( (uint32_t) (uintptr_t) destination_address );
cb->transfer_length = transfer_length;
cb->transfer_info = ( TI_DEST_INC | TI_SRC_INC );
cb->mode_2d_stride = 0;
cb->next_cb = 0;
cb->reserved[ 0 ] = 0;
cb->reserved[ 1 ] = 0;
return cb;
}
static rpi_dma_lite_control_block *rpi_dma_lite_init_cb(
void *source_address,
void *destination_address,
uint32_t transfer_length
)
{
rpi_dma_lite_control_block *cb = (rpi_dma_lite_control_block *)
rtems_heap_allocate_aligned_with_boundary(
sizeof( rpi_dma_control_block ),
CPU_CACHE_LINE_BYTES,
0
);
if ( cb == NULL ) {
return NULL;
}
cb->source_addr = BUS_ADDR( (uint32_t) (uintptr_t) source_address );
cb->destination_addr = BUS_ADDR( (uint32_t) (uintptr_t) destination_address );
cb->transfer_length = transfer_length;
cb->transfer_info = ( TI_DEST_INC | TI_SRC_INC );
cb->next_cb = 0;
cb->reserved_bit = 0;
cb->reserved[ 0 ] = 0;
cb->reserved[ 1 ] = 0;
return cb;
}
static rpi_dma4_control_block *rpi_dma4_init_cb(
void *source_address,
void *destination_address,
uint32_t transfer_length
)
{
rpi_dma4_control_block *cb = (rpi_dma4_control_block *)
rtems_heap_allocate_aligned_with_boundary(
sizeof( rpi_dma4_control_block ),
CPU_CACHE_LINE_BYTES,
0
);
if ( cb == NULL ) {
return NULL;
}
cb->source_addr = (uint32_t) ADDRESS_LOW( source_address );
cb->source_info = SI_SRC_INC | ADDRESS_HIGH( source_address );
cb->destination_addr = (uint32_t) ADDRESS_LOW( destination_address );
cb->destination_info = DI_DEST_INC | ADDRESS_HIGH( destination_address );
cb->transfer_length = transfer_length;
cb->transfer_info = 0;
cb->next_cb = 0;
cb->reserved = 0;
return cb;
}
static inline void rpi_dma_free_control_block(
rpi_dma_channel channel,
uint32_t base_address
)
{
uint32_t cb_ad_reg = BCM2835_REG( base_address + CONBLK_AD_OFFSET );
if ( cb_ad_reg == 0 ) {
return;
}
uintptr_t cb_addr;
if ( channel >= DMA4_CHANNEL_11 && channel <= DMA4_CHANNEL_14 ) {
cb_addr = DMA4_AD_UNSHIFT( cb_ad_reg );
} else {
cb_addr = (uintptr_t) cb_ad_reg;
}
if ( cb_addr != 0 ) {
void *cb = (void *) cb_addr;
free( cb );
BCM2835_REG( base_address + CONBLK_AD_OFFSET ) = 0;
}
}
rtems_status_code rpi_dma_start_transfer( rpi_dma_channel channel )
{
uint32_t base_address = get_base_address( channel );
if ( !base_address ) {
return RTEMS_INVALID_NUMBER;
}
BCM2835_REG( base_address + CS_OFFSET ) = CS_WAIT_FOR_OUTSTANDING_WRITES |
CS_PANIC_PRIORITY_SHIFT |
CS_PRIORITY_SHIFT;
BCM2835_REG( base_address + CS_OFFSET ) |= CS_ACTIVE;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rpi_dma_wait( rpi_dma_channel channel )
{
uint32_t base_address = get_base_address( channel );
if ( !base_address ) {
return RTEMS_INVALID_NUMBER;
}
while (( BCM2835_REG( base_address + CS_OFFSET ) & CS_ACTIVE ));
rpi_dma_free_control_block( channel, base_address );
return RTEMS_SUCCESSFUL;
}
rtems_status_code rpi_dma_mem_to_mem_init(
rpi_dma_channel channel,
void *source_address,
void *destination_address,
uint32_t transfer_length
)
{
uint32_t base_address = get_base_address( channel );
if ( !base_address ) {
return RTEMS_INVALID_NUMBER;
}
if ( ( (uintptr_t) source_address % CPU_CACHE_LINE_BYTES ) != 0 ||
( (uintptr_t) destination_address % CPU_CACHE_LINE_BYTES ) != 0 ) {
return RTEMS_INVALID_ADDRESS;
}
void *control_block = NULL;
size_t cb_size = 0;
if ( channel < DMA_LITE_CHANNEL_7 ) {
control_block = rpi_dma_init_cb(
source_address,
destination_address,
transfer_length
);
cb_size = sizeof( rpi_dma_control_block );
} else if ( channel > DMA_CHANNEL_6 && channel < DMA4_CHANNEL_11 ) {
control_block = rpi_dma_lite_init_cb(
source_address,
destination_address,
transfer_length
);
cb_size = sizeof( rpi_dma_lite_control_block );
} else if ( channel > DMA_LITE_CHANNEL_10 && channel <= DMA4_CHANNEL_14 ) {
control_block = rpi_dma4_init_cb(
source_address,
destination_address,
transfer_length
);
cb_size = sizeof( rpi_dma4_control_block );
} else {
return RTEMS_INVALID_NUMBER;
}
if ( control_block == NULL ) {
return RTEMS_NO_MEMORY;
}
BCM2835_REG( base_address + CS_OFFSET ) = CS_RESET | CS_ABORT;
rtems_cache_flush_multiple_data_lines( control_block, cb_size );
rtems_cache_flush_multiple_data_lines( source_address, transfer_length );
rtems_cache_invalidate_multiple_data_lines(
destination_address,
transfer_length
);
if ( ( channel >= DMA4_CHANNEL_11 ) && ( channel <= DMA4_CHANNEL_14 ) ) {
uint32_t cb_addr = (uint32_t) (uintptr_t) control_block;
uint32_t dma4_cb_addr = DMA4_AD_SHIFT( cb_addr );
BCM2835_REG( base_address + CONBLK_AD_OFFSET ) = dma4_cb_addr;
} else {
BCM2835_REG( base_address + CONBLK_AD_OFFSET ) = (uint32_t) (uintptr_t
) control_block;
}
return RTEMS_SUCCESSFUL;
}

View File

@@ -1,79 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief This file provides the base Raspberrypi4 device tree
*/
/*
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/dts-v1/;
/ {
#address-cells = <2>;
#size-cells = <1>;
amba@7c000000 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x7c000000 0x00 0xfc000000 0x3800000>, <0x40000000 0x00 0xff800000 0x800000>;
interrupt-controller@40041000 {
compatible = "arm,gic-400";
#address-cells = <2>;
#interrupt-cells = <3>;
reg = <0x40041000 0x1000>, <0x40042000 0x2000>, <0x40044000 0x2000>, <0x40046000 0x2000>;
interrupt-controller;
phandle = <1>;
};
ethernet@7d580000 {
phy-mode = "rgmii-rxid";
phy-handle = <&phy0>;
compatible = "brcm,bcm2711-genet-v5";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x7d580000 0x10000>;
interrupt-parent = <1>;
interrupts = <0x0 0x9d 0x4> , <0x0 0x9e 0x4>;
mdio@e14 {
compatible = "brcm,genet-mdio-v5";
#address-cells = <1>;
#size-cells = <0>;
reg = <0xe14 0x8>;
phy0: ethernet-phy@1 {
reg = <0x1>;
};
};
};
};
};

View File

@@ -1,50 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief This source file contains the implementatin of bsp_fdt_get().
*/
/*
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/fdt.h>
const void *bsp_fdt_get(void)
{
return bcm2711_rpi_4_b_dtb;
}
uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
{
if (icells != 3) {
return 0;
}
return (intr[0] == 0 ? 32 : 16) + intr[1];
}

View File

@@ -1,88 +0,0 @@
/*
* Declarations for C structure representing binary file bcm2711-rpi-4-b.dtb
*
* WARNING: Automatically generated -- do not edit!
*/
#include <sys/types.h>
const unsigned char bcm2711_rpi_4_b_dtb[] = {
0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x03, 0x8b, 0x00, 0x00, 0x00, 0x38,
0x00, 0x00, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f,
0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01, 0x61, 0x6d, 0x62, 0x61, 0x40, 0x37, 0x63, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1b, 0x73, 0x69, 0x6d, 0x70,
0x6c, 0x65, 0x2d, 0x62, 0x75, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x26, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70,
0x74, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72,
0x40, 0x34, 0x30, 0x30, 0x34, 0x31, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1b,
0x61, 0x72, 0x6d, 0x2c, 0x67, 0x69, 0x63, 0x2d, 0x34, 0x30, 0x30, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x04, 0x10, 0x00,
0x00, 0x00, 0x10, 0x00, 0x40, 0x04, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00,
0x40, 0x04, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x40, 0x04, 0x60, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x65, 0x74,
0x40, 0x37, 0x64, 0x35, 0x38, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5f,
0x72, 0x67, 0x6d, 0x69, 0x69, 0x2d, 0x72, 0x78, 0x69, 0x64, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x68,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x16,
0x00, 0x00, 0x00, 0x1b, 0x62, 0x72, 0x63, 0x6d, 0x2c, 0x62, 0x63, 0x6d,
0x32, 0x37, 0x31, 0x31, 0x2d, 0x67, 0x65, 0x6e, 0x65, 0x74, 0x2d, 0x76,
0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3e,
0x7d, 0x58, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x84,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x01, 0x6d, 0x64, 0x69, 0x6f, 0x40, 0x65, 0x31, 0x34,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13,
0x00, 0x00, 0x00, 0x1b, 0x62, 0x72, 0x63, 0x6d, 0x2c, 0x67, 0x65, 0x6e,
0x65, 0x74, 0x2d, 0x6d, 0x64, 0x69, 0x6f, 0x2d, 0x76, 0x35, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x0e, 0x14,
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x65, 0x74, 0x68, 0x65,
0x72, 0x6e, 0x65, 0x74, 0x2d, 0x70, 0x68, 0x79, 0x40, 0x31, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x23, 0x61, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x2d, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x00, 0x23,
0x73, 0x69, 0x7a, 0x65, 0x2d, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x00, 0x63,
0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x00, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x73, 0x00, 0x23, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72,
0x75, 0x70, 0x74, 0x2d, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x00, 0x72, 0x65,
0x67, 0x00, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70, 0x74, 0x2d,
0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x00, 0x70,
0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x00, 0x70, 0x68, 0x79, 0x2d, 0x6d,
0x6f, 0x64, 0x65, 0x00, 0x70, 0x68, 0x79, 0x2d, 0x68, 0x61, 0x6e, 0x64,
0x6c, 0x65, 0x00, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70, 0x74,
0x2d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x72, 0x75, 0x70, 0x74, 0x73, 0x00,
};
const size_t bcm2711_rpi_4_b_dtb_size = sizeof(bcm2711_rpi_4_b_dtb);

View File

@@ -1,110 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief GPIO Driver
*/
/*
* Copyright (C) 2023 Utkarsh Verma
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/rtems/status.h>
#include <stdint.h>
#include <bsp/rpi-gpio.h>
#include <bsp/raspberrypi.h>
#define BSP_GPIO_BASE BCM2711_GPIO_BASE
#define BSP_GPIO_SIZE BCM2711_GPIO_SIZE
#define BSP_GPIO_PIN_COUNT BCM2711_GPIO_PIN_COUNT
#define GPFSEL0 BCM2835_REG(BSP_GPIO_BASE + 0x00)
#define GPSET0 BCM2835_REG(BSP_GPIO_BASE + 0x1c)
#define GPCLR0 BCM2835_REG(BSP_GPIO_BASE + 0x28)
#define GPIO_PUP_PDN_CTRL_REG0 BCM2835_REG(BSP_GPIO_BASE + 0xe4)
#define FSELn_SIZE 3
#define CLRn_SIZE 1
#define SETn_SIZE 1
#define REG_SET 1
static rtems_status_code raspberrypi_gpio_set_reg(
volatile uint32_t *base_reg,
const unsigned int pin,
const uint32_t value,
const unsigned int field_size
)
{
unsigned int field_mask, n_fields, shift, tmp;
volatile uint32_t *reg;
if (pin > BSP_GPIO_PIN_COUNT)
return RTEMS_INVALID_NUMBER;
field_mask = (1 << field_size) - 1;
if (value > field_mask)
return RTEMS_INVALID_NUMBER;
/* GPIO registers are uniformly subdivided */
n_fields = sizeof(uint32_t) * 8 / field_size;
/* Registers are sequentially mapped for each `n_field` GPIOs */
reg = base_reg + pin / n_fields;
shift = (pin % n_fields) * field_size;
tmp = *reg;
tmp &= ~(field_mask << shift); /* Clear the field */
tmp |= value << shift; /* Set value to the field */
*reg = tmp;
return RTEMS_SUCCESSFUL;
}
rtems_status_code raspberrypi_gpio_set_function(
const unsigned int pin,
const raspberrypi_gpio_function value
)
{
return raspberrypi_gpio_set_reg(&GPFSEL0, pin, value, FSELn_SIZE);
}
rtems_status_code raspberrypi_gpio_clear_pin(const unsigned int pin)
{
return raspberrypi_gpio_set_reg(&GPCLR0, pin, REG_SET, CLRn_SIZE);
}
rtems_status_code raspberrypi_gpio_set_pin(const unsigned int pin)
{
return raspberrypi_gpio_set_reg(&GPSET0, pin, REG_SET, SETn_SIZE);
}
rtems_status_code raspberrypi_gpio_set_pull(
const unsigned int pin,
const raspberrypi_gpio_pull value
)
{
return raspberrypi_gpio_set_reg(&GPIO_PUP_PDN_CTRL_REG0, pin, value, 2);
}

View File

@@ -1,397 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup raspberrypi_4_i2c
*
* @brief I2C Driver
*/
/*
* Copyright (C) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp/irq.h>
#include <bsp/raspberrypi-i2c.h>
#include <bsp/raspberrypi.h>
#include <bsp/rpi-gpio.h>
#include <dev/i2c/i2c.h>
#define C_REG( bus ) BCM2835_REG( ( bus )->base_address + BCM2711_I2C_CONTROL )
#define C_I2CEN ( 1 << 15 )
#define C_INTR ( 1 << 10 )
#define C_INTT ( 1 << 9 )
#define C_INTD ( 1 << 8 )
#define C_ST ( 1 << 7 )
#define C_CLEAR ( 1 << 5 )
#define C_READ ( 1 << 0 )
#define BSC_CORE_CLK_HZ 150000000
#define S_REG( bus ) BCM2835_REG( ( bus )->base_address + BCM2711_I2C_STATUS )
#define S_CLKT ( 1 << 9 )
#define S_ERR ( 1 << 8 )
#define S_RXF ( 1 << 7 )
#define S_TXE ( 1 << 6 )
#define S_RXD ( 1 << 5 )
#define S_TXD ( 1 << 4 )
#define S_RXR ( 1 << 3 )
#define S_TXW ( 1 << 2 )
#define S_DONE ( 1 << 1 )
#define S_TA ( 1 << 0 )
#define S_ERROR ( S_CLKT | S_ERR | S_DONE )
typedef struct {
i2c_bus base;
rtems_binary_semaphore sem;
uint32_t input_clock;
uintptr_t base_address;
raspberrypi_bsc_masters device;
uint32_t remaining_bytes;
uint32_t remaining_transfers;
uint8_t *current_buffer;
uint32_t current_buffer_size;
bool read_transfer;
} raspberrypi_i2c_bus;
static int rpi_i2c_bus_transfer( raspberrypi_i2c_bus *bus )
{
while ( bus->remaining_bytes > 0 ) {
if ( bus->read_transfer ) {
while ( ( S_REG( bus ) & ( S_RXD | S_CLKT ) ) == 0 ) {
}
if ( S_REG( bus ) & S_CLKT ) {
return -EIO;
}
*bus->current_buffer = BCM2835_REG(
bus->base_address + BCM2711_I2C_FIFO
) &
BCM2711_I2C_FIFO_MASK;
++bus->current_buffer;
if ( ( S_REG( bus ) & S_ERR ) || ( S_REG( bus ) & S_CLKT ) ) {
return -EIO;
}
} else {
#ifdef BSP_I2C_USE_INTERRUPTS
C_REG( bus ) |= C_INTT;
if ( rtems_binary_semaphore_wait_timed_ticks(
&bus->sem,
bus->base.timeout
) != RTEMS_SUCCESSFUL ) {
rtems_binary_semaphore_try_wait( &bus->sem );
return -ETIMEDOUT;
}
#else
while ( ( S_REG( bus ) & ( S_TXW | S_CLKT ) ) == 0 ) {
}
if ( S_REG( bus ) & S_CLKT ) {
return -EIO;
}
#endif
BCM2835_REG(
bus->base_address + BCM2711_I2C_FIFO
) = *bus->current_buffer;
++bus->current_buffer;
if ( ( S_REG( bus ) & S_ERR ) || ( S_REG( bus ) & S_CLKT ) ) {
return -EIO;
}
}
--bus->remaining_bytes;
}
return 0;
}
static void rpi_i2c_destroy( i2c_bus *base )
{
raspberrypi_i2c_bus *bus = (raspberrypi_i2c_bus *) base;
i2c_bus_destroy_and_free( &bus->base );
}
static int rpi_i2c_set_clock( i2c_bus *base, unsigned long clock )
{
raspberrypi_i2c_bus *bus = (raspberrypi_i2c_bus *) base;
uint32_t clock_rate;
uint16_t divider;
divider = BSC_CORE_CLK_HZ / clock;
clock_rate = BSC_CORE_CLK_HZ / divider;
while ( clock_rate > clock ) {
++divider;
clock_rate = BSC_CORE_CLK_HZ / divider;
}
BCM2835_REG( bus->base_address + BCM2711_I2C_DIV ) = divider;
return 0;
}
static int rpi_i2c_setup_and_transfer( raspberrypi_i2c_bus *bus )
{
int rv;
while ( bus->remaining_transfers > 0 ) {
bus->remaining_bytes = bus->remaining_transfers > 1 ?
BCM2711_I2C_DLEN_MASK :
( bus->current_buffer_size & BCM2711_I2C_DLEN_MASK
);
BCM2835_REG( bus->base_address + BCM2711_I2C_DLEN ) = bus->remaining_bytes;
/* Clear the error bits before starting new transfer */
S_REG( bus ) = S_ERROR;
C_REG( bus ) |= C_ST;
rv = rpi_i2c_bus_transfer( bus );
if ( rv < 0 ) {
return rv;
}
#ifdef BSP_I2C_USE_INTERRUPTS
C_REG( bus ) |= C_INTD;
if ( rtems_binary_semaphore_wait_timed_ticks(
&bus->sem,
bus->base.timeout
) != 0 ) {
rtems_binary_semaphore_try_wait( &bus->sem );
return -ETIMEDOUT;
}
#else
while ( ( S_REG( bus ) & ( S_DONE | S_CLKT ) ) == 0 ) {
}
if ( S_REG( bus ) & S_CLKT ) {
return -EIO;
}
#endif
--bus->remaining_transfers;
}
return 0;
}
#ifdef BSP_I2C_USE_INTERRUPTS
static void i2c_handler( void *args )
{
raspberrypi_i2c_bus *bus = (raspberrypi_i2c_bus *) args;
if ( C_REG( bus ) & C_INTT ) {
C_REG( bus ) &= ~C_INTT;
} else if ( C_REG( bus ) & C_INTD ) {
C_REG( bus ) &= ~C_INTD;
}
rtems_binary_semaphore_post( &bus->sem );
}
#endif
static int rpi_i2c_transfer( i2c_bus *base, i2c_msg *msgs, uint32_t msg_count )
{
raspberrypi_i2c_bus *bus = (raspberrypi_i2c_bus *) base;
int rv = 0;
uint32_t i;
uint8_t msbs;
int supported_flags = I2C_M_TEN | I2C_M_RD;
for ( i = 0; i < msg_count; i++ ) {
if ( msgs[ i ].len == 0 || msgs[ i ].buf == NULL ) {
return -EINVAL;
}
if ( ( msgs[ i ].flags & ~supported_flags ) != 0 ) {
return -EINVAL;
}
}
for ( i = 0; i < msg_count; i++ ) {
bus->current_buffer = msgs[ i ].buf;
bus->current_buffer_size = msgs[ i ].len;
bus->remaining_transfers = ( bus->current_buffer_size +
( BCM2711_I2C_DLEN_MASK - 1 ) ) /
BCM2711_I2C_DLEN_MASK;
/* 10-bit slave address */
if ( msgs[ i ].flags & I2C_M_TEN ) {
/* Add the 8 lsbs of the 10-bit slave address to the fifo register */
BCM2835_REG(
bus->base_address + BCM2711_I2C_FIFO
) = msgs[ i ].addr & BCM2711_I2C_FIFO_MASK;
msbs = msgs[ i ].addr >> 8;
BCM2835_REG(
bus->base_address + BCM2711_I2C_SLAVE_ADDRESS
) = BCM2711_10_BIT_ADDR_MASK | msbs;
} else {
BCM2835_REG(
bus->base_address + BCM2711_I2C_SLAVE_ADDRESS
) = msgs[ i ].addr;
}
if ( msgs[ i ].flags & I2C_M_RD ) {
C_REG( bus ) |= C_CLEAR | C_READ;
bus->read_transfer = true;
} else {
C_REG( bus ) |= C_CLEAR;
C_REG( bus ) &= ~C_READ;
bus->read_transfer = false;
}
/* Disable clock stretch timeout */
BCM2835_REG( bus->base_address + BCM2711_I2C_CLKT ) = 0;
rv = rpi_i2c_setup_and_transfer( bus );
if ( rv < 0 ) {
return rv;
}
}
return rv;
}
static rtems_status_code rpi_i2c_gpio_init(
raspberrypi_bsc_masters device,
raspberrypi_i2c_bus *bus
)
{
switch ( device ) {
case raspberrypi_bscm0:
raspberrypi_gpio_set_function( 0, GPIO_AF0 );
raspberrypi_gpio_set_function( 1, GPIO_AF0 );
bus->base_address = BCM2711_I2C0_BASE;
break;
case raspberrypi_bscm1:
raspberrypi_gpio_set_function( 2, GPIO_AF0 );
raspberrypi_gpio_set_function( 3, GPIO_AF0 );
bus->base_address = BCM2711_I2C1_BASE;
break;
case raspberrypi_bscm3:
raspberrypi_gpio_set_function( 4, GPIO_AF5 );
raspberrypi_gpio_set_function( 5, GPIO_AF5 );
bus->base_address = BCM2711_I2C3_BASE;
break;
case raspberrypi_bscm4:
raspberrypi_gpio_set_function( 6, GPIO_AF5 );
raspberrypi_gpio_set_function( 7, GPIO_AF5 );
bus->base_address = BCM2711_I2C4_BASE;
break;
case raspberrypi_bscm5:
raspberrypi_gpio_set_function( 10, GPIO_AF5 );
raspberrypi_gpio_set_function( 11, GPIO_AF5 );
bus->base_address = BCM2711_I2C5_BASE;
break;
case raspberrypi_bscm6:
raspberrypi_gpio_set_function( 22, GPIO_AF5 );
raspberrypi_gpio_set_function( 23, GPIO_AF5 );
bus->base_address = BCM2711_I2C6_BASE;
break;
default:
return RTEMS_INVALID_ADDRESS;
}
return RTEMS_SUCCESSFUL;
}
static char *rpi_select_bus( raspberrypi_bsc_masters device )
{
switch ( device ) {
case raspberrypi_bscm0:
return "/dev/i2c-0";
case raspberrypi_bscm1:
return "/dev/i2c-1";
case raspberrypi_bscm3:
return "/dev/i2c-3";
case raspberrypi_bscm4:
return "/dev/i2c-4";
case raspberrypi_bscm5:
return "/dev/i2c-5";
case raspberrypi_bscm6:
return "/dev/i2c-6";
default:
return NULL;
}
}
rtems_status_code rpi_i2c_init(
raspberrypi_bsc_masters device,
uint32_t bus_clock
)
{
raspberrypi_i2c_bus *bus;
rtems_status_code sc;
const char *bus_path;
if ( device != raspberrypi_bscm0 && device != raspberrypi_bscm1 &&
device != raspberrypi_bscm3 && device != raspberrypi_bscm4 &&
device != raspberrypi_bscm5 && device != raspberrypi_bscm6 ) {
return RTEMS_INVALID_NUMBER;
}
bus_path = rpi_select_bus( device );
if ( bus_path == NULL ) {
return RTEMS_INVALID_NUMBER;
}
bus = (raspberrypi_i2c_bus *) i2c_bus_alloc_and_init( sizeof( *bus ) );
if ( bus == NULL ) {
return RTEMS_NO_MEMORY;
}
sc = rpi_i2c_gpio_init( device, bus );
if ( sc != RTEMS_SUCCESSFUL ) {
i2c_bus_destroy_and_free( &bus->base );
return sc;
}
/* Enable I2C */
C_REG( bus ) = C_CLEAR;
C_REG( bus ) = C_I2CEN;
#ifdef BSP_I2C_USE_INTERRUPTS
sc = rtems_interrupt_handler_install(
BCM2711_IRQ_I2C,
"I2C",
RTEMS_INTERRUPT_SHARED,
(rtems_interrupt_handler) i2c_handler,
bus
);
rtems_binary_semaphore_init( &bus->sem, "RPII2C" );
if ( sc != RTEMS_SUCCESSFUL ) {
return -EIO;
}
#endif
sc = rpi_i2c_set_clock( &bus->base, bus_clock );
if ( sc != RTEMS_SUCCESSFUL ) {
i2c_bus_destroy_and_free( &bus->base );
return sc;
}
bus->base.transfer = rpi_i2c_transfer;
bus->base.set_clock = rpi_i2c_set_clock;
bus->base.destroy = rpi_i2c_destroy;
bus->base.functionality = I2C_FUNC_I2C | I2C_FUNC_10BIT_ADDR;
return i2c_bus_register( &bus->base, bus_path );
}

View File

@@ -1,78 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief Core BSP definitions
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_4_BSP_H
#define LIBBSP_AARCH64_RASPBERRYPI_4_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/start.h>
#include <rtems.h>
/*Raspberry pi MMU initialization */
BSP_START_TEXT_SECTION void raspberrypi_4_setup_mmu_and_cache(void);
BSP_START_TEXT_SECTION void rpi_setup_secondary_cpu_mmu_and_cache( void );
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_FDT_IS_SUPPORTED
extern const unsigned char bcm2711_rpi_4_b_dtb[];
extern const size_t bcm2711_rpi_4_b_dtb_size;
#define BSP_ARM_GIC_CPUIF_BASE 0xFF842000
#define BSP_ARM_GIC_DIST_BASE 0xFF841000
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_4_BSP_H */

View File

@@ -1,79 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2023 Utkarsh Verma
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_BSP_CONSOLE_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_CONSOLE_H
#include <bspopts.h>
#include <bsp/raspberrypi-uart.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define CONSOLE_DEVICES RASPBERRYPI_CONSOLE_DEVICES
#define CONSOLE_DEVICE_PORT2ENUM(port_no) UART##port_no
#define CONSOLE_DEVICE_ENUM(port_no, ...) CONSOLE_DEVICE_PORT2ENUM(port_no),
typedef enum {
CONSOLE_DEVICES(CONSOLE_DEVICE_ENUM)
CONSOLE_DEVICE_COUNT,
} raspberrypi_console_device_port;
/**
* @brief Initialize gpio of UART and install UART to the dev directory.
*
* @param uart_num The optional devices are UART0, UART2, UART3, UART4, UART5.
*
* @retval RTEMS_SUCCESSFUL Successful operation.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
* @retval RTEMS_NO_MEMORY Not enough memory to create a device node.
* @retval RTEMS_UNSATISFIED Creation of the device file failed.
* @retval RTEMS_INCORRECT_STATE Termios is not initialized.
*/
rtems_status_code raspberrypi_uart_init(
raspberrypi_console_device_port uart_num
);
#undef CONSOLE_DEVICE_ENUM
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_BSP_CONSOLE_H */

View File

@@ -1,121 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup raspberrypi_interrupt
*
* @brief Interrupt definitions.
*/
/**
* Copyright (c) 2013 Alan Cudmore
* Copyright (c) 2022 Mohd Noor Aman
* Copyright (c) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_ARM_RASPBERRYPI_IRQ_H
#define LIBBSP_ARM_RASPBERRYPI_IRQ_H
#ifndef ASM
#include <rtems.h>
#include <dev/irq/arm-gic-irq.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup raspberrypi_interrupt Interrupt Support
*
* @ingroup RTEMSBSPsARMRaspberryPi
*
* @brief Interrupt support.
*/
#define BCM2835_INTC_TOTAL_IRQ 216
#define BCM2835_IRQ_SET1_MIN 0
#define BCM2835_IRQ_SET2_MIN 32
#define BCM2711_IRQ_VC_PERIPHERAL_BASE 96
/* Interrupt Vectors: System Timer */
#define BCM2835_IRQ_ID_GPU_TIMER_M0 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 0)
#define BCM2835_IRQ_ID_GPU_TIMER_M1 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 1)
#define BCM2835_IRQ_ID_GPU_TIMER_M2 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 2)
#define BCM2835_IRQ_ID_GPU_TIMER_M3 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 3)
/* Interrupt Vectors: SPI */
#define BCM2711_IRQ_SPI (BCM2711_IRQ_VC_PERIPHERAL_BASE + 54)
/* Interrupt Vectors: I2C */
#define BCM2711_IRQ_I2C ( BCM2711_IRQ_VC_PERIPHERAL_BASE + 53 )
/* Interrupt Vectors: Videocore */
#define BCM2711_IRQ_VC_PERIPHERAL_BASE 96
#define BCM2711_IRQ_AUX (BCM2711_IRQ_VC_PERIPHERAL_BASE + 29)
#define BCM2711_IRQ_PL011_UART (BCM2711_IRQ_VC_PERIPHERAL_BASE + 57)
#define BCM2835_IRQ_ID_USB 9
#define BCM2835_IRQ_ID_AUX 29
#define BCM2835_IRQ_ID_SPI_SLAVE 43
#define BCM2835_IRQ_ID_PWA0 45
#define BCM2835_IRQ_ID_PWA1 46
#define BCM2835_IRQ_ID_SMI 48
#define BCM2835_IRQ_ID_GPIO_0 49
#define BCM2835_IRQ_ID_GPIO_1 50
#define BCM2835_IRQ_ID_GPIO_2 51
#define BCM2835_IRQ_ID_GPIO_3 52
#define BCM2835_IRQ_ID_I2C 53
#define BCM2835_IRQ_ID_SPI 54
#define BCM2835_IRQ_ID_PCM 55
#define BCM2835_IRQ_ID_UART 57
#define BCM2835_IRQ_ID_SD 62
#define BCM2835_IRQ_ID_BASIC_BASE_ID 64
#define BCM2835_IRQ_ID_TIMER_0 64
#define BCM2835_IRQ_ID_MAILBOX_0 65
#define BCM2835_IRQ_ID_DOORBELL_0 66
#define BCM2835_IRQ_ID_DOORBELL_1 67
#define BCM2835_IRQ_ID_GPU0_HALTED 68
#define BCM2835_IRQ_ID_GPU1_HALTED 69
#define BCM2835_IRQ_ID_ILL_ACCESS_1 70
#define BCM2835_IRQ_ID_ILL_ACCESS_0 71
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_NS_PPI 30
#define BSP_VPL011_SPI 32
#define BSP_INTERRUPT_VECTOR_COUNT BCM2835_INTC_TOTAL_IRQ
#define BSP_INTERRUPT_VECTOR_INVALID (UINT32_MAX)
#define BSP_IRQ_COUNT (BCM2835_INTC_TOTAL_IRQ)
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
#endif /* LIBBSP_ARM_RASPBERRYPI_IRQ_H */

View File

@@ -1,133 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief Raspberry Pi specific DMA definitions.
*/
/*
* Copyright (C) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_DMA_H
#define LIBBSP_AARCH64_RASPBERRYPI_DMA_H
#include <bsp/raspberrypi.h>
#include <bsp/rpi-gpio.h>
#include <bsp/utility.h>
#include <rtems/malloc.h>
#include <rtems/rtems/cache.h>
#include <rtems/score/basedefs.h>
#include <rtems/score/cpu.h>
#include <stdlib.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief DMA channel identifiers for BCM2711 (06 full, 710 lite, 1114 DMA4).
*/
typedef enum {
DMA_CHANNEL_0,
DMA_CHANNEL_1,
DMA_CHANNEL_2,
DMA_CHANNEL_3,
DMA_CHANNEL_4,
DMA_CHANNEL_5,
DMA_CHANNEL_6,
DMA_LITE_CHANNEL_7,
DMA_LITE_CHANNEL_8,
DMA_LITE_CHANNEL_9,
DMA_LITE_CHANNEL_10,
DMA4_CHANNEL_11,
DMA4_CHANNEL_12,
DMA4_CHANNEL_13,
DMA4_CHANNEL_14,
} rpi_dma_channel;
/**
* @brief Start a previously initialized DMA transfer on @a channel.
*
* Expects the channel's CONBLK_AD to point to a valid
* control block. Sets ACTIVE and required priorities.
*
* @param channel DMA channel to start.
* @retval RTEMS_SUCCESSFUL on success.
* @retval RTEMS_INVALID_NUMBER if @a channel is invalid.
*/
rtems_status_code rpi_dma_start_transfer( rpi_dma_channel channel );
/**
* @brief Block until the current DMA transfer on @a channel completes.
*
* Busy-waits for ACTIVE to clear and frees the control block previously
* programmed into CONBLK_AD (including DMA4 address unshifting). Does **not**
* invalidate/flush user buffers beyond setup done by the init helpers.
*
* @param channel DMA channel to wait on.
* @retval RTEMS_SUCCESSFUL on success.
* @retval RTEMS_INVALID_NUMBER if @a channel is invalid.
* @retval RTEMS_UNSATISFIED if the channel reports an error.
*/
rtems_status_code rpi_dma_wait( rpi_dma_channel channel );
/**
* @brief Initialize a memcpy-style DMA transfer from @a source_address to
* @a destination_address of @a transfer_length bytes on @a channel.
*
* Allocates and prepares the channel-specific control block, performs required
* cache maintenance (flush control block and source; invalidate destination),
* issues CS reset/abort, and writes CONBLK_AD (with DMA4 address packing via
* DMA4_AD_SHIFT). This function does **not** start the transfer; call
* ::rpi_dma_start_transfer() and then ::rpi_dma_wait().
*
* @param channel DMA channel to use (06 noarmal DMA, 710 lite,
* 1114 DMA4).
* @param source_address Source buffer (must be CPU_CACHE_LINE_BYTES
* aligned).
* @param destination_address Destination buffer (must be CPU_CACHE_LINE_BYTES
* aligned).
* @param transfer_length Number of bytes to copy.
* @retval RTEMS_SUCCESSFUL on success.
* @retval RTEMS_INVALID_NUMBER if @a channel is invalid/unsupported or has
* no base address.
* @retval RTEMS_INVALID_ADDRESS if @a source_address or @a
* destination_address are misaligned.
* @retval RTEMS_NO_MEMORY if control block allocation failed.
*/
rtems_status_code rpi_dma_mem_to_mem_init(
rpi_dma_channel channel,
void *source_address,
void *destination_address,
uint32_t transfer_length
);
#ifdef __cplusplus
}
#endif
#endif /* LIBBSP_AARCH64_RASPBERRYPI_DMA_H */

View File

@@ -1,100 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup raspberrypi_4_i2c
*
* @brief Raspberry Pi specific I2C definitions.
*/
/*
* Copyright (C) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_I2C_H
#define LIBBSP_AARCH64_RASPBERRYPI_I2C_H
#include <bsp/raspberrypi.h>
#include <bsp/rpi-gpio.h>
#include <bsp/utility.h>
#include <dev/i2c/i2c.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief I2C controller instances on Raspberry Pi 4.
*/
typedef enum {
/**
* @brief BSC Master 0 (GPIO 0/1)
*/
raspberrypi_bscm0,
/**
* @brief BSC Master 1 (GPIO 2/3)
*/
raspberrypi_bscm1,
/**
* @brief BSC Master 3 (GPIO 4/5)
*/
raspberrypi_bscm3,
/**
* @brief BSC Master 4 (GPIO 6/7)
*/
raspberrypi_bscm4,
/**
* @brief BSC Master 5 (GPIO 10/11)
*/
raspberrypi_bscm5,
/**
* @brief BSC Master 6 (GPIO 22/23)
*/
raspberrypi_bscm6
} raspberrypi_bsc_masters;
/**
* @brief Initialize the I2C bus for a specified master.
*
* @param device The BSC master to initialize.
* @param bus_clock The desired bus clock frequency in Hz.
*
* @return RTEMS status code indicating success or failure.
*/
rtems_status_code rpi_i2c_init(
raspberrypi_bsc_masters device,
uint32_t bus_clock
);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_I2C_H */

View File

@@ -1,118 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief Raspberry Pi specific PWM definitions.
*/
/*
* Copyright (C) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_4_PWM_H
#define LIBBSP_AARCH64_RASPBERRYPI_4_PWM_H
#include "bsp/raspberrypi.h"
#include "bsp/rpi-gpio.h"
#include "bsp/utility.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { raspberrypi_pwm0, raspberrypi_pwm1 } raspberrypi_pwm_channel;
typedef enum {
raspberrypi_pwm_master0,
raspberrypi_pwm_master1
} raspberrypi_pwm_master;
/**
* @name PWM_CONTROL register bits
* @{
*/
#define C_MSEN2 BSP_BIT32( 15 ) /**< Channel 2 Mark-Space enable */
#define C_USEF2 BSP_BIT32( 13 ) /**< Channel 2 use FIFO */
#define C_POLA2 BSP_BIT32( 12 ) /**< Channel 2 invert polarity */
#define C_SBIT2 BSP_BIT32( 11 ) /**< Channel 2 silence bit high */
#define C_RPTL2 BSP_BIT32( 10 ) /**< Channel 2 repeat on underrun */
#define C_MODE2 BSP_BIT32( 9 ) /**< Channel 2 serializer mode */
#define C_PWEN2 BSP_BIT32( 8 ) /**< Channel 2 enable output */
#define C_MSEN1 BSP_BIT32( 7 ) /**< Channel 1 Mark-Space enable */
#define C_CLRF BSP_BIT32( 6 ) /**< Clear FIFO */
#define C_USEF1 BSP_BIT32( 5 ) /**< Channel 1 use FIFO */
#define C_POLA1 BSP_BIT32( 4 ) /**< Channel 1 invert polarity */
#define C_SBIT1 BSP_BIT32( 3 ) /**< Channel 1 silence bit high */
#define C_RPTL1 BSP_BIT32( 2 ) /**< Channel 1 repeat underrun */
#define C_MODE1 BSP_BIT32( 1 ) /**< Channel 1 serializer mode */
#define C_PWEN1 BSP_BIT32( 0 ) /**< Channel 1 enable output */
/** @} */
/**
* @brief Set PWM clock divider.
* @param divisor 1 4095; PWMCLK = 19.2 MHz / @p divisor.
* @retval RTEMS_SUCCESSFUL OK
* @retval RTEMS_INVALID_NUMBER 0 or >4095
*/
rtems_status_code rpi_pwm_set_clock( uint32_t divisor );
/**
* @brief Update duty-cycle register.
* @param master Selects the hardware instance to be used
* (raspberrypi_pwm_master0 = PWM0, raspberrypi_pwm_master1 = PWM1)
* @param channel Selects the channel for @p master (raspberrypi_pwm0 = PWMx_0,
* raspberrypi_pwm1 = PWMx_1)
* @param data Initial duty count, 1 current range value.(0 rejected)
*/
rtems_status_code rpi_pwm_set_data(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel,
uint32_t data
);
/**
* @brief Main PWM initialization function. This functions sets up the PWM
* master, channel, duty cycle and GPIO pin.
* @param master Selects the hardware instance to be used
* (raspberrypi_pwm_master0 = PWM0, raspberrypi_pwm_master1 = PWM1)
* @param channel Selects the channel for @p master (raspberrypi_pwm0 = PWMx_0,
* raspberrypi_pwm1 = PWMx_1)
* @param range Period register value (> 0)
* @param data Initial duty count, 1 @p range (0 rejected)
*/
rtems_status_code rpi_pwm_init(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel,
uint32_t range,
uint32_t data
);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_4_PWM_H */

View File

@@ -1,130 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup raspberrypi_4_spi
*
* @brief Raspberry Pi specific SPI definitions.
*/
/*
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H
#define LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H
#include <bsp/utility.h>
#include <bsp/rpi-gpio.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
uint32_t spics;
#define RPI_SPICS_LEN_LONG BSP_BIT32(25)
#define RPI_SPICS_DMA_LEN BSP_BIT32(24)
#define RPI_SPICS_CSPOL2 BSP_BIT32(23)
#define RPI_SPICS_CSPOL1 BSP_BIT32(22)
#define RPI_SPICS_CSPOL0 BSP_BIT32(21)
#define RPI_SPICS_RXF BSP_BIT32(20)
#define RPI_SPICS_RXR BSP_BIT32(19)
#define RPI_SPICS_TXD BSP_BIT32(18)
#define RPI_SPICS_RXD BSP_BIT32(17)
#define RPI_SPICS_DONE BSP_BIT32(16)
#define RPI_SPICS_LEN BSP_BIT32(13)
#define RPI_SPICS_REN BSP_BIT32(12)
#define RPI_SPICS_ADCS BSP_BIT32(11)
#define RPI_SPICS_INTR BSP_BIT32(10)
#define RPI_SPICS_INTD BSP_BIT32(9)
#define RPI_SPICS_DMAEN BSP_BIT32(8)
#define RPI_SPICS_TA BSP_BIT32(7)
#define RPI_SPICS_CSPOL BSP_BIT32(6)
#define RPI_SPICS_CLEAR_TX BSP_BIT32(5)
#define RPI_SPICS_CLEAR_RX BSP_BIT32(4)
#define RPI_SPICS_CPOL BSP_BIT32(3)
#define RPI_SPICS_CPHA BSP_BIT32(2)
#define RPI_SPICS_CS(val) BSP_FLD32(val, 0, 1)
#define RPI_SPICS_CS_SET(reg,val) BSP_FLD32SET(reg, val, 0, 1)
uint32_t spififo;
#define RPI_SPIFIFO_DATA(val) BSP_FLD32(val, 0, 31)
#define RPI_SPIFIFO_DATA_GET(reg) BSP_FLD32GET(reg, 0, 31)
#define RPI_SPIFIFO_DATA_SET(reg, val) BSP_FLD32SET(reg, val, 0, 31)
uint32_t spiclk;
#define RPI_SPICLK_CDIV(val) BSP_FLD32(val, 0, 15)
#define RPI_SPICLK_CDIV_GET(reg) BSP_FLD32GET(reg, 0, 15)
#define RPI_SPICLK_CDIV_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
uint32_t spidlen;
#define RPI_SPIDLEN_LEN(val) BSP_FLD32(val, 0, 15)
#define RPI_SPIDLEN_LEN_GET(reg) BSP_FLD32GET(reg, 0, 15)
#define RPI_SPIDLEN_LEN_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
uint32_t spiltoh;
#define RPI_SPILTOH_TOH(val) BSP_FLD32(val, 0, 3)
#define RPI_SPILTOH_TOH_GET(reg) BSP_FLD32GET(reg, 0, 3)
#define RPI_SPILTOH_TOH_SET(reg, val) BSP_FLD32SET(reg, val, 0, 3)
uint32_t spidc;
#define RPI_SPIDC_RPANIC(val) BSP_FLD32(val, 24, 31)
#define RPI_SPIDC_RPANIC_GET(reg) BSP_FLD32GET(reg, 24, 31)
#define RPI_SPIDC_RPANIC_SET(reg, val) BSP_FLD32SET(reg, val, 24, 31)
#define RPI_SPIDC_RDREQ(val) BSP_FLD32(val, 16, 23)
#define RPI_SPIDC_RDREQ_GET(reg) BSP_FLD32GET(reg, 16, 23)
#define RPI_SPIDC_RDREQ_SET(reg, val) BSP_FLD32SET(reg, val, 16, 23)
#define RPI_SPIDC_TPANIC(val) BSP_FLD32(val, 8, 15)
#define RPI_SPIDC_TPANIC_GET(reg) BSP_FLD32GET(reg, 8, 15)
#define RPI_SPIDC_TPANIC_SET(reg, val) BSP_FLD32SET(reg, val, 8, 15)
#define RPI_SPIDC_TDREQ(val) BSP_FLD32(val, 0, 7)
#define RPI_SPIDC_TDREQ_GET(reg) BSP_FLD32GET(reg, 0, 7)
#define RPI_SPIDC_TDREQ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 7)
} raspberrypi_spi;
typedef enum {
raspberrypi_SPI0,
raspberrypi_SPI3,
raspberrypi_SPI4,
raspberrypi_SPI5,
raspberrypi_SPI6
} raspberrypi_spi_device;
/**
* @brief Register a spi device.
*
* @param device The optional devices are raspberrypi_SPI0, raspberrypi_SPI3,
* raspberrypi_SPI4, raspberrypi_SPI5, raspberrypi_SPI6.
*
* @retval RTEMS_SUCCESSFUL Successfully registered SPI device.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
* @retval RTEMS_UNSATISFIED This status code indicates that the request was
* not satisfied.
*/
rtems_status_code raspberrypi_spi_init(raspberrypi_spi_device device);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H */

View File

@@ -1,81 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Raspberry Pi 4B Console Device Definitions
*/
/*
* Copyright (C) 2023 Utkarsh Verma
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_BSP_RASPBERRYPI_UART_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_RASPBERRYPI_UART_H
#include <bspopts.h>
#include <bsp/irq.h>
#include <bsp/raspberrypi.h>
#include <bsp/rpi-gpio.h>
#include <dev/serial/arm-pl011.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This macro exists to serve as a common point of definition for the
* parameters of the UARTs present in the Raspberry Pi 4. It is used in
* multiple locations with different rendering macros to prevent duplication
* of information.
*/
#define RASPBERRYPI_CONSOLE_DEVICES(CONSOLE_DEVICE_DEFINITION_RENDERER) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
0, "/dev/ttyAMA0", BCM2711_UART0_BASE,BCM2711_UART0_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 15, 14, GPIO_AF0) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
2, "/dev/ttyAMA1", BCM2711_UART2_BASE, BCM2711_UART2_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 1, 0, GPIO_AF4) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
3, "/dev/ttyAMA2", BCM2711_UART3_BASE, BCM2711_UART3_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 5, 4, GPIO_AF4) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
4, "/dev/ttyAMA3", BCM2711_UART4_BASE, BCM2711_UART4_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 9, 8, GPIO_AF4) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
5, "/dev/ttyAMA4", BCM2711_UART5_BASE, BCM2711_UART5_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 13, 12, GPIO_AF4)
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_BSP_RASPBERRYPI_UART_H */

View File

@@ -1,639 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup raspberrypi_4_regs
*
* @brief Register definitions.
*/
/*
* Copyright (c) 2022 Mohd Noor Aman
* Copyright (c) 2024 Ning Yang
* Copyright (c) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_RASPBERRYPI_4_H
#define LIBBSP_AARCH64_RASPBERRYPI_RASPBERRYPI_4_H
#include <bsp/utility.h>
#include <bspopts.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup raspberrypi_reg Register Definitions
*
* @ingroup RTEMSBSPsARMRaspberryPi
*
* @brief Register Definitions
*
* @{
*/
/**
* @name Register Macros
*
* @{
*/
#define BCM2711_REG( x ) ( *(volatile uintptr_t *) ( x ) )
#define BCM2711_BIT( n ) ( 1 << ( n ) )
#define BCM2835_REG( addr ) ( *(volatile uint32_t *) (uintptr_t) ( addr ) )
/** @} */
/**
* @name Peripheral Base Register Address
*
* @{
*/
#define RPI_PERIPHERAL_BASE 0xFE000000
#define BASE_OFFSET 0xFE000000
#define RPI_PERIPHERAL_SIZE 0x01800000
/**
* @name Bus to Physical address translation
* Macro.
* @{
*/
#define BUS_TO_PHY( x ) ( ( x ) - BASE_OFFSET )
/** @} */
/**
* @name Internal ARM Timer Registers
*
* @{
*/
#define BCM2711_CLOCK_FREQ 250000000
#define BCM2711_TIMER_BASE ( RPI_PERIPHERAL_BASE + 0xB400 )
#define BCM2711_TIMER_LOD ( BCM2711_TIMER_BASE + 0x00 )
#define BCM2711_TIMER_VAL ( BCM2711_TIMER_BASE + 0x04 )
#define BCM2711_TIMER_CTL ( BCM2711_TIMER_BASE + 0x08 )
#define BCM2711_TIMER_CLI ( BCM2711_TIMER_BASE + 0x0C )
#define BCM2711_TIMER_RIS ( BCM2711_TIMER_BASE + 0x10 )
#define BCM2711_TIMER_MIS ( BCM2711_TIMER_BASE + 0x14 )
#define BCM2711_TIMER_RLD ( BCM2711_TIMER_BASE + 0x18 )
#define BCM2711_TIMER_DIV ( BCM2711_TIMER_BASE + 0x1C )
#define BCM2711_TIMER_CNT ( BCM2711_TIMER_BASE + 0x20 )
#define BCM2711_TIMER_PRESCALE 0xF9
/** @} */
/**
* @name Power Management and Watchdog Registers
*
* @{
*/
#define BCM2711_PM_PASSWD_MAGIC 0x5a000000
#define BCM2711_PM_BASE ( RPI_PERIPHERAL_BASE + 0x100000 )
#define BCM2711_PM_GNRIC ( BCM2711_PM_BASE + 0x00 )
#define BCM2711_PM_GNRIC_POWUP 0x00000001
#define BCM2711_PM_GNRIC_POWOK 0x00000002
#define BCM2711_PM_GNRIC_ISPOW 0x00000004
#define BCM2711_PM_GNRIC_MEMREP 0x00000008
#define BCM2711_PM_GNRIC_MRDONE 0x00000010
#define BCM2711_PM_GNRIC_ISFUNC 0x00000020
#define BCM2711_PM_GNRIC_RSTN 0x00000fc0
#define BCM2711_PM_GNRIC_ENAB 0x00001000
#define BCM2711_PM_GNRIC_CFG 0x007f0000
#define BCM2711_PM_AUDIO ( BCM2711_PM_BASE + 0x04 )
#define BCM2711_PM_AUDIO_APSM 0x000fffff
#define BCM2711_PM_AUDIO_CTRLEN 0x00100000
#define BCM2711_PM_AUDIO_RSTN 0x00200000
#define BCM2711_PM_STATUS ( BCM2711_PM_BASE + 0x18 )
#define BCM2711_PM_RSTC ( BCM2711_PM_BASE + 0x1c )
#define BCM2711_PM_RSTC_DRCFG 0x00000003
#define BCM2711_PM_RSTC_WRCFG 0x00000030
#define BCM2711_PM_RSTC_WRCFG_FULL 0x00000020
#define BCM2711_PM_RSTC_WRCFG_CLR 0xffffffcf
#define BCM2711_PM_RSTC_SRCFG 0x00000300
#define BCM2711_PM_RSTC_QRCFG 0x00003000
#define BCM2711_PM_RSTC_FRCFG 0x00030000
#define BCM2711_PM_RSTC_HRCFG 0x00300000
#define BCM2711_PM_RSTC_RESET 0x00000102
#define BCM2711_PM_RSTS ( BCM2711_PM_BASE + 0x20 )
#define BCM2711_PM_RSTS_HADDRQ 0x00000001
#define BCM2711_PM_RSTS_HADDRF 0x00000002
#define BCM2711_PM_RSTS_HADDRH 0x00000004
#define BCM2711_PM_RSTS_HADWRQ 0x00000010
#define BCM2711_PM_RSTS_HADWRF 0x0000002
#define BCM2711_PM_RSTS_HADWRH 0x00000040
#define BCM2711_PM_RSTS_HADSRQ 0x00000100
#define BCM2711_PM_RSTS_HADSRF 0x00000200
#define BCM2711_PM_RSTS_HADSRH 0x00000400
#define BCM2711_PM_RSTS_HADPOR 0x00001000
#define BCM2711_PM_WDOG ( BCM2711_PM_BASE + 0x24 )
#define BCM2711_PM_WDOG_MASK 0x000fffff
/** @} */
/** @} */
/**
* @name AUX Registers
*
* @{
*/
#define BCM2711_AUX_BASE ( RPI_PERIPHERAL_BASE + 0x215000 )
#define AUX_ENABLES ( BCM2711_AUX_BASE + 0x04 )
#define AUX_MU_IO_REG ( BCM2711_AUX_BASE + 0x40 )
#define AUX_MU_IER_REG ( BCM2711_AUX_BASE + 0x44 )
#define AUX_MU_IIR_REG ( BCM2711_AUX_BASE + 0x48 )
#define AUX_MU_LCR_REG ( BCM2711_AUX_BASE + 0x4C )
#define AUX_MU_MCR_REG ( BCM2711_AUX_BASE + 0x50 )
#define AUX_MU_LSR_REG ( BCM2711_AUX_BASE + 0x54 )
#define AUX_MU_MSR_REG ( BCM2711_AUX_BASE + 0x58 )
#define AUX_MU_SCRATCH ( BCM2711_AUX_BASE + 0x5C )
#define AUX_MU_CNTL_REG ( BCM2711_AUX_BASE + 0x60 )
#define AUX_MU_STAT_REG ( BCM2711_AUX_BASE + 0x64 )
#define AUX_MU_BAUD_REG ( BCM2711_AUX_BASE + 0x68 )
/** @} */
/**
* @name PL011 UARTs
*
* @{
*/
#define BCM2711_PL011_BASE ( RPI_PERIPHERAL_BASE + 0x201000 )
#define BCM2711_PL011_SIZE 0xc00
#define BCM2711_PL011_DEVICE_SIZE 0x200
#define BCM2711_UART0_BASE ( BCM2711_PL011_BASE + 0x000 )
#define BCM2711_UART0_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART2_BASE ( BCM2711_PL011_BASE + 0x400 )
#define BCM2711_UART2_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART3_BASE ( BCM2711_PL011_BASE + 0x600 )
#define BCM2711_UART3_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART4_BASE ( BCM2711_PL011_BASE + 0x800 )
#define BCM2711_UART4_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART5_BASE ( BCM2711_PL011_BASE + 0xa00 )
#define BCM2711_UART5_SIZE BCM2711_PL011_DEVICE_SIZE
/** @} */
/**
* @name GPU Timer Registers
*
* @{
*/
/**
* NOTE: The GPU uses Compare registers 0 and 2 for
* it's own RTOS. 1 and 3 are available for use in
* RTEMS.
*/
#define BCM2711_GPU_TIMER_BASE ( RPI_PERIPHERAL_BASE + 0x3000 )
#define BCM2711_GPU_TIMER_CS ( BCM2711_GPU_TIMER_BASE + 0x00 )
#define BCM2711_GPU_TIMER_CS_M0 0x00000001
#define BCM2711_GPU_TIMER_CS_M1 0x00000002
#define BCM2711_GPU_TIMER_CS_M2 0x00000004
#define BCM2711_GPU_TIMER_CS_M3 0x00000008
#define BCM2711_GPU_TIMER_CLO ( BCM2711_GPU_TIMER_BASE + 0x04 )
#define BCM2711_GPU_TIMER_CHI ( BCM2711_GPU_TIMER_BASE + 0x08 )
#define BCM2711_GPU_TIMER_C0 ( BCM2711_GPU_TIMER_BASE + 0x0C )
#define BCM2711_GPU_TIMER_C1 ( BCM2711_GPU_TIMER_BASE + 0x10 )
#define BCM2711_GPU_TIMER_C2 ( BCM2711_GPU_TIMER_BASE + 0x14 )
#define BCM2711_GPU_TIMER_C3 ( BCM2711_GPU_TIMER_BASE + 0x18 )
/**
* NOTE: compatible with the BCM2835 system timer
*/
#define BCM2835_GPU_TIMER_CS_M3 BCM2711_GPU_TIMER_CS_M3
#define BCM2835_GPU_TIMER_C3 BCM2711_GPU_TIMER_C3
#define BCM2835_GPU_TIMER_CLO BCM2711_GPU_TIMER_CLO
#define BCM2835_GPU_TIMER_CS BCM2711_GPU_TIMER_CS
/** @} */
/**
* @name GPIO Registers
*
* @{
*/
#define BCM2711_GPIO_BASE ( RPI_PERIPHERAL_BASE + 0x200000 )
#define BCM2711_GPIO_SIZE 0xf4
#define BCM2711_GPIO_PIN_COUNT 58
/** @} */
/**
* @name EMMC Registers
*
* @{
*/
/**
* NOTE: Since the SD controller follows the SDHCI standard,
* the rtems-libbsd tree already provides the remaining registers.
*/
#define BCM2711_EMMC_BASE ( RPI_PERIPHERAL_BASE + 0x300000 )
/** @} */
/**
* @name SPI Registers
*
* @{
*/
#define BCM2711_SPI0_BASE ( RPI_PERIPHERAL_BASE + 0x204000 )
#define BCM2711_SPI3_BASE ( RPI_PERIPHERAL_BASE + 0x204600 )
#define BCM2711_SPI4_BASE ( RPI_PERIPHERAL_BASE + 0x204800 )
#define BCM2711_SPI5_BASE ( RPI_PERIPHERAL_BASE + 0x204A00 )
#define BCM2711_SPI6_BASE ( RPI_PERIPHERAL_BASE + 0x204C00 )
/** @} */
/**
* @name PWM Clock Manager Register and Offsets
*
* @{
*/
#define BCM2711_CM_PWM_BASE ( RPI_PERIPHERAL_BASE + 0x00101000 )
#define BCM2711_CM_PWM_CTL 0xA0
#define BCM2711_CM_PWM_DIV 0xA4
#define CM_PWM_PASSWD ( 0x5A << 24 )
#define CM_PWM_CTL_SRC_OSC BSP_BIT32( 0 )
#define CM_PWM_CTL_BUSY BSP_BIT32( 7 )
#define CM_PWM_CTL_ENAB BSP_BIT32( 4 )
#define CM_PWM_DIV_MASK 0xFFF
/** @} */
/**
* @name PWM Registers and offsets
*
* @{
*/
#define BCM2711_PWM0_BASE ( RPI_PERIPHERAL_BASE + 0x0020C000 )
#define BCM2711_PWM1_BASE ( RPI_PERIPHERAL_BASE + 0x0020C800 )
#define BCM2711_PWM_CONTROL 0x00
#define BCM2711_PWM_STATUS 0x04
#define BCM2711_PWM_DMAC 0x08
#define BCM2711_PWM_RNG1 0x10
#define BCM2711_PWM_DAT1 0x14
#define BCM2711_PWM_FIFO 0x18
#define BCM2711_PWM_RNG2 0x20
#define BCM2711_PWM_DAT2 0x24
/** @} */
/**
* @name I2C Registers
*
* @{
*/
#define BCM2711_I2C0_BASE ( RPI_PERIPHERAL_BASE + 0x00205000 )
#define BCM2711_I2C1_BASE ( RPI_PERIPHERAL_BASE + 0x00804000 )
#define BCM2711_I2C3_BASE ( RPI_PERIPHERAL_BASE + 0x00205600 )
#define BCM2711_I2C4_BASE ( RPI_PERIPHERAL_BASE + 0x00205800 )
#define BCM2711_I2C5_BASE ( RPI_PERIPHERAL_BASE + 0x00205a80 )
#define BCM2711_I2C6_BASE ( RPI_PERIPHERAL_BASE + 0x00205c00 )
#define BCM2711_I2C_CONTROL 0x0
#define BCM2711_I2C_STATUS 0x4
#define BCM2711_I2C_DLEN 0x8
#define BCM2711_I2C_SLAVE_ADDRESS 0xc
#define BCM2711_I2C_FIFO 0x10
#define BCM2711_I2C_DIV 0x14
#define BCM2711_DELAY 0x18
#define BCM2711_I2C_CLKT 0x1c
#define BCM2711_I2C_FIFO_MASK 0xFF
#define BCM2711_I2C_DLEN_MASK 0xFFFF
#define BCM2711_10_BIT_ADDR_MASK 0x78
/** @} */
/**
* @name DMA Registers
*
* @{
*/
#define BCM2711_DMA0_BASE ( RPI_PERIPHERAL_BASE + 0x00007000 )
#define BCM2711_DMA1_BASE ( BCM2711_DMA0_BASE + 0x100 )
#define BCM2711_DMA2_BASE ( BCM2711_DMA0_BASE + 0x200 )
#define BCM2711_DMA3_BASE ( BCM2711_DMA0_BASE + 0x300 )
#define BCM2711_DMA4_BASE ( BCM2711_DMA0_BASE + 0x400 )
#define BCM2711_DMA5_BASE ( BCM2711_DMA0_BASE + 0x500 )
#define BCM2711_DMA6_BASE ( BCM2711_DMA0_BASE + 0x600 )
#define BCM2711_DMA7_BASE ( BCM2711_DMA0_BASE + 0x700 )
#define BCM2711_DMA8_BASE ( BCM2711_DMA0_BASE + 0x800 )
#define BCM2711_DMA9_BASE ( BCM2711_DMA0_BASE + 0x900 )
#define BCM2711_DMA10_BASE ( BCM2711_DMA0_BASE + 0xa00 )
#define BCM2711_DMA11_BASE ( BCM2711_DMA0_BASE + 0xb00 )
#define BCM2711_DMA12_BASE ( BCM2711_DMA0_BASE + 0xc00 )
#define BCM2711_DMA13_BASE ( BCM2711_DMA0_BASE + 0xd00 )
#define BCM2711_DMA14_BASE ( BCM2711_DMA0_BASE + 0xe00 )
#define ENABLE ( RPI_PERIPHERAL_BASE + 0x00007FF0 )
#define CS_OFFSET 0x00
#define CONBLK_AD_OFFSET 0x04
#define DEBUG_OFFSET 0x020
#define INT_STATUS_OFFSET 0xfe0
#define CS_RESET ( 1 << 31 )
#define CS_ABORT ( 1 << 30 )
#define CS_END ( 1 << 1 )
#define CS_WAIT_FOR_OUTSTANDING_WRITES ( 1 << 28 )
#define CS_PRIORITY_SHIFT ( 1 << 16 )
#define CS_PANIC_PRIORITY_SHIFT ( 15 << 20 )
#define CS_ACTIVE ( 1 << 0 )
#define CS_ERROR ( 1 << 8 )
#define TI_DEST_INC ( 1 << 4 )
#define TI_SRC_INC ( 1 << 8 )
#define TI_SRC_WIDTH ( 1 << 9 )
#define TI_DEST_WIDTH ( 1 << 5 )
#define TI_PERMAP( x ) ( ( x ) << 16 )
#define TI_SRC_DREQ ( 1 << 10 )
#define TI_DEST_DREQ ( 1 << 6 )
#define TI_WAIT_RESP ( 1 << 3 )
#define TI_NO_WIDE_BURSTS ( 1 << 26 )
#define SI_SRC_INC ( 1 << 12 )
#define DI_DEST_INC ( 1 << 12 )
/** @} */
/**
* @name Mailbox Registers
*
* @{
*/
#define BCM2711_MBOX_BASE ( RPI_PERIPHERAL_BASE + 0xB880 )
#define BCM2711_MBOX_READ ( BCM2711_MBOX_BASE + 0x00 )
#define BCM2711_MBOX_PEEK ( BCM2711_MBOX_BASE + 0x10 )
#define BCM2711_MBOX_SENDER ( BCM2711_MBOX_BASE + 0x14 )
#define BCM2711_MBOX_STATUS ( BCM2711_MBOX_BASE + 0x18 )
#define BCM2711_MBOX_WRITE ( BCM2711_MBOX_BASE + 0x20 )
#define BCM2711_MBOX_CONFIG ( BCM2711_MBOX_BASE + 0x1C )
#define BCM2711_MBOX_RESPONSE 0x80000000
#define BCM2711_MBOX_FULL 0x80000000
#define BCM2711_MBOX_EMPTY 0x40000000
/** @} */
/**
* @name Mailbox Channels
*
* @{
*/
/* Power Manager channel */
#define BCM2711_MBOX_CHANNEL_PM 0
/* Framebuffer channel */
#define BCM2711_MBOX_CHANNEL_FB 1
/* Virtual UART channel */
#define BCM2711_MBOX_CHANNEL_VUART 2
/* VCHIQ channel */
#define BCM2711_MBOX_CHANNEL_VCHIQ 3
/* LEDs channel */
#define BCM2711_MBOX_CHANNEL_LED 4
/* Button channel */
#define BCM2711_MBOX_CHANNEL_BUTTON 5
/* Touch screen channel */
#define BCM2711_MBOX_CHANNEL_TOUCHS 6
#define BCM2711_MBOX_CHANNEL_COUNT 7
/* Property tags (ARM <-> VC) channel */
#define BCM2711_MBOX_CHANNEL_PROP_AVC 8
/* Property tags (VC <-> ARM) channel */
#define BCM2711_MBOX_CHANNEL_PROP_VCA 9
/** @} */
/**
* @name Raspberry Pi 2 Interrupt Register Defines
*
* @{
*/
/* Timers interrupt control registers */
#define BCM2711_CORE0_TIMER_IRQ_CTRL_BASE 0xFF800040
#define BCM2711_CORE1_TIMER_IRQ_CTRL_BASE 0xFF800044
#define BCM2711_CORE2_TIMER_IRQ_CTRL_BASE 0xFF800048
#define BCM2711_CORE3_TIMER_IRQ_CTRL_BASE 0xFF80004C
#define BCM2711_CORE_TIMER_IRQ_CTRL( cpuidx ) \
( BCM2711_CORE0_TIMER_IRQ_CTRL_BASE + 0x4 * ( cpuidx ) )
/**
* @name Raspberry Pi 4 ARM_LOCAL registers
*
* @{
*/
#define BCM2711_LOCAL_REGS_BASE 0x4C0000000
#define BCM2711_LOCAL_REGS_SIZE 0x100
#define BCM2711_LOCAL_ARM_CONTROL ( BCM2711_LOCAL_REGS_BASE + 0x00 )
#define BCM2711_LOCAL_CORE_IRQ_CONTROL ( BCM2711_LOCAL_REGS_BASE + 0x0c )
#define BCM2711_LOCAL_PMU_CONTROL_SET ( BCM2711_LOCAL_REGS_BASE + 0x10 )
#define BCM2711_LOCAL_PMU_CONTROL_CLR ( BCM2711_LOCAL_REGS_BASE + 0x14 )
#define BCM2711_LOCAL_PERI_IRQ_ROUTE0 ( BCM2711_LOCAL_REGS_BASE + 0x24 )
#define BCM2711_LOCAL_AXI_QUIET_TIME ( BCM2711_LOCAL_REGS_BASE + 0x30 )
#define BCM2711_LOCAL_LOCAL_TIMER_CONTROL ( BCM2711_LOCAL_REGS_BASE + 0x34 )
#define BCM2711_LOCAL_LOCAL_TIMER_IRQ ( BCM2711_LOCAL_REGS_BASE + 0x38 )
#define BCM2711_LOCAL_TIMER_CNTRL0 ( BCM2711_LOCAL_REGS_BASE + 0x40 )
#define BCM2711_LOCAL_TIMER_CNTRL1 ( BCM2711_LOCAL_REGS_BASE + 0x44 )
#define BCM2711_LOCAL_TIMER_CNTRL2 ( BCM2711_LOCAL_REGS_BASE + 0x48 )
#define BCM2711_LOCAL_TIMER_CNTRL3 ( BCM2711_LOCAL_REGS_BASE + 0x4c )
#define BCM2711_LOCAL_MAILBOX_CNTRL0 ( BCM2711_LOCAL_REGS_BASE + 0x50 )
#define BCM2711_LOCAL_MAILBOX_CNTRL1 ( BCM2711_LOCAL_REGS_BASE + 0x54 )
#define BCM2711_LOCAL_MAILBOX_CNTRL2 ( BCM2711_LOCAL_REGS_BASE + 0x58 )
#define BCM2711_LOCAL_MAILBOX_CNTRL3 ( BCM2711_LOCAL_REGS_BASE + 0x5c )
#define BCM2711_LOCAL_IRQ_SOURCE0 ( BCM2711_LOCAL_REGS_BASE + 0x60 )
#define BCM2711_LOCAL_IRQ_SOURCE1 ( BCM2711_LOCAL_REGS_BASE + 0x64 )
#define BCM2711_LOCAL_IRQ_SOURCE2 ( BCM2711_LOCAL_REGS_BASE + 0x68 )
#define BCM2711_LOCAL_IRQ_SOURCE3 ( BCM2711_LOCAL_REGS_BASE + 0x6c )
#define BCM2711_LOCAL_FIQ_SOURCE0 ( BCM2711_LOCAL_REGS_BASE + 0x70 )
#define BCM2711_LOCAL_FIQ_SOURCE1 ( BCM2711_LOCAL_REGS_BASE + 0x74 )
#define BCM2711_LOCAL_FIQ_SOURCE2 ( BCM2711_LOCAL_REGS_BASE + 0x78 )
#define BCM2711_LOCAL_FIQ_SOURCE3 ( BCM2711_LOCAL_REGS_BASE + 0x7c )
/**
* @name Raspberry Pi 4 Mailbox registers
*
* @{
*/
#define BCM2711_MAILBOX_00_WRITE_SET_BASE 0x4C000080
#define BCM2711_MAILBOX_01_WRITE_SET_BASE 0x4C000084
#define BCM2711_MAILBOX_02_WRITE_SET_BASE 0x4C000088
#define BCM2711_MAILBOX_03_WRITE_SET_BASE 0x4C00008C
#define BCM2711_MAILBOX_04_WRITE_SET_BASE 0x4C000090
#define BCM2711_MAILBOX_05_WRITE_SET_BASE 0x4C000094
#define BCM2711_MAILBOX_06_WRITE_SET_BASE 0x4C000098
#define BCM2711_MAILBOX_07_WRITE_SET_BASE 0x4C00009C
#define BCM2711_MAILBOX_08_WRITE_SET_BASE 0x4C0000A0
#define BCM2711_MAILBOX_09_WRITE_SET_BASE 0x4C0000A4
#define BCM2711_MAILBOX_10_WRITE_SET_BASE 0x4C0000A8
#define BCM2711_MAILBOX_11_WRITE_SET_BASE 0x4C0000AC
#define BCM2711_MAILBOX_12_WRITE_SET_BASE 0x4C0000B0
#define BCM2711_MAILBOX_13_WRITE_SET_BASE 0x4C0000B4
#define BCM2711_MAILBOX_14_WRITE_SET_BASE 0x4C0000B8
#define BCM2711_MAILBOX_15_WRITE_SET_BASE 0x4C0000BC
#define BCM2711_MAILBOX_00_READ_CLEAR_BASE 0x4C0000C0
#define BCM2711_MAILBOX_01_READ_CLEAR_BASE 0x4C0000C4
#define BCM2711_MAILBOX_02_READ_CLEAR_BASE 0x4C0000C8
#define BCM2711_MAILBOX_03_READ_CLEAR_BASE 0x4C0000CC
#define BCM2711_MAILBOX_04_READ_CLEAR_BASE 0x4C0000D0
#define BCM2711_MAILBOX_05_READ_CLEAR_BASE 0x4C0000D4
#define BCM2711_MAILBOX_06_READ_CLEAR_BASE 0x4C0000D8
#define BCM2711_MAILBOX_07_READ_CLEAR_BASE 0x4C0000DC
#define BCM2711_MAILBOX_08_READ_CLEAR_BASE 0x4C0000E0
#define BCM2711_MAILBOX_09_READ_CLEAR_BASE 0x4C0000E4
#define BCM2711_MAILBOX_10_READ_CLEAR_BASE 0x4C0000E8
#define BCM2711_MAILBOX_11_READ_CLEAR_BASE 0x4C0000EC
#define BCM2711_MAILBOX_12_READ_CLEAR_BASE 0x4C0000F0
#define BCM2711_MAILBOX_13_READ_CLEAR_BASE 0x4C0000F4
#define BCM2711_MAILBOX_14_READ_CLEAR_BASE 0x4C0000F8
#define BCM2711_MAILBOX_15_READ_CLEAR_BASE 0x4C0000FC
/**
* @name Raspberry Pi 4 ARM_C FIQ and IRQ registers
*
* @{
*/
#define BCM2711_ARMC_REGS_BASE ( RPI_PERIPHERAL_BASE + 0xB200 )
#define BCM2711_ARMC_REGS_SIZE 0x200
#define BCM2711_ARMC_IRQ0_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x00 )
#define BCM2711_ARMC_IRQ0_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x04 )
#define BCM2711_ARMC_IRQ0_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x08 )
#define BCM2711_ARMC_IRQ0_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x10 )
#define BCM2711_ARMC_IRQ0_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x14 )
#define BCM2711_ARMC_IRQ0_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x18 )
#define BCM2711_ARMC_IRQ0_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x20 )
#define BCM2711_ARMC_IRQ0_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x24 )
#define BCM2711_ARMC_IRQ0_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x28 )
#define BCM2711_ARMC_IRQ_STATUS0 ( BCM2711_ARMC_REGS_BASE + 0x30 )
#define BCM2711_ARMC_IRQ_STATUS1 ( BCM2711_ARMC_REGS_BASE + 0x34 )
#define BCM2711_ARMC_IRQ_STATUS2 ( BCM2711_ARMC_REGS_BASE + 0x38 )
#define BCM2711_ARMC_IRQ1_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x40 )
#define BCM2711_ARMC_IRQ1_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x44 )
#define BCM2711_ARMC_IRQ1_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x48 )
#define BCM2711_ARMC_IRQ1_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x50 )
#define BCM2711_ARMC_IRQ1_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x54 )
#define BCM2711_ARMC_IRQ1_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x58 )
#define BCM2711_ARMC_IRQ1_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x60 )
#define BCM2711_ARMC_IRQ1_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x64 )
#define BCM2711_ARMC_IRQ1_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x68 )
#define BCM2711_ARMC_IRQ2_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x80 )
#define BCM2711_ARMC_IRQ2_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x84 )
#define BCM2711_ARMC_IRQ2_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x88 )
#define BCM2711_ARMC_IRQ2_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x90 )
#define BCM2711_ARMC_IRQ2_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x94 )
#define BCM2711_ARMC_IRQ2_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x98 )
#define BCM2711_ARMC_IRQ2_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0xA0 )
#define BCM2711_ARMC_IRQ2_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0xA4 )
#define BCM2711_ARMC_IRQ2_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0xA8 )
#define BCM2711_ARMC_IRQ3_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0xC0 )
#define BCM2711_ARMC_IRQ3_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0xC4 )
#define BCM2711_ARMC_IRQ3_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0xC8 )
#define BCM2711_ARMC_IRQ3_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0xD0 )
#define BCM2711_ARMC_IRQ3_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0xD4 )
#define BCM2711_ARMC_IRQ3_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0xD8 )
#define BCM2711_ARMC_IRQ3_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0xE0 )
#define BCM2711_ARMC_IRQ3_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0xE4 )
#define BCM2711_ARMC_IRQ3_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0xE8 )
#define BCM2711_ARMC_FIQ0_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x100 )
#define BCM2711_ARMC_FIQ0_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x104 )
#define BCM2711_ARMC_FIQ0_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x108 )
#define BCM2711_ARMC_FIQ0_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x110 )
#define BCM2711_ARMC_FIQ0_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x114 )
#define BCM2711_ARMC_FIQ0_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x118 )
#define BCM2711_ARMC_FIQ0_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x120 )
#define BCM2711_ARMC_FIQ0_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x124 )
#define BCM2711_ARMC_FIQ0_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x128 )
#define BCM2711_ARMC_FIQ1_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x140 )
#define BCM2711_ARMC_FIQ1_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x144 )
#define BCM2711_ARMC_FIQ1_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x148 )
#define BCM2711_ARMC_FIQ1_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x150 )
#define BCM2711_ARMC_FIQ1_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x154 )
#define BCM2711_ARMC_FIQ1_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x158 )
#define BCM2711_ARMC_FIQ1_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x160 )
#define BCM2711_ARMC_FIQ1_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x164 )
#define BCM2711_ARMC_FIQ1_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x168 )
#define BCM2711_ARMC_FIQ2_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x180 )
#define BCM2711_ARMC_FIQ2_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x184 )
#define BCM2711_ARMC_FIQ2_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x188 )
#define BCM2711_ARMC_FIQ2_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x190 )
#define BCM2711_ARMC_FIQ2_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x194 )
#define BCM2711_ARMC_FIQ2_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x198 )
#define BCM2711_ARMC_FIQ2_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x1A0 )
#define BCM2711_ARMC_FIQ2_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x1A4 )
#define BCM2711_ARMC_FIQ2_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x1A8 )
#define BCM2711_ARMC_FIQ3_PENDING0 ( BCM2711_ARMC_REGS_BASE + 0x1C0 )
#define BCM2711_ARMC_FIQ3_PENDING1 ( BCM2711_ARMC_REGS_BASE + 0x1C4 )
#define BCM2711_ARMC_FIQ3_PENDING2 ( BCM2711_ARMC_REGS_BASE + 0x1C8 )
#define BCM2711_ARMC_FIQ3_SET_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x1D0 )
#define BCM2711_ARMC_FIQ3_SET_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x1D4 )
#define BCM2711_ARMC_FIQ3_SET_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x1D8 )
#define BCM2711_ARMC_FIQ3_CLR_EN_0 ( BCM2711_ARMC_REGS_BASE + 0x1E0 )
#define BCM2711_ARMC_FIQ3_CLR_EN_1 ( BCM2711_ARMC_REGS_BASE + 0x1E4 )
#define BCM2711_ARMC_FIQ3_CLR_EN_2 ( BCM2711_ARMC_REGS_BASE + 0x1E8 )
#define BCM2711_ARMC_SWIRQ_SET ( BCM2711_ARMC_REGS_BASE + 0x1F0 )
#define BCM2711_ARMC_SWIRQ_CLEAR ( BCM2711_ARMC_REGS_BASE + 0x1F4 )
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_ARM_RASPBERRYPI_RASPBERRYPI_H */

View File

@@ -1,126 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Raspberry Pi 4B specific GPIO definitions.
*/
/*
* Copyright (C) 2023 Utkarsh Verma
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_GPIO_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_GPIO_H
#include <bspopts.h>
#include <rtems/rtems/status.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Raspberry Pi GPIO functions.
*/
typedef enum {
GPIO_INPUT,
GPIO_OUTPUT,
GPIO_AF5,
GPIO_AF4,
GPIO_AF0,
GPIO_AF1,
GPIO_AF2,
GPIO_AF3,
} raspberrypi_gpio_function;
typedef enum {
GPIO_PULL_NONE,
GPIO_PULL_UP,
GPIO_PULL_DOWN,
} raspberrypi_gpio_pull;
/**
* @brief Set the operation of the general-purpose I/O pins. Each of the 58
* GPIO pins has at least two alternative functions as defined.
*
* @param pin The GPIO pin.
* @param value The optional functions are GPIO_INPUT, GPIO_OUTPUT, GPIO_AF5,
* GPIO_AF4, GPIO_AF0, GPIO_AF1, GPIO_AF2, GPIO_AF3.
*
* @retval RTEMS_SUCCESSFUL GPIO function successfully configured.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_set_function(
const unsigned int pin,
const raspberrypi_gpio_function value
);
/**
* @brief Set a GPIO pin.
*
* @param pin The GPIO pin.
*
* @retval RTEMS_SUCCESSFUL GPIO pin set successfully.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_set_pin(const unsigned int pin);
/**
* @brief Clear a GPIO pin.
*
* @param pin The GPIO pin.
*
* @retval RTEMS_SUCCESSFUL GPIO pin clear successfully.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_clear_pin(const unsigned int pin);
/**
* @brief Control the actuation of the internal pull-up/down resistors.
*
* @param pin The GPIO pin.
* @param value The optional value are GPIO_PULL_NONE, GPIO_PULL_UP,
* GPIO_PULL_DOWN.
*
* @retval RTEMS_SUCCESSFUL GPIO pull set successfully.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_set_pull(
const unsigned int pin,
const raspberrypi_gpio_pull value
);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_GPIO_H */

View File

@@ -1,97 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief API of the Watchdog driver for the raspberrypi4 bsp in RTEMS.
*/
/*
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_WATCHDOG_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_WATCHDOG_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @note a brief example of expected usage.
*
* void raspberrypi_watchdog_example()
* {
* raspberrypi_watchdog_init();
* raspberrypi_watchdog_start(15000);
*
* raspberrypi_watchdog_reload();
* ...
* raspberrypi_watchdog_reload();
*
* raspberrypi_watchdog_stop();
* }
*
*/
/**
* @brief Initialize BSP watchdog routines.
*/
void raspberrypi_watchdog_init(void);
/**
* @brief Turn on the watchdog / begin the counter at the desired value.
*
* @param timeout Watchdog timeout value in ms.
* The watchdog device has 20 bits of timeout, so it only
* supports a maximum of 15999 ms for its timeout.
* This value should be between 0 and 15999.
*/
void raspberrypi_watchdog_start(uint32_t timeout_ms);
/**
* @brief Turn off the watchdog.
*/
void raspberrypi_watchdog_stop(void);
/**
* @brief Reload watchdog.
*/
void raspberrypi_watchdog_reload(void);
/**
* @brief Get the remaining time of the watchdog.
* The return value is still valid when the watchdog has been stopped.
*
* @retval Watchdog remaining time in ms.
*/
uint32_t raspberrypi_watchdog_get_remaining_time(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,46 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP tm27 header
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -1,198 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief PWM Support
*/
/*
* Copyright (C) 2025 Shaunak Datar
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "bsp/raspberrypi-pwm.h"
// Clock manager macros
#define BCM2711_CM_PWM( x ) BCM2835_REG( BCM2711_CM_PWM_BASE + ( x ) )
#define CM_PWM_CTL_ENABLE_OSC \
( CM_PWM_PASSWD | CM_PWM_CTL_ENAB | CM_PWM_CTL_SRC_OSC )
#define CM_PWM_CTL_DISABLE ( CM_PWM_PASSWD | CM_PWM_CTL_SRC_OSC )
static inline bool rpi_pwm_validate(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel
)
{
return ( ( master == raspberrypi_pwm_master0 ) ||
( master == raspberrypi_pwm_master1 ) ) &&
( ( channel == raspberrypi_pwm0 ) || ( channel == raspberrypi_pwm1 ) );
}
rtems_status_code rpi_pwm_set_clock( uint32_t divisor )
{
if ( !( divisor > 0 && divisor < 4096 ) ) {
return RTEMS_INVALID_NUMBER;
}
/* Stop Clock */
BCM2711_CM_PWM( BCM2711_CM_PWM_CTL ) = CM_PWM_CTL_DISABLE;
while ( BCM2711_CM_PWM( BCM2711_CM_PWM_CTL ) & CM_PWM_CTL_BUSY );
/* Set divisor */
divisor &= CM_PWM_DIV_MASK;
BCM2711_CM_PWM( BCM2711_CM_PWM_DIV ) = CM_PWM_PASSWD | ( divisor << 12 );
/* Select src = osc(1) and enable */
BCM2711_CM_PWM( BCM2711_CM_PWM_CTL ) = CM_PWM_CTL_ENABLE_OSC;
while ( !( BCM2711_CM_PWM( BCM2711_CM_PWM_CTL ) & CM_PWM_CTL_BUSY ) );
return RTEMS_SUCCESSFUL;
}
static rtems_status_code rpi_pwm_set_control(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel
)
{
uint32_t pwm_base = ( master == raspberrypi_pwm_master0 ) ?
BCM2711_PWM0_BASE :
BCM2711_PWM1_BASE;
uint32_t control_reg = pwm_base + BCM2711_PWM_CONTROL;
uint32_t control = BCM2835_REG( control_reg );
if ( channel == raspberrypi_pwm0 ) {
control &= ~( C_MODE1 | C_POLA1 | C_SBIT1 | C_RPTL1 | C_USEF1 );
control |= ( C_PWEN1 | C_CLRF | C_MSEN1 );
} else {
control &= ~( C_MODE2 | C_POLA2 | C_SBIT2 | C_RPTL2 | C_USEF2 );
control |= ( C_PWEN2 | C_CLRF | C_MSEN2 );
}
BCM2835_REG( control_reg ) = control;
return RTEMS_SUCCESSFUL;
}
static rtems_status_code rpi_pwm_set_range(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel,
uint32_t range
)
{
uint32_t pwm_base = ( master == raspberrypi_pwm_master0 ) ?
BCM2711_PWM0_BASE :
BCM2711_PWM1_BASE;
uint32_t range_offset = ( channel == raspberrypi_pwm0 ) ? BCM2711_PWM_RNG1 :
BCM2711_PWM_RNG2;
BCM2835_REG( pwm_base + range_offset ) = range;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rpi_pwm_set_data(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel,
uint32_t data
)
{
if ( !( rpi_pwm_validate( master, channel ) ) || data == 0 ) {
return RTEMS_INVALID_NUMBER;
}
uint32_t pwm_base = ( master == raspberrypi_pwm_master0 ) ?
BCM2711_PWM0_BASE :
BCM2711_PWM1_BASE;
uint32_t range_offset = ( channel == raspberrypi_pwm0 ) ? BCM2711_PWM_RNG1 :
BCM2711_PWM_RNG2;
if ( data > BCM2835_REG( pwm_base + range_offset ) ) {
return RTEMS_INVALID_NUMBER;
}
uint32_t data_offset = ( channel == raspberrypi_pwm0 ) ? BCM2711_PWM_DAT1 :
BCM2711_PWM_DAT2;
BCM2835_REG( pwm_base + data_offset ) = data;
return RTEMS_SUCCESSFUL;
}
static rtems_status_code rpi_pwm_set_gpio(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel
)
{
rtems_status_code sc;
if ( master == raspberrypi_pwm_master0 ) {
if ( channel == raspberrypi_pwm0 ) {
sc = raspberrypi_gpio_set_function( 18, GPIO_AF5 );
} else {
sc = raspberrypi_gpio_set_function( 19, GPIO_AF5 );
}
} else {
if ( channel == raspberrypi_pwm0 ) {
sc = raspberrypi_gpio_set_function( 40, GPIO_AF0 );
} else {
sc = raspberrypi_gpio_set_function( 41, GPIO_AF0 );
}
}
return sc;
}
rtems_status_code rpi_pwm_init(
raspberrypi_pwm_master master,
raspberrypi_pwm_channel channel,
uint32_t range,
uint32_t data
)
{
rtems_status_code sc;
if ( !( rpi_pwm_validate( master, channel ) ) || range == 0 ) {
return RTEMS_INVALID_NUMBER;
}
sc = rpi_pwm_set_gpio( master, channel );
if ( sc != RTEMS_SUCCESSFUL ) {
return sc;
}
sc = rpi_pwm_set_range( master, channel, range );
if ( sc != RTEMS_SUCCESSFUL ) {
return sc;
}
sc = rpi_pwm_set_data( master, channel, data );
if ( sc != RTEMS_SUCCESSFUL ) {
return sc;
}
sc = rpi_pwm_set_control( master, channel );
if ( sc != RTEMS_SUCCESSFUL ) {
return sc;
}
return RTEMS_SUCCESSFUL;
}

View File

@@ -1,582 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief SPI Driver
*/
/*
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp/irq.h>
#include <bsp/raspberrypi.h>
#include <bsp/raspberrypi-spi.h>
#include <bsp/rpi-gpio.h>
#include <dev/spi/spi.h>
#include <bspopts.h>
typedef struct {
spi_bus base;
volatile raspberrypi_spi *regs;
const spi_ioc_transfer *msg;
uint32_t msg_todo;
uint8_t *rx_buf;
const uint8_t *tx_buf;
uint32_t todo;
uint8_t num_cs;
uint32_t in_transfer;
rtems_id task_id;
rtems_vector_number irq;
}raspberrypi_spi_bus;
static int raspberrypi_spi_check_msg(
raspberrypi_spi_bus *bus,
const spi_ioc_transfer *msg,
uint32_t n
)
{
while (n > 0) {
if (msg->bits_per_word != 8) {
return -EINVAL;
}
if ((msg->mode &
~(SPI_CPHA | SPI_CPOL | SPI_NO_CS)) != 0) {
return -EINVAL;
}
if (msg->cs >= bus->num_cs) {
return -EINVAL;
}
++msg;
--n;
}
return 0;
}
/* Calculates a clock divider to be used with the GPU core clock rate
* to set a SPI clock rate the closest (<=) to a desired frequency. */
static rtems_status_code rpi_spi_calculate_clock_divider(
uint32_t clock_hz,
uint16_t *clock_divider
)
{
uint16_t divider;
uint32_t clock_rate;
/* Calculates an initial clock divider. */
divider = GPU_CORE_CLOCK_RATE / clock_hz;
/* Because the divider must be a power of two (as per the BCM2835 datasheet),
* calculate the next greater power of two. */
--divider;
divider |= (divider >> 1);
divider |= (divider >> 2);
divider |= (divider >> 4);
divider |= (divider >> 8);
++divider;
clock_rate = GPU_CORE_CLOCK_RATE / divider;
/* If the resulting clock rate is greater than the desired frequency,
* try the next greater power of two divider. */
while (clock_rate > clock_hz) {
divider = (divider << 1);
clock_rate = GPU_CORE_CLOCK_RATE / divider;
}
*clock_divider = divider;
return RTEMS_SUCCESSFUL;
}
static int raspberrypi_spi_config(
raspberrypi_spi_bus *bus,
volatile raspberrypi_spi *regs,
uint32_t speed_hz,
uint32_t mode,
uint8_t cs
)
{
spi_bus *base = &bus->base;
uint32_t spics = regs->spics;
rtems_status_code sc;
uint16_t clock_divider;
/* Calculate the most appropriate clock divider. */
sc = rpi_spi_calculate_clock_divider(speed_hz, &clock_divider);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Set the bus clock divider. */
regs->spiclk = RPI_SPICLK_CDIV_SET(regs->spiclk, clock_divider);
if ((mode & SPI_CPHA) != 0) {
spics |= RPI_SPICS_CPHA;
} else {
spics &= ~RPI_SPICS_CPHA;
}
if ((mode & SPI_CPOL) != 0) {
spics |= RPI_SPICS_CPOL;
} else {
spics &= ~RPI_SPICS_CPOL;
}
if ((mode & SPI_CS_HIGH) != 0) {
spics |= RPI_SPICS_CSPOL;
} else {
spics &= ~RPI_SPICS_CSPOL;
}
spics = RPI_SPICS_CS_SET(spics, cs);
regs->spics = spics;
base->speed_hz = speed_hz;
base->mode = mode;
base->cs = cs;
return 0;
}
#ifdef BSP_SPI_USE_INTERRUPTS
static void raspberrypi_spi_done(raspberrypi_spi_bus *bus)
{
volatile raspberrypi_spi *regs;
regs = bus->regs;
regs->spics = regs->spics & ~RPI_SPICS_TA;
rtems_event_transient_send(bus->task_id);
}
static bool raspberrpi_spi_TX_FULL(volatile raspberrypi_spi *regs)
{
return !(regs->spics & RPI_SPICS_TXD);
}
static void raspberrypi_spi_push(
raspberrypi_spi_bus *bus,
volatile raspberrypi_spi *regs
)
{
uint8_t val;
while (bus->todo > 0 && !raspberrpi_spi_TX_FULL(regs)) {
val = 0;
if (bus->tx_buf != NULL) {
val = *bus->tx_buf;
++bus->tx_buf;
}
--bus->todo;
regs->spififo = val;
++bus->in_transfer;
}
}
static void raspberrypi_spi_next_msg(raspberrypi_spi_bus *bus)
{
const spi_ioc_transfer *msg;
spi_bus *base;
volatile raspberrypi_spi *regs;
regs=bus->regs;
if (bus->msg_todo > 0) {
base = &bus->base;
msg = bus->msg;
if (
msg->speed_hz != base->speed_hz
|| msg->mode != base->mode
|| msg->cs != base->cs
) {
raspberrypi_spi_config(
bus,
regs,
msg->speed_hz,
msg->mode,
msg->cs
);
}
bus->todo = msg->len;
bus->rx_buf = msg->rx_buf;
bus->tx_buf = msg->tx_buf;
raspberrypi_spi_push(bus, regs);
} else {
raspberrypi_spi_done(bus);
}
}
static void raspberrypi_spi_start(raspberrypi_spi_bus *bus)
{
volatile raspberrypi_spi *regs;
regs = bus->regs;
regs->spics = regs->spics | RPI_SPICS_INTR | RPI_SPICS_INTD;
/*
* Set TA = 1. This will immediately trigger a first interrupt with
* DONE = 1.
*/
regs->spics = regs->spics | RPI_SPICS_TA;
}
static bool raspberrypi_spi_irq(volatile raspberrypi_spi *regs)
{
/* Check whether the interrupt is generated by this SPI device */
if(regs->spics & RPI_SPICS_INTD && regs->spics & RPI_SPICS_DONE) {
return 1;
}
if(regs->spics & RPI_SPICS_INTR && regs->spics & RPI_SPICS_RXR) {
return 1;
}
return 0;
}
static void raspberrypi_spi_interrupt(void *arg)
{
raspberrypi_spi_bus *bus;
volatile raspberrypi_spi *regs;
uint32_t val;
bus = arg;
regs = bus->regs;
if (raspberrypi_spi_irq(regs)) {
if (bus->todo > 0) {
raspberrypi_spi_push(bus, regs);
} else {
--bus->msg_todo;
++bus->msg;
raspberrypi_spi_next_msg(bus);
}
while (regs->spics & RPI_SPICS_RXD && bus->in_transfer > 0) {
/* RX FIFO contains at least 1 byte. */
val = regs->spififo;
if (bus->rx_buf != NULL) {
*bus->rx_buf = (uint8_t)val;
++bus->rx_buf;
}
--bus->in_transfer;
}
}
}
#else
static void raspberrypi_spi_polling_tx_rx(raspberrypi_spi_bus *bus)
{
volatile raspberrypi_spi *regs = bus->regs;
const unsigned char *sbuffer = bus->tx_buf;
unsigned char *rbuffer;
unsigned int size;
unsigned int read_count, write_count;
unsigned int data;
while (bus->msg_todo) {
rbuffer = bus->rx_buf;
size = bus->todo;
regs->spics = regs->spics | RPI_SPICS_CLEAR_RX | RPI_SPICS_CLEAR_TX
| RPI_SPICS_TA;
read_count = 0;
write_count = 0;
while (read_count < size || write_count < size) {
if (write_count < size && regs->spics & RPI_SPICS_TXD) {
if (sbuffer) {
regs->spififo = *sbuffer++;
} else {
regs->spififo = 0;
}
write_count++;
}
if (read_count < size && regs->spics & RPI_SPICS_RXD) {
data = regs->spififo;
if (rbuffer) {
*rbuffer++ = data;
}
read_count++;
}
}
while (!(regs->spics & RPI_SPICS_DONE)) {
/*wait*/
}
regs->spics = (regs->spics & ~RPI_SPICS_TA);
bus->msg_todo--;
bus->msg++;
bus->rx_buf = bus->msg->rx_buf;
bus->tx_buf = bus->msg->tx_buf;
bus->todo = bus->msg->len;
}
}
static void raspberrypi_spi_transfer_msg(
raspberrypi_spi_bus *bus
)
{
volatile raspberrypi_spi *regs = bus->regs;
uint32_t msg_todo = bus->msg_todo;
const spi_ioc_transfer *msg = bus->msg;
if (msg_todo > 0) {
if (
msg->speed_hz != bus->base.speed_hz
|| msg->mode != bus->base.mode
|| msg->cs != bus->base.cs
) {
raspberrypi_spi_config(
bus,
regs,
msg->speed_hz,
msg->mode,
msg->cs
);
}
bus->todo = msg->len;
bus->rx_buf = msg->rx_buf;
bus->tx_buf = msg->tx_buf;
raspberrypi_spi_polling_tx_rx(bus);
}
}
#endif
static int raspberrypi_spi_transfer(
spi_bus *base,
const spi_ioc_transfer *msgs,
uint32_t msg_count
)
{
int rv = 0;
raspberrypi_spi_bus *bus;
bus = (raspberrypi_spi_bus *) base;
rv = raspberrypi_spi_check_msg(bus, msgs, msg_count);
if (rv == 0) {
bus->msg_todo = msg_count;
bus->msg = msgs;
#ifdef BSP_SPI_USE_INTERRUPTS
bus->task_id = rtems_task_self();
raspberrypi_spi_start(bus);
rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT);
#else
raspberrypi_spi_transfer_msg(bus);
#endif
}
return rv;
}
static void raspberrypi_spi_destroy(spi_bus *base)
{
raspberrypi_spi_bus *bus;
bus = (raspberrypi_spi_bus *) base;
#ifdef BSP_SPI_USE_INTERRUPTS
rtems_interrupt_handler_remove(
bus->irq,
raspberrypi_spi_interrupt,
bus
);
#endif
spi_bus_destroy_and_free(&bus->base);
}
static int raspberrypi_spi_setup(spi_bus *base)
{
raspberrypi_spi_bus *bus;
uint32_t mode = base->mode;
bus = (raspberrypi_spi_bus *) base;
if (mode & SPI_LOOP) {
return -EINVAL;
}
return raspberrypi_spi_config(
bus,
bus->regs,
bus->base.speed_hz,
bus->base.mode,
bus->base.cs
);
}
static rtems_status_code raspberrypi_spi_init_gpio(
raspberrypi_spi_device device
)
{
switch (device) {
case raspberrypi_SPI0:
raspberrypi_gpio_set_function(7, GPIO_AF0); /* CS1 */
raspberrypi_gpio_set_pull(7, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(8, GPIO_AF0); /* CS0 */
raspberrypi_gpio_set_pull(8, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(9, GPIO_AF0); /* MISO */
raspberrypi_gpio_set_function(10, GPIO_AF0); /* MOSI */
raspberrypi_gpio_set_function(11, GPIO_AF0); /* SCLK */
break;
case raspberrypi_SPI3:
raspberrypi_gpio_set_function(24, GPIO_AF5);
raspberrypi_gpio_set_pull(24, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(0, GPIO_AF3);
raspberrypi_gpio_set_pull(0, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(1, GPIO_AF3);
raspberrypi_gpio_set_function(2, GPIO_AF3);
raspberrypi_gpio_set_function(3, GPIO_AF3);
break;
case raspberrypi_SPI4:
raspberrypi_gpio_set_function(25, GPIO_AF5);
raspberrypi_gpio_set_pull(25, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(4, GPIO_AF3);
raspberrypi_gpio_set_pull(4, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(5, GPIO_AF3);
raspberrypi_gpio_set_function(6, GPIO_AF3);
raspberrypi_gpio_set_function(7, GPIO_AF3);
break;
case raspberrypi_SPI5:
raspberrypi_gpio_set_function(26, GPIO_AF5);
raspberrypi_gpio_set_pull(26, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(12, GPIO_AF3);
raspberrypi_gpio_set_pull(12, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(13, GPIO_AF3);
raspberrypi_gpio_set_function(14, GPIO_AF3);
raspberrypi_gpio_set_function(15, GPIO_AF3);
break;
case raspberrypi_SPI6:
raspberrypi_gpio_set_function(27, GPIO_AF5);
raspberrypi_gpio_set_pull(27, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(18, GPIO_AF3);
raspberrypi_gpio_set_pull(18, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(19, GPIO_AF3);
raspberrypi_gpio_set_function(20, GPIO_AF3);
raspberrypi_gpio_set_function(21, GPIO_AF3);
break;
default:
return RTEMS_INVALID_NUMBER;
break;
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code raspberrypi_spi_init(raspberrypi_spi_device device)
{
raspberrypi_spi_bus *bus;
int eno;
volatile raspberrypi_spi *regs;
const char *bus_path;
bus = (raspberrypi_spi_bus *) spi_bus_alloc_and_init(sizeof(*bus));
if (bus == NULL) {
return RTEMS_UNSATISFIED;
}
switch (device) {
case raspberrypi_SPI0:
regs = (volatile raspberrypi_spi *) BCM2711_SPI0_BASE;
bus_path = "/dev/spidev0";
break;
case raspberrypi_SPI3:
regs = (volatile raspberrypi_spi *) BCM2711_SPI3_BASE;
bus_path = "/dev/spidev3";
break;
case raspberrypi_SPI4:
regs = (volatile raspberrypi_spi *) BCM2711_SPI4_BASE;
bus_path = "/dev/spidev4";
break;
case raspberrypi_SPI5:
regs = (volatile raspberrypi_spi *) BCM2711_SPI5_BASE;
bus_path = "/dev/spidev5";
break;
case raspberrypi_SPI6:
regs = (volatile raspberrypi_spi *) BCM2711_SPI6_BASE;
bus_path = "/dev/spidev6";
break;
default:
spi_bus_destroy_and_free(&bus->base);
return RTEMS_INVALID_NUMBER;
break;
}
bus->regs = regs;
bus->num_cs = 2;
bus->base.transfer = raspberrypi_spi_transfer;
bus->base.destroy = raspberrypi_spi_destroy;
bus->base.setup = raspberrypi_spi_setup;
bus->base.bits_per_word = 8;
bus->base.max_speed_hz = 250000000;
bus->base.cs = 0;
#ifdef BSP_SPI_USE_INTERRUPTS
bus->irq = BCM2711_IRQ_SPI;
eno = rtems_interrupt_handler_install(
bus->irq,
"SPI",
RTEMS_INTERRUPT_SHARED,
raspberrypi_spi_interrupt,
bus
);
if (eno != RTEMS_SUCCESSFUL) {
return EAGAIN;
}
#endif
eno = spi_bus_register(&bus->base, bus_path);
if (eno != 0) {
spi_bus_destroy_and_free(&bus->base);
return RTEMS_UNSATISFIED;
}
eno = raspberrypi_spi_init_gpio(device);
if (eno != 0) {
spi_bus_destroy_and_free(&bus->base);
return RTEMS_INVALID_NUMBER;
}
return RTEMS_SUCCESSFUL;
}

View File

@@ -1,49 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Reset Driver
*/
/*
* Copyright (C) 2025 Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp/raspberrypi.h>
#include <bsp/watchdog.h>
#include <bsp/bootcard.h>
void bsp_reset( rtems_fatal_source source, rtems_fatal_code code )
{
(void) source;
(void) code;
/* Restart with enough of a delay to finish printing the exit spill. */
raspberrypi_watchdog_start(20);
while (1) ;
}

View File

@@ -1,56 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP SMP Support
*/
/*
* Copyright (C) 2023 Mohd Noor Aman
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/score/smpimpl.h>
#include <bsp/raspberrypi.h>
#include <bsp/irq.h>
static uintptr_t *cpu_addr[] =
{
[0] = (uintptr_t *)0xd8,
[1] = (uintptr_t *)0xe0,
[2] = (uintptr_t *)0xe8,
[3] = (uintptr_t *)0xf0
};
bool _CPU_SMP_Start_processor( uint32_t cpu_index )
{
BCM2711_REG(cpu_addr[cpu_index]) = (uintptr_t)_start;
_AARCH64_Send_event();
_AARCH64_Data_synchronization_barrier();
return true;
}

View File

@@ -1,49 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP Startup
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -1,84 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP Startup Hooks
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/irq-generic.h>
#include <bsp/start.h>
#include <rtems/score/cpu.h>
#ifdef RTEMS_SMP
#include <rtems/score/aarch64-system-registers.h>
#include <rtems/score/smpimpl.h>
#include <rtems/score/smp.h>
#include <bsp/irq-generic.h>
#endif
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
/* Do nothing */
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
#ifdef RTEMS_SMP
uint32_t cpu_index_self = _SMP_Get_current_processor();
if ( cpu_index_self != 0 ) {
if (
cpu_index_self >= rtems_configuration_get_maximum_processors()
|| !_SMP_Should_start_processor( cpu_index_self )
) {
while ( true ) {
_AARCH64_Wait_for_event();
}
}
AArch64_start_set_vector_base();
arm_gic_irq_initialize_secondary_cpu();
rpi_setup_secondary_cpu_mmu_and_cache();
bsp_interrupt_vector_enable( ARM_GIC_IRQ_SGI_0 );
_SMP_Start_multitasking_on_secondary_processor(
_Per_CPU_Get_by_index( cpu_index_self )
);
}
#endif
AArch64_start_set_vector_base();
bsp_start_copy_sections();
raspberrypi_4_setup_mmu_and_cache();
bsp_start_clear_bss();
}

View File

@@ -1,115 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief This source file contains the default MMU tables and setup.
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
#include <bsp/start.h>
#include <bsp/aarch64-mmu.h>
#include <bsp/raspberrypi.h>
#include <libcpu/mmu-vmsav8-64.h>
BSP_START_DATA_SECTION static const aarch64_mmu_config_entry
raspberrypi_4_mmu_config_table[] = {
AARCH64_MMU_DEFAULT_SECTIONS,
{ /* RPI peripheral address */
.begin = (unsigned)RPI_PERIPHERAL_BASE,
.end = (unsigned)RPI_PERIPHERAL_BASE + (unsigned)RPI_PERIPHERAL_SIZE,
.flags = AARCH64_MMU_DEVICE
},
{ /* RPI ARM local registers */
.begin = (unsigned)BCM2711_LOCAL_REGS_BASE,
.end = (unsigned)BCM2711_LOCAL_REGS_BASE + (unsigned)BCM2711_LOCAL_REGS_SIZE,
.flags = AARCH64_MMU_DEVICE
},
{ /* RPI firmware-owned addresses including spintables */
.begin = (unsigned)0x0,
.end = (unsigned)0x1000,
.flags = AARCH64_MMU_DEVICE
},
{ /* RPI GIC Interface address */
.begin = 0xFF800000U,
.end = 0xFFA00000U,
.flags = AARCH64_MMU_DEVICE
},
{ /* RPI genet address */
.begin = (unsigned)0xFD580000,
.end = (unsigned)0xFD580000 + (unsigned)0x10000,
.flags = AARCH64_MMU_DEVICE
}
};
/*
* Make weak and let the user override.
*/
BSP_START_TEXT_SECTION void
raspberrypi_4_setup_mmu_and_cache( void ) __attribute__ ((weak));
BSP_START_TEXT_SECTION void
raspberrypi_4_setup_mmu_and_cache( void )
{
aarch64_mmu_control *control = &aarch64_mmu_instance;
aarch64_mmu_setup();
aarch64_mmu_setup_translation_table(
control,
&raspberrypi_4_mmu_config_table[ 0 ],
RTEMS_ARRAY_SIZE( raspberrypi_4_mmu_config_table )
);
aarch64_mmu_enable( control );
}
BSP_START_TEXT_SECTION void rpi_setup_secondary_cpu_mmu_and_cache( void )
__attribute__ ( ( weak ) );
BSP_START_TEXT_SECTION void rpi_setup_secondary_cpu_mmu_and_cache( void )
{
aarch64_mmu_control *control = &aarch64_mmu_instance;
/* Perform basic MMU setup */
aarch64_mmu_setup();
/* Use the existing root page table already configured by CPU0 */
_AArch64_Write_ttbr0_el1( (uintptr_t) bsp_translation_table_base );
aarch64_mmu_enable( control );
}

View File

@@ -1,73 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Watchdog Driver
*/
/*
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp/raspberrypi.h>
#include <bsp/watchdog.h>
#define PM_WDOG BCM2835_REG(BCM2711_PM_WDOG)
#define PM_RSTC BCM2835_REG(BCM2711_PM_RSTC)
uint32_t raspberrypi_watchdog_timeout;
void raspberrypi_watchdog_init()
{
raspberrypi_watchdog_timeout = 0;
}
void raspberrypi_watchdog_start(uint32_t timeout_ms)
{
raspberrypi_watchdog_timeout = timeout_ms;
PM_WDOG = BCM2711_PM_PASSWD_MAGIC |
((timeout_ms * 65536 / 1000) & BCM2711_PM_WDOG_MASK);
PM_RSTC &= BCM2711_PM_RSTC_WRCFG_CLR;
PM_RSTC = (BCM2711_PM_PASSWD_MAGIC | BCM2711_PM_RSTC_WRCFG_FULL);
}
void raspberrypi_watchdog_stop()
{
PM_RSTC = BCM2711_PM_PASSWD_MAGIC | BCM2711_PM_RSTC_RESET;
}
void raspberrypi_watchdog_reload()
{
raspberrypi_watchdog_start(raspberrypi_watchdog_timeout);
}
uint32_t raspberrypi_watchdog_get_remaining_time()
{
return (PM_WDOG & BCM2711_PM_WDOG_MASK)*1000/65536;
}

View File

@@ -1,415 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief AArch64 cache defines and implementation.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems.h>
#include <bsp.h>
#include <rtems/score/aarch64-system-registers.h>
#define CPU_DATA_CACHE_ALIGNMENT 64
#define CPU_INSTRUCTION_CACHE_ALIGNMENT 64
#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS
#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS
#define AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT ( (size_t) 64 )
#define AARCH64_CACHE_PREPARE_MVA(mva) (const void *) \
RTEMS_ALIGN_DOWN ( (size_t) mva, AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT )
static inline
void AArch64_data_cache_clean_and_invalidate_line(const void *d_addr)
{
d_addr = AARCH64_CACHE_PREPARE_MVA(d_addr);
__asm__ volatile (
"dc civac, %[d_addr]"
:
: [d_addr] "r" (d_addr)
: "memory"
);
}
static inline void
_CPU_cache_flush_data_range(
const void *d_addr,
size_t n_bytes
)
{
_AARCH64_Data_synchronization_barrier();
if ( n_bytes != 0 ) {
size_t adx = (size_t) AARCH64_CACHE_PREPARE_MVA ( d_addr );
const size_t ADDR_LAST = (size_t) d_addr + n_bytes - 1;
for (; adx <= ADDR_LAST; adx += AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT ) {
/* Store and invalidate the Data cache line */
AArch64_data_cache_clean_and_invalidate_line( (void*)adx );
}
/* Wait for L1 store to complete */
_AARCH64_Data_synchronization_barrier();
}
_AARCH64_Data_synchronization_barrier();
}
static inline void AArch64_data_cache_invalidate_line(const void *d_addr)
{
d_addr = AARCH64_CACHE_PREPARE_MVA(d_addr);
__asm__ volatile (
"dc ivac, %[d_addr]"
:
: [d_addr] "r" (d_addr)
: "memory"
);
}
static inline void
_CPU_cache_invalidate_data_range(
const void *d_addr,
size_t n_bytes
)
{
if ( n_bytes != 0 ) {
size_t adx = (size_t) AARCH64_CACHE_PREPARE_MVA ( d_addr );
const size_t end = (size_t)d_addr + n_bytes -1;
/* Back starting address up to start of a line and invalidate until end */
for (;
adx <= end;
adx += AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT ) {
/* Invalidate the Instruction cache line */
AArch64_data_cache_invalidate_line( (void*)adx );
}
/* Wait for L1 invalidate to complete */
_AARCH64_Data_synchronization_barrier();
}
}
static inline void _CPU_cache_freeze_data(void)
{
/* TODO */
}
static inline void _CPU_cache_unfreeze_data(void)
{
/* TODO */
}
static inline void AArch64_instruction_cache_invalidate_line(const void *i_addr)
{
/* __builtin___clear_cache is explicitly only for instruction cacche */
__builtin___clear_cache((void *)i_addr, ((char *)i_addr) + sizeof(void*) - 1);
}
static inline void
_CPU_cache_invalidate_instruction_range( const void *i_addr, size_t n_bytes)
{
if ( n_bytes != 0 ) {
__builtin___clear_cache((void *)i_addr, ((char *)i_addr) + n_bytes - 1);
}
_AARCH64_Instruction_synchronization_barrier();
}
static inline void _CPU_cache_freeze_instruction(void)
{
/* TODO */
}
static inline void _CPU_cache_unfreeze_instruction(void)
{
/* TODO */
}
static inline uint64_t AArch64_get_ccsidr_for_level(
uint64_t level, bool instruction
)
{
uint64_t csselr = AARCH64_CSSELR_EL1_LEVEL(level - 1);
csselr |= instruction ? AARCH64_CSSELR_EL1_IND : 0;
_AArch64_Write_csselr_el1(csselr);
_AARCH64_Instruction_synchronization_barrier();
return _AArch64_Read_ccsidr_el1();
}
static inline uint64_t
AArch64_ccsidr_get_line_power(uint64_t ccsidr)
{
return AARCH64_CCSIDR_EL1_LINESIZE_GET(ccsidr) + 4;
}
static inline uint64_t
AArch64_ccsidr_get_associativity(uint64_t ccsidr)
{
return AARCH64_CCSIDR_EL1_ASSOCIATIVITY_GET_0(ccsidr) + 1;
}
static inline uint64_t
AArch64_ccsidr_get_num_sets(uint64_t ccsidr)
{
return AARCH64_CCSIDR_EL1_NUMSETS_GET_0(ccsidr) + 1;
}
static inline void
AArch64_data_cache_clean_and_invalidate_level(uint64_t level)
{
uint64_t ccsidr;
uint64_t line_power;
uint64_t associativity;
uint64_t way;
uint64_t way_shift;
ccsidr = AArch64_get_ccsidr_for_level(level, false);
line_power = AArch64_ccsidr_get_line_power(ccsidr);
associativity = AArch64_ccsidr_get_associativity(ccsidr);
way_shift = __builtin_clz(associativity - 1);
for (way = 0; way < associativity; ++way) {
uint64_t num_sets = AArch64_ccsidr_get_num_sets(ccsidr);
uint64_t set;
for (set = 0; set < num_sets; ++set) {
uint64_t set_and_way = (way << way_shift)
| (set << line_power)
| ((level - 1) << 1);
__asm__ volatile (
"dc cisw, %[set_and_way]"
:
: [set_and_way] "r" (set_and_way)
: "memory"
);
}
}
}
static inline
uint64_t AArch64_clidr_get_cache_type(uint64_t clidr, uint64_t level)
{
return (clidr >> (3 * level)) & 0x7;
}
static inline uint64_t AArch64_clidr_get_level_of_coherency(uint64_t clidr)
{
return AARCH64_CLIDR_EL1_LOC_GET(clidr);
}
static inline void AArch64_data_cache_clean_and_invalidate_all_levels(void)
{
uint64_t clidr = _AArch64_Read_clidr_el1();
uint64_t loc = AArch64_clidr_get_level_of_coherency(clidr);
uint64_t level = 0;
for (level = 1; level <= loc; ++level) {
/* Assume that all levels have a data cache */
AArch64_data_cache_clean_and_invalidate_level(level);
}
}
static inline void _CPU_cache_flush_entire_data(void)
{
rtems_interrupt_level isr_level;
rtems_interrupt_local_disable(isr_level);
_AARCH64_Data_synchronization_barrier();
AArch64_data_cache_clean_and_invalidate_all_levels();
_AARCH64_Data_synchronization_barrier();
rtems_interrupt_local_enable(isr_level);
}
static inline void AArch64_cache_invalidate_level(uint64_t level)
{
uint64_t ccsidr;
uint64_t line_power;
uint64_t associativity;
uint64_t way;
uint64_t way_shift;
ccsidr = AArch64_get_ccsidr_for_level(level, false);
line_power = AArch64_ccsidr_get_line_power(ccsidr);
associativity = AArch64_ccsidr_get_associativity(ccsidr);
way_shift = __builtin_clz(associativity - 1);
for (way = 0; way < associativity; ++way) {
uint64_t num_sets = AArch64_ccsidr_get_num_sets(ccsidr);
uint64_t set;
for (set = 0; set < num_sets; ++set) {
uint64_t set_and_way = (way << way_shift)
| (set << line_power)
| ((level - 1) << 1);
__asm__ volatile (
"dc isw, %[set_and_way]"
:
: [set_and_way] "r" (set_and_way)
: "memory"
);
}
}
}
static inline void AArch64_data_cache_invalidate_all_levels(void)
{
uint64_t clidr = _AArch64_Read_clidr_el1();
uint64_t loc = AArch64_clidr_get_level_of_coherency(clidr);
uint64_t level = 0;
for (level = 1; level <= loc; ++level) {
/* Assume that all levels have a data cache */
AArch64_cache_invalidate_level(level);
}
}
static inline void _CPU_cache_invalidate_entire_data(void)
{
rtems_interrupt_level isr_level;
rtems_interrupt_local_disable(isr_level);
_AARCH64_Data_synchronization_barrier();
AArch64_data_cache_invalidate_all_levels();
_AARCH64_Data_synchronization_barrier();
rtems_interrupt_local_enable(isr_level);
}
static inline void _CPU_cache_enable_data(void)
{
rtems_interrupt_level isr_level;
uint64_t sctlr;
rtems_interrupt_local_disable(isr_level);
sctlr = _AArch64_Read_sctlr_el1();
sctlr |= AARCH64_SCTLR_EL1_C;
_AArch64_Write_sctlr_el1(sctlr);
rtems_interrupt_local_enable(isr_level);
}
static RTEMS_NO_RETURN inline void _CPU_cache_disable_data(void)
{
_Internal_error( INTERNAL_ERROR_CANNOT_DISABLE_DATA_CACHE );
}
static inline void _CPU_cache_invalidate_entire_instruction(void)
{
/*
* There is no way to manage branch prediction in AArch64. See D4.4.12 in
* the ARM Architecture Reference Manual, ARMv8, for ARMv8-A architecture
* profile (ARM DDI 0487D.a).
*/
__asm__ volatile (
#ifdef RTEMS_SMP
/*
* Invalidate all instruction caches up to
* Point of Unification, Inner Shareable.
*/
"ic ialluis\n"
#else
/* Invalidate all instruction caches up to Point of Unification */
"ic iallu\n"
#endif
"isb"
:
:
: "memory"
);
}
static inline void _CPU_cache_enable_instruction(void)
{
rtems_interrupt_level isr_level;
uint64_t sctlr;
rtems_interrupt_local_disable(isr_level);
sctlr = _AArch64_Read_sctlr_el1();
sctlr |= AARCH64_SCTLR_EL1_I;
_AArch64_Write_sctlr_el1(sctlr);
rtems_interrupt_local_enable(isr_level);
}
static inline void _CPU_cache_disable_instruction(void)
{
rtems_interrupt_level isr_level;
uint64_t sctlr;
rtems_interrupt_local_disable(isr_level);
sctlr = _AArch64_Read_sctlr_el1();
sctlr &= ~AARCH64_SCTLR_EL1_I;
_AArch64_Write_sctlr_el1(sctlr);
rtems_interrupt_local_enable(isr_level);
}
static inline size_t AArch64_get_cache_size(
uint64_t level,
bool instruction
)
{
rtems_interrupt_level isr_level;
uint64_t clidr;
uint64_t loc;
uint64_t ccsidr;
clidr = _AArch64_Read_clidr_el1();
loc = AArch64_clidr_get_level_of_coherency(clidr);
if (level > loc) {
return 0;
}
rtems_interrupt_local_disable(isr_level);
ccsidr = AArch64_get_ccsidr_for_level(level, instruction);
rtems_interrupt_local_enable(isr_level);
return (1U << (AArch64_ccsidr_get_line_power(ccsidr)+4))
* AArch64_ccsidr_get_associativity(ccsidr)
* AArch64_ccsidr_get_num_sets(ccsidr);
}
static inline size_t _CPU_cache_get_data_cache_size(uint64_t level)
{
return AArch64_get_cache_size(level, false);
}
static inline size_t _CPU_cache_get_instruction_cache_size(uint64_t level)
{
return AArch64_get_cache_size(level, true);
}
#include "../../shared/cache/cacheimpl.h"

View File

@@ -1,116 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief AArch64-specific ARM GPT system register accessors.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <dev/clock/arm-generic-timer.h>
#include <bsp/irq.h>
uint64_t arm_gt_clock_get_compare_value(void)
{
uint64_t val;
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"mrs %[val], cntv_cval_el0"
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
"mrs %[val], cntps_cval_el1"
#else
"mrs %[val], cntp_cval_el0"
#endif
: [val] "=&r" (val)
);
return val;
}
void arm_gt_clock_set_compare_value(uint64_t cval)
{
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"msr cntv_cval_el0, %[cval]"
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
"msr cntps_cval_el1, %[cval]"
#else
"msr cntp_cval_el0, %[cval]"
#endif
:
: [cval] "r" (cval)
);
}
uint64_t arm_gt_clock_get_count(void)
{
uint64_t val;
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"mrs %[val], cntvct_el0"
#else
"mrs %[val], cntpct_el0"
#endif
: [val] "=&r" (val)
);
return val;
}
void arm_gt_clock_set_control(uint32_t ctl)
{
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"msr cntv_ctl_el0, %[ctl]"
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
"msr cntps_ctl_el1, %[ctl]"
#else
"msr cntp_ctl_el0, %[ctl]"
#endif
:
: [ctl] "r" (ctl)
);
}
void arm_generic_timer_get_config( uint32_t *frequency, uint32_t *irq )
{
uint64_t val;
__asm__ volatile (
"mrs %[val], cntfrq_el0"
: [val] "=&r" (val)
);
*frequency = val;
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
*irq = BSP_TIMER_VIRT_PPI;
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
*irq = BSP_TIMER_PHYS_S_PPI;
#else
*irq = BSP_TIMER_PHYS_NS_PPI;
#endif
}

View File

@@ -1,23 +0,0 @@
/**
* @file
*
* @ingroup RTEMSImplDoxygen
*
* @brief This header file defines BSP-specific groups.
*/
/**
* @defgroup RTEMSBSPsAArch64 AArch64
*
* @ingroup RTEMSBSPs
*
* @brief This group contains AArch64 Board Support Packages.
*/
/**
* @defgroup RTEMSBSPsAArch64Shared Shared
*
* @ingroup RTEMSBSPsAArch64
*
* @brief This group contains support shared by AArch64 Board Support Packages.
*/

View File

@@ -1,319 +0,0 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup aarch64_start
*
* @brief AArch64 MMU configuration.
*/
/*
* Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp/aarch64-mmu.h>
#include <bsp/fatal.h>
#include <bsp/linker-symbols.h>
#include <bsp/start.h>
#include <rtems/score/aarch64-system-registers.h>
#include <rtems/score/assert.h>
aarch64_mmu_control aarch64_mmu_instance = {
.ttb = (uint64_t *) bsp_translation_table_base,
/* One page table is used for the initial setup at the base */
.used_page_tables = 1
};
/* AArch64 uses levels 0, 1, 2, and 3 */
#define MMU_MAX_SUBTABLE_PAGE_BITS ( 3 * MMU_BITS_PER_LEVEL + MMU_PAGE_BITS )
/* setup straight mapped block entries */
BSP_START_TEXT_SECTION static inline void aarch64_mmu_page_table_set_blocks(
uint64_t *page_table,
uint64_t base,
uint32_t bits_offset,
uint64_t default_attr
)
{
uint64_t page_flag = 0;
if ( bits_offset == MMU_PAGE_BITS ) {
page_flag = MMU_DESC_TYPE_PAGE;
}
for ( uint64_t i = 0; i < ( 1 << MMU_BITS_PER_LEVEL ); i++ ) {
page_table[i] = base | ( i << bits_offset );
page_table[i] |= default_attr | page_flag;
}
}
BSP_START_TEXT_SECTION static inline uint64_t *
aarch64_mmu_page_table_alloc( aarch64_mmu_control *control )
{
size_t used_page_tables = control->used_page_tables;
if ( used_page_tables >= AARCH64_MMU_TRANSLATION_TABLE_PAGES ) {
return NULL;
}
control->used_page_tables = used_page_tables + 1;
return (uint64_t *)
( (uintptr_t) control->ttb + ( used_page_tables << MMU_PAGE_BITS ) );
}
BSP_START_TEXT_SECTION static inline uintptr_t aarch64_mmu_get_index(
uintptr_t root_address,
uintptr_t vaddr,
uint32_t shift
)
{
uintptr_t mask = ( 1 << ( MMU_BITS_PER_LEVEL + 1 ) ) - 1;
return ( ( vaddr - root_address ) >> shift ) & mask;
}
BSP_START_TEXT_SECTION static uint64_t *
aarch64_mmu_get_sub_table(
aarch64_mmu_control *control,
uint64_t *page_table_entry,
uintptr_t physical_root_address,
uint32_t shift
)
{
/* check if the index already has a page table */
if ( ( *page_table_entry & MMU_DESC_TYPE_TABLE ) == MMU_DESC_TYPE_TABLE ) {
/* extract page table address */
uint64_t table_pointer = *page_table_entry & MMU_DESC_PAGE_TABLE_MASK;
/* This cast should be safe since the address was inserted in this mode */
return (uint64_t *) (uintptr_t) table_pointer;
}
/* allocate new page table and set block */
uint64_t *sub_table = aarch64_mmu_page_table_alloc( control );
if ( sub_table == NULL ) {
return NULL;
}
aarch64_mmu_page_table_set_blocks(
sub_table,
physical_root_address,
shift - MMU_BITS_PER_LEVEL,
*page_table_entry & ~MMU_DESC_PAGE_TABLE_MASK
);
*page_table_entry = (uintptr_t) sub_table;
*page_table_entry |= MMU_DESC_TYPE_TABLE | MMU_DESC_VALID;
return sub_table;
}
BSP_START_TEXT_SECTION static inline rtems_status_code aarch64_mmu_map_block(
aarch64_mmu_control *control,
uint64_t *page_table,
uint64_t root_address,
uint64_t addr,
uint64_t size,
int8_t level,
uint64_t flags
)
{
uint32_t shift = ( 2 - level ) * MMU_BITS_PER_LEVEL + MMU_PAGE_BITS;
uint64_t granularity = 1LLU << shift;
do {
uintptr_t index = aarch64_mmu_get_index( root_address, addr, shift );
uint64_t block_bottom = RTEMS_ALIGN_DOWN( addr, granularity );
uint64_t chunk_size = granularity;
/* check for perfect block match */
if ( block_bottom == addr ) {
if ( size >= chunk_size ) {
/* level -1 can't contain block descriptors, fall through to subtable */
if ( level != -1 ) {
uint64_t page_flag = 0;
if ( level == 2 ) {
page_flag = MMU_DESC_TYPE_PAGE;
}
/* when page_flag is set the last level must be a page descriptor */
if ( page_flag || ( page_table[index] & MMU_DESC_TYPE_TABLE ) != MMU_DESC_TYPE_TABLE ) {
/* no sub-table, apply block properties */
page_table[index] = addr | flags | page_flag;
size -= chunk_size;
addr += chunk_size;
continue;
}
}
} else {
/*
* Block starts on a boundary, but is short.
*
* The size is >= MMU_PAGE_SIZE since
* aarch64_mmu_set_translation_table_entries() aligns the memory region
* to page boundaries. The minimum chunk_size is MMU_PAGE_SIZE.
*/
_Assert( level < 2 );
chunk_size = size;
}
} else {
uintptr_t block_top = RTEMS_ALIGN_UP( addr, granularity );
chunk_size = block_top - addr;
if ( chunk_size > size ) {
chunk_size = size;
}
}
/* Deal with any subtable modification */
uint64_t new_root_address = root_address + index * granularity;
rtems_status_code sc;
uint64_t *sub_table = aarch64_mmu_get_sub_table(
control,
&page_table[index],
new_root_address,
shift
);
if ( sub_table == NULL ) {
return RTEMS_TOO_MANY;
}
sc = aarch64_mmu_map_block(
control,
sub_table,
new_root_address,
addr,
chunk_size,
level + 1,
flags
);
if ( sc != RTEMS_SUCCESSFUL ) {
return sc;
}
size -= chunk_size;
addr += chunk_size;
} while ( size > 0 );
return RTEMS_SUCCESSFUL;
}
/* Get the maximum number of bits supported by this hardware */
BSP_START_TEXT_SECTION static inline uint64_t
aarch64_mmu_get_cpu_pa_bits( void )
{
#ifdef AARCH64_MMU_PHYSICAL_ADDRESS_RANGE_BITS
return AARCH64_MMU_PHYSICAL_ADDRESS_RANGE_BITS;
#else
uint64_t id_reg = _AArch64_Read_id_aa64mmfr0_el1();
switch ( AARCH64_ID_AA64MMFR0_EL1_PARANGE_GET( id_reg ) ) {
case 0:
return 32;
case 1:
return 36;
case 2:
return 40;
case 3:
return 42;
case 4:
return 44;
case 5:
return 48;
case 6:
return 52;
default:
return 48;
}
return 48;
#endif
}
BSP_START_TEXT_SECTION rtems_status_code
aarch64_mmu_set_translation_table_entries(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config
)
{
uint64_t max_mappable = 1LLU << aarch64_mmu_get_cpu_pa_bits();
/* Align to page boundaries */
uint64_t begin = RTEMS_ALIGN_DOWN( config->begin, MMU_PAGE_SIZE );
uint64_t end = RTEMS_ALIGN_UP( (uint64_t) config->end, MMU_PAGE_SIZE );
uint64_t size = end - begin;
if ( config->begin == config->end ) {
return RTEMS_SUCCESSFUL;
}
if ( begin >= max_mappable ) {
return RTEMS_INVALID_ADDRESS;
}
if ( size > max_mappable - begin ) {
return RTEMS_INVALID_SIZE;
}
return aarch64_mmu_map_block(
control,
control->ttb,
0x0,
begin,
size,
-1,
config->flags
);
}
BSP_START_TEXT_SECTION void aarch64_mmu_setup_translation_table(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config_table,
size_t config_count
)
{
size_t i;
aarch64_mmu_page_table_set_blocks(
control->ttb,
(uintptr_t) NULL,
MMU_MAX_SUBTABLE_PAGE_BITS,
0
);
/* Configure entries required for each memory section */
for ( i = 0; i < config_count; ++i ) {
rtems_status_code sc;
sc = aarch64_mmu_set_translation_table_entries( control, &config_table[i] );
if ( sc != RTEMS_SUCCESSFUL ) {
bsp_fatal( AARCH64_FATAL_MMU_CANNOT_MAP_BLOCK );
}
}
}

Some files were not shown because too many files have changed in this diff Show More