From 1efeb61c56e89a970b30fbea9731dfeb0f9fa38c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 16 Jun 1998 18:22:54 +0000 Subject: Added css_iface -- assumes ../include/dy_supplied. --- c/src/lib/libbsp/powerpc/dmv177/Makefile.in | 2 +- .../libbsp/powerpc/dmv177/css_iface/Makefile.in | 59 ++++++++ .../libbsp/powerpc/dmv177/css_iface/css_iface.c | 149 +++++++++++++++++++++ c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in | 2 +- 4 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 c/src/lib/libbsp/powerpc/dmv177/css_iface/Makefile.in create mode 100644 c/src/lib/libbsp/powerpc/dmv177/css_iface/css_iface.c (limited to 'c/src/lib/libbsp') diff --git a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/Makefile.in index 1aa164a880..58c6646a6a 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in +++ b/c/src/lib/libbsp/powerpc/dmv177/Makefile.in @@ -21,5 +21,5 @@ 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 \ +SUB_DIRS=include clock console css_iface startup start timer \ tod $(KA9Q_DRIVER) wrapup diff --git a/c/src/lib/libbsp/powerpc/dmv177/css_iface/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/css_iface/Makefile.in new file mode 100644 index 0000000000..a2beb5a285 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/css_iface/Makefile.in @@ -0,0 +1,59 @@ +# +# $Id$ +# + +@SET_MAKE@ +srcdir = @srcdir@ +VPATH = @srcdir@ +RTEMS_ROOT = @top_srcdir@ +PROJECT_ROOT = @PROJECT_ROOT@ + +PGM=${ARCH}/css_iface.rel + +# 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= +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/css_iface/css_iface.c b/c/src/lib/libbsp/powerpc/dmv177/css_iface/css_iface.c new file mode 100644 index 0000000000..f46782f2b0 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/css_iface/css_iface.c @@ -0,0 +1,149 @@ +#include + +rtems_unsigned32 Css_Id( + rtems_vector_number vector /* vector number */ +) +{ + rtems_unsigned32 id; + + switch ( vector ) { + case DMV170_DUART_IRQ: + case DMV170_ETHERNET_IRQ: + case DMV170_SCSI_IRQ: + case DMV170_SCC_IRQ: + id = CSS_DARF_INT; + break; + + case DMV170_MEZZANINE_IRQ: + id = CSS_MAXPACK_INT; + break; + + case DMV170_TICK_IRQ: + id = CSS_TICK_INT; + break; + + case DMV170_LOCATION_MON_IRQ: + id = CSS_LM_INT; + break; + + case DMV170_SCV64_IRQ: + id = CSS_SCV_VME_INT; + break; + + case DMV170_RTC_IRQ: + id = CSS_RTC_INT; + break; + } + + return id; +} + +rtems_vector_number Vector_id( + rtems_unsigned32 id +) +{ + rtems_vector_number vector; + + switch ( id ) { + case CSS_ACFAIL_INT: + vector = DMV170_ACFAIL_IRQ; + break; + case CSS_SYSFAIL_INT: + vector = DMV170_SYSFAIL_IRQ; + break; + case CSS_WATCHDOG_INT: + vector = DMV170_WATCHDOG_IRQ; + break; + case CSS_BI_INT: + vector = DMV170_BI_IRQ; + break; + case CSS_LM_INT: + vector = DMV170_LOCATION_MON_IRQ; + break; + case CSS_TICK_INT: + vector = DMV170_TICK_IRQ; + break; + case CSS_DARF_INT: + vector = DMV170_DUART_IRQ; + break; + case CSS_RAM_PARITY_INT: + vector = DMV170_RAM_PARITY_IRQ; + break; + case CSS_DARF_BUS_ERROR: + vector = DMV170_DARF_BUS_ERROR_IRQ; + break; + case CSS_PERIPHERAL_INT: + vector = DMV170_PERIPHERAL_IRQ; + break; + case CSS_MAXPACK_INT: + vector = DMV170_MEZZANINE_IRQ_0;assert(0); + break; + case CSS_SCV_VME_INT: + vector = DMV170_MEZZANINE_IRQ_1;assert(0); + break; + case CSS_RTC_INT: + vector = DMV170_RTC_IRQ; + break; + } + + return vector; +} + +void enable_card_interrupt( + rtems_vector_number vector /* vector number */ +) +{ + rtems_unsigned32 Id; + Id = Css_Id(vector); + + Enable_int(Id); +} + +rtems_vector_number Get_interrupt() +{ + rtems_vector_number vector; + rtems_unsigned32 id; + + if ( Get_int_status(CSS_ACFAIL_INT) ) + vector = DMV170_ACFAIL_IRQ; + else if ( Get_int_status( CSS_SYSFAIL_INT) ) + vector = DMV170_SYSFAIL_IRQ; + else if ( Get_int_status( CSS_WATCHDOG_INT) ) + vector = DMV170_WATCHDOG_IRQ; + else if ( Get_int_status( CSS_BI_INT) ) + vector = DMV170_BI_IRQ; + else if ( Get_int_status( CSS_LM_INT) ) + vector = DMV170_LOCATION_MON_IRQ; + else if ( Get_int_status( CSS_TICK_INT) ) + vector = DMV170_TICK_IRQ; + else if ( Get_int_status( CSS_DARF_INT) ) + vector = DMV170_DUART_IRQ; + else if ( Get_int_status( CSS_RAM_PARITY_INT) ) + vector = DMV170_RAM_PARITY_IRQ; + else if ( Get_int_status( CSS_DARF_BUS_ERROR) ) + vector = DMV170_DARF_BUS_ERROR_IRQ; + else if ( Get_int_status( CSS_PERIPHERAL_INT) ) + vector = DMV170_PERIPHERAL_IRQ; + else if ( Get_int_status( CSS_MAXPACK_INT) ) { + vector = DMV170_MEZZANINE_IRQ_0; + assert(0); + } + else if ( Get_int_status( CSS_SCV_VME_INT) ) { + vector = DMV170_MEZZANINE_IRQ_1; + assert(0); + } + else if ( Get_int_status( CSS_RTC_INT) ) + vector = DMV170_RTC_IRQ; + + return vector; +} + +void Clear_interrupt( + rtems_vector_number vector +) +{ + rtems_unsigned32 Id; + Id = Css_Id(vector); + + Clear_int(Id); +} diff --git a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in index 02bee936b5..5f11cf8656 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in +++ b/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in @@ -13,7 +13,7 @@ KA9Q_DRIVER_yes_V = network KA9Q_DRIVER = $(KA9Q_DRIVER_$(HAS_KA9Q)_V) # pieces specific to this BSP -BSP_PIECES=startup clock console timer tod $(KA9Q_DRIVER) +BSP_PIECES=startup clock console css_iface timer tod $(KA9Q_DRIVER) # pieces to pick up out of libcpu/$(RTEMS_CPU) CPU_PIECES= -- cgit v1.2.3