diff options
Diffstat (limited to 'c/src/lib/libbsp/powerpc')
40 files changed, 0 insertions, 6106 deletions
diff --git a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/Makefile.in deleted file mode 100644 index 3e5ccf3e06..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/directory.cfg - -SRCS=README - -# We only build the networking device driver if HAS_NETWORKING was defined -NETWORKING_DRIVER_yes_V = sonic -NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V) - -all: $(SRCS) - -# wrapup is the one that actually builds and installs the library -# from the individual .rel files built in other directories -SUB_DIRS=include clock console startup start timer \ - scv64 tod $(NETWORKING_DRIVER) wrapup diff --git a/c/src/lib/libbsp/powerpc/dmv177/QUIRKS b/c/src/lib/libbsp/powerpc/dmv177/QUIRKS deleted file mode 100644 index e1d95e6427..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/QUIRKS +++ /dev/null @@ -1,74 +0,0 @@ -# -# Quirks in the DY-4 DMV177 -# -# $Id$ -# - -JTAG and Caching -================ -If data or code caching is enabled on certain revisions of the PPC603e, -then the JTAG emulator interface become disfunctional. You can not -debug using the emulator on these chip revisions. On certain revisions, -it is so bad that when code caching is enabled, you can not even -download code reliably to the board. - -Caching and Peripherals -======================= -When caching is enabled, care must be exercised to insure that all -peripheral addresses are still uncached. - -Exar 88681 Clock -================ -This board uses a different clock for the Exar 88681 DUART than is -documented in the Exar manual or the original MC68681 manual. This -resulted in the need for the the mc68681 libchip driver to support -BSP specific baud rate tables and the development of a DMV177 -specific baud rate table. - -In the end, this all works but you have a very limited range of -useful baud rates on the 88681 ports compared to what would have -been supported had DY-4 just followed the Exar or Motorola manual. - - -SCC Addresses -============= -The full set of SCC addresses is not documented in the DY-4 manual -and they are not ordered as one would expect. Normally the four -SCC registers are ordered Control A, Data A, Control B, and Data B. -DY-4 orders them with B first. - -This required extra time to debug. - - -SCV64 and the Foundation Firmware -================================= -DY-4 technical support did not offer code to determine which interrupt -sources were pending at the SCV64. They recommended calling into the -Foundation Firmware ROM monitor to figure this out. The Foundation -Firmware did not recognize enough interrupts on this board to be useful. - -In the end, we gave up on their technical support's recommendation -and directly manipulated the SVC64. This is what we wanted to do in -the first place but we got no information from them to aid in this. -Luckily, the manual does document enough of DY-4's mapping of the specific -interrupt sources to make this work. - - -Z85C30 SCC Clock Speed -====================== - -The Z85C30 SCC can be factory configured for 10 Mhz or 2.4616 Mhz. Code -had to be added to dynamically determine which clock was installed. - -The board we had used a 10 Mhz clock. No testing was done with a 2.4616 Mhz -clock. - - -P2 Octopus Cable -================ - -DY-4's P2 breakout is large and a bit unwieldy. It was difficult to -fight into the VME cage we used. The SCSI connector comes off the -side and is very stiff thus making it difficult to route around -anything in the back of the cage. We gave up on trying to use -it in the first few slots of OAR's cage. diff --git a/c/src/lib/libbsp/powerpc/dmv177/README b/c/src/lib/libbsp/powerpc/dmv177/README deleted file mode 100644 index 0f00873225..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/README +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# - -BSP NAME: dmv177 -BOARD: DY-4 DMV177 -BUS: VMEBus -CPU FAMILY: powerpc -CPU: PowerPC 603e -COPROCESSORS: N/A -MODE: 32 bit mode - -DEBUG MONITOR: DY-4 General Purpose Monitor (GPM) - -PERIPHERALS -=========== -TIMERS: PPC internal Timebase register - RESOLUTION: ??? -SERIAL PORTS: 2 RS-232 provided by a Exar 88681 - 2 RS-422 provided by a Zilog Z8530 -REAL-TIME CLOCK: PPC internal Decrementer register -DMA: none -RTC: Harris ICM7170 -VIDEO: none -SCSI: QLogic FAS216 SCSI-2 (unsupported) -NETWORKING: National Semiconductor SONIC DP83932B (Ethernet) - -DRIVER INFORMATION -================== -CLOCK DRIVER: PPC internal -SHMSUPP: N/A -TIMER DRIVER: PPC internal -CONSOLE DRIVER: Uses libchip drivers for Exar 88681 and Zilog Z8530. - -STDIO -===== - -These are the default settings. - -PORT: Console port 0 -ELECTRICAL: RS-232 -BAUD: 9600 -BITS PER CHARACTER: 8 -PARITY: N -STOP BITS: 1 - -Notes -===== -The console and real-time clock drivers use the libchip library. diff --git a/c/src/lib/libbsp/powerpc/dmv177/README.net b/c/src/lib/libbsp/powerpc/dmv177/README.net deleted file mode 100644 index b3ff231340..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/README.net +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# - -Setting the Ethernet Hardware Address -===================================== - -The hardware Ethernet address is not set at the factory. It is the -responsibility of the end-user to insure that it is set properly. -This file describes the standard procedure recommended by DY-4 -technical support for setting this address. This procedure is -similar to that followed by VxWorks as documented in DY-4 -Document Number #807885. - -The hardware Ethernet address and OS configuration information -must be stored in the SEEPROM non-volatile memory of the -SVME/DMV-176/177. The Foundation Firmware (FFW) reserves the -first 256 bytes of the SEEPROM for its own use and the remaining -remaining 256 bytes are available for OS specific information. - -Three bytes in the Serial EEPROM are used for the lowest three bytes -of the hardware Ethernet address These should be set to the serial -number of your SVME/DMV-176/177 card to ensure a unique Ethernet -address on your network. The three high bytes are hard coded in the -BSP and represent the vendor-specific Ethernet codes (0x00, 0x80, 0x7F). -Together these six bytes form the target's Ethernet address. - -Address is of the form ... - -NOTE: The serial number is found on the packaging (box) that the -board came in OR it is also located on the solder side of the board and -looks something like SERNO:XXXXXX. It can not be determined dynamically -by software. - -Prior to using the Ethernet controller on the SVME/DMV-176/177 for the -first time, the Ethernet address bytes must be programmed into the -Serial EEPROM on the target card. The 'emm' (EEPROM Memory Modification) -command in the General Purpose Monitor (GPM) can be used to do this. - -In this example we will assume that the serial number of the target card -is 123456. - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/STATUS b/c/src/lib/libbsp/powerpc/dmv177/STATUS deleted file mode 100644 index 394412421e..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/STATUS +++ /dev/null @@ -1,82 +0,0 @@ -# -# This is a status file for the update effort. -# - -make/custom -=========== -dmv17x.cfg - -TOP -=== -README -Makefile.in -bsp_specs - -clock -===== -clock.c -Makefile.in - -console -======= -Changed console from - duart.c - console.c -To - consolebsp.h - console.c - 85c30.c - tbl85c30.c - -Note: Check the number of serial ports and modify - tbl85c30.c values to indicate the correct values. - -Makefile.in - Modified with new file names. - -timer -======= -timer.c -Makefile.in - -include -======= -chain.h -dmv170.h -bsp.h -Makefile -Makefile.in -coverhd.h - -network -======= -Eric's problem - -startup -======= -device-tree - remove -linkcmds -setvec.c - Modified to acount for general purpose vector. -sbrk.c - Ok -rtems-ctor.cc - Ok -bspclean.s - Ok -vmeintr.c -Makefile.in - Added genpvec.c -bspstart.c - Modified with changes from vista bsp. - -Added: -genpvec.c - -Note: Need to add routine which connects the general purpose interupt with the - various interupt handlers. genpvec.c uses this routine and may need - to be modified. -wrapup -======= -wrapup/Makefile.in - -vectors -======= - -start -======= -start/Makefile.in -start/start.s - Made modifications based upon Score603e mods. diff --git a/c/src/lib/libbsp/powerpc/dmv177/bsp_specs b/c/src/lib/libbsp/powerpc/dmv177/bsp_specs deleted file mode 100644 index ab5a8ddbeb..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/bsp_specs +++ /dev/null @@ -1,23 +0,0 @@ -%rename cpp old_cpp -%rename lib old_lib -%rename endfile old_endfile -%rename startfile old_startfile -%rename link old_link - -*cpp: -%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded) - -*lib: -%{!qrtems: %(old_lib)} %{qrtems: --start-group \ -%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \ --lc -lgcc --end-group ecrtn%O%s \ -%{!qnolinkcmds: -T linkcmds%s}} - -*startfile: -%{!qrtems: %(old_startfile)} %{qrtems: ecrti%O%s \ -%{!qrtems_debug: start.o%s} \ -%{qrtems_debug: start_g.o%s}} - -*link: -%{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -T linkcmds%s -e _start -u __vectors} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/cable.doc b/c/src/lib/libbsp/powerpc/dmv177/cable.doc deleted file mode 100644 index e77fbd9a95..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/cable.doc +++ /dev/null @@ -1,97 +0,0 @@ -# -# Cable information for the DY-4 DMV177 -# -# $Id$ -# - -Background -========== - -All serial cables described in this file were built using RJ-45 ribbon -cables which were plugged into DB-25 or DB-9 adapters wired as described. -Matching the colors of the wires in the shell is the easiest way to -make sure the cable is built properly. - -The board is configured as follows: - - - An MC68681 is the first two serial ports. These are RS-232 and may - be accessed via the front panel or the P2. The front panel connector - has both A and B serial ports on a single connector. DY-4 part number - "OBYC3ASSY901132-000 Rev-" brings these ports out to two DB-25 - female connectors. - - - The MC68681 serial ports are also accessible on the P2 connector. - DY-4 part number "OBYC3ASSY901080-004 Rev A" brings these out - to DB-9 female connectors. These were not used in this effort. - - - A Z85C30 is used for the third and fourth serial ports. These are - RS-422 and may only be accessed via the P2 connector. These are - brought out to DB-25 male connectors. An RS-422 to RS-232 converter - was used to interface with these serial ports. - -References -========== - - - Linux Serial FAQ - - http://ahmed.egypt.com/electronics/serial - - DY-4 Documentation - -RS-422 Converter -================ - -An RS-422 to RS-232 converter from B&B Electronics was used to -adapt the RS-422 signals so they could be used with a normal -RS-232 serial port. Here is the information required to purchase -one of these: - - RS-232/RS-422 Converter: Model 422LCON - Power Supply: Model 422PS - - B&B Electronics Manufacturing Company - 707 Dayton Road - PO Box 1040 - Ottawa, IL 61350 - Voice: (815) 433-5100 - FAX: (815)434-7094 - - -Front Panel RS-232 Connection to a PC -===================================== - - Board's DB-25 PC's DB-9 Color in - Channel A COM1 Shell - ============= ============ ========= - RX on pin 2 TX on pin 2 Red - TX on pin 3 RX on pin 3 Blue - GND on pin 7 GND on pin 5 Black - DTR on pin 20 DTR on pin 4 Brown - - No other signals are used. - -RS-422 Connection to a PC -========================= - -This requires two cables with the converter connecting them. - -P2 RS-422 to the RS-422/RS-232 Converter -======================================== - - Board's Converter's Color in - DB-25 RS-422 DB-25 Shell - =============== ============== ======== - TXD_A on pin 2 RDA on pin 5 Red - TXD_B on pin 14 RDB on pin 17 Blue - RX_A on pin 3 TDA on pin 2 Brown - RX_B on pin 16 TDB on pin 14 Green - GND on pin 7 GND on pin 7 Black - - - Converter's PC's DB-9 Color in - RS-232 DB-25 COM1 Shell - =============== ============== ======== - TX on pin 2 TX on pin 2 Blue - RX on pin 3 RX on pin 3 Red - GND on pin 5 GND on pin 5 Black - DTR on pin 4 DTR on pin 4 Brown - - No other signals diff --git a/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in deleted file mode 100644 index 7c2cfc0772..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/clock.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=clock -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c b/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c deleted file mode 100644 index 75490a3382..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Clock Tick Device Driver - * - * This routine utilizes the Decrementer Register common to the PPC family. - * - * The tick frequency is directly programmed to the configured number of - * microseconds per tick. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <stdlib.h> - -#include <bsp.h> -#include <rtems/libio.h> - -extern rtems_cpu_table Cpu_table; - -/* - * The Real Time Clock Counter Timer uses this trap type. - */ - -#define CLOCK_VECTOR PPC_IRQ_DECREMENTER - -/* - * Clock ticks since initialization - */ - -volatile rtems_unsigned32 Clock_driver_ticks; - -/* - * This is the value programmed into the count down timer. - */ - -rtems_unsigned32 Clock_Decrementer_value; - -/* - * This is the value of the old isr routine. - */ -rtems_isr_entry Old_ticker; - - -void Clock_exit( void ); - -/* - * These are set by clock driver during its init - */ - -rtems_device_major_number rtems_clock_major = ~0; -rtems_device_minor_number rtems_clock_minor; - -/*PAGE - * - * Clock_isr - * - * This is the clock tick interrupt handler. - * - * Input parameters: - * vector - vector number - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -rtems_isr Clock_isr( - rtems_vector_number vector, - CPU_Interrupt_frame *frame -) -{ - /* - * Set the decrementer. - */ - - PPC_Set_decrementer( Clock_Decrementer_value ); - - /* - * The driver has seen another tick. - */ - - Clock_driver_ticks += 1; - - /* - * Real Time Clock counter/timer is set to automatically reload. - */ - - rtems_clock_tick(); -} - -/*PAGE - * - * Install_clock - * - * This routine actually performs the hardware initialization for the clock. - * - * Input parameters: - * clock_isr - clock interrupt service routine entry point - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -extern int CLOCK_SPEED; - -void Install_clock( - rtems_isr_entry clock_isr -) -{ - Clock_driver_ticks = 0; - - if ( BSP_Configuration.ticks_per_timeslice ) { - Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - - PPC_Set_decrementer( Clock_Decrementer_value ); - - atexit( Clock_exit ); - } -} - -/*PAGE - * - * Clock_exit - * - * This routine allows the clock driver to exit by masking the interrupt and - * disabling the clock's counter. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Clock_exit( void ) -{ - if ( BSP_Configuration.ticks_per_timeslice ) { - - /* nothing to do */; - - /* do not restore old vector */ - } -} - -/*PAGE - * - * Clock_initialize - * - * This routine initializes the clock driver. - * - * Input parameters: - * major - clock device major number - * minor - clock device minor number - * parg - pointer to optional device driver arguments - * - * Output parameters: NONE - * - * Return values: - * rtems_device_driver status code - */ - -rtems_device_driver Clock_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - Clock_Decrementer_value = Cpu_table.clicks_per_usec * - BSP_Configuration.microseconds_per_tick; - - Install_clock( Clock_isr ); - - /* - * make major/minor avail to others such as shared memory driver - */ - - rtems_clock_major = major; - rtems_clock_minor = minor; - - return RTEMS_SUCCESSFUL; -} - -/* PAGE - * - * Clock_control - * - * This routine is the clock device driver control entry point. - * - * Input parameters: - * major - clock device major number - * minor - clock device minor number - * parg - pointer to optional device driver arguments - * - * Output parameters: NONE - * - * Return values: - * rtems_device_driver status code - */ - -rtems_device_driver Clock_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - rtems_unsigned32 isrlevel; - rtems_libio_ioctl_args_t *args = pargp; - - if (args == 0) - goto done; - - /* - * This is hokey, but until we get a defined interface - * to do this, it will just be this simple... - */ - - if (args->command == rtems_build_name('I', 'S', 'R', ' ')) - { - Clock_isr( CLOCK_VECTOR, pargp ); - } - else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) - { - rtems_interrupt_disable( isrlevel ); - (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); - } - -done: - return RTEMS_SUCCESSFUL; -} - - - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in deleted file mode 100644 index 261eb79a82..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/console.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=config console debugio -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/config.c b/c/src/lib/libbsp/powerpc/dmv177/console/config.c deleted file mode 100644 index e3a0eb073f..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/config.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * This file contains the TTY driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/serial.h> -#include <libchip/mc68681.h> -#include <libchip/z85c30.h> - -/* - * Configuration specific probe routines - * - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine which serial - * ports are on a board. Debugging this would require access to - * multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the console drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/console, - * all others being given the name indicated. - */ - -mc68681_baud_t - dmv177_mc68681_baud_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { - { /* ACR[7] = 0, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - 0x0A, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - 0x0A, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 0, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - 0x0A, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, -}; - -#define MC68681_PORT_CONFIG \ - (MC68681_DATA_BAUD_RATE_SET_1|MC68681_XBRG_ENABLED) - -/* - * Based on BSP configuration information decide whether to do polling IO - * or interrupt driven IO. - */ - -#if (CONSOLE_USE_INTERRUPTS) -#define MC68681_FUNCTIONS &mc68681_fns -#define Z85C30_FUNCTIONS &z85c30_fns -#else -#define MC68681_FUNCTIONS &mc68681_fns_polled -#define Z85C30_FUNCTIONS &z85c30_fns_polled -#endif - -boolean dmv177_z85c30_probe(int minor); -boolean dmv177_mc68681_probe(int minor); - -console_tbl Console_Port_Tbl[] = { - { - "/dev/com0", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT1_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com1", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT2_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com3", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_A, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - }, - { - "/dev/com4", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_B, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - } -}; - -/* - * Declare some information used by the console driver - */ - -#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) - -unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; - -console_data Console_Port_Data[NUM_CONSOLE_PORTS]; - -rtems_device_minor_number Console_Port_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_z85c30_probe(int minor) -{ - volatile unsigned32 *dma_control_status_reg; - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_SCC_INST_MASK; - - if ( v != DMV170_SCC_INSTALLED ) - return FALSE; - - /* - * Figure out the clock speed of the Z85C30 SCC - */ - - dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG; - - if ( *dma_control_status_reg & DMV170_SCC_10MHZ ) - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10; - else - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_2; - - return TRUE; -} - -boolean dmv177_mc68681_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_DUART_INST_MASK; - - if ( v == DMV170_DUART_INSTALLED ) - return TRUE; - - return FALSE; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c b/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c deleted file mode 100644 index e3a0eb073f..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * This file contains the TTY driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/serial.h> -#include <libchip/mc68681.h> -#include <libchip/z85c30.h> - -/* - * Configuration specific probe routines - * - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine which serial - * ports are on a board. Debugging this would require access to - * multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the console drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/console, - * all others being given the name indicated. - */ - -mc68681_baud_t - dmv177_mc68681_baud_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { - { /* ACR[7] = 0, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - 0x0A, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - 0x0A, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 0, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - 0x0A, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, -}; - -#define MC68681_PORT_CONFIG \ - (MC68681_DATA_BAUD_RATE_SET_1|MC68681_XBRG_ENABLED) - -/* - * Based on BSP configuration information decide whether to do polling IO - * or interrupt driven IO. - */ - -#if (CONSOLE_USE_INTERRUPTS) -#define MC68681_FUNCTIONS &mc68681_fns -#define Z85C30_FUNCTIONS &z85c30_fns -#else -#define MC68681_FUNCTIONS &mc68681_fns_polled -#define Z85C30_FUNCTIONS &z85c30_fns_polled -#endif - -boolean dmv177_z85c30_probe(int minor); -boolean dmv177_mc68681_probe(int minor); - -console_tbl Console_Port_Tbl[] = { - { - "/dev/com0", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT1_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com1", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT2_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com3", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_A, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - }, - { - "/dev/com4", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_B, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - } -}; - -/* - * Declare some information used by the console driver - */ - -#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) - -unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; - -console_data Console_Port_Data[NUM_CONSOLE_PORTS]; - -rtems_device_minor_number Console_Port_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_z85c30_probe(int minor) -{ - volatile unsigned32 *dma_control_status_reg; - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_SCC_INST_MASK; - - if ( v != DMV170_SCC_INSTALLED ) - return FALSE; - - /* - * Figure out the clock speed of the Z85C30 SCC - */ - - dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG; - - if ( *dma_control_status_reg & DMV170_SCC_10MHZ ) - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10; - else - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_2; - - return TRUE; -} - -boolean dmv177_mc68681_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_DUART_INST_MASK; - - if ( v == DMV170_DUART_INSTALLED ) - return TRUE; - - return FALSE; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c b/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c deleted file mode 100644 index d23df205a3..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * This file contains the debug IO support. - * - * COPYRIGHT (c) 1998 by Radstone Technology - * - * - * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY - * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK - * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. - * - * You are hereby granted permission to use, copy, modify, and distribute - * this file, provided that this notice, plus the above copyright notice - * and disclaimer, appears in all copies. Radstone Technology will provide - * no support for this code. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <bsp.h> -#include <rtems/libio.h> -#include <stdlib.h> -#include <assert.h> -#include <termios.h> - -#include <libchip/serial.h> - -/* - * Load configuration table - */ - -extern console_data Console_Port_Data[]; -extern rtems_device_minor_number Console_Port_Minor; - -/* PAGE - * - * DEBUG_puts - * - * This should be safe in the event of an error. It attempts to ensure - * that no TX empty interrupts occur while it is doing polled IO. Then - * it restores the state of that external interrupt. - * - * Input parameters: - * string - pointer to debug output string - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void DEBUG_puts( - char *string -) -{ - char *s; - unsigned32 Irql; - - rtems_interrupt_disable(Irql); - - for ( s = string ; *s ; s++ ) { - Console_Port_Tbl[Console_Port_Minor].pDeviceFns-> - deviceWritePolled(Console_Port_Minor, *s); - } - - rtems_interrupt_enable(Irql); -} - -/* PAGE - * - * DEBUG_puth - * - * This should be safe in the event of an error. It attempts to ensure - * that no TX empty interrupts occur while it is doing polled IO. Then - * it restores the state of that external interrupt. - * - * Input parameters: - * ulHexNum - value to display - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void DEBUG_puth( - unsigned32 ulHexNum -) -{ - unsigned long i,d; - unsigned32 Irql; - void (*poll)(int minor, char cChar); - - poll = Console_Port_Tbl[Console_Port_Minor].pDeviceFns->deviceWritePolled; - - rtems_interrupt_disable(Irql); - - (*poll)(Console_Port_Minor, '0'); - (*poll)(Console_Port_Minor, 'x'); - - for ( i=32 ; i ; ) { - i -= 4; - d = (ulHexNum>>i)&0xf; - (*poll)(Console_Port_Minor, (d<=9) ? d+'0' : d+'a'-0xa); - } - rtems_interrupt_enable(Irql); -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in deleted file mode 100644 index a711b3e1de..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in +++ /dev/null @@ -1,36 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h \ - $(srcdir)/dmv170.h $(srcdir)/../../../shared/tod.h - -# -# Equate files are for including from assembly preprocessed by -# gm4 or gasp. No examples are provided except for those for -# other CPUs. The best way to generate them would be to -# provide a program which generates the constants used based -# on the C equivalents. -# -# If you add equate files, don't forget to uncomment the install line -# below. -# - -EQ_FILES = - -SRCS=$(H_FILES) $(EQ_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: $(SRCS) - $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE) diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h b/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h deleted file mode 100644 index f99211f8d3..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h +++ /dev/null @@ -1,187 +0,0 @@ -/* bsp.h - * - * This include file contains all DY-4 DMV170 board IO definitions. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#ifndef __DMV170_BSP_h -#define __DMV170_BSP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef ASM -/* Definition of where to store registers in alignment handler */ -#define ALIGN_REGS 0x0140 - -#else -#include <rtems.h> -#include <console.h> -#include <clockdrv.h> -#include <console.h> -#include <iosupp.h> - -#include <dmv170.h> - -#if 0 -#define Enable_Debug() \ - DMV170_WRITE( 0xffffbd0c, 0 ) - -#define Debug_Entry( num ) \ - DMV170_WRITE( 0xffffbd06, num ) -#else -#define Enable_Debug() -#define Debug_Entry( num ) -#endif - -/* - * The following macro calculates the Baud constant. For the Z8530 chip. - */ -#define Z8530_Baud( _frequency, _clock_by, _baud_rate ) \ - ( (_frequency /( _clock_by * 2 * _baud_rate)) - 2) - - -/* - * Define the time limits for RTEMS Test Suite test durations. - * Long test and short test duration limits are provided. These - * values are in seconds and need to be converted to ticks for the - * application. - * - */ - -#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ -#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ - - -/* - * Stuff for Time Test 27 - */ - -#define MUST_WAIT_FOR_INTERRUPT 1 - -#define Install_tm27_vector( _handler ) \ - set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 ) - -#define Cause_tm27_intr() \ - do { \ - unsigned32 _clicks = 1; \ - asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ - } while (0) - -#define Clear_tm27_intr() \ - do { \ - unsigned32 _clicks = 0xffffffff; \ - unsigned32 _msr = 0; \ - _ISR_Set_level( 0 ); \ - asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - _msr &= ~0x8000; \ - asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ - } while (0) - -#define Lower_tm27_intr() \ - do { \ - unsigned32 _msr = 0; \ - _ISR_Set_level( 0 ); \ - asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - _msr |= 0x8002; \ - asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - } while (0) - -/* Constants */ - -/* - * Device Driver Table Entries - */ - -/* - * NOTE: Use the standard Console driver entry - */ - -/* - * NOTE: Use the standard Clock driver entry - */ - - -/* - * Information placed in the linkcmds file. - */ - -extern int RAM_START; -extern int RAM_END; -extern int RAM_SIZE; - -extern int PROM_START; -extern int PROM_END; -extern int PROM_SIZE; - -extern int CLOCK_SPEED; - -extern int end; /* last address in the program */ - -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - -/* functions */ - -/* - * genvec.c - */ -rtems_isr_entry set_EE_vector( - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector /* vector number */ -); -void initialize_external_exception_vector (); - -/* - * console.c - */ -void DEBUG_puts( char *string ); - -void BSP_fatal_return( void ); - - - -void bsp_start( void ); - -void bsp_cleanup( void ); - -rtems_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -); - -void BSP_fatal_return( void ); - -void bsp_spurious_initialize( void ); - -extern rtems_configuration_table BSP_Configuration; /* owned by BSP */ - -extern rtems_cpu_table Cpu_table; /* owned by BSP */ - -extern rtems_unsigned32 bsp_isr_level; - -extern int CPU_PPC_CLICKS_PER_MS; - -#endif /* ASM */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h b/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h deleted file mode 100644 index 451d13b706..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h +++ /dev/null @@ -1,134 +0,0 @@ -/* coverhd.h - * - * This include file has defines to represent the overhead associated - * with calling a particular directive from C. These are used in the - * Timing Test Suite to ignore the overhead required to pass arguments - * to directives. On some CPUs and/or target boards, this overhead - * is significant and makes it difficult to distinguish internal - * RTEMS execution time from that used to call the directive. - * This file should be updated after running the C overhead timing - * test. Once this update has been performed, the RTEMS Time Test - * Suite should be rebuilt to account for these overhead times in the - * timing results. - * - * NOTE: If these are all zero, then the times reported include - * calling overhead including passing of arguments. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -/* - * - * Units are 100ns. - * - * These numbers are of questionable use, as they are developed by calling - * the routine many times, thus getting its entry veneer into the (small) - * cache on the 403GA. This in general is not true of the RTEMS timing - * tests, which usually call a routine only once, thus having no cache loaded - * advantage. - * - * Whether the directive times are useful after deducting the function call - * overhead is also questionable. The user is more interested generally - * in the total cost of a directive, not the cost if the procedure call - * is inlined! (In general this is not true). - * - * Andrew Bray 18/08/1995 - * - */ - -#ifndef __COVERHD_h -#define __COVERHD_h - -#ifdef __cplusplus -extern "C" { -#endif - -#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0 -#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0 -#define CALLING_OVERHEAD_TASK_CREATE 0 -#define CALLING_OVERHEAD_TASK_IDENT 0 -#define CALLING_OVERHEAD_TASK_START 0 -#define CALLING_OVERHEAD_TASK_RESTART 0 -#define CALLING_OVERHEAD_TASK_DELETE 0 -#define CALLING_OVERHEAD_TASK_SUSPEND 0 -#define CALLING_OVERHEAD_TASK_RESUME 0 -#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0 -#define CALLING_OVERHEAD_TASK_MODE 0 -#define CALLING_OVERHEAD_TASK_GET_NOTE 0 -#define CALLING_OVERHEAD_TASK_SET_NOTE 0 -#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0 -#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0 -#define CALLING_OVERHEAD_INTERRUPT_CATCH 0 -#define CALLING_OVERHEAD_CLOCK_GET 0 -#define CALLING_OVERHEAD_CLOCK_SET 0 -#define CALLING_OVERHEAD_CLOCK_TICK 0 - -#define CALLING_OVERHEAD_TIMER_CREATE 0 -#define CALLING_OVERHEAD_TIMER_IDENT 0 -#define CALLING_OVERHEAD_TIMER_DELETE 0 -#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0 -#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0 -#define CALLING_OVERHEAD_TIMER_RESET 0 -#define CALLING_OVERHEAD_TIMER_CANCEL 0 -#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0 -#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0 -#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0 -#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0 -#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0 - -#define CALLING_OVERHEAD_EVENT_SEND 0 -#define CALLING_OVERHEAD_EVENT_RECEIVE 0 -#define CALLING_OVERHEAD_SIGNAL_CATCH 0 -#define CALLING_OVERHEAD_SIGNAL_SEND 0 -#define CALLING_OVERHEAD_PARTITION_CREATE 0 -#define CALLING_OVERHEAD_PARTITION_IDENT 0 -#define CALLING_OVERHEAD_PARTITION_DELETE 0 -#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0 -#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0 -#define CALLING_OVERHEAD_REGION_CREATE 0 -#define CALLING_OVERHEAD_REGION_IDENT 0 -#define CALLING_OVERHEAD_REGION_DELETE 0 -#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0 -#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0 -#define CALLING_OVERHEAD_PORT_CREATE 0 -#define CALLING_OVERHEAD_PORT_IDENT 0 -#define CALLING_OVERHEAD_PORT_DELETE 0 -#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0 -#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0 - -#define CALLING_OVERHEAD_IO_INITIALIZE 0 -#define CALLING_OVERHEAD_IO_OPEN 0 -#define CALLING_OVERHEAD_IO_CLOSE 0 -#define CALLING_OVERHEAD_IO_READ 0 -#define CALLING_OVERHEAD_IO_WRITE 0 -#define CALLING_OVERHEAD_IO_CONTROL 0 -#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0 -#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0 - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h deleted file mode 100644 index b676dafe0c..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h +++ /dev/null @@ -1,290 +0,0 @@ -/* dmv170.h - * - * This include file contains information pertaining to the DMV170. - * - * NOTE: Other than where absolutely required, this version currently - * supports only the peripherals and bits used by the basic board - * support package. This includes at least significant pieces of - * the following items: - * - * + UART Channels A and B - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef _INCLUDE_DMV170_h -#define _INCLUDE_DMV170_h - - -/* - * DY-4 uses a non-standard clock for the Exar 88681. - */ - -#undef MC68681_BAUD_RATE_MASK_9600 -#define MC68681_BAUD_RATE_MASK_9600 - -#define DMV17x_MC68681_BAUD_RATE_MASK_9600 - -#if 0 -#define MC68681_OFFSET_MULTIPLIER 8 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Note: Move address defs to the linker files. XXX */ - -/* Real Time Clock Base Address */ -#define DMV170_RTC_ADDRESS 0xf2c00000 - -/* base address of the DUART (68681) */ -#define MC68681_ADDR 0xf2800000 -#define MC68681_PORT1_ADDR 0xf2800000 -#define MC68681_PORT2_ADDR 0xf2800040 - -/* - * SONIC Information - */ - -#define DMV170_SONIC_ADDR 0xf3000000 - -#define SONIC_BASE_ADDRESS DMV170_SONIC_ADDR -#define SONIC_VECTOR DMV170_ETHERNET_IRQ - -/* base address for the SCC (85C30) */ -#define Z85C30_ADDR 0xfb000010 -#define Z85C30_CTRL_A 0xfb000010 -#define Z85C30_DATA_A 0xfb000018 -#define Z85C30_CTRL_B 0xfb000000 -#define Z85C30_DATA_B 0xfb000008 -#define Z85C30_CLOCK_10 (10485760) /* 10 Mhz */ -#define Z85C30_CLOCK_2 (2581175) /* 2.4616 Mhz */ - -/* base address for the SCV64 */ -#define DMV170_SCV64_BASE_ADDRESS 0xf2000000 - -#define DMV170_LOCAL_CONTROL_STATUS_REG 0xf2400000 -#define DMV170_TIMER0_COUNT_INTERVAL_REG 0xf2400008 -#define DMV170_TIMER1_COUNT_INTERVAL_REG 0xf2400010 -#define DMV170_TIMER2_COUNT_INTERVAL_REG 0xf2400018 -#define DMV170_TIMER_CONTROL_REG 0xf2400020 -#define DMV170_CARD_RESORCE_REG 0xf2400040 - -#define DMV170_WRITE( _reg, _data ) \ - *((volatile rtems_unsigned16 *)(_reg)) = (_data) - -#define DMV170_READ( _reg, _data ) \ - (_data) = *((volatile rtems_unsigned16 *)(_reg)) - -/* - * The following defines the bits in the DMA Control and Status Register - */ - -/* XXX fill in the other bits */ - -#define DMV170_DMA_CONTROL_STATUS_REG 0xfc000090 - -#define DMV170_SCC_10MHZ 0x00010000 - -/* - * The following defines the bits in the Local Control and Status Register. - */ -#define DMV170_IPLx_MASK 0x0007 -#define DMV170_MAXPACK_SENSE_MASK 0x0008 -#define DMV170_MAXPACK_NOT_INSTALLED 0x0008 -#define DMV170_MAXPACK_INSTALLED 0x0000 - -#define DMV170_MAXPACK_RESET_MASK 0x0010 -#define DMV170_MAXPACK_RESET_NEGATE 0x0010 -#define DMV170_MAXPACK_RESET_ASSERT 0x0000 -#define DMV170_EEPROM_READ_WRITE_MASK 0x0020 -#define DMV170_EEPROM_READ 0x0020 -#define DMV170_EEPROM_WRITE 0x0000 -#define DMV170_EEPROM_CLOCK_CTRL_MASK 0x0040 -#define DMV170_EEPROM_CLOCK_ASSERT 0x0040 -#define DMV170_EEPROM_CLOCK_NEGATE 0x0000 -#define DMV170_EEPROM_DATA_MASK 0x0080 -#define DMV170_EEPROM_DATA_HIGH 0x0080 -#define DMV170_EEPROM_DATA_LOW 0x0000 - -/* Bits 8-10: 68040 Transfer Modifer Codes represent the Transfer - * Modifier to be used on MAXPack Accesses. - * - * Bit 11 : 68040 Transfer Type (TT) 0:TT are both low 1:TT are both high - */ - -#define DMV170_USER_LINK0_STATUS_MASK 0x1000 -#define DMV170_USER_LINK0_OPEN 0x1000 -#define DMV170_USER_LINK0_INSTALLED 0x0000 -#define DMV170_LOWER_STATUS_LED_CONTROL_MASK 0x2000 -#define DMV170_LOWER_STATUS_LED_IS_OFF 0x2000 -#define DMV170_LOWER_STATUS_LED_IS_ON 0x0000 -#ifdef DMV176 - /* The following are not available for the DMV171 */ -#define DMV170_RAM_TYPE_MASK 0x4000 -#define DMV170_RAM_TYPE_IS_DRAM 0x4000 -#define DMV170_RAM_TYPE_IS_SRAM 0x0000 -#define DMV170_IACK_VECTOR_AUTOVECTOR_MASK 0x8000 -#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_VECTOR 0x8000 -#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_NOT_VECTOR 0x0000 -#endif - -/* - * The following defines the bits in the Timer Control Register. - */ - -#define DMV170_TIMER0_ENABLE_MASK 0x0001 -#define DMV170_TIMER0_IS_ENABLED 0x0001 -#define DMV170_TIMER0_IS_DISABLED 0x0000 -#define DMV170_TIMER1_ENABLE_MASK 0x0002 -#define DMV170_TIMER1_IS_ENABLED 0x0002 -#define DMV170_TIMER1_IS_DISABLED 0x0000 -#define DMV170_TIMER2_ENABLE_MASK 0x0004 -#define DMV170_TIMER2_IS_ENABLED 0x0004 -#define DMV170_TIMER2_IS_DISABLED 0x0000 -#define DMV170_TIMER1_CLOCK_MASK 0x0008 -#define DMV170_TIMER1_CLOCK_AT_TIMER0 0x0008 -#define DMV170_TIMER1_CLOCK_AT_1MHZ 0x0000 - -#define DMV170_TIMER2_CLOCK_MASK 0x0010 -#define DMV170_TIMER2_CLOCK_AT_TIMER0 0x0010 -#define DMV170_TIMER2_CLOCK_AT_1MHZ 0x0000 -#define DMV170_TIMER0_INTERRUPT_MASK 0x0020 -#define DMV170_TIMER0_INTERRUPT_ENABLE 0x0020 -#define DMV170_TIMER0_INTERRUPT_CLEAR 0x0000 -#define DMV170_TIMER1_INTERRUPT_MASK 0x0040 -#define DMV170_TIMER1_INTERRUPT_ENABLE 0x0040 -#define DMV170_TIMER1_INTERRUPT_CLEAR 0x0000 -#define DMV170_TIMER2_INTERRUPT_MASK 0x0080 -#define DMV170_TIMER2_INTERRUPT_ENABLE 0x0080 -#define DMV170_TIMER2_INTERRUPT_CLEAR 0x0000 - -/* - * The Following define the bits for the Card Resource Register. - */ - -#define DMV170_DUART_INTERRUPT_MASK 0x0001 /* DUART Interrupt Sense Bit */ -#define DMV170_DUART_INTERRUPT_NEGATE 0x0001 -#define DMV170_DUART_INTERRUPT_ASSERT 0x0000 -#define DMV170_SONIC_INTERRUPT_MASK 0x0002 /* SONIC Interrupt Sense Bit */ -#define DMV170_SONIC_INTERRUPT_NEGATE 0x0002 -#define DMV170_SONIC_INTERRUPT_ASSERT 0x0000 -#define DMV170_SCSI_INTERRUPT_MASK 0x0004 /* SCSI Interrupt Sense Bit */ -#define DMV170_SCSI_INTERRUPT_NEGATE 0x0004 -#define DMV170_SCSI_INTERRUPT_ASSERT 0x0000 -#define DMV170_SCC_INTERRUPT_MASK 0x0008 /* SCC Interrupt Sense Bit */ -#define DMV170_SCC_INTERRUPT_NEGATE 0x0008 -#define DMV170_SCC_INTERRUPT_ASSERT 0x0000 -#define DMV170_SNOOP_ENABLE_MASK 0x0010 /* CPU Snoop Enable Bit */ -#define DMV170_SNOOP_DISABLE 0x0010 -#define DMV170_SNOOP_ENABLE 0x0000 -#define DMV170_SONIC_RESET_MASK 0x0020 /* SONIC RESET Control */ -#define DMV170_SONIC_RESET_CLEAR 0x0020 -#define DMV170_SONIC_RESET_HOLD 0x0000 -#define DMV170_NV64_WE_MASK 0x0040 /* 64-bit Non-Volital Memory */ -#define DMV170_NV64_WRITE_ENABLE 0x0040 /* Write Enable */ -#define DMV170_NV64_WRITE_DISABLE 0x0000 -#define DMV170_BOOT_NV16_MASK 0x0080 /* BOOT Device Type */ -#define DMV170_BOOT_64_BIT 0x0080 -#define DMV170_BOOT_16_BIT 0x0000 -#define DMV170_DUART_INST_MASK 0x0100 /* DUART Sense Bit */ -#define DMV170_DUART_INSTALLED 0x0100 -#define DMV170_DUART_NOT_INSTALLED 0x0000 -#define DMV170_SONIC_INST_MASK 0x0200 /* SONIC Sense Bit */ -#define DMV170_SONIC_INSTALLED 0x0200 -#define DMV170_SONIC_NOT_INSTALLED 0x0000 -#define DMV170_16M_NV64_MASK 0x0400 /* 16 Mb of 64bit Flash Sense */ -#define DMV170_16Mb_FLASH_INSTALLED 0x0400 -#define DMV170_8Mb_FLASH_INSTALLED 0x0000 -#define DMV170_SCC_INST_MASK 0x0800 /* SCC Sense Bit */ -#define DMV170_SCC_INSTALLED 0x0800 -#define DMV170_SCC_NOT_INSTALLED 0x0000 -#define DMV170_RTC_INST_MASK 0x1000 /* RTC Sense Bit */ -#define DMV170_RTC_INSTALLED 0x1000 -#define DMV170_RTC_NOT_INSTALLED 0x0000 -#define DMV170_NV64_INST_MASK 0x2000 /* 64bit Non-Volital Mem Sense*/ - -#define DMV170_64_BIT_NON_VOLITAL_MEM_INSTALLED 0x2000 -#define DMV170_64_BIT_NON_VOLITAL_MEM_NOT_INSTALLED 0x0000 - - -/* - * DUART Baud Rate Definitions. - */ - -#define DMV170_DUART_9621 MC68681_BAUD_RATE_MASK_600 /* close to 9600 */ - -#define DMV170_RTC_FREQUENCY 0x0000 - - -/* - * CPU General Purpose Interrupt definations (PPC_IRQ_EXTERNAL). - * Note: For the interrupt level read the lower 3 bits of the - * Local Control and Status Register. - */ - -#define DMV170_IRQ_FIRST ( PPC_IRQ_LAST + 1 ) - -#define DMV170_LIRQ0 ( DMV170_IRQ_FIRST + 0 ) -#define DMV170_LIRQ1 ( DMV170_IRQ_FIRST + 1 ) -#define DMV170_LIRQ2 ( DMV170_IRQ_FIRST + 2 ) -#define DMV170_LIRQ3 ( DMV170_IRQ_FIRST + 3 ) -#define DMV170_LIRQ4 ( DMV170_IRQ_FIRST + 4 ) -#define DMV170_LIRQ5 ( DMV170_IRQ_FIRST + 5 ) -#define DMV170_L7IACF ( DMV170_IRQ_FIRST + 6 ) -#define DMV170_L7ISYS ( DMV170_IRQ_FIRST + 7 ) -#define DMV170_L7IMNI ( DMV170_IRQ_FIRST + 8 ) -#define DMV170_BIMODE ( DMV170_IRQ_FIRST + 9 ) - -#define DMV170_DUART_IRQ DMV170_LIRQ5 -#define DMV170_ETHERNET_IRQ DMV170_LIRQ5 -#define DMV170_SCSI_IRQ DMV170_LIRQ5 -#define DMV170_SCC_IRQ DMV170_LIRQ5 -#define DMV170_MEZZANINE_IRQ_0 DMV170_LIRQ4 -#define DMV170_TICK_IRQ DMV170_LIRQ3 -#define DMV170_LOCATION_MON_IRQ DMV170_LIRQ2 -#define DMV170_SCV64_IRQ DMV170_LIRQ1 -#define DMV170_RTC_IRQ DMV170_LIRQ0 - -#define DMV170_ACFAIL_IRQ DMV170_L7IACF -#define DMV170_SYSFAIL_IRQ DMV170_L7ISYS -#define DMV170_WATCHDOG_IRQ DMV170_L7IMNI -#define DMV170_BI_IRQ DMV170_BIMODE -#define DMV170_RAM_PARITY_IRQ ( DMV170_IRQ_FIRST + 10) -#define DMV170_DARF_BUS_ERROR_IRQ ( DMV170_IRQ_FIRST + 11) -#define DMV170_PERIPHERAL_IRQ ( DMV170_IRQ_FIRST + 12) - -#define MAX_BOARD_IRQS DMV170_PERIPHERAL_IRQ - -#define SCV64_Is_IRQ0( _status ) (_status&0x01) -#define SCV64_Is_IRQ1( _status ) (_status&0x02) -#define SCV64_Is_IRQ2( _status ) (_status&0x04) -#define SCV64_Is_IRQ3( _status ) (_status&0x08) -#define SCV64_Is_IRQ4( _status ) (_status&0x10) -#define SCV64_Is_IRQ5( _status ) (_status&0x20) - - -/* - * scv64.c - */ - -void SCV64_Generate_DUART_Interrupts(); -rtems_unsigned32 SCV64_Get_Interrupt(); -rtems_unsigned32 SCV64_Get_Interrupt_Enable(); - -#ifdef __cplusplus -} -#endif - -#endif /* !_INCLUDE_DMV170_h */ -/* end of include file */ - diff --git a/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in deleted file mode 100644 index 14961659b3..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/scv64.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=$(SCV64_PIECES) -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -SCV64_PIECES=scv64 - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c b/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c deleted file mode 100644 index 850618ad0e..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c +++ /dev/null @@ -1,171 +0,0 @@ -/* scv64.c - * - * This set of routines control the scv64 chip on the DMV177 board. - * - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <rtems.h> -#include <bsp.h> - -typedef struct { - /* DARF Registers */ - volatile rtems_unsigned32 DMALAR; /* 0x00 */ - volatile rtems_unsigned32 DMAVAR; /* 0x04 */ - volatile rtems_unsigned32 DMATC; /* 0x08 */ - volatile rtems_unsigned32 DCSR; /* 0x0c */ - volatile rtems_unsigned32 VMEBAR; /* 0x10 */ - volatile rtems_unsigned32 RXDATA; /* 0x14 */ - volatile rtems_unsigned32 RXADDR; /* 0x18 */ - volatile rtems_unsigned32 RXCTL; /* 0x1c */ - volatile rtems_unsigned32 BUSSEL; /* 0x20 */ - volatile rtems_unsigned32 IVECT; /* 0x24 */ - volatile rtems_unsigned32 APBR; /* 0x28 */ - volatile rtems_unsigned32 TXDATA; /* 0x2c */ - volatile rtems_unsigned32 TXADDR; /* 0x30 */ - volatile rtems_unsigned32 TXCTL; /* 0x34 */ - volatile rtems_unsigned32 LMFIFO; /* 0x38 */ - volatile rtems_unsigned32 MODE; /* 0x3c */ - volatile rtems_unsigned32 SA64BAR; /* 0x40 */ - volatile rtems_unsigned32 MA64BAR; /* 0x44 */ - volatile rtems_unsigned32 LAG; /* 0x48 */ - volatile rtems_unsigned32 DMAVTC; /* 0x4c */ - - /* Reserved */ - volatile rtems_unsigned32 reserved_50_7F[12]; - - /* ACC Registers */ - volatile rtems_unsigned8 STAT0_pad[3]; /* 0x80 */ - volatile rtems_unsigned8 STAT0; - volatile rtems_unsigned8 STAT1_pad[3]; /* 0x84 */ - volatile rtems_unsigned8 STAT1; - volatile rtems_unsigned8 GENCTL_pad[3]; /* 0x88 */ - volatile rtems_unsigned8 GENCTL; - volatile rtems_unsigned8 VINT_pad[3]; /* 0x8c */ - volatile rtems_unsigned8 VINT; - volatile rtems_unsigned8 VREQ_pad[3]; /* 0x90 */ - volatile rtems_unsigned8 VREQ; - volatile rtems_unsigned8 VARB_pad[3]; /* 0x94 */ - volatile rtems_unsigned8 VARB; - volatile rtems_unsigned8 ID_pad[3]; /* 0x98 */ - volatile rtems_unsigned8 ID; - volatile rtems_unsigned8 NA_pad[3]; /* 0x9c */ - volatile rtems_unsigned8 NA; - volatile rtems_unsigned8 _7IS_pad[3]; /* 0xa0 */ - volatile rtems_unsigned8 _7IS; - volatile rtems_unsigned8 LIS_pad[3]; /* 0xa4 */ - volatile rtems_unsigned8 LIS; - volatile rtems_unsigned8 UIE_pad[3]; /* 0xa8 */ - volatile rtems_unsigned8 UIE; - volatile rtems_unsigned8 LIE_pad[3]; /* 0xac */ - volatile rtems_unsigned8 LIE; - volatile rtems_unsigned8 VIE_pad[3]; /* 0xb0 */ - volatile rtems_unsigned8 VIE; - volatile rtems_unsigned8 IC10_pad[3]; /* 0xb4 */ - volatile rtems_unsigned8 IC10; - volatile rtems_unsigned8 IC32_pad[3]; /* 0xb8 */ - volatile rtems_unsigned8 IC32; - volatile rtems_unsigned8 IC54_pad[3]; /* 0xbc */ - volatile rtems_unsigned8 IC54; - /* Utility Registers */ - volatile rtems_unsigned32 MISC; - volatile rtems_unsigned32 delay_line[3]; - volatile rtems_unsigned32 MBOX0; - volatile rtems_unsigned32 MBOX1; - volatile rtems_unsigned32 MBOX2; - volatile rtems_unsigned32 MBOX3; -} SCV64_Registers; - -/* - * LIE Register - */ -#define LOCAL_INTERRUPT_ENABLE_0 0x01 -#define LOCAL_INTERRUPT_ENABLE_1 0x02 -#define LOCAL_INTERRUPT_ENABLE_2 0x04 -#define LOCAL_INTERRUPT_ENABLE_3 0x08 -#define LOCAL_INTERRUPT_ENABLE_4 0x10 -#define LOCAL_INTERRUPT_ENABLE_5 0x20 - -/* - * IC54 Register - */ -#define AUTOVECTOR_5 0x80 - - -/* - * Set the registers pointer to the base address of the SCV64 - */ -SCV64_Registers *SCV64 = (void *)DMV170_SCV64_BASE_ADDRESS; - -/*PAGE - * - * SCV64_Initialize - * - * This routine initializes the SCV64. - */ -void SCV64_Initialize() { - SCV64->LIE = 0; -} - -/*PAGE - * - * SCV64_Generate_DUART_Interrupts - * - * This sets the SCV64 to generate duart interrupts for - * the DMV177 board. - */ -void SCV64_Generate_DUART_Interrupts() { - - rtems_unsigned8 data; - - /* - * Set Local Interrupt 5 enable - */ - data = SCV64->LIE; - data |= LOCAL_INTERRUPT_ENABLE_5; - SCV64->LIE = data; - - /* - * Set Autovector. - */ - data = SCV64->IC54; - data |= AUTOVECTOR_5; - SCV64->IC54 = data; -} - -/*PAGE - * - * SCV64_Get_Interrupt - * - * This routine returns the SCV64 status register. - */ -rtems_unsigned32 SCV64_Get_Interrupt() -{ - rtems_unsigned8 data; - - /* - * Put the LIS data into the lower byte of the result - */ - data = SCV64->LIS; - - return data; -} - -/*PAGE - * - * SCV64_Get_Interrupt_Enable - * - * This routine returns the interrupt enable mask. - */ -rtems_unsigned32 SCV64_Get_Interrupt_Enable() -{ - /* - * Return the set of interrupts enabled. - */ - return SCV64->LIE; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in deleted file mode 100644 index 35cd5ff209..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/sonic.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=sonic -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \ - -DDIAGNOSTIC -DBOOTP_COMPAT -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c b/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c deleted file mode 100644 index 651025ee71..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c +++ /dev/null @@ -1,1599 +0,0 @@ -void break_when_you_get_here(); -/* - ******************************************************************* - ******************************************************************* - ** ** - ** RTEMS NETWORK DRIVER FOR NATIONAL DP83932 `SONIC' ** - ** SYSTEMS-ORIENTED NETWORK INTERFACE CONTROLLER ** - ** ** - ******************************************************************* - ******************************************************************* - */ - -/* - * $Revision$ $Date$ $Author$ - * $State$ - * $Id$ - */ - -/* - * References: - * 1) DP83932C-20/25/33 MHz SONIC(TM) Systems-Oriented Network Interface - * Controller data sheet. TL/F/10492, RRD-B30M105, National Semiconductor, - * 1995. - * - * 2) Software Driver Programmer's Guide for the DP83932 SONIC(TM), - * Application Note 746, Wesley Lee and Mike Lui, TL/F/11140, - * RRD-B30M75, National Semiconductor, March, 1991. - * - * 3) SVME/DMV-171 Single Board Computer Documentation Package, #805905, - * DY 4 Systems Inc., Kanata, Ontario, September, 1996. - */ - -#include <rtems/rtems_bsdnet.h> -#include "sonic.h" - -#include <stdio.h> - -#include <errno.h> -#include <rtems/error.h> - -#include <sys/param.h> -#include <sys/mbuf.h> -#include <sys/socket.h> -#include <sys/sockio.h> -#include <sys/sockio.h> - -#include <net/if.h> - -#include <netinet/in.h> -#include <netinet/if_ether.h> - -/* - * Debug levels - * - */ - -#define SONIC_DEBUG_NONE 0x0000 -#define SONIC_DEBUG_ALL 0xFFFF -#define SONIC_DEBUG_PRINT_REGISTERS 0x0001 -#define SONIC_DEBUG_MEMORY 0x0002 -#define SONIC_DEBUG_MEMORY_ALLOCATE 0x0004 -#define SONIC_DEBUG_FRAGMENTS 0x0008 -#define SONIC_DEBUG_CAM 0x0008 -#define SONIC_DEBUG_DESCRIPTORS 0x0010 -#define SONIC_DEBUG_ERRORS 0x0020 - -#define SONIC_DEBUG (SONIC_DEBUG_ERRORS) - -/* (SONIC_DEBUG_MEMORY|SONIC_DEBUG_DESCRIPTORS) */ - -/* SONIC_DEBUG_ALL */ - - -/* - * XXX - */ - -#include <dmv170.h> - -/* - * Use the top line if you want more symbols. - */ - -#define SONIC_STATIC -/* #define SONIC_STATIC static */ - -/* - * Number of devices supported by this driver - */ -#ifndef NSONIC -# define NSONIC 1 -#endif - -/* - * Default location of device registers - */ -#ifndef SONIC_BASE_ADDRESS -# define SONIC_BASE_ADDRESS 0xF3000000 -# warning "Using default SONIC_BASE_ADDRESS." -#endif - -/* - * Default interrupt vector - */ -#ifndef SONIC_VECTOR -# define SONIC_VECTOR 1 -# warning "Using default SONIC_VECTOR." -#endif - -/* - * Default device configuration register values - * Conservative, generic values. - * DCR: - * No extended bus mode - * Unlatched bus retry - * Programmable outputs unused - * Asynchronous bus mode - * User definable pins unused - * No wait states (access time controlled by DTACK*) - * 32-bit DMA - * Empty/Fill DMA mode - * Maximum Transmit/Receive FIFO - * DC2: - * Extended programmable outputs unused - * Normal HOLD request - * Packet compress output unused - * No reject on CAM match - */ -#define SONIC_DCR \ - (DCR_DW32 | DCR_WAIT0 | DCR_PO0 | DCR_PO1 | DCR_RFT4 | DCR_TFT8) -#ifndef SONIC_DCR -# define SONIC_DCR (DCR_DW32 | DCR_TFT28) -#endif -#ifndef SONIC_DC2 -# define SONIC_DC2 (0) -#endif - -/* - * Default sizes of transmit and receive descriptor areas - */ -#define RDA_COUNT 20 -#define TDA_COUNT 100 - -/* - * - * As suggested by National Application Note 746, make the - * receive resource area bigger than the receive descriptor area. - */ -#define RRA_EXTRA_COUNT 0 - -/* - * RTEMS event used by interrupt handler to signal daemons. - */ -#define INTERRUPT_EVENT RTEMS_EVENT_1 - -/* - * RTEMS event used to start transmit daemon. - * This must not be the same as INTERRUPT_EVENT. - */ -#define START_TRANSMIT_EVENT RTEMS_EVENT_2 - -/* - * Largest Ethernet frame. - */ -#define MAXIMUM_FRAME_SIZE 1518 - -/* - * Receive buffer size. - * Allow for a pointer, plus a full ethernet frame (including Frame - * Check Sequence) rounded up to a 4-byte boundary. - */ -#define RBUF_SIZE ((sizeof (void *) + (MAXIMUM_FRAME_SIZE) + 3) & ~3) -#define RBUF_WC ((((MAXIMUM_FRAME_SIZE) + 3) & ~3) / 2) - -/* - * Macros for manipulating 32-bit pointers as 16-bit fragments - */ -#define LSW(p) ((rtems_unsigned16)((rtems_unsigned32)(p))) -#define MSW(p) ((rtems_unsigned16)((rtems_unsigned32)(p) >> 16)) -#define PTR(m,l) ((void*)(((rtems_unsigned16)(m)<<16)|(rtems_unsigned16)(l))) - -/* - * Hardware-specific storage - */ -struct sonic_softc { - /* - * Connection to networking code - * This entry *must* be the first in the sonic_softc structure. - */ - struct arpcom arpcom; - - /* - * Default location of device registers - * ===CACHE=== - * This area must be non-cacheable, guarded. - */ - void *sonic; - - /* - * Interrupt vector - */ - rtems_vector_number vector; - - /* - * Indicates configuration - */ - int acceptBroadcast; - - /* - * Task waiting for interrupts - */ - rtems_id rxDaemonTid; - rtems_id txDaemonTid; - - /* - * Receive resource area - */ - int rdaCount; - ReceiveResourcePointer_t rsa; - ReceiveResourcePointer_t rea; - CamDescriptorPointer_t cdp; - ReceiveDescriptorPointer_t rda; - ReceiveDescriptorPointer_t rdp_last; - - /* - * Transmit descriptors - */ - int tdaCount; - TransmitDescriptorPointer_t tdaHead; /* Last filled */ - TransmitDescriptorPointer_t tdaTail; /* Next to retire */ - int tdaActiveCount; - - /* - * Statistics - */ - unsigned long Interrupts; - unsigned long rxInterrupts; - unsigned long rxMissed; - unsigned long rxGiant; - unsigned long rxNonOctet; - unsigned long rxBadCRC; - unsigned long rxCollision; - - unsigned long txInterrupts; - unsigned long txSingleCollision; - unsigned long txMultipleCollision; - unsigned long txCollision; - unsigned long txDeferred; - unsigned long txUnderrun; - unsigned long txLateCollision; - unsigned long txExcessiveCollision; - unsigned long txExcessiveDeferral; - unsigned long txLostCarrier; - unsigned long txRawWait; -}; -SONIC_STATIC struct sonic_softc sonic_softc[NSONIC]; - -/* - ****************************************************************** - * * - * Support Routines * - * * - ****************************************************************** - */ - -void sonic_write_register( - void *base, - unsigned32 regno, - unsigned32 value -); - -unsigned32 sonic_read_register( - void *base, - unsigned32 regno -); - -void sonic_enable_interrupts( - void *rp, - unsigned32 mask -) -{ - rtems_interrupt_level level; - - rtems_interrupt_disable( level ); - sonic_write_register( - rp, - SONIC_REG_IMR, - sonic_read_register(rp, SONIC_REG_IMR) | mask - ); - rtems_interrupt_enable( level ); -} - -/* - * Allocate non-cacheable memory on a single 64k page. - * Very simple minded -- just keeps trying till the memory is on a single page. - */ -SONIC_STATIC void * sonic_allocate(unsigned int nbytes) -{ - void *p; - unsigned long a1, a2; - - for (;;) { - /* - * ===CACHE=== - * Change malloc to malloc_noncacheable_guarded. - */ - p = malloc( nbytes, M_MBUF, M_NOWAIT ); - memset (p, '\0', nbytes); - if (p == NULL) - rtems_panic ("No memory!"); - a1 = (unsigned long)p; - a2 = a1 + nbytes - 1; - if ((a1 >> 16) == (a2 >> 16)) - break; - } -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY_ALLOCATE) - printf( "sonic_allocate %d bytes at %p\n", nbytes, p ); -#endif - return p; -} - -/* - * Shut down the interface. - */ - -SONIC_STATIC void sonic_stop (struct sonic_softc *sc) -{ - void *rp = sc->sonic; - struct ifnet *ifp = &sc->arpcom.ac_if; - - ifp->if_flags &= ~IFF_RUNNING; - - /* - * Stop the transmitter and receiver. - */ - sonic_write_register( rp, SONIC_REG_CR, CR_HTX | CR_RXDIS ); -} - -/* - * Show interface statistics - */ -SONIC_STATIC void sonic_stats (struct sonic_softc *sc) -{ - printf (" Total Interrupts:%-8lu", sc->Interrupts); - printf (" Rx Interrupts:%-8lu", sc->rxInterrupts); - printf (" Giant:%-8lu", sc->rxGiant); - printf (" Non-octet:%-8lu\n", sc->rxNonOctet); - printf (" Bad CRC:%-8lu", sc->rxBadCRC); - printf (" Collision:%-8lu", sc->rxCollision); - printf (" Missed:%-8lu\n", sc->rxMissed); - - printf ( " Tx Interrupts:%-8lu", sc->txInterrupts); - printf ( " Deferred:%-8lu", sc->txDeferred); - printf (" Lost Carrier:%-8lu\n", sc->txLostCarrier); - printf ( "Single Collisions:%-8lu", sc->txSingleCollision); - printf ( "Multiple Collisions:%-8lu", sc->txMultipleCollision); - printf ("Excessive Collisions:%-8lu\n", sc->txExcessiveCollision); - printf ( " Total Collisions:%-8lu", sc->txCollision); - printf ( " Late Collision:%-8lu", sc->txLateCollision); - printf (" Underrun:%-8lu\n", sc->txUnderrun); - printf ( " Raw output wait:%-8lu\n", sc->txRawWait); -} - -/* - ****************************************************************** - * * - * Interrupt Handler * - * * - ****************************************************************** - */ - -SONIC_STATIC rtems_isr sonic_interrupt_handler (rtems_vector_number v) -{ - struct sonic_softc *sc = sonic_softc; - void *rp; - -#if (NSONIC > 1) - /* - * Find the device which requires service - */ - for (;;) { - if (sc->vector == v) - break; - if (++sc == &sonic[NSONIC]) - return; /* Spurious interrupt? */ - } -#endif /* NSONIC > 1 */ - - /* - * Get pointer to SONIC registers - */ - rp = sc->sonic; - - sc->Interrupts++; - - /* - * Packet received or receive buffer area exceeded? - */ - if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PRXEN | IMR_RBAEEN)) && - (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PKTRX | ISR_RBAE))) { - sonic_write_register( - rp, - SONIC_REG_IMR, - sonic_read_register( rp, SONIC_REG_IMR) & ~(IMR_PRXEN | IMR_RBAEEN) - ); - sc->rxInterrupts++; - rtems_event_send (sc->rxDaemonTid, INTERRUPT_EVENT); - } - - /* - * Packet started, transmitter done or transmitter error? - */ - if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN)) - && (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PINT | ISR_TXDN | ISR_TXER))) { - sonic_write_register( - rp, - SONIC_REG_IMR, - sonic_read_register( rp, SONIC_REG_IMR) & - ~(IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) - ); - sc->txInterrupts++; - rtems_event_send (sc->txDaemonTid, INTERRUPT_EVENT); - } -} - -/* - ****************************************************************** - * * - * Transmitter Routines * - * * - ****************************************************************** - */ - -/* - * Soak up transmit descriptors that have been sent. - */ - -SONIC_STATIC void sonic_retire_tda (struct sonic_softc *sc) -{ - rtems_unsigned16 status; - unsigned int collisions; - struct mbuf *m, *n; - - /* - * Repeat for all completed transmit descriptors. - */ - while ((sc->tdaActiveCount != 0) - && ((status = sc->tdaTail->status) != 0)) { - -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "retire TDA %p (0x%04x)\n", sc->tdaTail, status ); -#endif - -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - if ( status != 0x0001 ) - printf( "ERROR: retire TDA %p (0x%04x)\n", sc->tdaTail, status ); -#endif - - /* - * Check for errors which stop the transmitter. - */ - if (status & (TDA_STATUS_EXD | - TDA_STATUS_EXC | - TDA_STATUS_FU | - TDA_STATUS_BCM)) { - /* - * Restart the transmitter if there are - * packets waiting to go. - */ - rtems_unsigned16 link; - link = *(sc->tdaTail->linkp); - - if ((link & TDA_LINK_EOL) == 0) { - void *rp = sc->sonic; - - sonic_write_register( rp, SONIC_REG_CTDA, link ); - sonic_write_register( rp, SONIC_REG_CR, CR_TXP ); - } - } - - /* - * Update network statistics - */ - collisions = (status & TDA_STATUS_COLLISION_MASK) >> TDA_STATUS_COLLISION_SHIFT; - if (collisions) { - if (collisions == 1) - sc->txSingleCollision++; - else - sc->txMultipleCollision++; - sc->txCollision += collisions; - } - if (status & TDA_STATUS_EXC) - sc->txExcessiveCollision++; - if (status & TDA_STATUS_OWC) - sc->txLateCollision++; - if (status & TDA_STATUS_EXD) - sc->txExcessiveDeferral++; - if (status & TDA_STATUS_DEF) - sc->txDeferred++; - if (status & TDA_STATUS_FU) - sc->txUnderrun++; - if (status & TDA_STATUS_CRSL) - sc->txLostCarrier++; - - /* - * Free the packet and reset a couple of fields - */ - sc->tdaActiveCount--; - m = (struct mbuf *)&sc->tdaTail->mbufp; - MFREE(m, n); - - sc->tdaTail->frag[0].frag_link = LSW(sc->tdaTail->link_pad); - sc->tdaTail->frag_count = 0; - - /* - * Move to the next transmit descriptor - */ - sc->tdaTail = sc->tdaTail->next; -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "next TDA %p\n", sc->tdaTail ); -#endif - } -} - -/* - * Send packet - */ -SONIC_STATIC void sonic_sendpacket (struct ifnet *ifp, struct mbuf *m) -{ - struct sonic_softc *sc = ifp->if_softc; - void *rp = sc->sonic; - struct mbuf *l = NULL; - TransmitDescriptorPointer_t tdp; - volatile struct TransmitDescriptorFragLink *fp; - unsigned int packetSize; - int i; - static char padBuf[64]; - - /* - * Free up transmit descriptors. - */ - sonic_retire_tda (sc); - - /* - * Wait for transmit descriptor to become available. - */ - if (sc->tdaActiveCount == sc->tdaCount) { -#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS) - puts( "Wait for more TDAs" ); -#endif - /* - * Clear old events. - */ - sonic_write_register( rp, SONIC_REG_ISR, ISR_PINT | ISR_TXDN | ISR_TXER ); - - /* - * Wait for transmit descriptor to become available. - * Note that the transmit descriptors are checked - * *before* * entering the wait loop -- this catches - * the possibility that a transmit descriptor became - * available between the `if' the started this block, - * and the clearing of the interrupt status register. - */ - sonic_retire_tda (sc); - while (sc->tdaActiveCount == sc->tdaCount) { - rtems_event_set events; - /* - * Enable transmitter interrupts. - */ - sonic_enable_interrupts( rp, (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) ); - - /* - * Wait for interrupt - */ - rtems_bsdnet_event_receive (INTERRUPT_EVENT, - RTEMS_WAIT|RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &events); - sonic_write_register( rp, SONIC_REG_ISR, ISR_PINT | ISR_TXDN | ISR_TXER ); - sonic_retire_tda (sc); - } - } - - /* - * Fill in the transmit descriptor fragment descriptors. - * ===CACHE=== - * If data cache is operating in write-back mode, flush cached - * data to memory. - */ - tdp = sc->tdaHead->next; - tdp->mbufp = m; - packetSize = 0; - fp = tdp->frag; - for (i = 0 ; i < MAXIMUM_FRAGS_PER_DESCRIPTOR ; i++, fp++) { - /* - * Throw away empty mbufs - */ - if (m->m_len) { - void *p = mtod (m, void *); - fp->frag_lsw = LSW(p); - fp->frag_msw = MSW(p); - fp->frag_size = m->m_len; - packetSize += m->m_len; - l = m; - m = m->m_next; -#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS) - printf( "fp %p 0x%04x%04x %d\n", - fp, fp->frag_msw, fp->frag_lsw, fp->frag_size ); -#endif - } - else { - struct mbuf *n; - MFREE (m, n); - m = n; - if (l != NULL) - l->m_next = m; - } - /* - * Break out of the loop if this mbuf is the last in the frame. - */ - if (m == NULL) - break; - } - - /* - * Pad short packets. - */ - if ((packetSize < 64) && (i < MAXIMUM_FRAGS_PER_DESCRIPTOR)) { - int padSize = 64 - packetSize; - fp++; - fp->frag_lsw = LSW(padBuf); - fp->frag_msw = MSW(padBuf); - fp->frag_size = padSize; -#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS) - printf( "PAD fp %p 0x%04x%04x %d\n", - fp, fp->frag_msw, fp->frag_lsw, fp->frag_size ); -#endif - packetSize += padSize; - i++; - } - - /* - * Fill Transmit Descriptor - */ - tdp->pkt_size = packetSize; - tdp->frag_count = i + 1; - tdp->status = 0; - - /* - * Chain onto list and start transmission. - */ - - tdp->linkp = &(fp+1)->frag_link; - *tdp->linkp = LSW(tdp->next) | TDA_LINK_EOL; - if ( sc->tdaHead->frag_count ) - *sc->tdaHead->linkp &= ~TDA_LINK_EOL; - sc->tdaActiveCount++; - sc->tdaHead = tdp; - - sonic_enable_interrupts( rp, (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) ); - sonic_write_register( rp, SONIC_REG_CR, CR_TXP ); -} - -/* - * Driver transmit daemon - */ -SONIC_STATIC void sonic_txDaemon (void *arg) -{ - struct sonic_softc *sc = (struct sonic_softc *)arg; - struct ifnet *ifp = &sc->arpcom.ac_if; - struct mbuf *m; - rtems_event_set events; - - for (;;) { - /* - * Wait for packet - */ - rtems_bsdnet_event_receive ( - START_TRANSMIT_EVENT, - RTEMS_EVENT_ANY | RTEMS_WAIT, - RTEMS_NO_TIMEOUT, - &events - ); - - /* - * Send packets till queue is empty - */ - for (;;) { - /* - * Get the next mbuf chain to transmit. - */ - IF_DEQUEUE(&ifp->if_snd, m); - if (!m) - break; - sonic_sendpacket (ifp, m); - } - ifp->if_flags &= ~IFF_OACTIVE; - } -} - -/* - ****************************************************************** - * * - * Receiver Routines * - * * - ****************************************************************** - */ - -/* - * Wait for SONIC to hand over a Receive Descriptor. - */ - -SONIC_STATIC void sonic_rda_wait( - struct sonic_softc *sc, - ReceiveDescriptorPointer_t rdp -) -{ - int i; - void *rp = sc->sonic; - rtems_event_set events; - - /* - * Wait for Receive Descriptor. - * The order of the tests is very important. - * The RDA is checked after RBAE is detected. This ensures that - * the driver processes all RDA entries before reusing the RRA - * entry holding the giant packet. - * The event wait is done after the RDA and RBAE checks. This - * catches the possibility that a Receive Descriptor became ready - * between the call to this function and the clearing of the - * interrupt status register bit. - */ - for (;;) { - /* - * Has a giant packet arrived? - * The National DP83932C data sheet is very vague on what - * happens under this condition. The description of the - * Interrupt Status Register (Section 4.3.6) states, - * ``Reception is aborted and the SONIC fetches the next - * available resource descriptors in the RRA. The buffer - * space is not re-used and an RDA is not setup for the - * truncated packet.'' - * I take ``Reception is aborted'' to mean that the RXEN - * bit in the Command Register is cleared and must be set - * by the driver to begin reception again. - * Unfortunately, an alternative interpretation could be - * that only reception of the current packet is aborted. - * This would be more difficult to recover from.... - */ - if (sonic_read_register( rp, SONIC_REG_ISR ) & ISR_RBAE) { - -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - printf( "ERROR: looks like a giant packet -- RBAE\n" ); -#endif - - /* - * One more check to soak up any Receive Descriptors - * that may already have been handed back to the driver. - */ - if (rdp->in_use == RDA_IN_USE) { -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - printf( "ERROR: nope just an RBAE\n" ); -#endif - break; - } - - /* - * Check my interpretation of the SONIC manual. - */ - if (sonic_read_register( rp, SONIC_REG_CR ) & CR_RXEN) - rtems_panic ("SONIC RBAE/RXEN"); - - /* - * Update statistics - */ - sc->rxGiant++; - - /* - * Reuse receive buffer. - * Again, the manual is subject to interpretation. The - * RRP register is described as, `the lower address of - * the next descriptor the SONIC will read.'' - * Since, acording to the ISR/RBAE notes, the SONIC has - * ``fetched the next available resource descriptor in - * the RRA'', I interpret this to mean that that the - * driver has to move the RRP back *two* entries to - * reuse the receive buffer holding the giant packet. - */ - for (i = 0 ; i < 2 ; i++) { - if (sonic_read_register( rp, SONIC_REG_RRP ) == - sonic_read_register( rp, SONIC_REG_RSA )) - sonic_write_register( - rp, - SONIC_REG_RRP, - sonic_read_register( rp, SONIC_REG_REA ) - ); - sonic_write_register( - rp, - SONIC_REG_RRP, - sonic_read_register(rp, SONIC_REG_RRP) - sizeof(ReceiveResource_t) - ); - } - - /* - * Restart reception - */ - sonic_write_register( rp, SONIC_REG_ISR, ISR_RBAE ); - sonic_write_register( rp, SONIC_REG_CR, CR_RXEN ); - } - - /* - * Clear old packet-received events. - */ - sonic_write_register( rp, SONIC_REG_ISR, ISR_PKTRX ); - - /* - * Has Receive Descriptor become available? - */ - if (rdp->in_use == RDA_IN_USE) - break; - - /* - * Enable interrupts. - */ - sonic_enable_interrupts( rp, (IMR_PRXEN | IMR_RBAEEN) ); - - /* - * Wait for interrupt. - */ - rtems_bsdnet_event_receive( - INTERRUPT_EVENT, - RTEMS_WAIT|RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &events - ); - } -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "RDA %p\n", rdp ); -#endif - -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - if (rdp->status & 0x000E) - printf( "ERROR: RDA %p (0x%04x)\n", rdp, rdp->status ); -#endif - -} - -/* - * SONIC reader task - */ -SONIC_STATIC void sonic_rxDaemon (void *arg) -{ - struct sonic_softc *sc = (struct sonic_softc *)arg; - struct ifnet *ifp = &sc->arpcom.ac_if; - void *rp = sc->sonic; - struct mbuf *m; - rtems_unsigned16 status; - ReceiveDescriptorPointer_t rdp; - ReceiveResourcePointer_t rwp, rea; - rtems_unsigned16 newMissedTally, oldMissedTally; - - rwp = sc->rsa; - rea = sc->rea; - rdp = sc->rda; - - /* - * Start the receiver - */ - oldMissedTally = sonic_read_register( rp, SONIC_REG_MPT ); - sonic_write_register( rp, SONIC_REG_CR, CR_RRRA ); - sonic_write_register( rp, SONIC_REG_CR, CR_RXEN ); - - /* - * Input packet handling loop - */ - for (;;) { - /* - * Wait till SONIC supplies a Receive Descriptor. - */ - if (rdp->in_use == RDA_FREE) { - sonic_rda_wait (sc, rdp); - } - -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "Incoming packet %p status=0x%04x\n", rdp, rdp->status ); -#endif - - /* - * Check that packet is valid - */ - status = rdp->status; - if (status & RDA_STATUS_PRX) { - struct mbuf **mp; - struct ether_header *eh; - void *p; - - /* - * Get the mbuf pointer - */ - p = PTR(rdp->pkt_msw, rdp->pkt_lsw); - mp = (struct mbuf **)p - 1; - m = *mp; - - /* - * Pass the packet up the chain. - * The mbuf count is reduced to remove - * the frame check sequence at the end - * of the packet. - * ===CACHE=== - * Invalidate cache entries for this memory. - */ - m->m_len = m->m_pkthdr.len = rdp->byte_count - - sizeof(rtems_unsigned32) - - sizeof(struct ether_header); - eh = mtod (m, struct ether_header *); - m->m_data += sizeof(struct ether_header); - ether_input (ifp, eh, m); - - /* - * Sanity check that Receive Resource Area is - * still in sync with Receive Descriptor Area - * The buffer reported in the Receive Descriptor - * should be the same as the buffer in the Receive - * Resource we are about to reuse. - */ -/* XXX figure out whether this is valid or not */ -#if 0 - if ((LSW(p) != rwp->buff_ptr_lsw) - || (MSW(p) != rwp->buff_ptr_msw)) - rtems_panic ("SONIC RDA/RRA"); -#endif - - /* - * Allocate a new mbuf. - */ - MGETHDR (m, M_WAIT, MT_DATA); - MCLGET (m, M_WAIT); - m->m_pkthdr.rcvif = ifp; - mp = mtod (m, struct mbuf **); - m->m_data += sizeof *mp; - *mp = m; - p = mtod (m, void *); - - /* - * Reuse Receive Resource. - */ - rwp->buff_ptr_lsw = LSW(p); - rwp->buff_ptr_msw = MSW(p); - rwp++; - if (rwp == rea) { -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "Wrapping RWP from %p to %p\n", rwp, sc->rsa ); -#endif - rwp = sc->rsa; - } - sonic_write_register( rp, SONIC_REG_RWP , LSW(rwp) ); - - /* - * Tell the SONIC to reread the RRA. - */ - if (sonic_read_register( rp, SONIC_REG_ISR ) & ISR_RBE) - sonic_write_register( rp, SONIC_REG_ISR, ISR_RBE ); - } - else { - if (status & RDA_STATUS_COL) - sc->rxCollision++; - if (status & RDA_STATUS_FAER) - sc->rxNonOctet++; - else if (status & RDA_STATUS_CRCR) - sc->rxBadCRC++; - } - - /* - * Count missed packets - */ - newMissedTally = sonic_read_register( rp, SONIC_REG_MPT ); - if (newMissedTally != oldMissedTally) { - sc->rxMissed += (newMissedTally - oldMissedTally) & 0xFFFF; - newMissedTally = oldMissedTally; - } - - /* - * Move to next receive descriptor - */ - rdp->in_use = RDA_FREE; - rdp = rdp->next; - rdp->link &= ~RDA_LINK_EOL; - } -} - -/* - ****************************************************************** - * * - * Initialization Routines * - * * - ****************************************************************** - */ - -/* - * Initialize the SONIC hardware - */ -SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc) -{ - void *rp = sc->sonic; - int i; - unsigned char *hwaddr; - rtems_isr_entry old_handler; - TransmitDescriptorPointer_t tdp; - ReceiveDescriptorPointer_t ordp, rdp; - ReceiveResourcePointer_t rwp; - struct mbuf *m; - void *p; - CamDescriptorPointer_t cdp; - - /* - * The Revision B SONIC has a horrible bug known as the "Zero - * Length Packet bug". The initial board used to develop this - * driver had a newer revision of the SONIC so there was no reason - * to check for this. If you have the Revision B SONIC chip, then - * you need to add some code to the RX path to handle this weirdness. - */ - - if ( sonic_read_register( rp, SONIC_REG_SR ) < SONIC_REVISION_C ) { - rtems_fatal_error_occurred( 0x0BADF00D ); /* don't eat this part :) */ - } - - /* - * Set up circular linked list in Transmit Descriptor Area. - * Use the PINT bit in the transmit configuration field to - * request an interrupt on every other transmitted packet. - * - * NOTE: sonic_allocate() zeroes all of the memory allocated. - */ - - sc->tdaActiveCount = 0; - sc->tdaTail = sonic_allocate(sc->tdaCount * sizeof *tdp); -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "tdaTail = %p\n", sc->tdaTail ); -#endif - tdp = sc->tdaTail; - for (i = 0 ; i < sc->tdaCount ; i++) { - /* - * status, pkt_config, pkt_size, and all fragment fields - * are set to zero by sonic_allocate. - */ - -/* XXX not used by the BSD drivers - if (i & 1) - tdp->pkt_config = TDA_CONFIG_PINT; -*/ - - tdp->frag_count = 0; - tdp->frag[0].frag_link = LSW(tdp + 1); - tdp->link_pad = LSW(tdp + 1) | TDA_LINK_EOL; - tdp->linkp = &((tdp + 1)->frag[0].frag_link); - tdp->next = (TransmitDescriptor_t *)(tdp + 1); - tdp++; - } - tdp--; - sc->tdaHead = tdp; - tdp->link_pad = LSW(sc->tdaTail) | TDA_LINK_EOL; - tdp->next = (TransmitDescriptor_t *)sc->tdaTail; - tdp->linkp = &sc->tdaTail->frag[0].frag_link; - - /* - * Set up circular linked list in Receive Descriptor Area. - * Leaves sc->rda pointing at the `beginning' of the list. - * - * NOTE: The RDA and CDP must have the same MSW for their addresses. - */ - - sc->rda = sonic_allocate( - (sc->rdaCount * sizeof(ReceiveDescriptor_t)) + - sizeof(CamDescriptor_t) ); - sc->cdp = (CamDescriptorPointer_t) ((unsigned char *)sc->rda + - (sc->rdaCount * sizeof(ReceiveDescriptor_t))); -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "rda area = %p\n", sc->rda ); - printf( "cdp area = %p\n", sc->cdp ); -#endif - - ordp = rdp = sc->rda; - for (i = 0 ; i < sc->rdaCount ; i++) { - /* - * status, byte_count, pkt_ptr0, pkt_ptr1, and seq_no are set - * to zero by sonic_allocate. - */ - rdp->link = LSW(rdp + 1); - rdp->in_use = RDA_FREE; - rdp->next = (ReceiveDescriptor_t *)(rdp + 1); - ordp = rdp; - rdp++; - } - /* - * Link the last desriptor to the 1st one and mark it as the end - * of the list. - */ - ordp->next = sc->rda; - ordp->link = LSW(sc->rda) | RDA_LINK_EOL; - sc->rdp_last = rdp; - - /* - * Allocate the receive resource area. - * In accordance with National Application Note 746, make the - * receive resource area bigger than the receive descriptor area. - * This has the useful side effect of making the receive resource - * area big enough to hold the CAM descriptor area. - */ - - sc->rsa = sonic_allocate((sc->rdaCount + RRA_EXTRA_COUNT) * sizeof *sc->rsa); -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "rsa area = %p\n", sc->rsa ); -#endif - - /* - * Set up list in Receive Resource Area. - * Allocate space for incoming packets. - */ - - rwp = sc->rsa; - for (i = 0 ; i < (sc->rdaCount + RRA_EXTRA_COUNT) ; i++, rwp++) { - struct mbuf **mp; - - /* - * Allocate memory for buffer. - * Place a pointer to the mbuf at the beginning of the buffer - * so we can find the mbuf when the SONIC returns the buffer - * to the driver. - */ - - MGETHDR (m, M_WAIT, MT_DATA); - MCLGET (m, M_WAIT); - m->m_pkthdr.rcvif = &sc->arpcom.ac_if; - mp = mtod (m, struct mbuf **); - - m->m_data += sizeof *mp; - *mp = m; - p = mtod (m, void *); - - /* - * Set up RRA entry - */ - rwp->buff_ptr_lsw = LSW(p); - rwp->buff_ptr_msw = MSW(p); - rwp->buff_wc_lsw = RBUF_WC; - rwp->buff_wc_msw = 0; - } - sc->rea = rwp; -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "rea area = %p\n", sc->rea ); -#endif - - - /* - * Issue a software reset. - */ - sonic_write_register( rp, SONIC_REG_CR, CR_RST | CR_STP | CR_RXDIS | CR_HTX ); - - /* - * Set up data configuration registers. - */ - sonic_write_register( rp, SONIC_REG_DCR, SONIC_DCR ); - sonic_write_register( rp, SONIC_REG_DCR2, SONIC_DC2 ); - - sonic_write_register( rp, SONIC_REG_CR, CR_STP | CR_RXDIS | CR_HTX ); - - /* - * Mask all interrupts - */ - sonic_write_register( rp, SONIC_REG_IMR, 0x3fff ); - - /* - * Clear outstanding interrupts. - */ - sonic_write_register( rp, SONIC_REG_ISR, 0x7FFF ); - - /* - * Clear the tally counters - */ - - sonic_write_register( rp, SONIC_REG_CRCT, 0xFFFF ); - sonic_write_register( rp, SONIC_REG_FAET, 0xFFFF ); - sonic_write_register( rp, SONIC_REG_MPT, 0xFFFF ); - sonic_write_register( rp, SONIC_REG_RSC, 0 ); - - /* - * Set the Receiver mode - * - * Enable/disable reception of broadcast packets - */ - - if (sc->acceptBroadcast) - sonic_write_register( rp, SONIC_REG_RCR, RCR_BRD ); - else - sonic_write_register( rp, SONIC_REG_RCR, 0 ); - - /* - * Set up Resource Area pointers - */ - - sonic_write_register( rp, SONIC_REG_URRA, MSW(sc->rsa) ); - sonic_write_register( rp, SONIC_REG_RSA, LSW(sc->rsa) ); - - sonic_write_register( rp, SONIC_REG_REA, LSW(sc->rea) ); - - sonic_write_register( rp, SONIC_REG_RRP, LSW(sc->rsa) ); - sonic_write_register( rp, SONIC_REG_RWP, LSW(sc->rsa) ); /* XXX was rea */ - - sonic_write_register( rp, SONIC_REG_URDA, MSW(sc->rda) ); - sonic_write_register( rp, SONIC_REG_CRDA, LSW(sc->rda) ); - - sonic_write_register( rp, SONIC_REG_UTDA, MSW(sc->tdaTail) ); - sonic_write_register( rp, SONIC_REG_CTDA, LSW(sc->tdaTail) ); - - /* - * Set End Of Buffer Count register to the value recommended - * in Note 1 of Section 3.4.4.4 of the SONIC data sheet. - */ - - sonic_write_register( rp, SONIC_REG_EOBC, RBUF_WC - 2 ); - - /* - * Issue the load RRA command - */ - - sonic_write_register( rp, SONIC_REG_CR, CR_RRRA ); - while (sonic_read_register( rp, SONIC_REG_CR ) & CR_RRRA) - continue; - - /* - * Remove device reset - */ - - sonic_write_register( rp, SONIC_REG_CR, 0 ); - - /* - * Set up the SONIC CAM with our hardware address. - */ - - hwaddr = sc->arpcom.ac_enaddr; - cdp = sc->cdp; - -#if (SONIC_DEBUG & SONIC_DEBUG_CAM) - printf( "hwaddr: %2x:%2x:%2x:%2x:%2x:%2x\n", - hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5] ); -#endif - - cdp->cep = 0; /* Fill first and only entry in CAM */ - cdp->cap0 = hwaddr[1] << 8 | hwaddr[0]; - cdp->cap1 = hwaddr[3] << 8 | hwaddr[2]; - cdp->cap2 = hwaddr[5] << 8 | hwaddr[4]; - cdp->ce = 0x0001; /* Enable first entry in CAM */ - - sonic_write_register( rp, SONIC_REG_CDC, 1 ); /* 1 entry in CDA */ - sonic_write_register( rp, SONIC_REG_CDP, LSW(cdp) ); - sonic_write_register( rp, SONIC_REG_CR, CR_LCAM ); /* Load the CAM */ - - while (sonic_read_register( rp, SONIC_REG_CR ) & CR_LCAM) - continue; - - /* - * Verify that CAM was properly loaded. - */ - - sonic_write_register( rp, SONIC_REG_CR, CR_RST | CR_STP | CR_RXDIS | CR_HTX ); - -#if (SONIC_DEBUG & SONIC_DEBUG_CAM) - sonic_write_register( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */ - printf ("Loaded Ethernet address into SONIC CAM.\n" - " Wrote %04x%04x%04x - %#x\n" - " Read %04x%04x%04x - %#x\n", - cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce, - sonic_read_register( rp, SONIC_REG_CAP2 ), - sonic_read_register( rp, SONIC_REG_CAP1 ), - sonic_read_register( rp, SONIC_REG_CAP0 ), - sonic_read_register( rp, SONIC_REG_CE )); -#endif - - sonic_write_register( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */ - if ((sonic_read_register( rp, SONIC_REG_CAP2 ) != cdp->cap2) - || (sonic_read_register( rp, SONIC_REG_CAP1 ) != cdp->cap1) - || (sonic_read_register( rp, SONIC_REG_CAP0 ) != cdp->cap0) - || (sonic_read_register( rp, SONIC_REG_CE ) != cdp->ce)) { - printf ("Failed to load Ethernet address into SONIC CAM.\n" - " Wrote %04x%04x%04x - %#x\n" - " Read %04x%04x%04x - %#x\n", - cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce, - sonic_read_register( rp, SONIC_REG_CAP2 ), - sonic_read_register( rp, SONIC_REG_CAP1 ), - sonic_read_register( rp, SONIC_REG_CAP0 ), - sonic_read_register( rp, SONIC_REG_CE )); - rtems_panic ("SONIC LCAM"); - } - - sonic_write_register(rp, SONIC_REG_CR, CR_TXP | CR_RXEN | CR_STP); - - /* - * Attach SONIC interrupt handler - */ - sonic_write_register( rp, SONIC_REG_IMR, 0 ); - old_handler = set_vector(sonic_interrupt_handler, sc->vector, 0); - - /* - * Remainder of hardware initialization is - * done by the receive and transmit daemons. - */ -} - -/* - * Send packet (caller provides header). - */ - -SONIC_STATIC void sonic_start(struct ifnet *ifp) -{ - struct sonic_softc *sc = ifp->if_softc; - - rtems_event_send(sc->txDaemonTid, START_TRANSMIT_EVENT); - ifp->if_flags |= IFF_OACTIVE; -} - -/* - * Initialize and start the device - */ - -SONIC_STATIC void sonic_init (void *arg) -{ - struct sonic_softc *sc = arg; - struct ifnet *ifp = &sc->arpcom.ac_if; - void *rp = sc->sonic; - int rcr; - - if (sc->txDaemonTid == 0) { - - /* - * Set up SONIC hardware - */ - sonic_initialize_hardware (sc); - - /* - * Start driver tasks - */ - sc->txDaemonTid = rtems_bsdnet_newproc ("SNtx", 4096, sonic_txDaemon, sc); - sc->rxDaemonTid = rtems_bsdnet_newproc ("SNrx", 4096, sonic_rxDaemon, sc); - } - - /* - * Set flags appropriately - */ - rcr = sonic_read_register( rp, SONIC_REG_RCR ); - if (ifp->if_flags & IFF_PROMISC) - rcr |= RCR_PRO; - else - rcr &= ~RCR_PRO; - sonic_write_register( rp, SONIC_REG_RCR, rcr); - - /* - * Tell the world that we're running. - */ - ifp->if_flags |= IFF_RUNNING; - - /* - * Enable receiver and transmitter - */ - sonic_write_register(rp, SONIC_REG_CR, CR_TXP | CR_RXEN); -} - -/* - * Driver ioctl handler - */ -static int -sonic_ioctl (struct ifnet *ifp, int command, caddr_t data) -{ - struct sonic_softc *sc = ifp->if_softc; - int error = 0; - - switch (command) { - case SIOCGIFADDR: - case SIOCSIFADDR: - ether_ioctl (ifp, command, data); - break; - - case SIOCSIFFLAGS: - switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) { - case IFF_RUNNING: - sonic_stop (sc); - break; - - case IFF_UP: - sonic_init (sc); - break; - - case IFF_UP | IFF_RUNNING: - sonic_stop (sc); - sonic_init (sc); - break; - - default: - break; - } - break; - - case SIO_RTEMS_SHOW_STATS: - sonic_stats (sc); - break; - - /* - * FIXME: All sorts of multicast commands need to be added here! - */ - default: - error = EINVAL; - break; - } - return error; -} - -/* - * Attach an SONIC driver to the system - * This is the only `extern' function in the driver. - */ -int -rtems_sonic_driver_attach (struct rtems_bsdnet_ifconfig *config) -{ - struct sonic_softc *sc; - struct ifnet *ifp; - int mtu; - int i; - - /* - * Find an unused entry - */ - i = 0; - sc = sonic_softc; - for (;;) { - if (sc == &sonic_softc[NSONIC]) { - printf ("No more SONIC devices.\n"); - return 0; - } - ifp = &sc->arpcom.ac_if; - if (ifp->if_softc == NULL) - break; - sc++; - i++; - } - - /* - * zero out the control structure - */ - - memset( sc, 0, sizeof(*sc) ); - - - /* - * Process options - */ - if (config->hardware_address) { - memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN); - } - else { - memset (sc->arpcom.ac_enaddr, 0x08, ETHER_ADDR_LEN); - } - if (config->mtu) - mtu = config->mtu; - else - mtu = ETHERMTU; - if (config->rbuf_count) - sc->rdaCount = config->rbuf_count; - else - sc->rdaCount = RDA_COUNT; - if (config->xbuf_count) - sc->tdaCount = config->xbuf_count; - else - sc->tdaCount = TDA_COUNT; - sc->acceptBroadcast = !config->ignore_broadcast; - - /* - * Set up network interface values - */ - ifp->if_softc = sc; - ifp->if_unit = i + 1; - ifp->if_name = "sonic"; - ifp->if_mtu = mtu; - ifp->if_init = sonic_init; - ifp->if_ioctl = sonic_ioctl; - ifp->if_start = sonic_start; - ifp->if_output = ether_output; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; - if (ifp->if_snd.ifq_maxlen == 0) - ifp->if_snd.ifq_maxlen = ifqmaxlen; - - /* - * Attach the interface - */ - if_attach (ifp); - ether_ifattach (ifp); - return 1; -} - -#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS) -#include <stdio.h> - -char SONIC_Reg_name[64][6]= { - "CR", /* 0x00 */ - "DCR", /* 0x01 */ - "RCR", /* 0x02 */ - "TCR", /* 0x03 */ - "IMR", /* 0x04 */ - "ISR", /* 0x05 */ - "UTDA", /* 0x06 */ - "CTDA", /* 0x07 */ - "0x08", /* 0x08 */ - "0x09", /* 0x09 */ - "0x0A", /* 0x0A */ - "0x0B", /* 0x0B */ - "0x0C", /* 0x0C */ - "URDA", /* 0x0D */ - "CRDA", /* 0x0E */ - "0x0F", /* 0x0F */ - "0x10", /* 0x10 */ - "0x11", /* 0x11 */ - "0x12", /* 0x12 */ - "EOBC", /* 0x13 */ - "URRA", /* 0x14 */ - "RSA", /* 0x15 */ - "REA", /* 0x16 */ - "RRP", /* 0x17 */ - "RWP", /* 0x18 */ - "0x19", /* 0x19 */ - "0x1A", /* 0x1A */ - "0x1B", /* 0x1B */ - "0x1C", /* 0x1C */ - "0x0D", /* 0x1D */ - "0x1E", /* 0x1E */ - "0x1F", /* 0x1F */ - "0x20", /* 0x20 */ - "CEP", /* 0x21 */ - "CAP2", /* 0x22 */ - "CAP1", /* 0x23 */ - "CAP0", /* 0x24 */ - "CE", /* 0x25 */ - "CDP", /* 0x26 */ - "CDC", /* 0x27 */ - "SR", /* 0x28 */ - "WT0", /* 0x29 */ - "WT1", /* 0x2A */ - "RSC", /* 0x2B */ - "CRCT", /* 0x2C */ - "FAET", /* 0x2D */ - "MPT", /* 0x2E */ - "MDT", /* 0x2F */ - "0x30", /* 0x30 */ - "0x31", /* 0x31 */ - "0x32", /* 0x32 */ - "0x33", /* 0x33 */ - "0x34", /* 0x34 */ - "0x35", /* 0x35 */ - "0x36", /* 0x36 */ - "0x37", /* 0x37 */ - "0x38", /* 0x38 */ - "0x39", /* 0x39 */ - "0x3A", /* 0x3A */ - "0x3B", /* 0x3B */ - "0x3C", /* 0x3C */ - "0x3D", /* 0x3D */ - "0x3E", /* 0x3E */ - "DCR2" /* 0x3F */ -}; -#endif -void sonic_write_register( - void *base, - unsigned32 regno, - unsigned32 value -) -{ - volatile unsigned32 *p = base; - -#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS) - printf( "%p Write 0x%04x to %s (0x%02x)\n", - &p[regno], value, SONIC_Reg_name[regno], regno ); - fflush( stdout ); -#endif - p[regno] = value; -} - -unsigned32 sonic_read_register( - void *base, - unsigned32 regno -) -{ - volatile unsigned32 *p = base; - unsigned32 value; - - value = p[regno]; -#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS) - printf( "%p Read 0x%04x from %s (0x%02x)\n", - &p[regno], value, SONIC_Reg_name[regno], regno ); - fflush( stdout ); -#endif - return value; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h b/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h deleted file mode 100644 index 64aa1718f1..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h +++ /dev/null @@ -1,372 +0,0 @@ -/*
- *******************************************************************
- *******************************************************************
- ** **
- ** DECLARATIONS FOR NATIONAL DP83932 `SONIC' **
- ** SYSTEMS-ORIENTED NETWORK INTERFACE CONTROLLER **
- ** **
- *******************************************************************
- *******************************************************************
- */
-
-/*
- * $Revision$ $Date$ $Author$
- * $State$
- * $Id$
- */
-
-#ifndef _SONIC_DP83932_
-#define _SONIC_DP83932_
-
-#include <bsp.h>
-
-/*
- ******************************************************************
- * *
- * Device Registers *
- * *
- ******************************************************************
- */
-#define SONIC_REG_CR 0x00 /* Command */
-#define SONIC_REG_DCR 0x01 /* Data configuration */
-#define SONIC_REG_RCR 0x02 /* Receive control */
-#define SONIC_REG_TCR 0x03 /* Transmit control */
-#define SONIC_REG_IMR 0x04 /* Interrupt mask */
-#define SONIC_REG_ISR 0x05 /* Interrupt status */
-#define SONIC_REG_UTDA 0x06 /* Upper transmit descriptor address */
-#define SONIC_REG_CTDA 0x07 /* Current transmit descriptor address */
-#define SONIC_REG_URDA 0x0D /* Upper receive descriptor address */
-#define SONIC_REG_CRDA 0x0E /* Current receive descriptor address */
-#define SONIC_REG_EOBC 0x13 /* End of buffer word count */
-#define SONIC_REG_URRA 0x14 /* Upper receive resource */
-#define SONIC_REG_RSA 0x15 /* Resource start address */
-#define SONIC_REG_REA 0x16 /* Resource end address */
-#define SONIC_REG_RRP 0x17 /* Resouce read pointer */
-#define SONIC_REG_RWP 0x18 /* Resouce write pointer */
-#define SONIC_REG_CEP 0x21 /* CAM entry pointer */
-#define SONIC_REG_CAP2 0x22 /* CAM address port 2 */
-#define SONIC_REG_CAP1 0x23 /* CAM address port 1 */
-#define SONIC_REG_CAP0 0x24 /* CAM address port 0 */
-#define SONIC_REG_CE 0x25 /* CAM enable */
-#define SONIC_REG_CDP 0x26 /* CAM descriptor pointer */
-#define SONIC_REG_CDC 0x27 /* CAM descriptor count */
-#define SONIC_REG_SR 0x28 /* Silicon revision */
-#define SONIC_REG_WT0 0x29 /* Watchdog timer 0 */
-#define SONIC_REG_WT1 0x2A /* Watchdog timer 1 */
-#define SONIC_REG_RSC 0x2B /* Receive sequence counter */
-#define SONIC_REG_CRCT 0x2C /* CRC error tally */
-#define SONIC_REG_FAET 0x2D /* FAE tally */
-#define SONIC_REG_MPT 0x2E /* Missed packet tally */
-#define SONIC_REG_MDT 0x2F /* TX Maximum Deferral */
-#define SONIC_REG_DCR2 0x3F /* Data configuration 2 */
-
-/*
- * Command register
- */
-#define CR_LCAM 0x0200
-#define CR_RRRA 0x0100
-#define CR_RST 0x0080
-#define CR_ST 0x0020
-#define CR_STP 0x0010
-#define CR_RXEN 0x0008
-#define CR_RXDIS 0x0004
-#define CR_TXP 0x0002
-#define CR_HTX 0x0001
-
-/*
- * Data configuration register
- */
-#define DCR_EXBUS 0x8000
-#define DCR_LBR 0x2000
-#define DCR_PO1 0x1000
-#define DCR_PO0 0x0800
-#define DCR_SBUS 0x0400
-#define DCR_USR1 0x0200
-#define DCR_USR0 0x0100
-#define DCR_WC1 0x0080
-#define DCR_WC0 0x0040
-#define DCR_DW 0x0020
-#define DCR_BMS 0x0010
-#define DCR_RFT1 0x0008
-#define DCR_RFT0 0x0004
-#define DCR_TFT1 0x0002
-#define DCR_TFT0 0x0001
-
-/* data configuration register aliases */
-#define DCR_SYNC DCR_SBUS /* synchronous (memory cycle 2 clocks) */
-#define DCR_ASYNC 0 /* asynchronous (memory cycle 3 clocks) */
-
-#define DCR_WAIT0 0 /* 0 wait states added */
-#define DCR_WAIT1 DCR_WC0 /* 1 wait state added */
-#define DCR_WAIT2 DCR_WC1 /* 2 wait states added */
-#define DCR_WAIT3 (DCR_WC1|DCR_WC0) /* 3 wait states added */
-
-#define DCR_DW16 0 /* use 16-bit DMA accesses */
-#define DCR_DW32 DCR_DW /* use 32-bit DMA accesses */
-
-#define DCR_DMAEF 0 /* DMA until TX/RX FIFO has emptied/filled */
-#define DCR_DMABLOCK DCR_BMS /* DMA until RX/TX threshold crossed */
-
-#define DCR_RFT4 0 /* receive threshold 4 bytes */
-#define DCR_RFT8 DCR_RFT0 /* receive threshold 8 bytes */
-#define DCR_RFT16 DCR_RFT1 /* receive threshold 16 bytes */
-#define DCR_RFT24 (DCR_RFT1|DCR_RFT0) /* receive threshold 24 bytes */
-
-#define DCR_TFT8 0 /* transmit threshold 8 bytes */
-#define DCR_TFT16 DCR_TFT0 /* transmit threshold 16 bytes */
-#define DCR_TFT24 DCR_TFT1 /* transmit threshold 24 bytes */
-#define DCR_TFT28 (DCR_TFT1|DCR_TFT0) /* transmit threshold 28 bytes */
-
-/*
- * Receive control register
- */
-#define RCR_ERR 0x8000
-#define RCR_RNT 0x4000
-#define RCR_BRD 0x2000
-#define RCR_PRO 0x1000
-#define RCR_AMC 0x0800
-#define RCR_LB1 0x0400
-#define RCR_LB0 0x0200
-#define RCR_MC 0x0100
-#define RCR_BC 0x0080
-#define RCR_LPKT 0x0040
-#define RCR_CRS 0x0020
-#define RCR_COL 0x0010
-#define RCR_CRCR 0x0008
-#define RCR_FAER 0x0004
-#define RCR_LBK 0x0002
-#define RCR_PRX 0x0001
-
-/*
- * Transmit control register
- */
-#define TCR_PINT 0x8000
-#define TCR_POWC 0x4000
-#define TCR_CRCI 0x2000
-#define TCR_EXDIS 0x1000
-#define TCR_EXD 0x0400
-#define TCR_DEF 0x0200
-#define TCR_NCRS 0x0100
-#define TCR_CRSL 0x0080
-#define TCR_EXC 0x0040
-#define TCR_OWC 0x0020
-#define TCR_PMB 0x0008
-#define TCR_FU 0x0004
-#define TCR_BCM 0x0002
-#define TCR_PTX 0x0001
-
-/*
- * Interrupt mask register
- */
-#define IMR_BREN 0x4000
-#define IMR_HBLEN 0x2000
-#define IMR_LCDEN 0x1000
-#define IMR_PINTEN 0x0800
-#define IMR_PRXEN 0x0400
-#define IMR_PTXEN 0x0200
-#define IMR_TXEREN 0x0100
-#define IMR_TCEN 0x0080
-#define IMR_RDEEN 0x0040
-#define IMR_RBEEN 0x0020
-#define IMR_RBAEEN 0x0010
-#define IMR_CRCEN 0x0008
-#define IMR_FAEEN 0x0004
-#define IMR_MPEN 0x0002
-#define IMR_RFOEN 0x0001
-
-/*
- * Interrupt status register
- */
-#define ISR_BR 0x4000
-#define ISR_HBL 0x2000
-#define ISR_LCD 0x1000
-#define ISR_PINT 0x0800
-#define ISR_PKTRX 0x0400
-#define ISR_TXDN 0x0200
-#define ISR_TXER 0x0100
-#define ISR_TC 0x0080
-#define ISR_RDE 0x0040
-#define ISR_RBE 0x0020
-#define ISR_RBAE 0x0010
-#define ISR_CRC 0x0008
-#define ISR_FAE 0x0004
-#define ISR_MP 0x0002
-#define ISR_RFO 0x0001
-
-/*
- * Data configuration register 2
- */
-#define DCR2_EXPO3 0x8000
-#define DCR2_EXPO2 0x4000
-#define DCR2_EXPO1 0x2000
-#define DCR2_EXPO0 0x1000
-#define DCR2_PH 0x0010
-#define DCR2_PCM 0x0004
-#define DCR2_PCNM 0x0002
-#define DCR2_RJCM 0x0001
-
-/*
- * Known values for the Silicon Revision Register
- */
-
-#define SONIC_REVISION_B 4
-#define SONIC_REVISION_C 6
-
-/*
- ******************************************************************
- * *
- * Transmit Buffer Management *
- * *
- ******************************************************************
- */
-
-/*
- * Transmit descriptor area entry.
- * There is one transmit descriptor for each packet to be transmitted.
- * Statically reserve space for up to MAXIMUM_FRAGS_PER_PACKET fragments
- * per descriptor.
- */
-#define MAXIMUM_FRAGS_PER_DESCRIPTOR 6
-struct TransmitDescriptor {
- rtems_unsigned32 status;
- rtems_unsigned32 pkt_config;
- rtems_unsigned32 pkt_size;
- rtems_unsigned32 frag_count;
-
- /*
- * Packet fragment pointers
- */
- struct TransmitDescriptorFragLink {
- rtems_unsigned32 frag_lsw; /* LSW of fragment address */
-#define frag_link frag_lsw
- rtems_unsigned32 frag_msw; /* MSW of fragment address */
- rtems_unsigned32 frag_size;
- } frag[MAXIMUM_FRAGS_PER_DESCRIPTOR];
-
- /*
- * Space for link if all fragment pointers are used.
- */
- rtems_unsigned32 link_pad;
-
- /*
- * Extra RTEMS stuff
- */
- struct TransmitDescriptor *next; /* Circularly-linked list */
- struct mbuf *mbufp; /* First mbuf in packet */
- volatile rtems_unsigned32 *linkp; /* Pointer to un[xxx].link */
-};
-typedef struct TransmitDescriptor TransmitDescriptor_t;
-typedef volatile TransmitDescriptor_t *TransmitDescriptorPointer_t;
-
-/*
- * Transmit Configuration.
- * For standard Ethernet transmission, all bits in the transmit
- * configuration field are set to 0.
- */
-#define TDA_CONFIG_PINT 0x8000
-#define TDA_CONFIG_POWC 0x4000
-#define TDA_CONFIG_CRCI 0x2000
-#define TDA_CONFIG_EXDIS 0x1000
-
-/*
- * Transmit status
- */
-#define TDA_STATUS_COLLISION_MASK 0xF800
-#define TDA_STATUS_COLLISION_SHIFT 11
-#define TDA_STATUS_EXD 0x0400
-#define TDA_STATUS_DEF 0x0200
-#define TDA_STATUS_NCRS 0x0100
-#define TDA_STATUS_CRSL 0x0080
-#define TDA_STATUS_EXC 0x0040
-#define TDA_STATUS_OWC 0x0020
-#define TDA_STATUS_PMB 0x0008
-#define TDA_STATUS_FU 0x0004
-#define TDA_STATUS_BCM 0x0002
-#define TDA_STATUS_PTX 0x0001
-
-#define TDA_LINK_EOL 0x0001
-#define TDA_LINK_EOL_MASK 0xFFFE
-
-
-
-/*
- ******************************************************************
- * *
- * Receive Buffer Management *
- * *
- ******************************************************************
- */
-
-/*
- * Receive resource area entry.
- * There is one receive resource entry for each receive buffer area (RBA).
- * This driver allows only one packet per receive buffer area, so one
- * receive resource entry corresponds to one correctly-received packet.
- */
-struct ReceiveResource {
- rtems_unsigned32 buff_ptr_lsw; /* LSW of RBA address */
- rtems_unsigned32 buff_ptr_msw; /* MSW of RBA address */
- rtems_unsigned32 buff_wc_lsw; /* LSW of RBA size (16-bit words) */
- rtems_unsigned32 buff_wc_msw; /* MSW of RBA size (16-bit words) */
-};
-typedef struct ReceiveResource ReceiveResource_t;
-typedef volatile ReceiveResource_t *ReceiveResourcePointer_t;
-
-/*
- * Receive descriptor area entry.
- * There is one receive descriptor for each packet received.
- */
-struct ReceiveDescriptor {
- rtems_unsigned32 status;
- rtems_unsigned32 byte_count;
- rtems_unsigned32 pkt_lsw; /* LSW of packet address */
- rtems_unsigned32 pkt_msw; /* MSW of packet address */
- rtems_unsigned32 seq_no;
- rtems_unsigned32 link;
- rtems_unsigned32 in_use;
-
- /*
- * Extra RTEMS stuff
- */
- volatile struct ReceiveDescriptor *next; /* Circularly-linked list */
-};
-typedef struct ReceiveDescriptor ReceiveDescriptor_t;
-typedef volatile ReceiveDescriptor_t *ReceiveDescriptorPointer_t;
-
-typedef struct {
- rtems_unsigned32 cep; /* CAM Entry Pointer */
- rtems_unsigned32 cap0; /* CAM Address Port 0 xx-xx-xx-xx-YY-YY */
- rtems_unsigned32 cap1; /* CAM Address Port 1 xx-xx-YY-YY-xxxx */
- rtems_unsigned32 cap2; /* CAM Address Port 2 YY-YY-xx-xx-xx-xx */
- rtems_unsigned32 ce;
-} CamDescriptor_t;
-
-typedef volatile CamDescriptor_t *CamDescriptorPointer_t;
-
-/*
- * Receive status
- */
-#define RDA_STATUS_ERR 0x8800
-#define RDA_STATUS_RNT 0x4000
-#define RDA_STATUS_BRD 0x2000
-#define RDA_STATUS_PRO 0x1000
-#define RDA_STATUS_AMC 0x0800
-#define RDA_STATUS_LB1 0x0400
-#define RDA_STATUS_LB0 0x0200
-#define RDA_STATUS_MC 0x0100
-#define RDA_STATUS_BC 0x0080
-#define RDA_STATUS_LPKT 0x0040
-#define RDA_STATUS_CRS 0x0020
-#define RDA_STATUS_COL 0x0010
-#define RDA_STATUS_CRCR 0x0008
-#define RDA_STATUS_FAER 0x0004
-#define RDA_STATUS_LBK 0x0002
-#define RDA_STATUS_PRX 0x0001
-
-#define RDA_LINK_EOL 0x0001
-#define RDA_LINK_EOL_MASK 0xFFFE
-#define RDA_IN_USE 0x0000 /* SONIC has finished with the packet */
- /* and the driver can process it */
-#define RDA_FREE 0xFFFF /* SONIC can use it */
-
-#endif /* _SONIC_DP83932_ */
diff --git a/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in deleted file mode 100644 index cb7d9c07ec..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/start.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/powerpc/dmv177/start/start.s b/c/src/lib/libbsp/powerpc/dmv177/start/start.s deleted file mode 100644 index f8e4e4e614..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/start/start.s +++ /dev/null @@ -1,117 +0,0 @@ -/* - * This is based on the mvme-crt0.S file from libgloss/rs6000. - * crt0.S -- startup file for PowerPC systems. - * - * Copyright (c) 1995 Cygnus Support - * - * The authors hereby grant permission to use, copy, modify, distribute, - * and license this software and its documentation for any purpose, provided - * that existing copyright notices are retained in all copies and that this - * notice is included verbatim in any distributions. No written agreement, - * license, or royalty fee is required for any of the authorized uses. - * Modifications to this software may be copyrighted by their authors - * and need not follow the licensing terms described here, provided that - * the new terms are clearly indicated on the first page of each file where - * they apply. - * - * $Id$ - */ - -#include <rtems/score/targopts.h> -#include "ppc-asm.h" - - .file "start.s" - .section ".got2","aw" - .align 2 - -.LCTOC1 = .+32768 - - .extern FUNC_NAME(atexit) - .globl FUNC_NAME(__atexit) - .section ".sdata","aw" - .align 2 -FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */ - .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */ - - .section ".fixup","aw" - .align 2 - .long FUNC_NAME(__atexit) - - .section ".got2","aw" -.Ltable = .-.LCTOC1 - .long .LCTOC1 /* address we think .LCTOC1 is loaded at */ - -.Lbss_start = .-.LCTOC1 - .long __bss_start - -.Lend = .-.LCTOC1 - .long _end - -.Lstack = .-.LCTOC1 /* stack address if set by user */ - .long __stack - - .text -.Lptr: - .long .LCTOC1-.Laddr - - .globl _start - .type _start,@function -_start: - lis r5,0 - mr r4,r5 - ori r4,r4,0x0000 /* 0x2030 */ - mtmsr r4 - -/* Add special purpose register initialization based upon the console driver - * initialization of these registers XXXXX - */ - - bl .Laddr /* get current address */ - -.Laddr: - mflr r4 /* real address of .Laddr */ - lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */ - add r5,r5,r4 /* correct to real pointer */ - lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */ - subf r4,r4,r5 /* calculate difference between where linked and current */ - - /* clear bss */ - lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */ - lwz r7,.Lend(r5) /* calculate end of the BSS */ - add r6,r6,r4 /* adjust pointers */ - add r7,r7,r4 - - cmplw 1,r6,r7 - bc 4,4,.Ldone - - subf r8,r6,r7 /* number of bytes to zero */ - srwi r9,r8,2 /* number of words to zero */ - mtctr r9 - li r0,0 /* zero to clear memory */ - addi r6,r6,-4 /* adjust so we can use stwu */ -.Lloop: - stwu r0,4(r6) /* zero bss */ - bdnz .Lloop - -.Ldone: - - lwz r0,.Lstack(r5) /* stack address or 0 */ - cmplwi 1,r0,0 /* equal to 0? */ - bc 12,6,.Lnostack /* use default stack if == 0 */ - mr sp,r0 /* use user defined stack */ - -.Lnostack: - /* set up initial stack frame */ - addi sp,sp,-4 /* make sure we don't overwrite debug mem */ - lis r0,0 - stw r0,0(sp) /* clear back chain */ - stwu sp,-56(sp) /* push another stack frame */ - - /* Let her rip */ - bl FUNC_NAME(boot_card) - - /* return value from boot_card is argument to exit */ - /* bl FUNC_NAME(exit) */ - trap -.Lstart: - .size _start,.Lstart-_start diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in deleted file mode 100644 index 0877918685..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/startup.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec genpvec vmeintr -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM) - $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c deleted file mode 100644 index 5e354f9387..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -void bsp_cleanup( void ) -{ -#if 0 - asm volatile( "li 10,99" ); /* 0x63 */ - asm volatile( "sc" ); -#endif -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c deleted file mode 100644 index 07a5bf1473..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c +++ /dev/null @@ -1,134 +0,0 @@ -/* bspstart.c - * - * This set of routines starts the application. It includes application, - * board, and monitor specific initialization and configuration. - * The generic CPU dependent initialization has been performed - * before any of these are invoked. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> -#include <rtems/libio.h> - -#include <libcsupport.h> - -#include <string.h> - -/* - * The original table from the application and our copy of it with - * some changes. - */ - -extern rtems_configuration_table Configuration; -rtems_configuration_table BSP_Configuration; -rtems_cpu_table Cpu_table; -rtems_unsigned32 bsp_isr_level; - -/* - * Use the shared implementations of the following routines - */ - -void bsp_postdriver_hook(void); -void bsp_libc_init( void *, unsigned32, int ); - -/*PAGE - * - * bsp_pretasking_hook - * - * BSP pretasking hook. Called just before drivers are initialized. - * Used to setup libc and install any BSP extensions. - */ - -void bsp_pretasking_hook(void) -{ - extern int end; - rtems_unsigned32 heap_start; - rtems_unsigned32 heap_size; - - heap_start = (rtems_unsigned32) &end; - if (heap_start & (CPU_ALIGNMENT-1)) - heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); - - heap_size = BSP_Configuration.work_space_start - (void *)&end; - heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */ - - bsp_libc_init((void *) heap_start, heap_size, 0); - -#ifdef RTEMS_DEBUG - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); -#endif -} - -/* PAGE - * - * bsp_predriver_hook - * - * Initialization before drivers are setup. - */ - -void bsp_predriver_hook(void) -{ - initialize_external_exception_vector(); -} - -/*PAGE - * - * bsp_start - * - * This routine does the bulk of the system initialization. - */ - -void bsp_start( void ) -{ - unsigned char *work_space_start; - unsigned int msr_value = 0x2030; - - /* - * Set BSP to initial value. Note: This value is a guess - * check how the real board comes up. This is critical to - * getting the source to work with the debugger. - */ - - _CPU_MSR_SET( msr_value ); - - /* - * Need to "allocate" the memory for the RTEMS Workspace and - * tell the RTEMS configuration where it is. This memory is - * not malloc'ed. It is just "pulled from the air". - */ - - work_space_start = - (unsigned char *)&RAM_END - BSP_Configuration.work_space_size; - - if ( work_space_start <= (unsigned char *)&end ) { - DEBUG_puts( "bspstart: Not enough RAM!!!\n" ); - bsp_cleanup(); - } - - BSP_Configuration.work_space_start = work_space_start; - - /* - * Account for the console's resources - */ - - console_reserve_resources( &BSP_Configuration ); - - /* - * initialize the CPU table for this BSP - */ - - Cpu_table.exceptions_in_RAM = TRUE; - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - Cpu_table.predriver_hook = bsp_predriver_hook; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - /* Cpu_table.clicks_per_usec = 66666667 / 4000000; */ - Cpu_table.clicks_per_usec = 66666667 / 4000000 / 2; - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = (12 * 1024); -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c deleted file mode 100644 index 2faa40ed9a..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c +++ /dev/null @@ -1,239 +0,0 @@ -/* genpvec.c - * - * These routines handle the external exception. Multiple ISRs occur off - * of this one interrupt. This method will allow multiple ISRs to be - * called using the same IRQ index. However, removing the ISR routines is - * presently not supported. - * - * The external exception vector numbers begin with DMV170_IRQ_FIRST. - * DMV170_IRQ_FIRST is defined to be one greater than the last processor - * interrupt. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <bsp.h> -#include "chain.h" -#include <assert.h> - -#define NUM_LIRQ_HANDLERS 20 -#define NUM_LIRQ ( MAX_BOARD_IRQS - PPC_IRQ_LAST ) - -/* - * Structure to for one of possible multiple interrupt handlers for - * a given interrupt. - */ -typedef struct -{ - Chain_Node Node; - rtems_isr_entry handler; /* isr routine */ - rtems_vector_number vector; /* vector number */ -} EE_ISR_Type; - -/* - * Note: The following will not work if we add a method to remove - * handlers at a later time. - */ -EE_ISR_Type ISR_Nodes [NUM_LIRQ_HANDLERS]; -rtems_unsigned16 Nodes_Used; -Chain_Control ISR_Array [NUM_LIRQ]; - -/*PAGE - * - * external_exception_ISR - * - * This interrupt service routine is called for an External Exception. - * - * Input parameters: - * vector - vector number representing the external exception vector. - * - * Output parameters: NONE - * - * Return values: - */ - -rtems_isr external_exception_ISR ( - rtems_vector_number vector /* IN */ -) -{ - rtems_unsigned16 index; - rtems_boolean is_active=FALSE; - rtems_unsigned32 scv64_status; - rtems_vector_number chained_vector; - Chain_Node *node; - EE_ISR_Type *ee_isr; - - - /* - * Get all active interrupts. - */ - scv64_status = SCV64_Get_Interrupt(); - scv64_status &= SCV64_Get_Interrupt_Enable(); - - /* - * Process any set interrupts. - */ - for (index = 0; index <= 5; index++) { - switch(index) { - case 0: - is_active = SCV64_Is_IRQ0( scv64_status ); - break; - case 1: - is_active = SCV64_Is_IRQ1( scv64_status ); - break; - case 2: - is_active = SCV64_Is_IRQ2( scv64_status ); - break; - case 3: - is_active = SCV64_Is_IRQ3( scv64_status ); - break; - case 4: - is_active = SCV64_Is_IRQ4( scv64_status ); - break; - case 5: - is_active = SCV64_Is_IRQ5( scv64_status ); - break; - } - - if (is_active) { - /* - * Read vector. - */ - node = ISR_Array[ index ].first; - while ( !_Chain_Is_tail( &ISR_Array[ index ], node ) ) { - ee_isr = (EE_ISR_Type *) node; - (*ee_isr->handler)( ee_isr->vector ); - node = node->next; - } - } - } -} - - -/*PAGE - * - * initialize_external_exception_vector - * - * This routine initializes the external exception vector - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void initialize_external_exception_vector () -{ - int i; - rtems_isr_entry previous_isr; - rtems_status_code status; - - Nodes_Used = 0; - - /* - * Initialize the SCV64 chip - */ - SCV64_Initialize(); - - for (i=0; i <NUM_LIRQ; i++) - Chain_Initialize_empty( &ISR_Array[i] ); - - /* - * Install external_exception_ISR () as the handler for - * the General Purpose Interrupt. - */ - - status = rtems_interrupt_catch( external_exception_ISR, - PPC_IRQ_EXTERNAL , (rtems_isr_entry *) &previous_isr ); - -} - -/*PAGE - * - * set_EE_vector - * - * This routine installs one of multiple ISRs for the general purpose - * inerrupt. - * - * Input parameters: - * handler - handler to call at exception - * vector - vector number associated with this handler. - * - * Output parameters: NONE - * - * Return values: - */ - -rtems_isr_entry set_EE_vector( - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector /* vector number */ -) -{ - rtems_unsigned16 vec_idx = vector - DMV170_IRQ_FIRST; - rtems_unsigned32 index; - - /* - * Verify that all of the nodes have not been used. - */ - assert (Nodes_Used < NUM_LIRQ_HANDLERS); - - /* - * If we have already installed this handler for this vector, then - * just reset it. - */ - - for ( index=0 ; index <= Nodes_Used ; index++ ) { - if ( ISR_Nodes[index].vector == vector && - ISR_Nodes[index].handler == handler ) - return 0; - } - - /* - * Increment the number of nedes used and set the index for the node - * array. - */ - - Nodes_Used++; - index = Nodes_Used - 1; - - /* - * Write the values of the handler and the vector to this node. - */ - ISR_Nodes[index].handler = handler; - ISR_Nodes[index].vector = vector; - - /* - * Connect this node to the chain at the location of the - * vector index. - */ - Chain_Append( &ISR_Array[vec_idx], &ISR_Nodes[index].Node ); - - /* - * Enable the LIRQ interrupt. - */ - SCV64_Generate_DUART_Interrupts(); - - /* - * No interrupt service routine was removed so return 0 - */ - return 0; -} - - - - - - - - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds b/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds deleted file mode 100644 index 52e379d8a4..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds +++ /dev/null @@ -1,183 +0,0 @@ -OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", - "elf32-powerpc") -OUTPUT_ARCH(powerpc) -ENTRY(_start) - -/* - * Number of Decrementer countdowns per millisecond - * - * Calculated by: (66.67 Mhz * 1000) / 4 cycles per click - * - -PROVIDE(CPU_PPC_CLICKS_PER_MS = 16667); -*/ - -MEMORY - { - RAM : ORIGIN = 0x41000, LENGTH = 32M - EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000 - } - -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - /* . = 0x40000 + SIZEOF_HEADERS; */ - /* . = 0x1000000;*/ - . = 0x41000; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rela.text : { *(.rela.text) } - .rela.data : { *(.rela.data) } - .rela.rodata : { *(.rela.rodata) } - .rela.got : { *(.rela.got) } - .rela.got1 : { *(.rela.got1) } - .rela.got2 : { *(.rela.got2) } - .rela.ctors : { *(.rela.ctors) } - .rela.dtors : { *(.rela.dtors) } - .rela.init : { *(.rela.init) } - .rela.fini : { *(.rela.fini) } - .rela.bss : { *(.rela.bss) } - .rela.plt : { *(.rela.plt) } - .rela.sdata : { *(.rela.sdata2) } - .rela.sbss : { *(.rela.sbss2) } - .rela.sdata2 : { *(.rela.sdata2) } - .rela.sbss2 : { *(.rela.sbss2) } - .plt : { *(.plt) } - .text : - { - *(.text) - *(.descriptors) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } >RAM - .init : { *(.init) } >RAM - .fini : { *(.fini) } >RAM - .rodata : { *(.rodata) } >RAM - .rodata1 : { *(.rodata1) } >RAM - _etext = .; - PROVIDE (etext = .); - PROVIDE (__SDATA2_START__ = .); - .sdata2 : { *(.sdata2) } >RAM - .sbss2 : { *(.sbss2) } >RAM - PROVIDE (__SBSS2_END__ = .); - /* Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up. It would - be more correct to do this: - . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1)); - The current expression does not correctly handle the case of a - text segment ending precisely at the end of a page; it causes the - data segment to skip a page. The above expression does not have - this problem, but it will currently (2/95) cause BFD to allocate - a single segment, combining both text and data, for this case. - This will prevent the text segment from being shared among - multiple executions of the program; I think that is more - important than losing a page of the virtual address space (note - that no actual memory is lost; the page which is skipped can not - be referenced). */ - . = ALIGN(8) + 0x40000; - PROVIDE (sdata = .); - .data : - { - *(.data) - CONSTRUCTORS - } >RAM - PROVIDE (__EXCEPT_START__ = .); - .gcc_except_table : { *(.gcc_except_table) } >RAM - PROVIDE (__EXCEPT_END__ = .); - - .data1 : { *(.data1) } >RAM - .got1 : { *(.got1) } >RAM - .dynamic : { *(.dynamic) } >RAM - /* Put .ctors and .dtors next to the .got2 section, so that the pointers - get relocated with -mrelocatable. Also put in the .fixup pointers. - The current compiler no longer needs this, but keep it around for 2.7.2 */ - PROVIDE (_GOT2_START_ = .); - PROVIDE (__GOT2_START__ = .); - .got2 : { *(.got2) } >RAM - PROVIDE (_GOT2_END_ = .); - PROVIDE (__GOT2_END__ = .); - - PROVIDE (__CTOR_LIST__ = .); - .ctors : { *(.ctors) } >RAM - PROVIDE (__CTOR_END__ = .); - - PROVIDE (__DTOR_LIST__ = .); - .dtors : { *(.dtors) } >RAM - PROVIDE (__DTOR_END__ = .); - - PROVIDE (_FIXUP_START_ = .); - PROVIDE (__FIXUP_START__ = .); - .fixup : { *(.fixup) } >RAM - PROVIDE (_FIXUP_END_ = .); - PROVIDE (__FIXUP_END__ = .); - - PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - s.got = .; - .got : { *(.got) } >RAM - .got.plt : { *(.got.plt) } >RAM - PROVIDE (_GOT_END_ = .); - PROVIDE (__GOT_END__ = .); - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - PROVIDE (__SDATA_START__ = .); - .sdata : { *(.sdata) } >RAM - _edata = .; - PROVIDE (edata = .); - - PROVIDE (RAM_END = 4M); - .sbss : - { - PROVIDE (__sbss_start = .); - *(.sbss) - *(.scommon) - PROVIDE (__sbss_end = .); - } >RAM - PROVIDE (__SBSS_END__ = .); - .bss : - { - PROVIDE (__bss_start = .); - *(.dynbss) - *(.bss) - *(COMMON) - } >RAM - . = ALIGN(8) + 0x8000; - PROVIDE (__stack = .); - _end = . ; - PROVIDE (end = .); - - /* These are needed for ELF backends which have not yet been - converted to the new style linker. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - /* 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 . */ -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c deleted file mode 100644 index cf385569d0..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c +++ /dev/null @@ -1,58 +0,0 @@ -/* set_vector - * - * This routine installs an interrupt vector on the target Board/CPU. - * This routine is allowed to be as board dependent as necessary. - * - * INPUT: - * handler - interrupt handler entry point - * vector - vector number - * type - 0 indicates raw hardware connect - * 1 indicates RTEMS interrupt connect - * - * RETURNS: - * address of previous interrupt handler - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems.h> -#include <bsp.h> - -/*PAGE - * - * set_vector - * - * This routine installs an interrupt handler for vector. - */ - -rtems_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -) -{ - rtems_isr_entry previous_isr; - rtems_status_code status; - - /* - * vectors greater than PPC603e_IRQ_LAST are handled by the General purpose - * interupt handler. - */ - if ( vector > PPC_IRQ_LAST ) { - set_EE_vector ( handler, vector ); - } - else { - status = rtems_interrupt_catch( - handler, vector, (rtems_isr_entry *) &previous_isr ); - } - return previous_isr; -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c b/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c deleted file mode 100644 index 212d7eb938..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c +++ /dev/null @@ -1,84 +0,0 @@ -/* vmeintr.c - * - * VMEbus support routines for the DMV170. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems.h> -#include <bsp.h> -#include <vmeintr.h> - -/* PAGE - * - * VME_interrupt_Disable - * - * This routine disables vme interupts - * - * Input parameters: - * mask - interupt mask - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void VME_interrupt_Disable ( - VME_interrupt_Mask mask /* IN */ -) -{ - volatile rtems_unsigned8 *VME_interrupt_enable; - rtems_unsigned8 value; - -#if 0 - VME_interrupt_enable = ACC_VIE; -#else - VME_interrupt_enable = 0; -#endif - value = *VME_interrupt_enable; - - value &= ~mask; /* turn off interrupts for all levels in mask */ - - *VME_interrupt_enable = value; -} - -/* PAGE - * - * VME_interrupt_Enable - * - * This routine enables vme interupts - * - * Input parameters: - * mask - interupt mask - * - * Output parameters: NONE - * - * Return values: - */ - -void VME_interrupt_Enable ( - VME_interrupt_Mask mask /* IN */ -) -{ - volatile rtems_unsigned8 *VME_interrupt_enable; - rtems_unsigned8 value; - -#if 0 - VME_interrupt_enable = ACC_VIE; -#else - VME_interrupt_enable = 0; -#endif - value = *VME_interrupt_enable; - - value |= mask; /* turn on interrupts for all levels in mask */ - - *VME_interrupt_enable = value; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in deleted file mode 100644 index 16665e4de9..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/timer.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=timer -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c b/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c deleted file mode 100644 index 674e2cf5a8..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c +++ /dev/null @@ -1,132 +0,0 @@ -/* timer.c - * - * This file implements a benchmark timer using the General Purpose Timer on - * the MEC. - * - * The license and distribution terms for this file are in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <assert.h> - -#include <bsp.h> - -rtems_unsigned64 Timer_driver_Start_time; - -rtems_boolean Timer_driver_Find_average_overhead; - -/*PAGE - * - * Timer_initialize - * - * This routine initializes the timer. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Timer_initialize() -{ - /* - * Timer runs long and accurate enough not to require an interrupt. - */ - - - Timer_driver_Start_time = PPC_Get_timebase_register(); - - -} - -#define AVG_OVERHEAD 24 /* It typically takes 24 instructions */ - /* to start/stop the timer. */ -#define LEAST_VALID 1 /* Don't trust a value lower than this */ - -/* PAGE - * - * Read_timer - * - * This routine reads the timer. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: timer in ms units - * - */ - -int Read_timer() -{ - rtems_unsigned64 clicks; - rtems_unsigned64 total64; - rtems_unsigned32 total; - - /* approximately CLOCK_SPEED clicks per microsecond */ - - clicks = PPC_Get_timebase_register(); - - assert( clicks > Timer_driver_Start_time ); - - total64 = clicks - Timer_driver_Start_time; - - assert( total64 <= 0xffffffff ); /* fits into a unsigned32 */ - - total = (rtems_unsigned32) total64; - - if ( Timer_driver_Find_average_overhead == 1 ) - return total; /* in one microsecond units */ - - if ( total < LEAST_VALID ) - return 0; /* below timer resolution */ - - return total - AVG_OVERHEAD; -} - -/* PAGE - * - * Empty_function - * - * This routine is called during the idle loop. - * - * Input parameters: NONE - * - * Output parameters: - * status code of successful - * - * Return values: NONE - * - */ - -rtems_status_code Empty_function( void ) -{ - return RTEMS_SUCCESSFUL; -} - -/* PAGE - * - * Set_find_average_overhead - * - * This routine sets a global boolean to the value passed in. - * - * Input parameters: - * find_flag - flag to indicate to find the average overhead. - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Set_find_average_overhead( - rtems_boolean find_flag -) -{ - Timer_driver_Find_average_overhead = find_flag; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/times b/c/src/lib/libbsp/powerpc/dmv177/times deleted file mode 100644 index 2a18eae92a..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/times +++ /dev/null @@ -1,191 +0,0 @@ -# -# Timing Test Suite Results for the DY-4 DMV177 -# -# $Id$ -# - -Board: DY-4 DMV177 -CPU: PPC 603e -Clock Speed: 100 Mhz -Memory Configuration: 32 Mbyte DRAM -Wait States: XXX - -Times Reported in: cycles -Timer Source: on-CPU General Purpose Count Down Timer - -Column A: 4.0.0-lmco -Column B: unused - -# DESCRIPTION A B -== ================================================================= ==== ==== - 1 rtems_semaphore_create 571 - rtems_semaphore_delete 575 - rtems_semaphore_obtain: available 414 - rtems_semaphore_obtain: not available -- NO_WAIT 414 - rtems_semaphore_release: no waiting tasks 501 - - 2 rtems_semaphore_obtain: not available -- caller blocks 1254 - - 3 rtems_semaphore_release: task readied -- preempts caller 982 - - 4 rtems_task_restart: blocked task -- preempts caller 1640 - rtems_task_restart: ready task -- preempts caller 1601 - rtems_semaphore_release: task readied -- returns to caller 636 - rtems_task_create 2301 - rtems_task_start 794 - rtems_task_restart: suspended task -- returns to caller 906 - rtems_task_delete: suspended task 1555 - rtems_task_restart: ready task -- returns to caller 928 - rtems_task_restart: blocked task -- returns to caller 1102 - rtems_task_delete: blocked task 1609 - - 5 rtems_task_suspend: calling task 960 - rtems_task_resume: task readied -- preempts caller 803 - - 6 rtems_task_restart: calling task 1137 - rtems_task_suspend: returns to caller 433 - rtems_task_resume: task readied -- returns to caller 451 - rtems_task_delete: ready task 1620 - - 7 rtems_task_restart: suspended task -- preempts caller 1483 - - 8 rtems_task_set_priority: obtain current priority 368 - rtems_task_set_priority: returns to caller 633 - rtems_task_mode: obtain current mode 184 - rtems_task_mode: no reschedule 213 - rtems_task_mode: reschedule -- returns to caller 247 - rtems_task_mode: reschedule -- preempts caller 919 - rtems_task_set_note 383 - rtems_task_get_note 382 - rtems_clock_set 792 - rtems_clock_get 78 - - 9 rtems_message_queue_create 2270 - rtems_message_queue_send: no waiting tasks 923 - rtems_message_queue_urgent: no waiting tasks 919 - rtems_message_queue_receive: available 755 - rtems_message_queue_flush: no messages flushed 369 - rtems_message_queue_flush: messages flushed 431 - rtems_message_queue_delete 708 - -10 rtems_message_queue_receive: not available -- NO_WAIT 467 - rtems_message_queue_receive: not available -- caller blocks 1283 - -11 rtems_message_queue_send: task readied -- preempts caller 1322 - -12 rtems_message_queue_send: task readied -- returns to caller 955 - -13 rtems_message_queue_urgent: task readied -- preempts caller 1322 - -14 rtems_message_queue_urgent: task readied -- returns to caller 955 - -15 rtems_event_receive: obtain current events 43 - rtems_event_receive: not available -- NO_WAIT 331 - rtems_event_receive: not available -- caller blocks 1043 - rtems_event_send: no task readied 354 - rtems_event_receive: available 357 - rtems_event_send: task readied -- returns to caller 571 - -16 rtems_event_send: task readied -- preempts caller 946 - -17 rtems_task_set_priority: preempts caller 1211 - -18 rtems_task_delete: calling task 2117 - -19 rtems_signal_catch 267 - rtems_signal_send: returns to caller 408 - rtems_signal_send: signal to self 607 - exit ASR overhead: returns to calling task 464 - exit ASR overhead: returns to preempting task 752 - -20 rtems_partition_create 762 - rtems_region_create 614 - rtems_partition_get_buffer: available 394 - rtems_partition_get_buffer: not available 376 - rtems_partition_return_buffer 420 - rtems_partition_delete 426 - rtems_region_get_segment: available 515 - rtems_region_get_segment: not available -- NO_WAIT 472 - rtems_region_return_segment: no waiting tasks 544 - rtems_region_get_segment: not available -- caller blocks 1345 - rtems_region_return_segment: task readied -- preempts caller 1296 - rtems_region_return_segment: task readied -- returns to caller 935 - rtems_region_delete 425 - rtems_io_initialize 52 - rtems_io_open 42 - rtems_io_close 44 - rtems_io_read 42 - rtems_io_write 44 - rtems_io_control 42 - -21 rtems_task_ident 2900 - rtems_message_queue_ident 2828 - rtems_semaphore_ident 3243 - rtems_partition_ident 2828 - rtems_region_ident 2878 - rtems_port_ident 2828 - rtems_timer_ident 2828 - rtems_rate_monotonic_ident 2826 - -22 rtems_message_queue_broadcast: task readied -- returns to caller 1079 - rtems_message_queue_broadcast: no waiting tasks 589 - rtems_message_queue_broadcast: task readied -- preempts caller 1435 - -23 rtems_timer_create 357 - rtems_timer_fire_after: inactive 607 - rtems_timer_fire_after: active 646 - rtems_timer_cancel: active 378 - rtems_timer_cancel: inactive 339 - rtems_timer_reset: inactive 552 - rtems_timer_reset: active 591 - rtems_timer_fire_when: inactive 766 - rtems_timer_fire_when: active 764 - rtems_timer_delete: active 471 - rtems_timer_delete: inactive 432 - rtems_task_wake_when 1275 - -24 rtems_task_wake_after: yield -- returns to caller 245 - rtems_task_wake_after: yields -- preempts caller 851 - -25 rtems_clock_tick 214 - -26 _ISR_Disable 24 - _ISR_Flash 21 - _ISR_Enable 19 - _Thread_Disable_dispatch 27 - _Thread_Enable_dispatch 211 - _Thread_Set_state 177 - _Thread_Disptach (NO FP) 761 - context switch: no floating point contexts 585 - context switch: self 230 - context switch: to another task 236 - context switch: restore 1st FP task 730 - fp context switch: save idle, restore idle 478 - fp context switch: save idle, restore initialized 828 - fp context switch: save initialized, restore initialized 478 - _Thread_Resume 143 - _Thread_Unblock 143 - _Thread_Ready 147 - _Thread_Get 93 - _Semaphore_Get 77 - _Thread_Get: invalid id 20 - -27 interrupt entry overhead: returns to interrupted task 206 - interrupt exit overhead: returns to interrupted task 213 - interrupt entry overhead: returns to nested interrupt 201 - interrupt exit overhead: returns to nested interrupt 186 - interrupt entry overhead: returns to preempting task 202 - interrupt exit overhead: returns to preempting task 857 - -28 rtems_port_create 428 - rtems_port_external_to_internal 339 - rtems_port_internal_to_external 339 - rtems_port_delete 421 - -29 rtems_rate_monotonic_create 388 - rtems_rate_monotonic_period: initiate period -- returns to caller 556 - rtems_rate_monotonic_period: obtain status 377 - rtems_rate_monotonic_cancel 427 - rtems_rate_monotonic_delete: inactive 465 - rtems_rate_monotonic_delete: active 519 - rtems_rate_monotonic_period: conclude periods -- caller blocks 843 diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in deleted file mode 100644 index f2af5cc8fb..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/tod.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=config tod -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# First and second generation use different RTC chips :( -TOD_PIECES=tod - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c b/c/src/lib/libbsp/powerpc/dmv177/tod/config.c deleted file mode 100644 index aa44aa66bf..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file contains the RTC driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/rtc.h> -#include <libchip/icm7170.h> - -/* - * Configuration specific probe routines - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine what type - * of real-time clock is on this board. This would be useful for - * a BSP supporting multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the RTC drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/rtc, - * all others being given the name indicated. - */ - -boolean dmv177_icm7170_probe(int minor); - -rtc_tbl RTC_Table[] = { - { - "/dev/rtc0", /* sDeviceName */ - RTC_ICM7170, /* deviceType */ - &icm7170_fns, /* pDeviceFns */ - dmv177_icm7170_probe, /* deviceProbe */ - (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ - DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ - NULL, /* ulDataPort */ - icm7170_get_register_8, /* getRegister */ - icm7170_set_register_8, /* setRegister */ - } -}; - -/* - * Declare some information used by the RTC driver - */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -unsigned long RTC_Count = NUM_RTCS; - -rtems_device_minor_number RTC_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_icm7170_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_RTC_INST_MASK; - - if ( v == DMV170_RTC_INSTALLED ) - return TRUE; - - return FALSE; -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c b/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c deleted file mode 100644 index aa44aa66bf..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file contains the RTC driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/rtc.h> -#include <libchip/icm7170.h> - -/* - * Configuration specific probe routines - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine what type - * of real-time clock is on this board. This would be useful for - * a BSP supporting multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the RTC drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/rtc, - * all others being given the name indicated. - */ - -boolean dmv177_icm7170_probe(int minor); - -rtc_tbl RTC_Table[] = { - { - "/dev/rtc0", /* sDeviceName */ - RTC_ICM7170, /* deviceType */ - &icm7170_fns, /* pDeviceFns */ - dmv177_icm7170_probe, /* deviceProbe */ - (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ - DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ - NULL, /* ulDataPort */ - icm7170_get_register_8, /* getRegister */ - icm7170_set_register_8, /* setRegister */ - } -}; - -/* - * Declare some information used by the RTC driver - */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -unsigned long RTC_Count = NUM_RTCS; - -rtems_device_minor_number RTC_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_icm7170_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_RTC_INST_MASK; - - if ( v == DMV170_RTC_INSTALLED ) - return TRUE; - - return FALSE; -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in deleted file mode 100644 index 7119536c6a..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in +++ /dev/null @@ -1,62 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -# We only build the networking device driver if HAS_NETWORKING was defined -NETWORKING_DRIVER_yes_V = sonic -NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V) - -# pieces specific to this BSP -BSP_PIECES=startup clock console scv64 timer tod $(NETWORKING_DRIVER) - -# pieces to pick up out of libcpu/$(RTEMS_CPU) -CPU_PIECES= - -# shared pieces -GENERIC_PIECES= - -# bummer; have to use $foreach since % pattern subst rules only replace 1x -OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \ - $(foreach piece, $(CPU_PIECES), \ - ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \ - $(foreach piece, $(GENERIC_PIECES), \ - ../../../$(piece)/$(ARCH)/$(piece).rel) -LIB=$(ARCH)/libbsp.a - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/lib.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -$(LIB): ${OBJS} - $(make-library) - -all: ${ARCH} $(SRCS) $(LIB) - $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib - diff --git a/c/src/lib/libbsp/powerpc/psim/start/Makefile.in b/c/src/lib/libbsp/powerpc/psim/start/Makefile.in deleted file mode 100644 index 35377e94f1..0000000000 --- a/c/src/lib/libbsp/powerpc/psim/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/startsim.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=startsim -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/powerpc/psim/start/startsim.s b/c/src/lib/libbsp/powerpc/psim/start/startsim.s deleted file mode 100644 index f94a3ca330..0000000000 --- a/c/src/lib/libbsp/powerpc/psim/start/startsim.s +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This is based on the mvme-crt0.S file from libgloss/rs6000. - * crt0.S -- startup file for PowerPC systems. - * - * Copyright (c) 1995 Cygnus Support - * - * The authors hereby grant permission to use, copy, modify, distribute, - * and license this software and its documentation for any purpose, provided - * that existing copyright notices are retained in all copies and that this - * notice is included verbatim in any distributions. No written agreement, - * license, or royalty fee is required for any of the authorized uses. - * Modifications to this software may be copyrighted by their authors - * and need not follow the licensing terms described here, provided that - * the new terms are clearly indicated on the first page of each file where - * they apply. - * - * $Id$ - */ - -#include "ppc-asm.h" - - .file "startsim.s" - .section ".got2","aw" - .align 2 - -.LCTOC1 = .+32768 - - .extern FUNC_NAME(atexit) - .globl FUNC_NAME(__atexit) - .section ".sdata","aw" - .align 2 -FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */ - .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */ - - .section ".fixup","aw" - .align 2 - .long FUNC_NAME(__atexit) - - .section ".got2","aw" -.Ltable = .-.LCTOC1 - .long .LCTOC1 /* address we think .LCTOC1 is loaded at */ - -.Lbss_start = .-.LCTOC1 - .long __bss_start - -.Lend = .-.LCTOC1 - .long _end - -.Lstack = .-.LCTOC1 /* stack address if set by user */ - .long __stack - - .text -.Lptr: - .long .LCTOC1-.Laddr - - .globl _start - .type _start,@function -_start: - bl .Laddr /* get current address */ -.Laddr: - mflr r4 /* real address of .Laddr */ - lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */ - add r5,r5,r4 /* correct to real pointer */ - lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */ - subf r4,r4,r5 /* calculate difference between where linked and current */ - - /* clear bss */ - lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */ - lwz r7,.Lend(r5) /* calculate end of the BSS */ - add r6,r6,r4 /* adjust pointers */ - add r7,r7,r4 - - cmplw 1,r6,r7 - bc 4,4,.Ldone - - subf r8,r6,r7 /* number of bytes to zero */ - srwi r9,r8,2 /* number of words to zero */ - mtctr r9 - li r0,0 /* zero to clear memory */ - addi r6,r6,-4 /* adjust so we can use stwu */ -.Lloop: - stwu r0,4(r6) /* zero bss */ - bdnz .Lloop - -.Ldone: - - lwz r0,.Lstack(r5) /* stack address or 0 */ - cmplwi 1,r0,0 /* equal to 0? */ - bc 12,6,.Lnostack /* use default stack if == 0 */ - mr sp,r0 /* use user defined stack */ - -.Lnostack: - /* set up initial stack frame */ - addi sp,sp,-4 /* make sure we don't overwrite debug mem */ - lis r0,0 - stw r0,0(sp) /* clear back chain */ - stwu sp,-56(sp) /* push another stack frame */ - - /* Let her rip */ - bl FUNC_NAME(boot_card) - - /* return value from boot_card is argument to exit */ - bl FUNC_NAME(exit) - trap -.Lstart: - .size _start,.Lstart-_start |