diff options
author | Jennifer Averett <jennifer.averett@OARcorp.com> | 2012-04-04 08:39:46 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-04-04 08:43:08 -0500 |
commit | 0c0181dee26d64835f0cd4f47ef81f681ea553e8 (patch) | |
tree | 2f8aef096fa1ed345176328b805d9bb8394fd2f8 /c/src/lib/libbsp/mips/rbtx4925 | |
parent | bsp/mpc55xx: Add and use chip features (diff) | |
download | rtems-0c0181dee26d64835f0cd4f47ef81f681ea553e8.tar.bz2 |
PR 1993 - Convert MIPS to PIC IRQ model
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/ChangeLog | 19 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/Makefile.am | 18 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/clock/clockdrv.c | 27 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/include/bsp.h | 16 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/include/irq.h | 82 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/irq/vectorisrs.c | 66 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/preinstall.am | 12 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/rbtx4925/startup/bspstart.c | 19 |
8 files changed, 240 insertions, 19 deletions
diff --git a/c/src/lib/libbsp/mips/rbtx4925/ChangeLog b/c/src/lib/libbsp/mips/rbtx4925/ChangeLog index 369eebaa46..42e669af7e 100644 --- a/c/src/lib/libbsp/mips/rbtx4925/ChangeLog +++ b/c/src/lib/libbsp/mips/rbtx4925/ChangeLog @@ -1,3 +1,22 @@ +2012-03-08 Jennifer Averett <Jennifer.Averett@OARcorp.com> + + * include/bsp.h: Added define for BSP_SHARED_HANDLER_SUPPORT. + +2012-03-06 Jennifer Averett <Jennifer.Averett@OARcorp.com> + + PR 1993/bsps + * clock/clockdrv.c, include/bsp.h, + include/irq.h, irq/vectorisrs.c, startup/bspstart.c: + Changed interrupt call, removed warnings and did cleanup. + +2012-02-23 Jennifer Averett <Jennifer.Averett@OARcorp.com> + + PR 1993/bsps + * Makefile.am, clock/clockdrv.c, include/irq.h, + irq/vectorisrs.c, preinstall.am, startup/bspstart.c: + Mips conversion to PIC IRQ model. + * include/irq.h, irq/vectorisrs.c: New files. + 2011-12-14 Joel Sherrill <joel.sherrilL@OARcorp.com> * Makefile.am: Change to one file per line. Clean up. diff --git a/c/src/lib/libbsp/mips/rbtx4925/Makefile.am b/c/src/lib/libbsp/mips/rbtx4925/Makefile.am index e7da5d5833..fe53813f12 100644 --- a/c/src/lib/libbsp/mips/rbtx4925/Makefile.am +++ b/c/src/lib/libbsp/mips/rbtx4925/Makefile.am @@ -13,6 +13,10 @@ dist_project_lib_DATA = bsp_specs include_HEADERS = include/bsp.h include_HEADERS += ../../shared/include/tm27.h include_bsp_HEADERS = ../shared/liblnk/regs.h +#isr +include_bsp_HEADERS += ../../shared/include/irq-generic.h +include_bsp_HEADERS += ../../shared/include/irq-info.h +include_bsp_HEADERS += include/irq.h nodist_include_HEADERS = include/bspopts.h nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h @@ -41,8 +45,6 @@ libbsp_a_SOURCES += ../../shared/bsppost.c libbsp_a_SOURCES += startup/bspstart.c libbsp_a_SOURCES += ../../shared/bootcard.c libbsp_a_SOURCES += ../../shared/sbrk.c -libbsp_a_SOURCES += ../../shared/gnatinstallhandler.c -libbsp_a_SOURCES += ../../shared/setvec.c libbsp_a_SOURCES += startup/inittlb.c libbsp_a_SOURCES += ../shared/startup/idttlb.S libbsp_a_SOURCES += ../shared/startup/idtmem.S @@ -56,11 +58,21 @@ libbsp_a_SOURCES += console/console-io.c libbsp_a_SOURCES += ../shared/liblnk/lnklib.S libbsp_a_SOURCES += ../shared/liblnk/pmon.S libbsp_a_SOURCES += ../shared/liblnk/regs.h +#isr +libbsp_a_SOURCES += ../../shared/src/irq-generic.c +libbsp_a_SOURCES += ../../shared/src/irq-legacy.c +libbsp_a_SOURCES += ../../shared/src/irq-info.c +libbsp_a_SOURCES += ../../shared/src/irq-shell.c +libbsp_a_SOURCES += ../../shared/src/irq-server.c +libbsp_a_SOURCES += ../shared/irq/vectorexceptions.c +libbsp_a_SOURCES += ../shared/irq/irq.c +libbsp_a_SOURCES += ../shared/irq/maxvectors.c +libbsp_a_SOURCES += irq/vectorisrs.c +libbsp_a_SOURCES += ../shared/irq/interruptmask_TX49.c libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/tx49/timer.rel -libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/tx49/vectorisrs.rel include $(srcdir)/preinstall.am include $(top_srcdir)/../../../../automake/local.am diff --git a/c/src/lib/libbsp/mips/rbtx4925/clock/clockdrv.c b/c/src/lib/libbsp/mips/rbtx4925/clock/clockdrv.c index c1fa5a7118..4d3d9acc19 100644 --- a/c/src/lib/libbsp/mips/rbtx4925/clock/clockdrv.c +++ b/c/src/lib/libbsp/mips/rbtx4925/clock/clockdrv.c @@ -1,11 +1,22 @@ -/* +/** + * @file + * * Instantiate the clock driver shell. + */ + +/* + * COPYRIGHT (c) 1989-2012. + * On-Line Applications Research Corporation (OAR). * - * clockdrv.c,v 1.5 2001/01/09 17:05:57 joel Exp + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ */ #include <rtems.h> -#include <libcpu/tx4925.h> +#include <bsp/irq.h> #include <bsp.h> /* #define CLOCK_DRIVER_USE_FAST_IDLE */ @@ -31,8 +42,14 @@ #define Clock_driver_support_install_isr( _new, _old ) \ do { \ - _old = set_vector( _new, CLOCK_VECTOR, 1 ); \ - } while(0) + rtems_interrupt_handler_install( \ + CLOCK_VECTOR, \ + "clock", \ + 0, \ + _new, \ + NULL \ + ); \ + } while(0) #define Clock_driver_support_at_tick() \ diff --git a/c/src/lib/libbsp/mips/rbtx4925/include/bsp.h b/c/src/lib/libbsp/mips/rbtx4925/include/bsp.h index 7078fb8c4d..3c275c9fe7 100644 --- a/c/src/lib/libbsp/mips/rbtx4925/include/bsp.h +++ b/c/src/lib/libbsp/mips/rbtx4925/include/bsp.h @@ -1,15 +1,18 @@ -/* bsp.h - * +/** + * @file + * * This include file contains some definitions specific to the RBTX4925. - * - * COPYRIGHT (c) 1989-2000. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * - * bsp.h,v 1.7.6.1 2003/09/04 18:44:49 joel Exp + * $Id$ */ #ifndef _BSP_H @@ -27,6 +30,9 @@ extern "C" { #include <rtems/clockdrv.h> #include <libcpu/tx4925.h> +#define BSP_FEATURE_IRQ_EXTENSION +#define BSP_SHARED_HANDLER_SUPPORT 1 + /* functions */ rtems_isr_entry set_vector( diff --git a/c/src/lib/libbsp/mips/rbtx4925/include/irq.h b/c/src/lib/libbsp/mips/rbtx4925/include/irq.h new file mode 100644 index 0000000000..a56b145baf --- /dev/null +++ b/c/src/lib/libbsp/mips/rbtx4925/include/irq.h @@ -0,0 +1,82 @@ +/** + * @file + * + * @ingroup bsp_interrupt + * + * @brief interrupt definitions. + */ + +/* + * COPYRIGHT (c) 1989-2012. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifndef LIBBSP_MIPS_TX4925_IRQ_H +#define LIBBSP_MIPS_TX4925_IRQ_H + +#ifndef ASM + #include <rtems.h> + #include <rtems/irq.h> + #include <rtems/irq-extension.h> + #include <rtems/score/mips.h> +#endif + +/** + * @addtogroup bsp_interrupt + * + * @{ + */ + +/* + * Interrupt Vector Numbers + * + */ +#define BSP_INTERRUPT_VECTOR_MIN 0 +#define TX4925_IRQ_RSV1 MIPS_INTERRUPT_BASE+0 +#define TX4925_IRQ_WTE MIPS_INTERRUPT_BASE+1 +#define TX4925_IRQ_INT0 MIPS_INTERRUPT_BASE+2 +#define TX4925_IRQ_INT1 MIPS_INTERRUPT_BASE+3 +#define TX4925_IRQ_INT2 MIPS_INTERRUPT_BASE+4 +#define TX4925_IRQ_INT3 MIPS_INTERRUPT_BASE+5 +#define TX4925_IRQ_INT4 MIPS_INTERRUPT_BASE+6 +#define TX4925_IRQ_INT5 MIPS_INTERRUPT_BASE+7 +#define TX4925_IRQ_INT6 MIPS_INTERRUPT_BASE+8 +#define TX4925_IRQ_INT7 MIPS_INTERRUPT_BASE+9 +#define TX4925_IRQ_RSV2 MIPS_INTERRUPT_BASE+10 +#define TX4925_IRQ_NAND MIPS_INTERRUPT_BASE+11 +#define TX4925_IRQ_SIO0 MIPS_INTERRUPT_BASE+12 +#define TX4925_IRQ_SIO1 MIPS_INTERRUPT_BASE+13 +#define TX4925_IRQ_DMAC0 MIPS_INTERRUPT_BASE+14 +#define TX4925_IRQ_DMAC1 MIPS_INTERRUPT_BASE+15 +#define TX4925_IRQ_DMAC2 MIPS_INTERRUPT_BASE+16 +#define TX4925_IRQ_DMAC3 MIPS_INTERRUPT_BASE+17 +#define TX4925_IRQ_IRC MIPS_INTERRUPT_BASE+18 +#define TX4925_IRQ_PDMAC MIPS_INTERRUPT_BASE+19 +#define TX4925_IRQ_PCIC MIPS_INTERRUPT_BASE+20 +#define TX4925_IRQ_TMR0 MIPS_INTERRUPT_BASE+21 +#define TX4925_IRQ_TMR1 MIPS_INTERRUPT_BASE+22 +#define TX4925_IRQ_TMR2 MIPS_INTERRUPT_BASE+23 +#define TX4925_IRQ_SPI MIPS_INTERRUPT_BASE+24 +#define TX4925_IRQ_RTC MIPS_INTERRUPT_BASE+25 +#define TX4925_IRQ_ACLC MIPS_INTERRUPT_BASE+26 +#define TX4925_IRQ_ACLCPME MIPS_INTERRUPT_BASE+27 +#define TX4925_IRQ_CHI MIPS_INTERRUPT_BASE+28 +#define TX4925_IRQ_PCIERR MIPS_INTERRUPT_BASE+29 +#define TX4925_IRQ_PCIPME MIPS_INTERRUPT_BASE+30 +#define TX4925_IRQ_RSV3 MIPS_INTERRUPT_BASE+31 + +#define TX4925_IRQ_SOFTWARE_1 MIPS_INTERRUPT_BASE+32 +#define TX4925_IRQ_SOFTWARE_2 MIPS_INTERRUPT_BASE+33 +#define TX4925_MAXIMUM_VECTORS MIPS_INTERRUPT_BASE+34 + +#define BSP_INTERRUPT_VECTOR_MAX TX4925_MAXIMUM_VECTORS + +/** @} */ + +#endif /* LIBBSP_MIPS_ TX4925_IRQ_H */ diff --git a/c/src/lib/libbsp/mips/rbtx4925/irq/vectorisrs.c b/c/src/lib/libbsp/mips/rbtx4925/irq/vectorisrs.c new file mode 100644 index 0000000000..3fff60ebd8 --- /dev/null +++ b/c/src/lib/libbsp/mips/rbtx4925/irq/vectorisrs.c @@ -0,0 +1,66 @@ +/** + * @file + * + * TX4925 Interrupt Vectoring + */ + +/* + * COPYRIGHT (c) 1989-2012. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <rtems.h> +#include <stdlib.h> +#include <libcpu/tx4925.h> +#include <bsp/irq.h> +#include <bsp/irq-generic.h> +#include <rtems/bspIo.h> /* for printk */ + +void mips_vector_isr_handlers( CPU_Interrupt_frame *frame ); +void mips_default_isr( int vector ); + +void mips_vector_isr_handlers( CPU_Interrupt_frame *frame ) +{ + unsigned int sr; + unsigned int cause; + unsigned int pending; + + mips_get_sr( sr ); + mips_get_cause( cause ); + + pending = (cause & sr & 0x700) >> CAUSE_IPSHIFT; + + if ( pending & 0x4 ) { /* (IP[2] == 1) ==> IP[3-7] are valid */ + unsigned int v = (cause >> (CAUSE_IPSHIFT + 3)) & 0x1f; + bsp_interrupt_handler_dispatch( MIPS_INTERRUPT_BASE + v ); + } + + if ( pending & 0x01 ) /* IP[0] */ + bsp_interrupt_handler_dispatch( TX4925_IRQ_SOFTWARE_1 ); + + if ( pending & 0x02 ) /* IP[1] */ + bsp_interrupt_handler_dispatch( TX4925_IRQ_SOFTWARE_2 ); +} + +void mips_default_isr( int vector ) +{ + unsigned int sr; + unsigned int cause; + + mips_get_sr( sr ); + mips_get_cause( cause ); + + printk( "Unhandled isr exception: vector 0x%02x, cause 0x%08X, sr 0x%08X\n", + vector, cause, sr ); + + while(1); /* Lock it up */ + + rtems_fatal_error_occurred(1); +} + diff --git a/c/src/lib/libbsp/mips/rbtx4925/preinstall.am b/c/src/lib/libbsp/mips/rbtx4925/preinstall.am index 3d496d2569..b2d7806975 100644 --- a/c/src/lib/libbsp/mips/rbtx4925/preinstall.am +++ b/c/src/lib/libbsp/mips/rbtx4925/preinstall.am @@ -49,6 +49,18 @@ $(PROJECT_INCLUDE)/bsp/regs.h: ../shared/liblnk/regs.h $(PROJECT_INCLUDE)/bsp/$( $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/regs.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/regs.h +$(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h + +$(PROJECT_INCLUDE)/bsp/irq-info.h: ../../shared/include/irq-info.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-info.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-info.h + +$(PROJECT_INCLUDE)/bsp/irq.h: include/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h + $(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h diff --git a/c/src/lib/libbsp/mips/rbtx4925/startup/bspstart.c b/c/src/lib/libbsp/mips/rbtx4925/startup/bspstart.c index 4577fd97e2..99cc20194b 100644 --- a/c/src/lib/libbsp/mips/rbtx4925/startup/bspstart.c +++ b/c/src/lib/libbsp/mips/rbtx4925/startup/bspstart.c @@ -1,21 +1,28 @@ -/* +/** + * @file + * * This routine starts the application. It includes application, * board, and monitor specific initialization and configuration. * The generic CPU dependent initialization has been performed * before this routine is invoked. - * - * COPYRIGHT (c) 1989-2000. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. - * - * bspstart.c,v 1.4.2.1 2003/09/04 18:44:49 joel Exp + * + * $Id$ */ #include <bsp.h> #include <libcpu/isr_entries.h> +#include <bsp/irq-generic.h> + +void bsp_start( void ); /* * bsp_start @@ -24,6 +31,6 @@ */ void bsp_start( void ) { - mips_install_isr_entries(); /* Install generic MIPS exception handler */ + bsp_interrupt_initialize(); } |