forked from Imagelibrary/rtems
Patch from Charles-Antoine Gauthier <charles.gauthier@iit.nrc.ca>
to update the mvme167 BSP and account for the fact that RAM base does not have to start at 0.
This commit is contained in:
@@ -7,7 +7,13 @@ ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
|
|||||||
|
|
||||||
# wrapup is the one that actually builds and installs the library
|
# wrapup is the one that actually builds and installs the library
|
||||||
# from the individual .rel files built in other directories
|
# from the individual .rel files built in other directories
|
||||||
SUBDIRS = . include start startup clock console fatal timer wrapup
|
|
||||||
|
if HAS_NETWORKING
|
||||||
|
NETWORKING_DRIVER = network
|
||||||
|
endif
|
||||||
|
|
||||||
|
SUBDIRS = . include start startup clock console fatal timer \
|
||||||
|
$(NETWORKING_DRIVER) wrapup
|
||||||
|
|
||||||
include $(top_srcdir)/../../bsp.am
|
include $(top_srcdir)/../../bsp.am
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,35 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
|
||||||
This is a README file for the MVME167 port of RTEMS 4.0.0.
|
This is a README file for the MVME167 port of RTEMS 4.5.0.
|
||||||
|
|
||||||
Please send any comments, improvements, or bug reports to:
|
Please send any comments, improvements, or bug reports to:
|
||||||
|
|
||||||
Charles-Antoine Gauthier
|
Charles-Antoine Gauthier
|
||||||
|
charles.gauthier@nrc.ca
|
||||||
|
or
|
||||||
|
|
||||||
|
Darlene Stewart
|
||||||
|
Darlene.Stewart@nrc.ca
|
||||||
|
|
||||||
Software Engineering Group
|
Software Engineering Group
|
||||||
Institute for Information Technology
|
Institute for Information Technology
|
||||||
National Research Council of Canada
|
National Research Council of Canada
|
||||||
Ottawa, ON, K1A 0R6
|
Ottawa, ON, K1A 0R6
|
||||||
Canada
|
Canada
|
||||||
|
|
||||||
charles.gauthier@iit.nrc.ca
|
|
||||||
|
WARNING:
|
||||||
|
--------
|
||||||
|
|
||||||
|
The network driver is currently being worked on. It is somewhat functional,
|
||||||
|
but it does run out of buffers under certain conditions. The code is
|
||||||
|
also undergoing a substantial reorganization. Before making any changes,
|
||||||
|
you should check with us for the availability of updates.
|
||||||
|
|
||||||
|
Note from Joel: The ttcp performance reported is very nice even if the
|
||||||
|
driver is still early in its life. :)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Disclaimer
|
Disclaimer
|
||||||
@@ -43,15 +60,15 @@ Installation
|
|||||||
Nothing unique to the MVME167. It uses the standard build process for
|
Nothing unique to the MVME167. It uses the standard build process for
|
||||||
m68k targets. You will need to edit linkcmds to put in the start address
|
m68k targets. You will need to edit linkcmds to put in the start address
|
||||||
of your board. We do TFTP transfers to our target. The mvme167.cfg file
|
of your board. We do TFTP transfers to our target. The mvme167.cfg file
|
||||||
builds only the coff images, which we download to the target, skipping over
|
builds only the ELF images, which we download to the target, skipping
|
||||||
the first 0xA8 bytes; Motorola S-records are not generated. Edit this file
|
over the first 0x54 bytes; Motorola S-records are not generated. Edit
|
||||||
if you want S-records.
|
this file if you want S-records.
|
||||||
|
|
||||||
|
|
||||||
Port Description
|
Port Description
|
||||||
Console driver
|
Console driver
|
||||||
|
|
||||||
----------------
|
---------------
|
||||||
|
|
||||||
This BSP includes an termios-capable console driver that supports all
|
This BSP includes an termios-capable console driver that supports all
|
||||||
four serial ports on the MVME167 model. The RTEMS console, /dev/console,
|
four serial ports on the MVME167 model. The RTEMS console, /dev/console,
|
||||||
@@ -60,27 +77,30 @@ corresponds to channel 1 in the CD2401. This corresponds to Serial Port
|
|||||||
do not open /dev/tty00 if you are debugging using 167Bug.
|
do not open /dev/tty00 if you are debugging using 167Bug.
|
||||||
|
|
||||||
The console is initialized with whatever parameters are set up in termios
|
The console is initialized with whatever parameters are set up in termios
|
||||||
before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE HANDSHAKING
|
before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE
|
||||||
IS TURNED OFF, i.e. CLOCAL is set in the struct termios c_cflag field. We use
|
HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set in the struct termios
|
||||||
3-wire cables for I/O, and find hardware handshaking a pain. If you enable
|
c_cflag field. We use 3-wire cables for I/O, and find hardware handshaking
|
||||||
hardware handshaking, you must drive CTS* low on the CD2401 for output to
|
a pain. If you enable hardware handshaking, you must drive CTS* low on the
|
||||||
occur. If the port is in the DTE configuration, you must drive the RS-232 CTS
|
CD2401 for output to occur. If the port is in the DTE configuration, you
|
||||||
line to space; if the port is in the DCE configuration, you must drive the
|
must drive the RS-232 CTS line to space; if the port is in the DCE
|
||||||
RS-232 RTS line to space.
|
configuration, you must drive the RS-232 RTS line to space.
|
||||||
|
|
||||||
|
Limited support is provided for polled terminal I/O. This is used when
|
||||||
|
running the timing tests. Set the CD2401_POLLED_IO manifest constant to 1
|
||||||
|
in rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled
|
||||||
|
I/O. In this case, I/O is done through 167Bug, usually to the Serial Port
|
||||||
|
1/Console port. Interrupt-driven and polled I/O cannot be mixed in the
|
||||||
|
MVME167.
|
||||||
|
|
||||||
Limited support is provided for polled terminal I/O. This is used when running
|
|
||||||
the timing tests. Set the CD2401_POLLED_IO manifest constant to 1 in
|
|
||||||
rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled I/O.
|
|
||||||
In this case, I/O is done through 167Bug, usually to the Serial Port 1/Console
|
|
||||||
|
|
||||||
Floating-point
|
Floating-point
|
||||||
|
|
||||||
The MC68040 has a built-in FPU. This FPU does not implement all the
|
The MC68040 has a built-in FPU. This FPU does not implement all the
|
||||||
instruction of the MC68881/MC68882 floating-point coprocessors in hardware.
|
instruction of the MC68881/MC68882 floating-point coprocessors in
|
||||||
The -m68040 compilation options instructs gcc to not generate the missing
|
hardware. The -m68040 compilation options instructs gcc to not generate
|
||||||
instructions. All of the RTEMS code is built this way. Some of the missing
|
the missing instructions. All of the RTEMS code is built this way. Some
|
||||||
functionality must be supplied by external libraries. The required functions
|
of the missing functionality must be supplied by external libraries. The
|
||||||
are part of libgcc.a.
|
required functions are part of libgcc.a.
|
||||||
|
|
||||||
The issue gets complicated because libc, libm and libgcc do not come as
|
The issue gets complicated because libc, libm and libgcc do not come as
|
||||||
m68040-specific variants. The default variants of these libraries are for the
|
m68040-specific variants. The default variants of these libraries are for the
|
||||||
@@ -127,9 +147,22 @@ mvme167.cfg that redefine which variants of libc, libm and libgcc to link
|
|||||||
against.
|
against.
|
||||||
|
|
||||||
|
|
||||||
Miscellaneous
|
Cache Control and Memory Mapping
|
||||||
|
|
||||||
port. Interrupt-driven and polled I/O cannot be mixed in the MVME167.
|
If Jumper J1-7 is installed, the data cache will be turned on. If Jumper
|
||||||
|
J1-6 is installed, the instruction cache will be turned on. Removing the
|
||||||
|
jumper causes the corresponding cache to be left disabled.
|
||||||
|
|
||||||
|
If Jumper J1-5 is installed, the data cache will be placed in copyback
|
||||||
|
mode. If it is removed, it will be placed in writethrough mode.
|
||||||
|
|
||||||
|
Currently, block address translation is set up to map the virtual
|
||||||
|
0x00000000--0x7FFFFFFF to the physical range 0x00000000--0x7FFFFFFF. The
|
||||||
|
port relies on the hardware to raise exceptions when addressing
|
||||||
|
non-existent memory. Caching is not controllable on a finer grain.
|
||||||
|
|
||||||
|
|
||||||
|
Miscellaneous
|
||||||
|
|
||||||
The timer and clock drivers were patterned after the MVME162 and MVME152
|
The timer and clock drivers were patterned after the MVME162 and MVME152
|
||||||
ports.
|
ports.
|
||||||
@@ -137,8 +170,6 @@ ports.
|
|||||||
At this time, we do not have an MPCI layer for the MVME167. We are planning
|
At this time, we do not have an MPCI layer for the MVME167. We are planning
|
||||||
to write one.
|
to write one.
|
||||||
|
|
||||||
The port does not have a network driver.
|
|
||||||
|
|
||||||
This port supplies its own fatal_error_handler, which attempts to print some
|
This port supplies its own fatal_error_handler, which attempts to print some
|
||||||
error message through 167Bug (on the Serial Port 1/Console on the MVME712M).
|
error message through 167Bug (on the Serial Port 1/Console on the MVME712M).
|
||||||
|
|
||||||
@@ -153,17 +184,20 @@ tools were used:
|
|||||||
m68k-rtems target;
|
m68k-rtems target;
|
||||||
- GNU binutils 2.9.1 configured for a powerpc-ibm-aix4.2.0.0 host and
|
- GNU binutils 2.9.1 configured for a powerpc-ibm-aix4.2.0.0 host and
|
||||||
m68k-rtems target;
|
m68k-rtems target;
|
||||||
|
|
||||||
It was also tested on a Pentium II-based PC running Windows NT Workstation 4.0
|
It was also tested on a Pentium II-based PC running Windows NT Workstation 4.0
|
||||||
and the Cygnus Cygwin32 release b20.1 environment, with the following tools:
|
and the Cygnus Cygwin32 release b20.1 environment, with the following tools:
|
||||||
|
|
||||||
- EGCS 1.1.1 configured for a i586-cygwin32 host and m68k-rtems target;
|
- EGCS 1.1.1 configured for a i586-cygwin32 host and m68k-rtems target;
|
||||||
- GNU binutils 2.9.4 configured for a i586-cygwin32 host and m68k-rtems
|
- GNU binutils 2.9.4 configured for a i586-cygwin32 host and m68k-rtems
|
||||||
target;
|
target;
|
||||||
- Cygnus newlib 1.8.0 with RTEMS 4.0.0 patches.
|
|
||||||
|
|
||||||
With the latter environment, be patient; builds take a very looong time...
|
With the latter environment, be patient; builds take a very looong time...
|
||||||
|
|
||||||
- Cygnus newlib 1.8.0 with RTEMS 4.0.0 patches.
|
Current development is done on a Pentium III PC running RedHat Linux 6.1.
|
||||||
|
At the time this README was composed, the latest working compiler that was
|
||||||
|
used successfully was gcc version 2.96 20000213 (experimental). Both the C
|
||||||
|
and C++ compilers were working. Binutils 2.9.1 are used.
|
||||||
|
|
||||||
|
|
||||||
Known Problems
|
Known Problems
|
||||||
@@ -202,6 +236,11 @@ blown. This is one case were overwritting the first or last 16 bytes of the
|
|||||||
stack does cause problems (but hey, an exception occurred, which is better
|
stack does cause problems (but hey, an exception occurred, which is better
|
||||||
than propagating the error).
|
than propagating the error).
|
||||||
|
|
||||||
|
In the stackchk test, an access fault exception is raised after the stack is
|
||||||
|
blown. This is one case were overwritting the first or last 16 bytes of the
|
||||||
|
stack does cause problems (but hey, an exception occurred, which is better
|
||||||
|
than propagating the error).
|
||||||
|
|
||||||
When using interrupt-driven I/O, psx08 produces all the expected output, but
|
When using interrupt-driven I/O, psx08 produces all the expected output, but
|
||||||
it does not return control to 167Bug. Is this test supposed to work with
|
it does not return control to 167Bug. Is this test supposed to work with
|
||||||
interrupt-driven console I/O?
|
interrupt-driven console I/O?
|
||||||
@@ -210,6 +249,8 @@ interrupt-driven console I/O?
|
|||||||
What's new
|
What's new
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
Support for Java is being actively worked on.
|
||||||
|
|
||||||
|
|
||||||
Thanks
|
Thanks
|
||||||
------
|
------
|
||||||
@@ -460,10 +501,3 @@ Timing tests:
|
|||||||
rtems_rate_monotonic_period: obtain status 13
|
rtems_rate_monotonic_period: obtain status 13
|
||||||
|
|
||||||
|
|
||||||
Network tests:
|
|
||||||
|
|
||||||
The driver is currently being worked on. It is somewhat functional,
|
|
||||||
but it does run out of buffers under certain conditions. The code is
|
|
||||||
also undergoing a substantial reorganization. Before making any changes,
|
|
||||||
you should check with us for the availability of updates.
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,15 +7,11 @@
|
|||||||
*cpp:
|
*cpp:
|
||||||
%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
|
%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
|
||||||
|
|
||||||
*endfile:
|
|
||||||
%{qelf: crtend.o%s crtn.o%s}
|
|
||||||
|
|
||||||
*lib:
|
*lib:
|
||||||
%{!qrtems: %(old_lib)} %{qrtems: --start-group \
|
%{!qrtems: %(old_lib)} %{qrtems: --start-group \
|
||||||
%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
|
%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
|
||||||
-lc -lgcc --end-group \
|
%{qjava: -lffi -lzgcj -lgcj} %{qc++: -lstdc++} -lc -lgcc --end-group \
|
||||||
%{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T
|
%{!qnolinkcmds: -T linkcmds%s}}
|
||||||
linkcmds%s}}}
|
|
||||||
|
|
||||||
*startfile:
|
*startfile:
|
||||||
%{!qrtems: %(old_startfile)} %{qrtems: \
|
%{!qrtems: %(old_startfile)} %{qrtems: \
|
||||||
|
|||||||
@@ -17,8 +17,11 @@ RTEMS_CANONICALIZE_TOOLS
|
|||||||
RTEMS_ENV_RTEMSBSP
|
RTEMS_ENV_RTEMSBSP
|
||||||
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
|
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
|
||||||
RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
|
RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
|
||||||
|
RTEMS_CHECK_NETWORKING
|
||||||
RTEMS_CANONICAL_HOST
|
RTEMS_CANONICAL_HOST
|
||||||
|
|
||||||
|
AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
|
||||||
|
|
||||||
RTEMS_PROJECT_ROOT
|
RTEMS_PROJECT_ROOT
|
||||||
|
|
||||||
# Explicitly list all Makefiles here
|
# Explicitly list all Makefiles here
|
||||||
@@ -28,6 +31,7 @@ clock/Makefile
|
|||||||
console/Makefile
|
console/Makefile
|
||||||
fatal/Makefile
|
fatal/Makefile
|
||||||
include/Makefile
|
include/Makefile
|
||||||
|
network/Makefile
|
||||||
start/Makefile
|
start/Makefile
|
||||||
startup/Makefile
|
startup/Makefile
|
||||||
timer/Makefile
|
timer/Makefile
|
||||||
|
|||||||
@@ -2,17 +2,19 @@
|
|||||||
* console.c
|
* console.c
|
||||||
*
|
*
|
||||||
* This file contains the MVME167 termios console package. Only asynchronous
|
* This file contains the MVME167 termios console package. Only asynchronous
|
||||||
* I/O is supported. Normal I/O uses DMA for output, interrupts for input.
|
* I/O is supported.
|
||||||
* Very limited support is provided for polled I/O. Polled I/O is intended
|
|
||||||
* only for running the RTEMS test suites, and uses the 167Bug console only.
|
|
||||||
*
|
*
|
||||||
* /dev/tty0 is channel 0, Serial Port 1/Console on the MVME712M.
|
* /dev/tty0 is channel 0, Serial Port 1/Console on the MVME712M.
|
||||||
* /dev/tty1 is channel 1, Serial Port 2/TTY01 on the MVME712M.
|
* /dev/tty1 is channel 1, Serial Port 2/TTY01 on the MVME712M.
|
||||||
* /dev/tty2 is channel 2, Serial Port 3 on the MVME712M.
|
* /dev/tty2 is channel 2, Serial Port 3 on the MVME712M.
|
||||||
* /dev/tty3 is channel 3, Serial Port 4 on the MVME712M.
|
* /dev/tty3 is channel 3, Serial Port 4 on the MVME712M.
|
||||||
*
|
*
|
||||||
* /dev/console is fixed to be /dev/tty01, Serial Port 2. 167Bug is given
|
* Normal I/O uses DMA for output, interrupts for input. /dev/console is
|
||||||
* Serial Port 1/Console. Do not open /dev/tty00.
|
* fixed to be /dev/tty01, Serial Port 2. Very limited support is provided
|
||||||
|
* for polled I/O. Polled I/O is intended only for running the RTEMS test
|
||||||
|
* suites. In all cases, Serial Port 1/Console is allocated to 167Bug and
|
||||||
|
* is the dedicated debugger port. We configure GDB to use 167Bug for
|
||||||
|
* debugging. When debugging with GDB or 167Bug, do not open /dev/tty00.
|
||||||
*
|
*
|
||||||
* Modern I/O chips often contain a number of I/O devices that can operate
|
* Modern I/O chips often contain a number of I/O devices that can operate
|
||||||
* almost independently of each other. Typically, in RTEMS, all devices in
|
* almost independently of each other. Typically, in RTEMS, all devices in
|
||||||
@@ -125,13 +127,12 @@
|
|||||||
|
|
||||||
#define M167_INIT
|
#define M167_INIT
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <bsp.h> /* Must be before libio.h */
|
#include <bsp.h> /* Must be before libio.h */
|
||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
|
|
||||||
#define CD2401_INT_LEVEL 1 /* Interrupt level for the CD2401 */
|
|
||||||
#define CD2401_POLLED_IO 0 /* 0 for interrupt-driven, 1 for polled I/O */
|
|
||||||
|
|
||||||
|
|
||||||
/* Channel info */
|
/* Channel info */
|
||||||
/* static */ struct {
|
/* static */ struct {
|
||||||
@@ -1081,21 +1082,25 @@ int _167Bug_pollRead(
|
|||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|
||||||
/* Check for a char in the input FIFO */
|
/* Check for a char in the input FIFO */
|
||||||
asm volatile( "trap #15 /* Trap to 167Bug (.INSTAT) */
|
asm volatile( "movew #0x1, -(%%sp) /* Code for .INSTAT */
|
||||||
.short 0x01
|
movew %1, -(%%sp) /* Channel */
|
||||||
|
trap #15 /* Trap to 167Bug */
|
||||||
|
.short 0x60 /* Code for .REDIR */
|
||||||
move %%cc, %0 /* Get condition codes */
|
move %%cc, %0 /* Get condition codes */
|
||||||
andil #4, %0"
|
andil #4, %0" /* Keep the Zero bit */
|
||||||
: "=d" (char_not_available) :: "%%cc" );
|
: "=d" (char_not_available) : "d" (minor): "%%cc" );
|
||||||
|
|
||||||
if (char_not_available)
|
if (char_not_available)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Read the char and return it */
|
/* Read the char and return it */
|
||||||
asm volatile( "subq.l #2,%%a7 /* Space for result */
|
asm volatile( "subq.l #2,%%a7 /* Space for result */
|
||||||
trap #15 /* Trap to 167 Bug (.INCHR) */
|
movew #0x0, -(%%sp) /* Code for .INCHR */
|
||||||
.short 0x00
|
movew %1, -(%%sp) /* Channel */
|
||||||
moveb (%%a7)+, %0"
|
trap #15 /* Trap to 167 Bug */
|
||||||
: "=d" (c) );
|
.short 0x60 /* Code for .REDIR */
|
||||||
|
moveb (%%a7)+, %0" /* Pop char into c */
|
||||||
|
: "=d" (c) : "d" (minor) );
|
||||||
|
|
||||||
return (int)c;
|
return (int)c;
|
||||||
}
|
}
|
||||||
@@ -1128,17 +1133,54 @@ int _167Bug_pollWrite(
|
|||||||
{
|
{
|
||||||
const char *endbuf = buf + len;
|
const char *endbuf = buf + len;
|
||||||
|
|
||||||
asm volatile( "pea (%0)
|
asm volatile( "pea (%0) /* endbuf */
|
||||||
pea (%1)
|
pea (%1) /* buf */
|
||||||
trap #15 /* trap to 167Bug (.OUTSTR) */
|
movew #0x21, -(%%sp) /* Code for .OUTSTR */
|
||||||
.short 0x21"
|
movew %2, -(%%sp) /* Channel */
|
||||||
:: "a" (endbuf), "a" (buf) );
|
trap #15 /* Trap to 167Bug */
|
||||||
|
.short 0x60" /* Code for .REDIR */
|
||||||
|
:: "a" (endbuf), "a" (buf), "d" (minor) );
|
||||||
|
|
||||||
/* Return something */
|
/* Return something */
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print functions: prototyped in bsp.h
|
||||||
|
* Debug printing on Channel 1
|
||||||
|
*/
|
||||||
|
|
||||||
|
void printk( char *fmt, ... )
|
||||||
|
{
|
||||||
|
va_list ap; /* points to each unnamed argument in turn */
|
||||||
|
static char buf[256];
|
||||||
|
unsigned int level;
|
||||||
|
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
|
|
||||||
|
va_start(ap, fmt); /* make ap point to 1st unnamed arg */
|
||||||
|
vsprintf(buf, fmt, ap); /* send output to buffer */
|
||||||
|
|
||||||
|
BSP_output_string(buf); /* print buffer -- Channel 1 */
|
||||||
|
|
||||||
|
va_end(ap); /* clean up and re-enable interrupts */
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BSP_output_string( char * buf )
|
||||||
|
{
|
||||||
|
int len = strlen(buf);
|
||||||
|
rtems_status_code sc;
|
||||||
|
|
||||||
|
/* The first argument forces a print to Port2 (ttyS1) */
|
||||||
|
sc = _167Bug_pollWrite(1, buf, len);
|
||||||
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
|
rtems_fatal_error_occurred (sc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
***************
|
***************
|
||||||
* BOILERPLATE *
|
* BOILERPLATE *
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TMPINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp.h \
|
|||||||
$(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/page_table.h \
|
$(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/page_table.h \
|
||||||
$(PROJECT_INCLUDE)/fatal.h
|
$(PROJECT_INCLUDE)/fatal.h
|
||||||
|
|
||||||
all-local: $(TMPINSTALL_FILES)
|
all: $(TMPINSTALL_FILES)
|
||||||
|
|
||||||
EXTRA_DIST = bsp.h coverhd.h fatal.h page_table.h
|
EXTRA_DIST = bsp.h coverhd.h fatal.h page_table.h
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,15 @@ extern "C" {
|
|||||||
#include <iosupp.h>
|
#include <iosupp.h>
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Network driver configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct rtems_bsdnet_ifconfig;
|
||||||
|
extern int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig );
|
||||||
|
#define RTEMS_BSP_NETWORK_DRIVER_NAME "uti1"
|
||||||
|
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH uti596_attach
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is NOT the base address of local RAM!
|
* This is NOT the base address of local RAM!
|
||||||
* This is the base local address of the VMEbus short I/O space. A local
|
* This is the base local address of the VMEbus short I/O space. A local
|
||||||
@@ -396,6 +405,28 @@ typedef volatile struct cd2401_regs_ {
|
|||||||
|
|
||||||
void console_reserve_resources( rtems_configuration_table *configuration );
|
void console_reserve_resources( rtems_configuration_table *configuration );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Debug print functions: implemented in console.c
|
||||||
|
*/
|
||||||
|
void printk( char *fmt, ... );
|
||||||
|
void BSP_output_string( char * buf );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Representation of 82596CA LAN controller: Memory Map
|
||||||
|
*/
|
||||||
|
typedef volatile struct i82596_regs_ {
|
||||||
|
unsigned short port_lower; /* 0xFFF46000 */
|
||||||
|
unsigned short port_upper; /* 0xFFF46002 */
|
||||||
|
unsigned long chan_attn; /* 0xFFF46004 */
|
||||||
|
} i82596_regs;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Base address of the 82596.
|
||||||
|
*/
|
||||||
|
#define i82596 ((i82596_regs * const) 0xFFF46000)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* BSP-wide functions */
|
/* BSP-wide functions */
|
||||||
|
|
||||||
void bsp_cleanup( void );
|
void bsp_cleanup( void );
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ PGM = $(ARCH)/network.rel
|
|||||||
C_FILES = network.c
|
C_FILES = network.c
|
||||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
||||||
|
|
||||||
H_FILES = uti596.h
|
H_FILES = netexterns.h uti596.h
|
||||||
|
|
||||||
OBJS = $(C_O_FILES)
|
OBJS = $(C_O_FILES)
|
||||||
|
|
||||||
@@ -20,6 +20,8 @@ include $(top_srcdir)/../../../../../../automake/lib.am
|
|||||||
# (OPTIONAL) Add local stuff here using +=
|
# (OPTIONAL) Add local stuff here using +=
|
||||||
#
|
#
|
||||||
|
|
||||||
|
AM_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
|
||||||
|
|
||||||
$(PGM): $(OBJS)
|
$(PGM): $(OBJS)
|
||||||
$(make-rel)
|
$(make-rel)
|
||||||
|
|
||||||
@@ -31,6 +33,6 @@ endif
|
|||||||
|
|
||||||
.PRECIOUS: $(PGM)
|
.PRECIOUS: $(PGM)
|
||||||
|
|
||||||
EXTRA_DIST = network.c uti596.h
|
EXTRA_DIST = network.c netexterns.h uti596.h
|
||||||
|
|
||||||
include $(top_srcdir)/../../../../../../automake/local.am
|
include $(top_srcdir)/../../../../../../automake/local.am
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
/* uti596.h: Contains the defines and structures used by the uti596 driver */
|
/* uti596.h: Contains the defines and structures used by the uti596 driver */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -296,3 +297,4 @@ typedef volatile struct uti596_softc {
|
|||||||
} uti596_softc_;
|
} uti596_softc_;
|
||||||
|
|
||||||
#endif /* UTI596_H */
|
#endif /* UTI596_H */
|
||||||
|
|
||||||
|
|||||||
@@ -32,16 +32,12 @@ $(PGM): $(OBJS)
|
|||||||
$(PROJECT_RELEASE)/lib/linkcmds: linkcmds
|
$(PROJECT_RELEASE)/lib/linkcmds: linkcmds
|
||||||
$(INSTALL_DATA) $< $@
|
$(INSTALL_DATA) $< $@
|
||||||
|
|
||||||
$(PROJECT_RELEASE)/lib/elflinkcmds: elflinkcmds
|
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds
|
||||||
$(INSTALL_DATA) $< $@
|
|
||||||
|
|
||||||
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds \
|
|
||||||
$(PROJECT_RELEASE)/lib/elflinkcmds
|
|
||||||
|
|
||||||
all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
|
all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
|
||||||
|
|
||||||
.PRECIOUS: $(PGM)
|
.PRECIOUS: $(PGM)
|
||||||
|
|
||||||
EXTRA_DIST = bspclean.c bspstart.c elflinkcmds linkcmds page_table.c
|
EXTRA_DIST = bspclean.c bspstart.c linkcmds page_table.c
|
||||||
|
|
||||||
include $(top_srcdir)/../../../../../../automake/local.am
|
include $(top_srcdir)/../../../../../../automake/local.am
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ void bsp_start( void )
|
|||||||
{
|
{
|
||||||
extern void *_WorkspaceBase;
|
extern void *_WorkspaceBase;
|
||||||
extern m68k_isr_entry M68Kvec[];
|
extern m68k_isr_entry M68Kvec[];
|
||||||
extern void *_WorkspaceBase;
|
|
||||||
|
|
||||||
void M68KFPSPInstallExceptionHandlers (void);
|
void M68KFPSPInstallExceptionHandlers (void);
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ OUTPUT_ARCH(m68k)
|
|||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Declare some sizes.
|
* Declare some sizes. Heap is sized at whatever ram space is left.
|
||||||
*/
|
*/
|
||||||
_RamBase = 0x00800000;
|
_RamBase = DEFINED(_RamBase) ? _RamBase : 0x00800000;
|
||||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
|
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
|
||||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0;
|
||||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
@@ -42,10 +42,6 @@ MEMORY
|
|||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
ram : {
|
|
||||||
. = .;
|
|
||||||
} >ram
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Text, data and bss segments
|
* Text, data and bss segments
|
||||||
*/
|
*/
|
||||||
@@ -76,6 +72,7 @@ SECTIONS
|
|||||||
*crti.o(.init)
|
*crti.o(.init)
|
||||||
*(.init)
|
*(.init)
|
||||||
*crtn.o(.init)
|
*crtn.o(.init)
|
||||||
|
|
||||||
PROVIDE (_fini = .);
|
PROVIDE (_fini = .);
|
||||||
*crti.o(.fini)
|
*crti.o(.fini)
|
||||||
*(.fini)
|
*(.fini)
|
||||||
@@ -97,6 +94,7 @@ SECTIONS
|
|||||||
*crtbegin.o(.ctors)
|
*crtbegin.o(.ctors)
|
||||||
*(.ctors)
|
*(.ctors)
|
||||||
*crtend.o(.ctors)
|
*crtend.o(.ctors)
|
||||||
|
|
||||||
*crtbegin.o(.dtors)
|
*crtbegin.o(.dtors)
|
||||||
*(.dtors)
|
*(.dtors)
|
||||||
*crtend.o(.dtors)
|
*crtend.o(.dtors)
|
||||||
@@ -111,13 +109,15 @@ SECTIONS
|
|||||||
* Read-only data
|
* Read-only data
|
||||||
*/
|
*/
|
||||||
. = ALIGN (16);
|
. = ALIGN (16);
|
||||||
_rodata_start = . ;
|
PROVIDE(_rodata_start = . );
|
||||||
*(.rodata)
|
*(.rodata)
|
||||||
*(.gnu.linkonce.r*)
|
*(.gnu.linkonce.r*)
|
||||||
|
PROVIDE(_erodata = . );
|
||||||
|
|
||||||
. = ALIGN (16);
|
. = ALIGN (16);
|
||||||
PROVIDE (_etext = .);
|
PROVIDE (_etext = .);
|
||||||
} >ram
|
} >ram
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
PROVIDE (_copy_start = .);
|
PROVIDE (_copy_start = .);
|
||||||
*(.data)
|
*(.data)
|
||||||
@@ -127,6 +127,7 @@ SECTIONS
|
|||||||
PROVIDE (_edata = .);
|
PROVIDE (_edata = .);
|
||||||
PROVIDE (_copy_end = .);
|
PROVIDE (_copy_end = .);
|
||||||
} >ram
|
} >ram
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
_clear_start = .;
|
_clear_start = .;
|
||||||
*(.bss)
|
*(.bss)
|
||||||
@@ -141,4 +142,44 @@ SECTIONS
|
|||||||
|
|
||||||
_WorkspaceBase = .;
|
_WorkspaceBase = .;
|
||||||
} >ram
|
} >ram
|
||||||
|
|
||||||
|
/* Stabs debugging sections. */
|
||||||
|
.stab 0 : { *(.stab) }
|
||||||
|
.stabstr 0 : { *(.stabstr) }
|
||||||
|
.stab.excl 0 : { *(.stab.excl) }
|
||||||
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||||
|
.stab.index 0 : { *(.stab.index) }
|
||||||
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||||
|
.comment 0 : { *(.comment) }
|
||||||
|
|
||||||
|
/* DWARF debug sections.
|
||||||
|
Symbols in the DWARF debugging sections are relative to the beginning
|
||||||
|
of the section so we begin them at 0. */
|
||||||
|
/* DWARF 1 */
|
||||||
|
.debug 0 : { *(.debug) }
|
||||||
|
.line 0 : { *(.line) }
|
||||||
|
|
||||||
|
/* GNU DWARF 1 extensions */
|
||||||
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||||
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||||
|
|
||||||
|
/* DWARF 1.1 and DWARF 2 */
|
||||||
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||||
|
|
||||||
|
/* DWARF 2 */
|
||||||
|
.debug_info 0 : { *(.debug_info) }
|
||||||
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||||
|
.debug_line 0 : { *(.debug_line) }
|
||||||
|
.debug_frame 0 : { *(.debug_frame) }
|
||||||
|
.debug_str 0 : { *(.debug_str) }
|
||||||
|
.debug_loc 0 : { *(.debug_loc) }
|
||||||
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||||
|
|
||||||
|
/* SGI/MIPS DWARF 2 extensions */
|
||||||
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||||
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||||
|
.debug_typenames 0 : { *(.debug_typenames) }
|
||||||
|
.debug_varnames 0 : { *(.debug_varnames) }
|
||||||
|
/* These must appear regardless of . */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ void page_table_init(
|
|||||||
* E = 0b1 enable address translation
|
* E = 0b1 enable address translation
|
||||||
* S-Field = 0b1X ignore FC2 when matching
|
* S-Field = 0b1X ignore FC2 when matching
|
||||||
* U1, U0 = 0b00 user page attributes not used
|
* U1, U0 = 0b00 user page attributes not used
|
||||||
* CM = 0b01 cachable, writethrough
|
* CM = 0b01 cachable, copyback
|
||||||
* W = 0b0 read/write access allowed
|
* W = 0b0 read/write access allowed
|
||||||
*/
|
*/
|
||||||
dtt0 = 0x007FC020;
|
dtt0 = 0x007FC020;
|
||||||
|
|||||||
@@ -4,7 +4,12 @@
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign 1.4
|
AUTOMAKE_OPTIONS = foreign 1.4
|
||||||
|
|
||||||
BSP_PIECES = clock console fatal startup timer
|
# We only build the networking device driver if HAS_NETWORKING was defined
|
||||||
|
if HAS_NETWORKING
|
||||||
|
NETWORKING_DRIVER = network
|
||||||
|
endif
|
||||||
|
|
||||||
|
BSP_PIECES = clock console fatal startup timer $(NETWORKING_DRIVER)
|
||||||
|
|
||||||
# bummer; have to use $foreach since % pattern subst rules only replace 1x
|
# bummer; have to use $foreach since % pattern subst rules only replace 1x
|
||||||
OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
|
OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ extern void bsp_libc_init( void *, unsigned long, int );
|
|||||||
extern rtems_configuration_table BSP_Configuration;
|
extern rtems_configuration_table BSP_Configuration;
|
||||||
|
|
||||||
extern unsigned long _RamSize;
|
extern unsigned long _RamSize;
|
||||||
|
extern void *_RamBase;
|
||||||
extern void *_WorkspaceBase;
|
extern void *_WorkspaceBase;
|
||||||
extern void *_HeapSize;
|
extern void *_HeapSize;
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ void bsp_pretasking_hook(void)
|
|||||||
|
|
||||||
heapStart = (void *)
|
heapStart = (void *)
|
||||||
((unsigned long)&_WorkspaceBase + BSP_Configuration.work_space_size);
|
((unsigned long)&_WorkspaceBase + BSP_Configuration.work_space_size);
|
||||||
ramSpace = _RamSize - (unsigned long) heapStart;
|
ramSpace = (unsigned long) &_RamBase + (unsigned long) &_RamSize - (unsigned long) heapStart;
|
||||||
|
|
||||||
if (heapSize == 0)
|
if (heapSize == 0)
|
||||||
heapSize = ramSpace;
|
heapSize = ramSpace;
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# THIS BSP USES ELF IMAGES. IT WILL NOT WORK WITH COFF UNLESS CHANGES
|
||||||
|
# ARE MADE TO THE LINKCMDS FILE.
|
||||||
|
|
||||||
RTEMS_CPU=m68k
|
RTEMS_CPU=m68k
|
||||||
RTEMS_CPU_MODEL=m68040
|
RTEMS_CPU_MODEL=m68040
|
||||||
|
|
||||||
@@ -14,10 +17,12 @@ RTEMS_BSP_FAMILY=mvme167
|
|||||||
|
|
||||||
#
|
#
|
||||||
# This contains the compiler options necessary to select the CPU model
|
# This contains the compiler options necessary to select the CPU model
|
||||||
# and (hopefully) optimize for it.
|
# and (hopefully) optimize for it. We also specify the BSP during compilation.
|
||||||
|
# This should really get its own flag, but it works here.
|
||||||
#
|
#
|
||||||
|
|
||||||
CPU_CFLAGS = -m68040
|
CPU_CFLAGS = -m68040 -DRTEMS_BSP=$(RTEMS_BSP)
|
||||||
|
CFLAGS_DEBUG_V += -ggdb
|
||||||
|
|
||||||
# optimize flag: typically -O, could use -O4 or -fast
|
# optimize flag: typically -O, could use -O4 or -fast
|
||||||
# -O4 is ok for RTEMS
|
# -O4 is ok for RTEMS
|
||||||
@@ -33,11 +38,21 @@ CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
|
|||||||
#
|
#
|
||||||
# RTEMS_DEBUG (RTEMS)
|
# RTEMS_DEBUG (RTEMS)
|
||||||
# If defined, debug checks in RTEMS and support library code are enabled.
|
# If defined, debug checks in RTEMS and support library code are enabled.
|
||||||
|
#
|
||||||
|
# CD2401_INT_LEVEL
|
||||||
|
# Interrupt level for the CD2401.
|
||||||
|
#
|
||||||
|
# CD2401_POLLED_IO
|
||||||
|
# 0 for interrupt-driven, 1 for polled I/O.
|
||||||
|
|
||||||
define make-target-options
|
define make-target-options
|
||||||
@echo "/* #define NDEBUG 1 */ " >>$@
|
@echo "/* #define NDEBUG 1 */ " >>$@
|
||||||
@echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
|
@echo "#define RTEMS_TEST_NO_PAUSE 1" >>$@
|
||||||
@echo "/* #define RTEMS_DEBUG 1 */" >>$@
|
@echo "/* #define RTEMS_DEBUG 1 */" >>$@
|
||||||
|
@echo "#define CD2401_INT_LEVEL 1" >>$@
|
||||||
|
@echo "#define CD2401_POLLED_IO 1" >>$@
|
||||||
|
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Here is the rule to actually build a $(ARCH)/foo.exe
|
# Here is the rule to actually build a $(ARCH)/foo.exe
|
||||||
@@ -79,7 +94,8 @@ define make-exe
|
|||||||
$(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \
|
$(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \
|
||||||
$(LINK_OBJS) $(LINK_LIBS)
|
$(LINK_OBJS) $(LINK_LIBS)
|
||||||
$(NM) -g -n $@ > $(basename $@).nm
|
$(NM) -g -n $@ > $(basename $@).nm
|
||||||
$(SIZE) $@
|
$(STRIP) -o $(basename $@) $@
|
||||||
|
$(SIZE) $(basename $@).exe
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user