Changeset bb734cc in rtems


Ignore:
Timestamp:
Apr 5, 2000, 6:24:48 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
35ff211
Parents:
ce70a16
Message:

Patch from Charles-Antoine Gauthier <charles.gauthier@…>
to update the mvme167 BSP and account for the fact that RAM base
does not have to start at 0.

Files:
17 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mvme167/Makefile.am

    rce70a16 rbb734cc  
    88# wrapup is the one that actually builds and installs the library
    99#  from the individual .rel files built in other directories
    10 SUBDIRS = . include start startup clock console fatal timer wrapup
     10
     11if HAS_NETWORKING
     12NETWORKING_DRIVER = network
     13endif
     14
     15SUBDIRS = . include start startup clock console fatal timer \
     16    $(NETWORKING_DRIVER) wrapup
    1117
    1218include $(top_srcdir)/../../bsp.am
  • c/src/lib/libbsp/m68k/mvme167/README

    rce70a16 rbb734cc  
    33#
    44
    5 This is a README file for the MVME167 port of RTEMS 4.0.0.
     5This is a README file for the MVME167 port of RTEMS 4.5.0.
    66
    77Please send any comments, improvements, or bug reports to:
    88
    99Charles-Antoine Gauthier
     10charles.gauthier@nrc.ca
     11or
     12
     13Darlene Stewart
     14Darlene.Stewart@nrc.ca
     15
    1016Software Engineering Group
    1117Institute for Information Technology
     
    1420Canada
    1521
    16 charles.gauthier@iit.nrc.ca
     22
     23WARNING:
     24--------
     25
     26The network driver is currently being worked on. It is somewhat functional,
     27but it does run out of buffers under certain conditions. The code is
     28also undergoing a substantial reorganization. Before making any changes,
     29you should check with us for the availability of updates.
     30
     31Note from Joel:  The ttcp performance reported is very nice even if the
     32driver is still early in its life. :)
     33
    1734 
    1835
     
    4461m68k targets. You will need to edit linkcmds to put in the start address
    4562of your board. We do TFTP transfers to our target. The mvme167.cfg file
    46 builds only the coff images, which we download to the target, skipping over
    47 the first 0xA8 bytes; Motorola S-records are not generated. Edit this file
    48 if you want S-records.
     63builds only the ELF images, which we download to the target, skipping
     64over the first 0x54 bytes; Motorola S-records are not generated. Edit
     65this file if you want S-records.
    4966
    5067
     
    5269Console driver
    5370
    54 ----------------
     71---------------
    5572
    5673This BSP includes an termios-capable console driver that supports all
     
    6178
    6279The console is initialized with whatever parameters are set up in termios
    63 before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE HANDSHAKING
    64 IS TURNED OFF, i.e. CLOCAL is set in the struct termios c_cflag field. We use
    65 3-wire cables for I/O, and find hardware handshaking a pain. If you enable
    66 hardware handshaking, you must drive CTS* low on the CD2401 for output to
    67 occur. If the port is in the DTE configuration, you must drive the RS-232 CTS
    68 line to space; if the port is in the DCE configuration, you must drive the
    69 RS-232 RTS line to space.
    70 
    71 Limited support is provided for polled terminal I/O. This is used when running
    72 the timing tests. Set the CD2401_POLLED_IO manifest constant to 1 in
    73 rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled I/O.
    74 In this case, I/O is done through 167Bug, usually to the Serial Port 1/Console
     80before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE
     81HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set in the struct termios
     82c_cflag field. We use 3-wire cables for I/O, and find hardware handshaking
     83a pain. If you enable hardware handshaking, you must drive CTS* low on the
     84CD2401 for output to occur. If the port is in the DTE configuration, you
     85must drive the RS-232 CTS line to space; if the port is in the DCE
     86configuration, you must drive the RS-232 RTS line to space.
     87
     88Limited support is provided for polled terminal I/O. This is used when
     89running the timing tests. Set the CD2401_POLLED_IO manifest constant to 1
     90in rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled
     91I/O. In this case, I/O is done through 167Bug, usually to the Serial Port
     921/Console port. Interrupt-driven and polled I/O cannot be mixed in the
     93MVME167.
     94
    7595
    7696Floating-point
    7797
    7898The MC68040 has a built-in FPU. This FPU does not implement all the
    79 instruction of the MC68881/MC68882 floating-point coprocessors in hardware.
    80 The -m68040 compilation options instructs gcc to not generate the missing
    81 instructions. All of the RTEMS code is built this way. Some of the missing
    82 functionality must be supplied by external libraries. The required functions
    83 are part of libgcc.a.
     99instruction of the MC68881/MC68882 floating-point coprocessors in
     100hardware. The -m68040 compilation options instructs gcc to not generate
     101the missing instructions. All of the RTEMS code is built this way. Some
     102of the missing functionality must be supplied by external libraries. The
     103required functions are part of libgcc.a.
    84104
    85105The issue gets complicated because libc, libm and libgcc do not come as
     
    128148
    129149
     150Cache Control and Memory Mapping
     151
     152If Jumper J1-7 is installed, the data cache will be turned on. If Jumper
     153J1-6 is installed, the instruction cache will be turned on. Removing the
     154jumper causes the corresponding cache to be left disabled.
     155
     156If Jumper J1-5 is installed, the data cache will be placed in copyback
     157mode. If it is removed, it will be placed in writethrough mode.
     158
     159Currently, block address translation is set up to map the virtual
     1600x00000000--0x7FFFFFFF to the physical range 0x00000000--0x7FFFFFFF. The
     161port relies on the hardware to raise exceptions when addressing
     162non-existent memory. Caching is not controllable on a finer grain.
     163
     164
    130165Miscellaneous
    131 
    132 port. Interrupt-driven and polled I/O cannot be mixed in the MVME167.
    133166
    134167The timer and clock drivers were patterned after the MVME162 and MVME152
     
    137170At this time, we do not have an MPCI layer for the MVME167. We are planning
    138171to write one.
    139 
    140 The port does not have a network driver.
    141172
    142173This port supplies its own fatal_error_handler, which attempts to print some
     
    154185    - GNU binutils 2.9.1 configured for a powerpc-ibm-aix4.2.0.0 host and
    155186      m68k-rtems target;
     187
    156188It was also tested on a Pentium II-based PC running Windows NT Workstation 4.0
    157 and the Cygnus Cygwin32 release b20.1 environment, witht he following tools:
     189and the Cygnus Cygwin32 release b20.1 environment, with the following tools:
    158190
    159191    - EGCS 1.1.1 configured for a i586-cygwin32 host and m68k-rtems target;
    160192    - GNU binutils 2.9.4 configured for a i586-cygwin32 host and m68k-rtems
    161193      target;
    162     - Cygnus newlib 1.8.0 with RTEMS 4.0.0 patches.
    163194
    164195With the latter environment, be patient; builds take a very looong time...
    165196
    166     - Cygnus newlib 1.8.0 with RTEMS 4.0.0 patches.
     197Current development is done on a Pentium III PC running RedHat Linux 6.1.
     198At the time this README was composed, the latest working compiler that was
     199used successfully was gcc version 2.96 20000213 (experimental). Both the C
     200and C++ compilers were working. Binutils 2.9.1 are used.
    167201
    168202
     
    203237than propagating the error).
    204238
     239In the stackchk test, an access fault exception is raised after the stack is
     240blown. This is one case were overwritting the first or last 16 bytes of the
     241stack does cause problems (but hey, an exception occurred, which is better
     242than propagating the error).
     243
    205244When using interrupt-driven I/O, psx08 produces all the expected output, but
    206245it does not return control to 167Bug. Is this test supposed to work with
     
    210249What's new
    211250----------
     251
     252Support for Java is being actively worked on.
    212253
    213254
     
    461502
    462503
    463 Network tests:
    464 
    465 The driver is currently being worked on. It is somewhat functional,
    466 but it does run out of buffers under certain conditions. The code is
    467 also undergoing a substantial reorganization. Before making any changes,
    468 you should check with us for the availability of updates. 
    469 
  • c/src/lib/libbsp/m68k/mvme167/bsp_specs

    rce70a16 rbb734cc  
    88%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
    99
    10 *endfile:
    11 %{qelf: crtend.o%s crtn.o%s}
    12 
    1310*lib:
    1411%{!qrtems: %(old_lib)} %{qrtems: --start-group \
    1512%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
    16 -lc -lgcc --end-group \
    17 %{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T
    18 linkcmds%s}}}
     13%{qjava: -lffi -lzgcj -lgcj} %{qc++: -lstdc++} -lc -lgcc --end-group \
     14%{!qnolinkcmds: -T linkcmds%s}}
    1915
    2016*startfile:
  • c/src/lib/libbsp/m68k/mvme167/configure.in

    rce70a16 rbb734cc  
    1818RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
    1919RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
     20RTEMS_CHECK_NETWORKING
    2021RTEMS_CANONICAL_HOST
     22
     23AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
    2124
    2225RTEMS_PROJECT_ROOT
     
    2932fatal/Makefile
    3033include/Makefile
     34network/Makefile
    3135start/Makefile
    3236startup/Makefile
  • c/src/lib/libbsp/m68k/mvme167/console/console.c

    rce70a16 rbb734cc  
    33 *
    44 *  This file contains the MVME167 termios console package. Only asynchronous
    5  *  I/O is supported. Normal I/O uses DMA for output, interrupts for input.
    6  *  Very limited support is provided for polled I/O. Polled I/O is intended
    7  *  only for running the RTEMS test suites, and uses the 167Bug console only.
     5 *  I/O is supported.
    86 *
    97 *  /dev/tty0 is channel 0, Serial Port 1/Console on the MVME712M.
     
    1210 *  /dev/tty3 is channel 3, Serial Port 4 on the MVME712M.
    1311 *
    14  *  /dev/console is fixed to be /dev/tty01, Serial Port 2. 167Bug is given
    15  *  Serial Port 1/Console. Do not open /dev/tty00.
     12 *  Normal I/O uses DMA for output, interrupts for input. /dev/console is
     13 *  fixed to be /dev/tty01, Serial Port 2. Very limited support is provided
     14 *  for polled I/O. Polled I/O is intended only for running the RTEMS test
     15 *  suites. In all cases, Serial Port 1/Console is allocated to 167Bug and
     16 *  is the dedicated debugger port. We configure GDB to use 167Bug for
     17 *  debugging. When debugging with GDB or 167Bug, do not open /dev/tty00.
    1618 *
    1719 *  Modern I/O chips often contain a number of I/O devices that can operate
    1820 *  almost independently of each other. Typically, in RTEMS, all devices in
    1921 *  an I/O chip are handled by a single device driver, but that need not be
    20  *  always the case. Each device driver must supply six entry  points in the
     22 *  always the case. Each device driver must supply six entry points in the
    2123 *  Device Driver Table: a device initialization function, as well as an open,
    2224 *  close, read, write and a control function. RTEMS assigns a device major
     
    6062 *  configuration, and that configuration then changed through a series of
    6163 *  device driver control calls. There is no standard API in RTEMS to switch
    62  *   a serial line to some synchronous protocol.
     64 *  a serial line to some synchronous protocol.
    6365 *
    6466 *  A better approach is to treat each channel as a separate device, each with
     
    9799 *  multiple tasks is likely to cause significant problems! Concurrency
    98100 *  control is implemented in the termios package.
    99 *
     101 *
    100102 *  THE INTERRUPT LEVEL IS SET TO 1 FOR ALL CHANNELS.
    101103 *  If the CD2401 is to be used for high speed synchronous serial I/O, the
     
    126128#define M167_INIT
    127129
     130#include <stdarg.h>
     131#include <stdio.h>
    128132#include <termios.h>
    129133#include <bsp.h>                /* Must be before libio.h */
    130134#include <rtems/libio.h>
    131 
    132 #define CD2401_INT_LEVEL 1      /* Interrupt level for the CD2401 */
    133 #define CD2401_POLLED_IO 0      /* 0 for interrupt-driven, 1 for polled I/O */
    134135
    135136
     
    570571    /* DMA done */
    571572    cd2401->ier &= 0xFC;        /* Shut up the interrupts */
    572    
     573
    573574    /* This call can result in a call to cd2401_write() */
    574575    rtems_termios_dequeue_characters (
     
    635636  if (sc != RTEMS_SUCCESSFUL)
    636637    rtems_fatal_error_occurred (sc);
    637    
     638
    638639  /*
    639640   *  Turn off hardware flow control. It is a pain with 3-wire cables.
     
    647648  if (sc != RTEMS_SUCCESSFUL)
    648649    rtems_fatal_error_occurred (sc);
    649  
     650
    650651  /* Mark that the channel as initialized */
    651652  CD2401_Channel_Info[minor].tty = args->iop->data1;
     
    877878    istrip = 0;                 /* Leave as 8 bits */
    878879
    879  
     880
    880881  /* Clear channel and disable rx and tx */
    881882  cd2401_chan_cmd (minor, 0x40, 1);
    882  
     883
    883884  /* Write to the ports */
    884885  cd2401->car = minor;          /* Select channel */
     
    10801081  int char_not_available;
    10811082  unsigned char c;
    1082  
     1083
    10831084  /* Check for a char in the input FIFO */
    1084   asm volatile( "trap   #15       /* Trap to 167Bug (.INSTAT) */
    1085                  .short 0x01
    1086                  move   %%cc, %0  /* Get condition codes */
    1087                  andil  #4, %0"
    1088     : "=d" (char_not_available) :: "%%cc" );
    1089    
     1085  asm volatile( "movew  #0x1, -(%%sp)   /* Code for .INSTAT */
     1086                 movew  %1, -(%%sp)     /* Channel */
     1087                 trap   #15             /* Trap to 167Bug */
     1088                 .short 0x60            /* Code for .REDIR */
     1089                 move   %%cc, %0        /* Get condition codes */
     1090                 andil  #4, %0"         /* Keep the Zero bit */
     1091    : "=d" (char_not_available) : "d" (minor): "%%cc" );
     1092
    10901093  if (char_not_available)
    10911094    return -1;
    1092    
     1095
    10931096  /* Read the char and return it */
    1094   asm volatile( "subq.l #2,%%a7   /* Space for result */
    1095                  trap   #15       /* Trap to 167 Bug (.INCHR) */
    1096                  .short 0x00
    1097                  moveb  (%%a7)+, %0"
    1098     : "=d" (c) );
    1099    
     1097  asm volatile( "subq.l #2,%%a7         /* Space for result */
     1098                 movew  #0x0, -(%%sp)   /* Code for .INCHR */
     1099                 movew  %1, -(%%sp)     /* Channel */
     1100                 trap   #15             /* Trap to 167 Bug */
     1101                 .short 0x60            /* Code for .REDIR */
     1102                 moveb  (%%a7)+, %0"    /* Pop char into c */
     1103    : "=d" (c) : "d" (minor) );
     1104
    11001105  return (int)c;
    11011106}
     
    11061111 *
    11071112 *  Output buffer through 167Bug. Returns only once every character has been
    1108  *  sent (polled output). 
     1113 *  sent (polled output).
    11091114 *
    11101115 *  Input parameters:
     
    11281133{
    11291134  const char *endbuf = buf + len;
    1130  
    1131   asm volatile( "pea    (%0)
    1132                  pea    (%1)
    1133                  trap   #15     /* trap to 167Bug (.OUTSTR) */
    1134                  .short 0x21"
    1135     :: "a" (endbuf), "a" (buf) );
    1136    
     1135
     1136  asm volatile( "pea    (%0)            /* endbuf */
     1137                 pea    (%1)            /* buf */
     1138                 movew  #0x21, -(%%sp)  /* Code for .OUTSTR */
     1139                 movew  %2, -(%%sp)     /* Channel */
     1140                 trap   #15             /* Trap to 167Bug */
     1141                 .short 0x60"           /* Code for .REDIR */
     1142    :: "a" (endbuf), "a" (buf), "d" (minor) );
     1143
    11371144  /* Return something */
    11381145  return RTEMS_SUCCESSFUL;
     1146}
     1147
     1148
     1149/*
     1150 *  Print functions: prototyped in bsp.h
     1151 *  Debug printing on Channel 1
     1152 */
     1153 
     1154void printk( char *fmt, ... )
     1155{
     1156  va_list  ap;                  /* points to each unnamed argument in turn */
     1157  static char buf[256];
     1158  unsigned int level;
     1159 
     1160  _CPU_ISR_Disable(level);
     1161 
     1162  va_start(ap, fmt);            /* make ap point to 1st unnamed arg */
     1163  vsprintf(buf, fmt, ap);       /* send output to buffer */
     1164 
     1165  BSP_output_string(buf);       /* print buffer -- Channel 1 */
     1166 
     1167  va_end(ap);                           /* clean up and re-enable interrupts */
     1168  _CPU_ISR_Enable(level);
     1169}
     1170
     1171
     1172void BSP_output_string( char * buf )
     1173{
     1174  int len = strlen(buf);                       
     1175  rtems_status_code sc;
     1176 
     1177  /* The first argument forces a print to Port2 (ttyS1) */
     1178  sc = _167Bug_pollWrite(1, buf, len);
     1179  if (sc != RTEMS_SUCCESSFUL)
     1180    rtems_fatal_error_occurred (sc);
    11391181}
    11401182
     
    12301272    0                           /* outputUsesInterrupts */
    12311273  };
    1232  
     1274
    12331275#else
    12341276
     
    12431285    1                           /* outputUsesInterrupts */
    12441286  };
    1245  
     1287
    12461288#endif
    12471289
  • c/src/lib/libbsp/m68k/mvme167/include/Makefile.am

    rce70a16 rbb734cc  
    2626    $(PROJECT_INCLUDE)/fatal.h
    2727
    28 all-local: $(TMPINSTALL_FILES)
     28all: $(TMPINSTALL_FILES)
    2929
    3030EXTRA_DIST = bsp.h coverhd.h fatal.h page_table.h
  • c/src/lib/libbsp/m68k/mvme167/include/bsp.h

    rce70a16 rbb734cc  
    3232#include <iosupp.h>
    3333
     34
     35/*
     36 * Network driver configuration
     37 */
     38 
     39struct rtems_bsdnet_ifconfig;
     40extern int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig );
     41#define RTEMS_BSP_NETWORK_DRIVER_NAME   "uti1"
     42#define RTEMS_BSP_NETWORK_DRIVER_ATTACH uti596_attach
    3443
    3544/*
     
    397406void console_reserve_resources( rtems_configuration_table *configuration );
    398407
     408/*
     409 *  Debug print functions: implemented in console.c
     410 */
     411void printk( char *fmt, ... );
     412void BSP_output_string( char * buf );
     413
     414/*
     415 *  Representation of 82596CA LAN controller: Memory Map
     416 */
     417typedef volatile struct i82596_regs_ {
     418  unsigned short        port_lower;                               /* 0xFFF46000 */
     419  unsigned short        port_upper;                     /* 0xFFF46002 */
     420  unsigned long         chan_attn;                                /* 0xFFF46004 */
     421} i82596_regs;
     422
     423/*
     424 *  Base address of the 82596.
     425 */
     426#define i82596    ((i82596_regs * const) 0xFFF46000)
     427
     428
     429
    399430/* BSP-wide functions */
    400431
  • c/src/lib/libbsp/m68k/mvme167/network/Makefile.am

    rce70a16 rbb734cc  
    1010C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1111
    12 H_FILES = uti596.h
     12H_FILES = netexterns.h uti596.h
    1313
    1414OBJS = $(C_O_FILES)
     
    2020# (OPTIONAL) Add local stuff here using +=
    2121#
     22
     23AM_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
    2224
    2325$(PGM): $(OBJS)
     
    3234.PRECIOUS: $(PGM)
    3335
    34 EXTRA_DIST = network.c uti596.h
     36EXTRA_DIST = network.c netexterns.h uti596.h
    3537
    3638include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/m68k/mvme167/network/netexterns.h

    rce70a16 rbb734cc  
    1212extern int uti596_attach(struct rtems_bsdnet_ifconfig *);
    1313extern int uti596dump(char * );
    14 extern void uti596reset(void); 
     14extern void uti596reset(void);
    1515extern void uti596Diagnose(int);
    1616extern void uti596_request_reset(void);
  • c/src/lib/libbsp/m68k/mvme167/network/uti596.h

    rce70a16 rbb734cc  
     1
    12
    23/* uti596.h: Contains the defines and structures used by the uti596 driver */
     
    2728
    2829struct enet_statistics{
    29   int   rx_packets;                                                     /* total packets received */
    30   int   tx_packets;                                                     /* total packets transmitted */
    31   int   rx_errors;                                                      /* bad packets received */
    32   int   tx_errors;                                                      /* packet transmit problems     */
    33   int   rx_dropped;                                                     /* no space in buffers */
    34   int   tx_dropped;
     30  int   rx_packets;                                                     /* total packets received */
     31  int   tx_packets;                                                     /* total packets transmitted */
     32  int   rx_errors;                                                      /* bad packets received */
     33  int   tx_errors;                                                      /* packet transmit problems     */
     34  int   rx_dropped;                                                     /* no space in buffers */
     35  int   tx_dropped;
    3536  int   tx_retries_exceeded;  /* excessive retries */
    36   int   multicast;                                                      /* multicast packets received   */
    37   int   collisions;
     37  int   multicast;                                                      /* multicast packets received   */
     38  int   collisions;
    3839
    3940  /* detailed rx_errors: */
    40   int   rx_length_errors;
    41   int   rx_over_errors;                                 /* receiver ring buff overflow  */
    42   int   rx_crc_errors;                                  /* recved pkt with crc error    */
    43   int   rx_frame_errors;                                /* recv'd frame alignment error */
    44   int   rx_fifo_errors;                                 /* recv'r fifo overrun          */
    45   int   rx_missed_errors;                               /* receiver missed packet       */
     41  int   rx_length_errors;
     42  int   rx_over_errors;                                 /* receiver ring buff overflow  */
     43  int   rx_crc_errors;                                  /* recved pkt with crc error    */
     44  int   rx_frame_errors;                                /* recv'd frame alignment error */
     45  int   rx_fifo_errors;                                 /* recv'r fifo overrun          */
     46  int   rx_missed_errors;                               /* receiver missed packet       */
    4647
    4748  /* detailed tx_errors */
    48   int   tx_aborted_errors;
    49   int   tx_carrier_errors;
    50   int   tx_fifo_errors;
    51   int   tx_heartbeat_errors;
    52   int   tx_window_errors;
     49  int   tx_aborted_errors;
     50  int   tx_carrier_errors;
     51  int   tx_fifo_errors;
     52  int   tx_heartbeat_errors;
     53  int   tx_window_errors;
    5354
    5455  /* NIC reset errors */
     
    5960
    6061
    61 #define CMD_EOL                                         0x8000          /* The last command of the list, stop. */
    62 #define CMD_SUSP                                        0x4000          /* Suspend after doing cmd.                                      */
    63 #define CMD_INTR                                        0x2000          /* Interrupt after doing cmd.                            */
    64 
    65 #define CMD_FLEX                                        0x0008          /* Enable flexible memory model */
    66 
    67 #define SCB_STAT_CX             0x8000          /* Cmd completes with 'I' bit set */
    68 #define SCB_STAT_FR             0x4000          /* Frame Received                 */
    69 #define SCB_STAT_CNA            0x2000          /* Cmd unit Not Active            */
    70 #define SCB_STAT_RNR            0x1000          /* Receiver Not Ready             */
     62#define CMD_EOL                                         0x8000          /* The last command of the list, stop. */
     63#define CMD_SUSP                                        0x4000          /* Suspend after doing cmd.                                      */
     64#define CMD_INTR                                        0x2000          /* Interrupt after doing cmd.                            */
     65
     66#define CMD_FLEX                                        0x0008          /* Enable flexible memory model */
     67
     68#define SCB_STAT_CX             0x8000          /* Cmd completes with 'I' bit set */
     69#define SCB_STAT_FR             0x4000          /* Frame Received                 */
     70#define SCB_STAT_CNA            0x2000          /* Cmd unit Not Active            */
     71#define SCB_STAT_RNR            0x1000          /* Receiver Not Ready             */
    7172
    7273#define SCB_CUS_SUSPENDED 0x0100
     
    7475
    7576
    76 #define STAT_C                                          0x8000          /* Set to 1 after execution              */
    77 #define STAT_B                                          0x4000          /* 1 : Cmd being executed, 0 : Cmd done. */
    78 #define STAT_OK                                         0x2000          /* 1: Command executed ok 0 : Error      */
    79 #define STAT_A                                  0x1000          /* command has been aborted              */
    80 
    81 #define STAT_S11                0x0800
    82 #define STAT_S10                0x0400
    83 #define STAT_S9                 0x0200
    84 #define STAT_S8                 0x0100
    85 #define STAT_S7                 0x0080
    86 #define STAT_S6                 0x0040
    87 #define STAT_S5                 0x0020
    88 #define STAT_MAX_COLLS          0x000F
    89 
    90 
    91 
    92 #define RBD_STAT_P              0x4000          /* prefetch */
    93 #define RBD_STAT_F              0x4000          /* used */
    94 
    95 #define CUC_START                                       0x0100
    96 #define CUC_RESUME                              0x0200
    97 #define CUC_SUSPEND             0x0300
    98 #define CUC_ABORT                                       0x0400
    99 #define RX_START                                        0x0010
    100 #define RX_RESUME                                       0x0020
    101 #define RX_SUSPEND                              0x0030
    102 #define RX_ABORT                                        0x0040
    103 
    104 #define RU_SUSPENDED            0x0010
    105 #define RU_NO_RESOURCES         0x0020
    106 #define RU_READY                0x0040
    107 
    108 
    109 #define IO_ADDR                 0x360
    110 #define PORT_ADDR               IO_ADDR
    111 #define CHAN_ATTN               PORT_ADDR + 4
    112 #define NIC_ADDR                PORT_ADDR + 8
     77#define STAT_C                                          0x8000          /* Set to 1 after execution              */
     78#define STAT_B                                          0x4000          /* 1 : Cmd being executed, 0 : Cmd done. */
     79#define STAT_OK                                         0x2000          /* 1: Command executed ok 0 : Error      */
     80#define STAT_A                                  0x1000          /* command has been aborted              */
     81
     82#define STAT_S11                0x0800
     83#define STAT_S10                0x0400
     84#define STAT_S9                 0x0200
     85#define STAT_S8                 0x0100
     86#define STAT_S7                 0x0080
     87#define STAT_S6                 0x0040
     88#define STAT_S5                 0x0020
     89#define STAT_MAX_COLLS          0x000F
     90
     91
     92
     93#define RBD_STAT_P              0x4000          /* prefetch */
     94#define RBD_STAT_F              0x4000          /* used */
     95
     96#define CUC_START                                       0x0100
     97#define CUC_RESUME                              0x0200
     98#define CUC_SUSPEND             0x0300
     99#define CUC_ABORT                                       0x0400
     100#define RX_START                                        0x0010
     101#define RX_RESUME                                       0x0020
     102#define RX_SUSPEND                              0x0030
     103#define RX_ABORT                                        0x0040
     104
     105#define RU_SUSPENDED            0x0010
     106#define RU_NO_RESOURCES         0x0020
     107#define RU_READY                0x0040
     108
     109
     110#define IO_ADDR                 0x360
     111#define PORT_ADDR               IO_ADDR
     112#define CHAN_ATTN               PORT_ADDR + 4
     113#define NIC_ADDR                PORT_ADDR + 8
    113114
    114115#define I596_NULL ( ( void * ) 0xffffffff)
    115116#define UTI_596_END_OF_FRAME 0x8000
    116 #define SIZE_MASK       0x3fff
     117#define SIZE_MASK       0x3fff
    117118
    118119struct i596_tbd;
     
    272273  i596_cmd     *pCmdTail;  /* unneeded, as chaining not used, but implemented */
    273274
    274   rtems_id              rxDaemonTid;
    275   rtems_id              txDaemonTid;
    276   rtems_id              resetDaemonTid;
     275  rtems_id              rxDaemonTid;
     276  rtems_id              txDaemonTid;
     277  rtems_id              resetDaemonTid;
    277278
    278279  struct enet_statistics stats;
     
    282283  volatile int         cmdOk;
    283284  int                  resetDone;
    284   unsigned long        txRawWait;
     285  unsigned long        txRawWait;
    285286  i596_rfd            *pInboundFrameQueue;
    286287  short int            rxBdCount;
     
    297298
    298299#endif /* UTI596_H */
     300
  • c/src/lib/libbsp/m68k/mvme167/startup/Makefile.am

    rce70a16 rbb734cc  
    3333        $(INSTALL_DATA) $< $@
    3434
    35 $(PROJECT_RELEASE)/lib/elflinkcmds: elflinkcmds
    36         $(INSTALL_DATA) $< $@
    37 
    38 TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds \
    39     $(PROJECT_RELEASE)/lib/elflinkcmds
     35TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds
    4036
    4137all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
     
    4339.PRECIOUS: $(PGM)
    4440
    45 EXTRA_DIST = bspclean.c bspstart.c elflinkcmds linkcmds page_table.c
     41EXTRA_DIST = bspclean.c bspstart.c linkcmds page_table.c
    4642
    4743include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c

    rce70a16 rbb734cc  
    8282  extern void *_WorkspaceBase;
    8383  extern m68k_isr_entry M68Kvec[];
    84   extern void    *_WorkspaceBase;
    8584 
    8685  void M68KFPSPInstallExceptionHandlers (void);
  • c/src/lib/libbsp/m68k/mvme167/startup/linkcmds

    rce70a16 rbb734cc  
    2323
    2424/*
    25  * Declare some sizes.
     25 * Declare some sizes.  Heap is sized at whatever ram space is left.
    2626 */
    27 _RamBase = 0x00800000;
     27_RamBase = DEFINED(_RamBase) ? _RamBase : 0x00800000;
    2828_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
    29 _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     29_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0;
    3030_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    3131
     
    4343SECTIONS
    4444{
    45         ram : {
    46                 . = .;
    47         } >ram
     45 /*
     46  * Text, data and bss segments
     47  */
     48  .text : {
     49    *(.text)
    4850
    49         /*
    50          * Text, data and bss segments
    51          */
    52         .text : {
    53                 *(.text)
     51    /*
     52     * C++ constructors/destructors
     53     */
     54    *(.gnu.linkonce.t.*)
    5455
    55                 /*
    56                  * C++ constructors/destructors
    57                  */
    58                 *(.gnu.linkonce.t.*)
     56    /*
     57     * Initialization and finalization code.
     58     *
     59     * Various files can provide initialization and finalization
     60     * functions.  crtbegin.o and crtend.o are two instances. The
     61     * body of these functions are in .init and .fini sections. We
     62     * accumulate the bodies here, and prepend function prologues
     63     * from crti.o and function epilogues from crtn.o. crti.o must
     64     * be linked first; crtn.o must be linked last.  Because these
     65     * are wildcards, it doesn't matter if the user does not
     66     * actually link against crti.o and crtn.o; the linker won't
     67     * look for a file to match a wildcard.  The wildcard also
     68     * means that it doesn't matter which directory crti.o and
     69     * crtn.o are in.
     70     */
     71    PROVIDE (_init = .);
     72    *crti.o(.init)
     73    *(.init)
     74    *crtn.o(.init)
     75   
     76    PROVIDE (_fini = .);
     77    *crti.o(.fini)
     78    *(.fini)
     79    *crtn.o(.fini)
    5980
    60                 /*
    61                  * Initialization and finalization code.
    62                  *
    63                  * Various files can provide initialization and finalization
    64                  * functions.  crtbegin.o and crtend.o are two instances. The
    65                  * body of these functions are in .init and .fini sections. We
    66                  * accumulate the bodies here, and prepend function prologues
    67                  * from crti.o and function epilogues from crtn.o. crti.o must
    68                  * be linked first; crtn.o must be linked last.  Because these
    69                  * are wildcards, it doesn't matter if the user does not
    70                  * actually link against crti.o and crtn.o; the linker won't
    71                  * look for a file to match a wildcard.  The wildcard also
    72                  * means that it doesn't matter which directory crti.o and
    73                  * crtn.o are in.
    74                  */
    75                 PROVIDE (_init = .);
    76                 *crti.o(.init)
    77                 *(.init)
    78                 *crtn.o(.init)
    79                 PROVIDE (_fini = .);
    80                 *crti.o(.fini)
    81                 *(.fini)
    82                 *crtn.o(.fini)
     81    /*
     82     * C++ constructors/destructors
     83     *
     84     * gcc uses crtbegin.o to find the start of the constructors
     85     * and destructors so we make sure it is first.  Because this
     86     * is a wildcard, it doesn't matter if the user does not
     87     * actually link against crtbegin.o; the linker won't look for
     88     * a file to match a wildcard.  The wildcard also means that
     89     * it doesn't matter which directory crtbegin.o is in. The
     90     * constructor and destructor list are terminated in
     91     * crtend.o.  The same comments apply to it.
     92     */
     93    . = ALIGN (16);
     94    *crtbegin.o(.ctors)
     95    *(.ctors)
     96    *crtend.o(.ctors)
     97   
     98    *crtbegin.o(.dtors)
     99    *(.dtors)
     100    *crtend.o(.dtors)
    83101
    84                 /*
    85                  * C++ constructors/destructors
    86                  *
    87                  * gcc uses crtbegin.o to find the start of the constructors
    88                  * and destructors so we make sure it is first.  Because this
    89                  * is a wildcard, it doesn't matter if the user does not
    90                  * actually link against crtbegin.o; the linker won't look for
    91                  * a file to match a wildcard.  The wildcard also means that
    92                  * it doesn't matter which directory crtbegin.o is in. The
    93                  * constructor and destructor list are terminated in
    94                  * crtend.o.  The same comments apply to it.
    95                  */
    96                 . = ALIGN (16);
    97                 *crtbegin.o(.ctors)
    98                 *(.ctors)
    99                 *crtend.o(.ctors)
    100                 *crtbegin.o(.dtors)
    101                 *(.dtors)
    102                 *crtend.o(.dtors)
     102    /*
     103     * Exception frame info
     104     */
     105    . = ALIGN (16);
     106    *(.eh_frame)
    103107
    104                 /*
    105                  * Exception frame info
    106                  */
    107                 . = ALIGN (16);
    108                 *(.eh_frame)
     108    /*
     109     * Read-only data
     110     */
     111    . = ALIGN (16);
     112    PROVIDE(_rodata_start = . );
     113    *(.rodata)
     114    *(.gnu.linkonce.r*)
     115    PROVIDE(_erodata = . );
    109116
    110                 /*
    111                  * Read-only data
    112                  */
    113                 . = ALIGN (16);
    114                 _rodata_start = . ;
    115                 *(.rodata)
    116                 *(.gnu.linkonce.r*)
     117    . = ALIGN (16);
     118    PROVIDE (_etext = .);
     119  } >ram
     120 
     121  .data : {
     122    PROVIDE (_copy_start = .);
     123    *(.data)
     124    *(.gnu.linkonce.d*)
     125    *(.gcc_except_table)
     126    . = ALIGN (16);
     127    PROVIDE (_edata = .);
     128    PROVIDE (_copy_end = .);
     129  } >ram
     130 
     131 .bss : {
     132    _clear_start = .;
     133    *(.bss)
     134    *(COMMON)
     135    . = ALIGN (16);
     136    PROVIDE (end = .);
    117137
    118                  . = ALIGN (16);
    119                 PROVIDE (_etext = .);
    120         } >ram
    121         .data : {
    122                 PROVIDE (_copy_start = .);
    123                 *(.data)
    124                 *(.gnu.linkonce.d*)
    125                 *(.gcc_except_table)
    126                 . = ALIGN (16);
    127                 PROVIDE (_edata = .);
    128                 PROVIDE (_copy_end = .);
    129         } >ram
    130         .bss : {
    131                 _clear_start = .;
    132                 *(.bss)
    133                 *(COMMON)
    134                 . = ALIGN (16);
    135                 PROVIDE (end = .);
     138    . += _StackSize;
     139    . = ALIGN (16);
     140    _stack_init = .;
     141    _clear_end = .;
    136142
    137                 . += _StackSize;
    138                 . = ALIGN (16);
    139                 _stack_init = .;
    140                 _clear_end = .;
     143    _WorkspaceBase = .;
     144  } >ram
    141145
    142                 _WorkspaceBase = .;
    143         } >ram
     146  /* Stabs debugging sections.  */
     147  .stab 0 : { *(.stab) }
     148  .stabstr 0 : { *(.stabstr) }
     149  .stab.excl 0 : { *(.stab.excl) }
     150  .stab.exclstr 0 : { *(.stab.exclstr) }
     151  .stab.index 0 : { *(.stab.index) }
     152  .stab.indexstr 0 : { *(.stab.indexstr) }
     153  .comment 0 : { *(.comment) }
     154 
     155  /* DWARF debug sections.
     156     Symbols in the DWARF debugging sections are relative to the beginning
     157     of the section so we begin them at 0.  */
     158  /* DWARF 1 */
     159  .debug          0 : { *(.debug) }
     160  .line           0 : { *(.line) }
     161 
     162  /* GNU DWARF 1 extensions */
     163  .debug_srcinfo  0 : { *(.debug_srcinfo) }
     164  .debug_sfnames  0 : { *(.debug_sfnames) }
     165 
     166  /* DWARF 1.1 and DWARF 2 */
     167  .debug_aranges  0 : { *(.debug_aranges) }
     168  .debug_pubnames 0 : { *(.debug_pubnames) }
     169 
     170  /* DWARF 2 */
     171  .debug_info     0 : { *(.debug_info) }
     172  .debug_abbrev   0 : { *(.debug_abbrev) }
     173  .debug_line     0 : { *(.debug_line) }
     174  .debug_frame    0 : { *(.debug_frame) }
     175  .debug_str      0 : { *(.debug_str) }
     176  .debug_loc      0 : { *(.debug_loc) }
     177  .debug_macinfo  0 : { *(.debug_macinfo) }
     178 
     179  /* SGI/MIPS DWARF 2 extensions */
     180  .debug_weaknames 0 : { *(.debug_weaknames) }
     181  .debug_funcnames 0 : { *(.debug_funcnames) }
     182  .debug_typenames 0 : { *(.debug_typenames) }
     183  .debug_varnames  0 : { *(.debug_varnames) }
     184  /* These must appear regardless of  .  */
    144185}
  • c/src/lib/libbsp/m68k/mvme167/startup/page_table.c

    rce70a16 rbb734cc  
    8080   *  S-Field = 0b1X              ignore FC2 when matching
    8181   *  U1, U0 = 0b00               user page attributes not used
    82    *  CM = 0b01                   cachable, writethrough
     82   *  CM = 0b01                   cachable, copyback
    8383   *  W = 0b0                     read/write access allowed
    8484   */
  • c/src/lib/libbsp/m68k/mvme167/wrapup/Makefile.am

    rce70a16 rbb734cc  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 BSP_PIECES = clock console fatal startup timer
     7# We only build the networking device driver if HAS_NETWORKING was defined
     8if HAS_NETWORKING
     9NETWORKING_DRIVER = network
     10endif
     11
     12BSP_PIECES = clock console fatal startup timer $(NETWORKING_DRIVER)
    813
    914# bummer; have to use $foreach since % pattern subst rules only replace 1x
  • c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c

    rce70a16 rbb734cc  
    3636
    3737extern unsigned long  _RamSize;
     38extern void          *_RamBase;
    3839extern void          *_WorkspaceBase;
    3940extern void          *_HeapSize;
     
    4748    heapStart =  (void *)
    4849       ((unsigned long)&_WorkspaceBase + BSP_Configuration.work_space_size);
    49     ramSpace = _RamSize - (unsigned long) heapStart;
     50    ramSpace = (unsigned long) &_RamBase + (unsigned long) &_RamSize - (unsigned long) heapStart;
    5051
    5152    if (heapSize == 0)
  • make/custom/mvme167.cfg

    rce70a16 rbb734cc  
    44#  $Id$
    55#
     6
     7# THIS BSP USES ELF IMAGES. IT WILL NOT WORK WITH COFF UNLESS CHANGES
     8# ARE MADE TO THE LINKCMDS FILE.
    69
    710RTEMS_CPU=m68k
     
    1518#
    1619#  This contains the compiler options necessary to select the CPU model
    17 #  and (hopefully) optimize for it.
     20#  and (hopefully) optimize for it.  We also specify the BSP during compilation.
     21#  This should really get its own flag, but it works here.
    1822#
    1923
    20 CPU_CFLAGS = -m68040
     24CPU_CFLAGS = -m68040 -DRTEMS_BSP=$(RTEMS_BSP)
     25CFLAGS_DEBUG_V += -ggdb
    2126
    2227# optimize flag: typically -O, could use -O4 or -fast
     
    3439#  RTEMS_DEBUG (RTEMS)
    3540#     If defined, debug checks in RTEMS and support library code are enabled.
     41#
     42#  CD2401_INT_LEVEL
     43#         Interrupt level for the CD2401.
     44#
     45#  CD2401_POLLED_IO
     46#         0 for interrupt-driven, 1 for polled I/O.
    3647
    3748define make-target-options
     
    3950        @echo "#define RTEMS_TEST_NO_PAUSE 1"               >>$@
    4051        @echo "/* #define RTEMS_DEBUG  1 */"                >>$@
     52        @echo "#define CD2401_INT_LEVEL 1"                  >>$@
     53        @echo "#define CD2401_POLLED_IO 1"                  >>$@
     54       
     55       
    4156endef
    4257
     
    8095            $(LINK_OBJS) $(LINK_LIBS)
    8196        $(NM) -g -n $@ > $(basename $@).nm
    82         $(SIZE) $@
     97        $(STRIP) -o $(basename $@) $@
     98        $(SIZE) $(basename $@).exe
    8399endef
    84100endif
Note: See TracChangeset for help on using the changeset viewer.