summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2009-05-05 16:18:06 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2009-05-05 16:18:06 +0000
commit31a5ec8cb054c34e4e752d4045dae23df12b49ad (patch)
tree5bf657169b88f4b2dc168abbc4b2bc678c323561 /c/src
parentMerge changes from CVS-HEAD addressing Fedora 11 rpm regressions. (diff)
downloadrtems-31a5ec8cb054c34e4e752d4045dae23df12b49ad.tar.bz2
2009-05-05 Jennifer Averett <jennifer.averett@OARcorp.com>
* Makefile.am, README, configure.ac, preinstall.am, PCI_bus/PCI.c, PCI_bus/PCI.h, PCI_bus/flash.c, PCI_bus/universe.c, console/85c30.c, console/85c30.h, console/console.c, console/consolebsp.h, console/tbl85c30.c, include/bsp.h, include/coverhd.h, include/gen2.h, include/irq-config.h, include/tm27.h, irq/FPGA.c, irq/irq.h, irq/irq_init.c, start/start.S, startup/Hwr_init.c, startup/bspstart.c, timer/timer.c, tod/tod.c: Updated and tested with the latest powerpc isr source * irq/no_pic.c: New file. * irq/irq.c, startup/genpvec.c, startup/setvec.c, startup/vmeintr.c: Removed.
Diffstat (limited to 'c/src')
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/ChangeLog13
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/Makefile.am38
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.c6
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.h6
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.c8
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/PCI_bus/universe.c7
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/README7
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/configure.ac2
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/console/85c30.c27
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/console/85c30.h8
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/console/console.c11
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/console/consolebsp.h8
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/console/tbl85c30.c5
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/include/bsp.h15
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/include/coverhd.h6
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/include/gen2.h74
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/include/irq-config.h2
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/include/tm27.h3
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c49
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/irq.c513
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/irq.h182
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c286
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/no_pic.c84
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/preinstall.am48
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/start/start.S2
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/startup/Hwr_init.c9
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c96
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/startup/genpvec.c196
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/startup/setvec.c70
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/startup/vmeintr.c55
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/timer/timer.c6
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/tod/tod.c3
32 files changed, 354 insertions, 1491 deletions
diff --git a/c/src/lib/libbsp/powerpc/score603e/ChangeLog b/c/src/lib/libbsp/powerpc/score603e/ChangeLog
index 92f459c218..cc8c5f26b0 100644
--- a/c/src/lib/libbsp/powerpc/score603e/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/score603e/ChangeLog
@@ -1,3 +1,16 @@
+2009-05-05 Jennifer Averett <jennifer.averett@OARcorp.com>
+
+ * Makefile.am, README, configure.ac, preinstall.am, PCI_bus/PCI.c,
+ PCI_bus/PCI.h, PCI_bus/flash.c, PCI_bus/universe.c, console/85c30.c,
+ console/85c30.h, console/console.c, console/consolebsp.h,
+ console/tbl85c30.c, include/bsp.h, include/coverhd.h, include/gen2.h,
+ include/irq-config.h, include/tm27.h, irq/FPGA.c, irq/irq.h,
+ irq/irq_init.c, start/start.S, startup/Hwr_init.c,
+ startup/bspstart.c, timer/timer.c, tod/tod.c: Updated and tested with
+ the latest powerpc isr source
+ * irq/no_pic.c: New file.
+ * irq/irq.c, startup/genpvec.c, startup/setvec.c, startup/vmeintr.c: Removed.
+
2008-12-08 Ralf Corsépius <ralf.corsepius@rtems.org>
* bsp_specs: Backport from CVS-HEAD.
diff --git a/c/src/lib/libbsp/powerpc/score603e/Makefile.am b/c/src/lib/libbsp/powerpc/score603e/Makefile.am
index b8603629d9..8822697755 100644
--- a/c/src/lib/libbsp/powerpc/score603e/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/score603e/Makefile.am
@@ -26,7 +26,7 @@ dist_project_lib_DATA += startup/linkcmds
startup_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
startup/bspstart.c ../../shared/bootcard.c \
../../shared/sbrk.c startup/Hwr_init.c \
- startup/genpvec.c ../../shared/gnatinstallhandler.c \
+ ../../shared/gnatinstallhandler.c \
../../powerpc/shared/showbats.c
pclock_SOURCES = ../../powerpc/shared/clock/p_clock.c
@@ -37,39 +37,20 @@ include_bsp_HEADERS = ../../powerpc/shared/pci/pci.h \
PCI_bus/PCI.h \
../../powerpc/shared/residual/residual.h \
../../powerpc/shared/residual/pnp.h \
- ../../powerpc/shared/console/consoleIo.h \
- ../../shared/include/irq-generic.h \
- include/irq-config.h
+ ../../powerpc/shared/console/consoleIo.h
-pci_SOURCES = ../../powerpc/shared/pci/pci.c \
+pci_SOURCES = PCI_bus/flash.c ../../powerpc/shared/pci/pci.c \
../../powerpc/shared/pci/pcifinddevice.c PCI_bus/PCI.c PCI_bus/universe.c
include_bsp_HEADERS += irq/irq.h \
../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/ppc_exc_bspsupp.h \
../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h \
../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/irq_supp.h
-irq_SOURCES = include/irq-config.h \
- irq/FPGA.c irq/irq.c \
- ../../shared/src/irq-generic.c \
- ../../powerpc/shared/irq/irq_asm.S
-
-include_bsp_HEADERS += ../../powerpc/shared/vectors/vectors.h
-vectors_SOURCES = ../../powerpc/shared/vectors/vectors_init.c \
- ../../powerpc/shared/vectors/vectors.S
-
-include_bsp_HEADERS += ../../shared/vmeUniverse/vmeUniverse.h \
- ../../shared/include/irq-generic.h \
- ../../shared/vmeUniverse/vme_am_defs.h \
- ../../shared/vmeUniverse/VME.h \
- vme/VMEConfig.h \
- ../../powerpc/shared/motorola/motorola.h \
- ../../shared/vmeUniverse/vmeUniverseDMA.h\
- ../../shared/vmeUniverse/bspVmeDmaList.h\
- ../../shared/vmeUniverse/VMEDMA.h
-vme_SOURCES = \
- ../../shared/vmeUniverse/bspVmeDmaList.c \
- ../../shared/vmeUniverse/vme_am_defs.h \
- ../shared/vme/vmeconfig.c
+
+irq_SOURCES = irq/no_pic.c irq/irq_init.c \
+ irq/FPGA.c
+
+vectors_SOURCES =
EXTRA_DIST = start/start.S
start.$(OBJEXT): start/start.S
@@ -83,7 +64,7 @@ project_lib_DATA += rtems_crti.$(OBJEXT)
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES = $(pclock_SOURCES) $(console_SOURCES) $(irq_SOURCES) \
- $(pci_SOURCES) $(vectors_SOURCES) $(startup_SOURCES) $(vme_SOURCES)
+ $(pci_SOURCES) $(vectors_SOURCES) $(startup_SOURCES)
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
@@ -91,6 +72,7 @@ libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/mpc6xx/clock.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
+ ../../../libcpu/@RTEMS_CPU@/@exceptions@/irq_bspsupport.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/raw_exception.rel \
../../../libcpu/@RTEMS_CPU@/mpc6xx/mmu.rel \
../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel
diff --git a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.c b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.c
index d2f15c8896..c5e7d47f65 100644
--- a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.c
+++ b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.c
@@ -1,8 +1,12 @@
/*
*
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
+ * COPYRIGHT (c) 1989-2009.
* 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$
*/
diff --git a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.h b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.h
index 78f0e71973..ffa894a79f 100644
--- a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.h
+++ b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/PCI.h
@@ -3,11 +3,11 @@
* This include file contains prototypes for chips attached to the
* PCI bus.
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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:
diff --git a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.c b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.c
index c04c288c69..9ffbe29b9b 100644
--- a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.c
+++ b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.c
@@ -1,8 +1,12 @@
/*
*
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
+ * COPYRIGHT (c) 1989-2009.
* 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$
*/
@@ -11,7 +15,9 @@
#include <stdio.h>
#include <bsp.h>
+#include <bsp/irq.h>
#include "PCI.h"
+
/*PAGE
*
* SCORE603e_FLASH_Disable
diff --git a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/universe.c b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/universe.c
index 0ceefe6c96..0b4da01c63 100644
--- a/c/src/lib/libbsp/powerpc/score603e/PCI_bus/universe.c
+++ b/c/src/lib/libbsp/powerpc/score603e/PCI_bus/universe.c
@@ -1,8 +1,11 @@
/*
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
+ * COPYRIGHT (c) 1989-2009.
* 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$
*/
diff --git a/c/src/lib/libbsp/powerpc/score603e/README b/c/src/lib/libbsp/powerpc/score603e/README
index f1217a2b6d..17912ca544 100644
--- a/c/src/lib/libbsp/powerpc/score603e/README
+++ b/c/src/lib/libbsp/powerpc/score603e/README
@@ -22,6 +22,9 @@ DMA: none
VIDEO: none
SCSI: none
NETWORKING: none
+MEZZANINE CARD optional with HAS_PMC_PSC8
+ 4 Z85C30s
+ ACE1553
DRIVER INFORMATION
==================
@@ -43,9 +46,7 @@ STOP BITS: 1
Notes
=====
This BSP has been modified to use the latest exception model.
-However, the modifications were never verified. This version
-has been partially verified in that Hello.ralf will load and
-run on the board.
+The modifications were verified.
This BSP has been tested using DINK Rom monitor. There have
been three rom chips loaded on the boards. One with the SDS
diff --git a/c/src/lib/libbsp/powerpc/score603e/configure.ac b/c/src/lib/libbsp/powerpc/score603e/configure.ac
index 8057fda0d3..d01c6a38d4 100644
--- a/c/src/lib/libbsp/powerpc/score603e/configure.ac
+++ b/c/src/lib/libbsp/powerpc/score603e/configure.ac
@@ -37,7 +37,7 @@ RTEMS_BSPOPTS_SET([CONSOLE_USE_INTERRUPTS],[*],[0])
RTEMS_BSPOPTS_HELP([CONSOLE_USE_INTERRUPTS],
[whether using console interrupts])
-RTEMS_BSPOPTS_SET([HAS_PMC_PSC8],[*],[1])
+RTEMS_BSPOPTS_SET([HAS_PMC_PSC8],[*],[0])
RTEMS_BSPOPTS_HELP([HAS_PMC_PSC8],
[whether has a PSC8 PMC board attached to PMC slot])
diff --git a/c/src/lib/libbsp/powerpc/score603e/console/85c30.c b/c/src/lib/libbsp/powerpc/score603e/console/85c30.c
index 056043aa57..c73a4fc0d2 100644
--- a/c/src/lib/libbsp/powerpc/score603e/console/85c30.c
+++ b/c/src/lib/libbsp/powerpc/score603e/console/85c30.c
@@ -4,14 +4,14 @@
*
* Currently only polled mode is supported.
*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* 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:
+ *
+ * $Id$
*/
#include <rtems.h>
@@ -129,8 +129,6 @@ void initialize_85c30_port(
Console_Protocol *Setup;
uint16_t baud_constant;
-printk("initialize_85c30_port start\n");
-
Setup = Port->Protocol;
ctrl = Port->ctrl;
@@ -155,20 +153,17 @@ printk("initialize_85c30_port start\n");
/*
* Set Write Register 2 to contain the interrupt vector
*/
-printk("initialize_85c30_port 2, %d\n", Port->Chip->vector );
Write_85c30_register( ctrl, 2, Port->Chip->vector );
#endif
/*
* Set Write Register 3 to disable the Receiver
*/
-printk("initialize_85c30_port 0x03, 0x00\n");
Write_85c30_register( ctrl, 0x03, 0x00 );
/*
* Set Write Register 5 to disable the Transmitter
*/
-printk("initialize_85c30_port 5, 0x00\n");
Write_85c30_register( ctrl, 5, 0x00 );
/* WR 6 -- unneeded in asynchronous mode */
@@ -178,13 +173,11 @@ printk("initialize_85c30_port 5, 0x00\n");
/*
* Set Write Register 9 to disable all interrupt sources
*/
-printk("initialize_85c30_port 9, 0x00\n");
Write_85c30_register( ctrl, 9, 0x00 );
/*
* Set Write Register 10 for simple Asynchronous operation
*/
-printk("initialize_85c30_port 0x0a, 0x00\n");
Write_85c30_register( ctrl, 0x0a, 0x00 );
/*
@@ -192,7 +185,6 @@ printk("initialize_85c30_port 0x0a, 0x00\n");
* clock as BRG output and the transmit clock
* as the output source for TRxC pin via register 11
*/
-printk("initialize_85c30_port 0x0b, 0x56\n");
Write_85c30_register( ctrl, 0x0b, 0x56 );
value = baud_constant;
@@ -202,14 +194,12 @@ printk("initialize_85c30_port 0x0b, 0x56\n");
* If the time constans = 1E, then the desire
* baud rate will be equilvalent to 9600, via register 12.
*/
-printk("initialize_85c30_port 0x0c, 0x%x\n", value & 0xff);
Write_85c30_register( ctrl, 0x0c, value & 0xff );
/*
* using register 13
* Setup the upper 8 bits time constants = 0
*/
-printk("initialize_85c30_port 0x0d, 0x%x\n", value>>8);
Write_85c30_register( ctrl, 0x0d, value>>8 );
/*
@@ -218,7 +208,6 @@ printk("initialize_85c30_port 0x0d, 0x%x\n", value>>8);
* rate generator enable with clock from the
* SCC's PCLK input via register 14.
*/
-printk("initialize_85c30_port 0x0e, 0x07\n");
Write_85c30_register( ctrl, 0x0e, 0x07 );
/*
@@ -234,7 +223,6 @@ printk("initialize_85c30_port 0x0e, 0x07\n");
value = 0x01;
value = value | Char_size_85c30[ Setup->read_char_bits ].read_setup;
-printk("initialize_85c30_port 0x03, 0x%x\n", value);
Write_85c30_register( ctrl, 0x03, value );
/*
@@ -249,21 +237,18 @@ printk("initialize_85c30_port 0x03, 0x%x\n", value);
*/
value = 0x8a;
value = value | Char_size_85c30[ Setup->write_char_bits ].write_setup;
-printk("initialize_85c30_port 0x05, 0x%x\n", value);
Write_85c30_register( ctrl, 0x05, value );
/*
* Reset Tx UNDERRUN/EOM LATCH and ERROR
* via register 0
*/
-printk("initialize_85c30_port 0x00, 0xf0\n");
Write_85c30_register( ctrl, 0x00, 0xf0 );
#if CONSOLE_USE_INTERRUPTS
/*
* Set Write Register 1 to interrupt on Rx characters or special condition.
*/
-printk("initialize_85c30_port 1, 0x10\n");
Write_85c30_register( ctrl, 1, 0x10 );
#endif
@@ -271,13 +256,11 @@ printk("initialize_85c30_port 1, 0x10\n");
* Set Write Register 15 to disable extended functions.
*/
-printk("initialize_85c30_port 15, 0x00\n");
Write_85c30_register( ctrl, 15, 0x00 );
/*
* Set the Command Register to Reset Ext/STATUS.
*/
-printk("initialize_85c30_port 0x00, 0x10\n");
Write_85c30_register( ctrl, 0x00, 0x10 );
#if CONSOLE_USE_INTERRUPTS
@@ -288,14 +271,12 @@ printk("initialize_85c30_port 0x00, 0x10\n");
* Enables parity as a special condition.
* Enables Tx interrupt.
*/
-printk("initialize_85c30_port 1, 0x16\n");
Write_85c30_register( ctrl, 1, 0x16 );
/*
* Set Write Register 9 to enable all interrupt sources
* Changed from 0 to a
*/
-printk("initialize_85c30_port 9, 0x0A\n");
Write_85c30_register( ctrl, 9, 0x0A );
/* XXX */
@@ -303,12 +284,10 @@ printk("initialize_85c30_port 9, 0x0A\n");
/*
* Issue reset highest Interrupt Under Service (IUS) command.
*/
-printk("initialize_85c30_port STATUS_REGISTER, 0X38\n");
Write_85c30_register( Port->ctrl, STATUS_REGISTER, 0x38 );
#endif
-printk("initialize_85c30_port end of method\n");
}
/* PAGE
diff --git a/c/src/lib/libbsp/powerpc/score603e/console/85c30.h b/c/src/lib/libbsp/powerpc/score603e/console/85c30.h
index 121d641994..0b578363c6 100644
--- a/c/src/lib/libbsp/powerpc/score603e/console/85c30.h
+++ b/c/src/lib/libbsp/powerpc/score603e/console/85c30.h
@@ -2,14 +2,14 @@
*
* This include file contains z85c30 chip information.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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:
+ * $Id$
*/
#ifndef __85c30_H
diff --git a/c/src/lib/libbsp/powerpc/score603e/console/console.c b/c/src/lib/libbsp/powerpc/score603e/console/console.c
index cefb732fe1..cdb2163e73 100644
--- a/c/src/lib/libbsp/powerpc/score603e/console/console.c
+++ b/c/src/lib/libbsp/powerpc/score603e/console/console.c
@@ -5,7 +5,7 @@
*
* Currently only polled mode is supported.
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -181,8 +181,6 @@ rtems_device_driver console_initialize(
rtems_device_minor_number console;
int port, chip, p0,p1;
-printk("console_initialize start\n");
-
/*
* initialize the termio interface.
*/
@@ -207,7 +205,6 @@ printk("console_initialize start\n");
* debugger...)
*/
#if ( INITIALIZE_COM_PORTS )
-
/*
* Force to perform a hardware reset w/o
* Master interrupt enable via register 9
@@ -239,16 +236,13 @@ printk("console_initialize start\n");
for (port=1; port<NUM_Z85C30_PORTS; port++) {
chip = port >> 1;
-printk("console_initialize initialize_85c30_port %d\n", port);
initialize_85c30_port( &Ports_85C30[port] );
}
#if CONSOLE_USE_INTERRUPTS
-printk("console_initialize console_initialize_interrupts\n");
console_initialize_interrupts();
#endif
-printk("console_initialize end\n");
return RTEMS_SUCCESSFUL;
}
@@ -420,12 +414,13 @@ debug_putc_onlcr(const char c)
if ('\n'==c){
rtems_interrupt_disable( isrlevel );
outbyte_polled_85c30( csr, '\r' );
- rtems_interrupt_enable( isrlevel );
asm volatile("isync");
+ rtems_interrupt_enable( isrlevel );
}
rtems_interrupt_disable( isrlevel );
outbyte_polled_85c30( csr, c );
+ asm volatile("isync");
rtems_interrupt_enable( isrlevel );
}
diff --git a/c/src/lib/libbsp/powerpc/score603e/console/consolebsp.h b/c/src/lib/libbsp/powerpc/score603e/console/consolebsp.h
index a895c3a1f4..ab33ef17ee 100644
--- a/c/src/lib/libbsp/powerpc/score603e/console/consolebsp.h
+++ b/c/src/lib/libbsp/powerpc/score603e/console/consolebsp.h
@@ -2,14 +2,14 @@
*
* This include file contains all console driver definations
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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:
+ * $Id$
*/
#ifndef __CONSOLEBSP_H
diff --git a/c/src/lib/libbsp/powerpc/score603e/console/tbl85c30.c b/c/src/lib/libbsp/powerpc/score603e/console/tbl85c30.c
index 8c8d26302c..efb49b901c 100644
--- a/c/src/lib/libbsp/powerpc/score603e/console/tbl85c30.c
+++ b/c/src/lib/libbsp/powerpc/score603e/console/tbl85c30.c
@@ -2,18 +2,19 @@
* This file contains the table for the z85c30 port
* used by the console driver.
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* 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:
+ * $Id$
*/
#include "consolebsp.h"
#include <bsp.h>
+#include <bsp/irq.h>
#define CONSOLE_DEFAULT_BAUD_RATE 9600
#define CONSOLE_DEFAULT_BAUD_CONSTANT Score603e_Z8530_Chip0_Baud(9600)
diff --git a/c/src/lib/libbsp/powerpc/score603e/include/bsp.h b/c/src/lib/libbsp/powerpc/score603e/include/bsp.h
index 5f52419b2e..3ea9e1e6bd 100644
--- a/c/src/lib/libbsp/powerpc/score603e/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/score603e/include/bsp.h
@@ -2,11 +2,11 @@
*
* This include file contains all board IO definitions.
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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$
@@ -19,6 +19,8 @@
extern "C" {
#endif
+#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
+
#include <bspopts.h>
#include <rtems.h>
#include <rtems/console.h>
@@ -35,8 +37,6 @@ extern "C" {
#if (HAS_PMC_PSC8)
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS (4 + 4)
#else
-/* XXXXX FIX THIS */
-#error "MUST HAVE PSC8 SET FOR BOEING CODE"
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS (4)
#endif
@@ -55,6 +55,7 @@ extern "C" {
*/
#include <gen2.h>
+#include <bsp/irq.h>
/*
* The following macro calculates the Baud constant. For the Z8530 chip.
@@ -173,6 +174,10 @@ void unmask_irq(
uint16_t irq_idx
);
+void mask_irq(
+ uint16_t irq_idx
+);
+
void init_irq_data_register();
uint16_t read_and_clear_PMC_irq(
diff --git a/c/src/lib/libbsp/powerpc/score603e/include/coverhd.h b/c/src/lib/libbsp/powerpc/score603e/include/coverhd.h
index d5dab9e254..bef4e722f1 100644
--- a/c/src/lib/libbsp/powerpc/score603e/include/coverhd.h
+++ b/c/src/lib/libbsp/powerpc/score603e/include/coverhd.h
@@ -15,11 +15,11 @@
* calling overhead including passing of arguments.
*
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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$
diff --git a/c/src/lib/libbsp/powerpc/score603e/include/gen2.h b/c/src/lib/libbsp/powerpc/score603e/include/gen2.h
index 0514f156ca..9b6ac15a37 100644
--- a/c/src/lib/libbsp/powerpc/score603e/include/gen2.h
+++ b/c/src/lib/libbsp/powerpc/score603e/include/gen2.h
@@ -2,14 +2,14 @@
*
* This include file contains all Generation 2 board addreses
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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:
+ * $Id$
*/
#ifndef __SCORE_GENERATION_2_h
@@ -178,67 +178,6 @@ extern "C" {
* Score603e Interupt Definations.
*/
-/*
- * First Score Unique IRQ
- */
-#define Score_IRQ_First ( PPC_IRQ_LAST + 1 )
-
-/*
- * The Following Are part of a Score603e FPGA.
- */
-#define SCORE603E_IRQ00 ( Score_IRQ_First + 0 )
-#define SCORE603E_IRQ01 ( Score_IRQ_First + 1 )
-#define SCORE603E_IRQ02 ( Score_IRQ_First + 2 )
-#define SCORE603E_IRQ03 ( Score_IRQ_First + 3 )
-#define SCORE603E_IRQ04 ( Score_IRQ_First + 4 )
-#define SCORE603E_IRQ05 ( Score_IRQ_First + 5 )
-#define SCORE603E_IRQ06 ( Score_IRQ_First + 6 )
-#define SCORE603E_IRQ07 ( Score_IRQ_First + 7 )
-#define SCORE603E_IRQ08 ( Score_IRQ_First + 8 )
-#define SCORE603E_IRQ09 ( Score_IRQ_First + 9 )
-#define SCORE603E_IRQ10 ( Score_IRQ_First + 10 )
-#define SCORE603E_IRQ11 ( Score_IRQ_First + 11 )
-#define SCORE603E_IRQ12 ( Score_IRQ_First + 12 )
-#define SCORE603E_IRQ13 ( Score_IRQ_First + 13 )
-#define SCORE603E_IRQ14 ( Score_IRQ_First + 14 )
-#define SCORE603E_IRQ15 ( Score_IRQ_First + 15 )
-
-#define SCORE603E_TIMER1_IRQ SCORE603E_IRQ00
-#define SCORE603E_TIMER2_IRQ SCORE603E_IRQ01
-#define SCORE603E_TIMER3_IRQ SCORE603E_IRQ02
-#define SCORE603E_85C30_1_IRQ SCORE603E_IRQ03
-#define SCORE603E_85C30_0_IRQ SCORE603E_IRQ04
-#define SCORE603E_RTC_IRQ SCORE603E_IRQ05
-#define SCORE603E_PCI_IRQ_0 SCORE603E_IRQ06
-#define SCORE603E_PCI_IRQ_1 SCORE603E_IRQ07
-#define SCORE603E_PCI_IRQ_2 SCORE603E_IRQ08
-#define SCORE603E_PCI_IRQ_3 SCORE603E_IRQ09
-#define SCORE603E_UNIVERSE_IRQ SCORE603E_IRQ10
-#define SCORE603E_1553_IRQ SCORE603E_IRQ11
-#define SCORE603E_MAIL_BOX_IRQ_0 SCORE603E_IRQ12
-#define SCORE603E_MAIL_BOX_IRQ_1 SCORE603E_IRQ13
-#define SCORE603E_MAIL_BOX_IRQ_2 SCORE603E_IRQ14
-#define SCORE603E_MAIL_BOX_IRQ_3 SCORE603E_IRQ15
-
-/*
- * The Score FPGA maps all interrupts comming from the PMC card to
- * the FPGA interrupt SCORE603E_PCI_IRQ_0 the PMC status word must be
- * read to indicate which interrupt was chained to the FPGA.
- */
-#define SCORE603E_IRQ16 ( Score_IRQ_First + 16 )
-#define SCORE603E_IRQ17 ( Score_IRQ_First + 17 )
-#define SCORE603E_IRQ18 ( Score_IRQ_First + 18 )
-#define SCORE603E_IRQ19 ( Score_IRQ_First + 19 )
-
-/*
- * IRQ'a read from the PMC card
- */
-#define SCORE603E_85C30_4_IRQ SCORE603E_IRQ16 /* SCC 422-1 */
-#define SCORE603E_85C30_2_IRQ SCORE603E_IRQ17 /* SCC 232-1 */
-#define SCORE603E_85C30_5_IRQ SCORE603E_IRQ18 /* SCC 422-2 */
-#define SCORE603E_85C30_3_IRQ SCORE603E_IRQ19 /* SCC 232-2 */
-
-#define MAX_BOARD_IRQS SCORE603E_IRQ19
/*
* BSP_TIMER_AVG_OVERHEAD and BSP_TIMER_LEAST_VALID for the shared timer
@@ -264,8 +203,9 @@ extern "C" {
#define BSP_Convert_decrementer( _value ) \
(int) (((_value) * 4000) / 6667)
-#endif
-
#ifdef __cplusplus
}
#endif
+
+#endif
+
diff --git a/c/src/lib/libbsp/powerpc/score603e/include/irq-config.h b/c/src/lib/libbsp/powerpc/score603e/include/irq-config.h
index 811ce6670f..ebe340ae33 100644
--- a/c/src/lib/libbsp/powerpc/score603e/include/irq-config.h
+++ b/c/src/lib/libbsp/powerpc/score603e/include/irq-config.h
@@ -4,6 +4,8 @@
* @ingroup bsp_interrupt
*
* @brief BSP interrupt support configuration.
+ *
+ * $Id$
*/
/*
diff --git a/c/src/lib/libbsp/powerpc/score603e/include/tm27.h b/c/src/lib/libbsp/powerpc/score603e/include/tm27.h
index d26a8bb920..2698a3bf40 100644
--- a/c/src/lib/libbsp/powerpc/score603e/include/tm27.h
+++ b/c/src/lib/libbsp/powerpc/score603e/include/tm27.h
@@ -1,6 +1,9 @@
/*
* tm27.h
*
+ * COPYRIGHT (c) 1989-2009.
+ * 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.
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c b/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c
index 67ba16815a..ec890a8e83 100644
--- a/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c
+++ b/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c
@@ -1,16 +1,17 @@
/* FPGA.c -- Bridge for second and subsequent generations
*
- * COPYRIGHT (c) 1989-2001.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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 <bsp.h>
+#include <bsp/irq.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
@@ -27,14 +28,13 @@ void initialize_PCI_bridge (void)
/* Note: Accept DINKs setup of the PCI Bridge and don't
* change anything.
*/
- printk("initialize_PCI_bridge: \n");
}
void set_irq_mask(
uint16_t value
)
{
- uint16_t *loc;
+ volatile uint16_t *loc;
loc = (uint16_t*)SCORE603E_FPGA_MASK_DATA;
@@ -43,8 +43,8 @@ void set_irq_mask(
uint16_t get_irq_mask(voi)
{
- uint16_t *loc;
- uint16_t value;
+ volatile uint16_t *loc;
+ uint16_t value;
loc = (uint16_t*)SCORE603E_FPGA_MASK_DATA;
@@ -53,6 +53,32 @@ uint16_t get_irq_mask(voi)
return value;
}
+void mask_irq(
+ uint16_t irq_idx
+)
+{
+ uint16_t value;
+ uint32_t mask_idx = irq_idx;
+
+ value = get_irq_mask();
+
+#if (HAS_PMC_PSC8)
+ switch (irq_idx + Score_IRQ_First ) {
+ case SCORE603E_85C30_4_IRQ:
+ case SCORE603E_85C30_2_IRQ:
+ case SCORE603E_85C30_5_IRQ:
+ case SCORE603E_85C30_3_IRQ:
+ mask_idx = SCORE603E_PCI_IRQ_0 - Score_IRQ_First;
+ break;
+ default:
+ break;
+ }
+#endif
+
+ value |= (0x1 << mask_idx);
+ set_irq_mask( value );
+}
+
void unmask_irq(
uint16_t irq_idx
)
@@ -100,7 +126,7 @@ uint16_t read_and_clear_PMC_irq(
uint16_t irq
)
{
- uint16_t status_word = irq;
+ uint16_t status_word = irq;
status_word = (*BSP_PMC_STATUS_ADDRESS);
@@ -139,14 +165,15 @@ uint16_t read_and_clear_irq(void)
{
uint16_t irq;
- irq = (*SCORE603E_FPGA_VECT_DATA);
+ irq = (*SCORE603E_FPGA_VECT_DATA);
+ Processor_Synchronize();
if ((irq & 0xffff0) != 0x10) {
- printk( "ERROR:: no irq data\n");
+ printk( "read_and_clear_irq:: ERROR==>no irq data 0x%x\n", irq);
return (irq | 0x80);
}
irq &=0xf;
-
+ irq += Score_IRQ_First;
return irq;
}
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/irq.c b/c/src/lib/libbsp/powerpc/score603e/irq/irq.c
deleted file mode 100644
index 31444af39e..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/irq/irq.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
- *
- * This file contains the implementation of the function described in irq.h
- *
- * Copyright (C) 1998, 1999 valette@crf.canon.fr
- *
- * The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <stdlib.h>
-
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <bsp/VME.h>
-#include <rtems/score/apiext.h> /* for post ISR signal processing */
-#include <libcpu/raw_exception.h>
-#include <libcpu/io.h>
-#include <bsp/vectors.h>
-#include <stdlib.h>
-#include <rtems/bspIo.h> /* for printk */
-
-/*
- * default handler connected on each irq after bsp initialization
- */
-static rtems_irq_connect_data default_rtems_entry;
-
-/*
- * location used to store initial tables used for interrupt
- * management.
- */
-static rtems_irq_global_settings* internal_config;
-static rtems_irq_connect_data* rtems_hdl_tbl;
-
-/*
- * Check if IRQ is an ISA IRQ
- */
-static inline int is_isa_irq(const rtems_irq_number irqLine)
-{
- return (((int) irqLine <= BSP_ISA_IRQ_MAX_OFFSET) &
- ((int) irqLine >= BSP_ISA_IRQ_LOWEST_OFFSET)
- );
-}
-
-/*
- * Check if IRQ is an pci IRQ
- */
-static inline int is_pci_irq(const rtems_irq_number irqLine)
-{
- return (((int) irqLine <= BSP_PCI_IRQ_MAX_OFFSET) &
- ((int) irqLine >= BSP_PCI_IRQ_LOWEST_OFFSET)
- );
-}
-
-/*
- * Check if IRQ is a Processor IRQ
- */
-static inline int is_processor_irq(const rtems_irq_number irqLine)
-{
- return (((int) irqLine <= BSP_PROCESSOR_IRQ_MAX_OFFSET) &
- ((int) irqLine >= BSP_PROCESSOR_IRQ_LOWEST_OFFSET)
- );
-}
-
-/*
- * ------------------------ RTEMS Irq helper functions ----------------
- */
-
-/*
- * This function check that the value given for the irq line
- * is valid.
- */
-
-static int isValidInterrupt(int irq)
-{
- if ( (irq < BSP_LOWEST_OFFSET) || (irq > BSP_MAX_OFFSET))
- return 0;
- return 1;
-}
-
-/*
- * ------------------------ RTEMS Shared Irq Handler Mngt Routines ----------------
- */
-int BSP_install_rtems_shared_irq_handler (const rtems_irq_connect_data* irq)
-{
- rtems_interrupt_level level;
- rtems_irq_connect_data* vchain;
-
-printk(" BSP_install_rtems_shared_irq_handler %d\n", irq->name );
-
- if (!isValidInterrupt(irq->name)) {
- printk("Invalid interrupt vector %d\n",irq->name);
- return 0;
- }
-
- rtems_interrupt_disable(level);
-
- if ( (int)rtems_hdl_tbl[irq->name].next_handler == -1 ) {
- rtems_interrupt_enable(level);
- printk("IRQ vector %d already connected to an unshared handler\n",irq->name);
- return 0;
- }
-
- vchain = (rtems_irq_connect_data*)malloc(sizeof(rtems_irq_connect_data));
-
- /* save off topmost handler */
- vchain[0]= rtems_hdl_tbl[irq->name];
-
- /*
- * store the data provided by user
- */
- rtems_hdl_tbl[irq->name] = *irq;
-
- /* link chain to new topmost handler */
- rtems_hdl_tbl[irq->name].next_handler = (void *)vchain;
-
- /*
- * XXX FIX ME
- */
- if (is_pci_irq(irq->name)) {
- }
-
- if (is_processor_irq(irq->name)) {
- /*
- * Enable exception at processor level
- */
- }
- /*
- * Enable interrupt on device
- */
- if (irq->on)
- irq->on(irq);
-
- rtems_interrupt_enable(level);
-
- return 1;
-}
-
-/*
- * This function disables a given XXX interrupt
- */
-rtems_status_code bsp_interrupt_vector_disable( rtems_vector_number irqLine)
-{
- /* XXX FIX ME!!!! */
-
- printk("bsp_interrupt_vector_disable: 0x%x\n", irqLine );
- return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code bsp_interrupt_vector_enable( rtems_vector_number irqLine)
-{
- /* XXX FIX ME!!!! */
- printk("bsp_interrupt_vector_enable: 0x%x\n", irqLine );
-
- return RTEMS_SUCCESSFUL;
-}
-
-
-
-/*
- * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
- */
-
-int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
-{
- rtems_interrupt_level level;
-
-printk(" BSP_install_rtems_irq_handler %d\n", irq->name );
-
- if (!isValidInterrupt(irq->name)) {
- printk("Invalid interrupt vector %d\n",irq->name);
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- rtems_interrupt_disable(level);
- if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
- rtems_interrupt_enable(level);
- printk("IRQ vector %d already connected\n",irq->name);
- return 0;
- }
-
- /*
- * store the data provided by user
- */
- rtems_hdl_tbl[irq->name] = *irq;
- rtems_hdl_tbl[irq->name].next_handler = (void *)-1;
-
- /* XXX -FIX ME !! */
- if (is_pci_irq(irq->name)) {
- /*
- * Enable interrupt
- */
- printk("is_pci_irq = TRUE - FIX THIS!\n");
- }
-
- if (is_processor_irq(irq->name)) {
- /*
- * Enable exception at processor level
- */
- printk("is_processor_irq = TRUE : Fix This\n");
- }
-
- /*
- * Enable interrupt on device
- */
- if (irq->on) {
- printk("Call 0x%x\n", irq->on );
- irq->on(irq);
- }
-
- rtems_interrupt_enable(level);
-
- return 1;
-}
-
-int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
-{
- rtems_interrupt_level level;
-
-printk(" BSP_get_current_rtems_irq_handler %d\n", irq->name );
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- rtems_interrupt_disable(level);
- *irq = rtems_hdl_tbl[irq->name];
- rtems_interrupt_enable(level);
- return 1;
-}
-
-int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
-{
- rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
- rtems_interrupt_level level;
-
-printk(" BSP_remove_rtems_irq_handler %d\n", irq->name );
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- * You must first get the current handler via i386_get_current_idt_entry
- * and then disconnect it using i386_delete_idt_entry.
- * RATIONALE : to always have the same transition by forcing the user
- * to get the previous handler before accepting to disconnect.
- */
- rtems_interrupt_disable(level);
- if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
- rtems_interrupt_enable(level);
- return 0;
- }
-
- if( (int)rtems_hdl_tbl[irq->name].next_handler != -1 )
- {
- int found = 0;
-
- for( (pchain= NULL, vchain = &rtems_hdl_tbl[irq->name]);
- (vchain->hdl != default_rtems_entry.hdl);
- (pchain= vchain, vchain = (rtems_irq_connect_data*)vchain->next_handler) )
- {
- if( vchain->hdl == irq->hdl )
- {
- found= -1; break;
- }
- }
-
- if( !found )
- {
- rtems_interrupt_enable(level);
- return 0;
- }
- }
- else
- {
- if (rtems_hdl_tbl[irq->name].hdl != irq->hdl)
- {
- rtems_interrupt_enable(level);
- return 0;
- }
- }
-
- /* XXX - FIX ME !! */
- if (is_pci_irq(irq->name)) {
- /*
- * disable interrupt
- */
- }
- if (is_processor_irq(irq->name)) {
- /*
- * disable exception at processor level
- */
- }
-
- /*
- * Disable interrupt on device
- */
- if (irq->off)
- irq->off(irq);
-
- /*
- * restore the default irq value
- */
- if( !vchain )
- {
- /* single handler vector... */
- rtems_hdl_tbl[irq->name] = default_rtems_entry;
- }
- else
- {
- if( pchain )
- {
- /* non-first handler being removed */
- pchain->next_handler = vchain->next_handler;
- }
- else
- {
- /* first handler isn't malloc'ed, so just overwrite it. Since
- the contents of vchain are being struct copied, vchain itself
- goes away */
- rtems_hdl_tbl[irq->name]= *vchain;
- }
- free(vchain);
- }
-
- rtems_interrupt_enable(level);
-
- return 1;
-}
-
-/*
- * RTEMS Global Interrupt Handler Management Routines
- */
-
-int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
-{
- int i;
- rtems_interrupt_level level;
-
- /*
- * Store various code accelerators
- */
- internal_config = config;
- default_rtems_entry = config->defaultEntry;
- rtems_hdl_tbl = config->irqHdlTbl;
-
-printk(" BSP_rtems_irq_mngt_set\n");
-
- rtems_interrupt_disable(level);
- /*
- * set up internal tables used by rtems interrupt prologue
- */
-
- /*
- * XXX - FIX ME !!!
- */
- for (i=BSP_PCI_IRQ_LOWEST_OFFSET; i < BSP_PCI_IRQ_LOWEST_OFFSET + BSP_PCI_IRQ_NUMBER ; i++) {
- if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
- {
- rtems_irq_connect_data* vchain;
- for( vchain = &rtems_hdl_tbl[i];
- ((int)vchain != -1 && vchain->hdl != default_rtems_entry.hdl);
- vchain = (rtems_irq_connect_data*)vchain->next_handler )
- {
- if (vchain->on)
- vchain->on(vchain);
- }
- }
-
- }
- else {
- /* if (rtems_hdl_tbl[i].off) rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]); */
- {
- rtems_irq_connect_data* vchain;
- for( vchain = &rtems_hdl_tbl[i];
- ((int)vchain != -1 && vchain->hdl != default_rtems_entry.hdl);
- vchain = (rtems_irq_connect_data*)vchain->next_handler )
- {
- if (vchain->off)
- vchain->off(vchain);
- }
- }
- }
- }
- /*
- * finish with Processor exceptions handled like IRQ
- */
- for (i=BSP_PROCESSOR_IRQ_LOWEST_OFFSET; i < BSP_PROCESSOR_IRQ_LOWEST_OFFSET+BSP_PROCESSOR_IRQ_NUMBER; i++){
- if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
- {
- rtems_irq_connect_data* vchain;
- for( vchain = &rtems_hdl_tbl[i];
- ((int)vchain != -1 && vchain->hdl != default_rtems_entry.hdl);
- vchain = (rtems_irq_connect_data*)vchain->next_handler )
- {
- if (vchain->on)
- vchain->on(vchain);
- }
- }
-
- }
- else {
- {
- rtems_irq_connect_data* vchain;
- for( vchain = &rtems_hdl_tbl[i];
- ((int)vchain != -1 && vchain->hdl != default_rtems_entry.hdl);
- vchain = (rtems_irq_connect_data*)vchain->next_handler )
- {
- if (vchain->off)
- vchain->off(vchain);
- }
- }
-
- }
- }
- rtems_interrupt_enable(level);
- return 1;
-}
-
-int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
-{
- *config = internal_config;
- return 0;
-}
-
-unsigned BSP_spuriousIntr = 0;
-
-/*
- * High level IRQ handler called from shared_raw_irq_code_entry
- */
-int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
-{
- register unsigned int irq;
- register unsigned msr;
- register unsigned new_msr;
-
- if (excNum == ASM_DEC_VECTOR) {
- _CPU_MSR_GET(msr);
- new_msr = msr | MSR_EE;
- _CPU_MSR_SET(new_msr);
-
- rtems_hdl_tbl[BSP_DECREMENTER].hdl(rtems_hdl_tbl[BSP_DECREMENTER].handle);
-
- _CPU_MSR_SET(msr);
- return 0;
-
- }
-
- irq = read_and_clear_irq();
- _CPU_MSR_GET(msr);
- new_msr = msr | MSR_EE;
- _CPU_MSR_SET(new_msr);
-
- /* rtems_hdl_tbl[irq].hdl(rtems_hdl_tbl[irq].handle); */
- {
- rtems_irq_connect_data* vchain;
- for( vchain = &rtems_hdl_tbl[irq];
- ((int)vchain != -1 && vchain->hdl != default_rtems_entry.hdl);
- vchain = (rtems_irq_connect_data*)vchain->next_handler )
- {
- vchain->hdl(vchain->handle);
- }
- }
-
- _CPU_MSR_SET(msr);
-
- return 0;
-}
-
-void _ThreadProcessSignalsFromIrq (BSP_Exception_frame* ctx)
-{
-printk(" _ThreadProcessSignalsFromIrq \n");
- /*
- * Process pending signals that have not already been
- * processed by _Thread_Displatch. This happens quite
- * unfrequently : the ISR must have posted an action
- * to the current running thread.
- */
- if ( _Thread_Do_post_task_switch_extension ||
- _Thread_Executing->do_post_task_switch_extension ) {
- _Thread_Executing->do_post_task_switch_extension = false;
- _API_extensions_Run_postswitch();
- }
- /*
- * I plan to process other thread related events here.
- * This will include DEBUG session requested from keyboard...
- */
-}
-
-rtems_status_code bsp_interrupt_facility_initialize( void)
-{
- /* Install exception handler */
- if (ppc_exc_set_handler( ASM_EXT_VECTOR, C_dispatch_irq_handler)) {
- return RTEMS_IO_ERROR;
- }
- if (ppc_exc_set_handler( ASM_DEC_VECTOR, C_dispatch_irq_handler)) {
- return RTEMS_IO_ERROR;
- }
- if (ppc_exc_set_handler( ASM_E300_SYSMGMT_VECTOR, C_dispatch_irq_handler)) {
- return RTEMS_IO_ERROR;
- }
-
- return RTEMS_SUCCESSFUL;
-}
-
-
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/irq.h b/c/src/lib/libbsp/powerpc/score603e/irq/irq.h
index 0511c632c2..78353cd269 100644
--- a/c/src/lib/libbsp/powerpc/score603e/irq/irq.h
+++ b/c/src/lib/libbsp/powerpc/score603e/irq/irq.h
@@ -3,16 +3,17 @@
* This include file describe the data structure and the functions implemented
* by RTEMS to write interrupt handlers.
*
- * Copyright (C) 1999 valette@crf.canon.fr
- *
* This code is heavilly inspired by the public specification of STREAM V2
* that can be found at :
*
- * <http://www.chorus.com/Documentation/index.html> by following
+ * <http://www.chorus.com/Documentation/index.html> by following
* the STREAM API Specification Document link.
*
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
* The license and distribution terms for this file may be
- * found in found in the file LICENSE in this distribution or at
+ * found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
@@ -24,46 +25,13 @@
#define BSP_SHARED_HANDLER_SUPPORT 1
#include <rtems/irq.h>
-/*
- * 8259 edge/level control definitions at VIA
- */
-#define ISA8259_M_ELCR 0x4d0
-#define ISA8259_S_ELCR 0x4d1
-
-#define ELCRS_INT15_LVL 0x80
-#define ELCRS_INT14_LVL 0x40
-#define ELCRS_INT13_LVL 0x20
-#define ELCRS_INT12_LVL 0x10
-#define ELCRS_INT11_LVL 0x08
-#define ELCRS_INT10_LVL 0x04
-#define ELCRS_INT9_LVL 0x02
-#define ELCRS_INT8_LVL 0x01
-#define ELCRM_INT7_LVL 0x80
-#define ELCRM_INT6_LVL 0x40
-#define ELCRM_INT5_LVL 0x20
-#define ELCRM_INT4_LVL 0x10
-#define ELCRM_INT3_LVL 0x8
-#define ELCRM_INT2_LVL 0x4
-#define ELCRM_INT1_LVL 0x2
-#define ELCRM_INT0_LVL 0x1
-
- /* PIC's command and mask registers */
-#define PIC_MASTER_COMMAND_IO_PORT 0x20 /* Master PIC command register */
-#define PIC_SLAVE_COMMAND_IO_PORT 0xa0 /* Slave PIC command register */
-#define PIC_MASTER_IMR_IO_PORT 0x21 /* Master PIC Interrupt Mask Register */
-#define PIC_SLAVE_IMR_IO_PORT 0xa1 /* Slave PIC Interrupt Mask Register */
-
- /* Command for specific EOI (End Of Interrupt): Interrupt acknowledge */
-#define PIC_EOSI 0x60 /* End of Specific Interrupt (EOSI) */
-#define SLAVE_PIC_EOSI 0x62 /* End of Specific Interrupt (EOSI) for cascade */
-#define PIC_EOI 0x20 /* Generic End of Interrupt (EOI) */
-
#ifndef ASM
#ifdef __cplusplus
extern "C" {
#endif
+
/*
* rtems_irq_number Definitions
*/
@@ -74,20 +42,30 @@ extern "C" {
#define BSP_ISA_IRQ_NUMBER (16)
#define BSP_ISA_IRQ_LOWEST_OFFSET (0)
#define BSP_ISA_IRQ_MAX_OFFSET (BSP_ISA_IRQ_LOWEST_OFFSET + BSP_ISA_IRQ_NUMBER - 1)
+
/*
* PCI IRQ handlers related definitions
- * CAUTION : BSP_PCI_IRQ_LOWEST_OFFSET should be equal to OPENPIC_VEC_SOURCE
*/
#define BSP_PCI_IRQ_NUMBER (16)
#define BSP_PCI_IRQ_LOWEST_OFFSET (BSP_ISA_IRQ_NUMBER)
#define BSP_PCI_IRQ_MAX_OFFSET (BSP_PCI_IRQ_LOWEST_OFFSET + BSP_PCI_IRQ_NUMBER - 1)
+
+/*
+ * PMC IRQ
+ */
+#define BSP_PMC_IRQ_NUMBER (4)
+#define BSP_PMC_IRQ_LOWEST_OFFSET (BSP_PCI_IRQ_MAX_OFFSET + 1)
+#define BSP_PMC_IRQ_MAX_OFFSET (BSP_PMC_IRQ_LOWEST_OFFSET + BSP_PMC_IRQ_NUMBER - 1)
+
+
/*
* PowerPC exceptions handled as interrupt where an RTEMS managed interrupt
* handler might be connected
*/
#define BSP_PROCESSOR_IRQ_NUMBER (1)
-#define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_PCI_IRQ_MAX_OFFSET + 1)
+#define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_PMC_IRQ_MAX_OFFSET + 1)
#define BSP_PROCESSOR_IRQ_MAX_OFFSET (BSP_PROCESSOR_IRQ_LOWEST_OFFSET + BSP_PROCESSOR_IRQ_NUMBER - 1)
+
/* Misc vectors for OPENPIC irqs (IPI, timers)
*/
#define BSP_MISC_IRQ_NUMBER (8)
@@ -99,96 +77,76 @@ extern "C" {
#define BSP_IRQ_NUMBER (BSP_MISC_IRQ_MAX_OFFSET + 1)
#define BSP_LOWEST_OFFSET (BSP_ISA_IRQ_LOWEST_OFFSET)
#define BSP_MAX_OFFSET (BSP_MISC_IRQ_MAX_OFFSET)
-/*
- * Some ISA IRQ symbolic name definition
- */
-#define BSP_ISA_PERIODIC_TIMER (0)
-#define BSP_ISA_KEYBOARD (1)
-#define BSP_ISA_UART_COM2_IRQ (3)
-#define BSP_ISA_UART_COM1_IRQ (4)
-#define BSP_ISA_RT_TIMER1 (8)
-#define BSP_ISA_RT_TIMER3 (10)
-/*
- * Some PCI IRQ symbolic name definition
- */
-#define BSP_PCI_IRQ0 (BSP_PCI_IRQ_LOWEST_OFFSET)
-#define BSP_PCI_ISA_BRIDGE_IRQ (BSP_PCI_IRQ0)
-
-#if defined(mvme2100)
-#define BSP_DEC21143_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 1)
-#define BSP_PMC_PCMIP_TYPE1_SLOT0_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 2)
-#define BSP_PCMIP_TYPE1_SLOT1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 3)
-#define BSP_PCMIP_TYPE2_SLOT0_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 4)
-#define BSP_PCMIP_TYPE2_SLOT1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 5)
-#define BSP_PCI_INTA_UNIVERSE_LINT0_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 7)
-#define BSP_PCI_INTB_UNIVERSE_LINT1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 8)
-#define BSP_PCI_INTC_UNIVERSE_LINT2_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 9)
-#define BSP_PCI_INTD_UNIVERSE_LINT3_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 10)
-#define BSP_UART_COM1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 13)
-#define BSP_FRONT_PANEL_ABORT_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 14)
-#define BSP_RTC_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 15)
-#else
-#define BSP_UART_COM1_IRQ BSP_ISA_UART_COM1_IRQ
-#define BSP_UART_COM2_IRQ BSP_ISA_UART_COM2_IRQ
-#endif
/*
* Some Processor execption handled as RTEMS IRQ symbolic name definition
*/
#define BSP_DECREMENTER (BSP_PROCESSOR_IRQ_LOWEST_OFFSET)
-
/*
- * Type definition for RTEMS managed interrupts
+ * First Score Unique IRQ
*/
-typedef unsigned short rtems_i8259_masks;
-
-extern volatile rtems_i8259_masks i8259s_cache;
+#define Score_IRQ_First ( BSP_PCI_IRQ_LOWEST_OFFSET )
-/*-------------------------------------------------------------------------+
-| Function Prototypes.
-+--------------------------------------------------------------------------*/
/*
- * ------------------------ Intel 8259 (or emulation) Mngt Routines -------
- */
-void BSP_i8259s_init(void);
+ * The Following Are part of a Score603e FPGA.
+ */
+#define SCORE603E_IRQ00 ( Score_IRQ_First + 0 )
+#define SCORE603E_IRQ01 ( Score_IRQ_First + 1 )
+#define SCORE603E_IRQ02 ( Score_IRQ_First + 2 )
+#define SCORE603E_IRQ03 ( Score_IRQ_First + 3 )
+#define SCORE603E_IRQ04 ( Score_IRQ_First + 4 )
+#define SCORE603E_IRQ05 ( Score_IRQ_First + 5 )
+#define SCORE603E_IRQ06 ( Score_IRQ_First + 6 )
+#define SCORE603E_IRQ07 ( Score_IRQ_First + 7 )
+#define SCORE603E_IRQ08 ( Score_IRQ_First + 8 )
+#define SCORE603E_IRQ09 ( Score_IRQ_First + 9 )
+#define SCORE603E_IRQ10 ( Score_IRQ_First + 10 )
+#define SCORE603E_IRQ11 ( Score_IRQ_First + 11 )
+#define SCORE603E_IRQ12 ( Score_IRQ_First + 12 )
+#define SCORE603E_IRQ13 ( Score_IRQ_First + 13 )
+#define SCORE603E_IRQ14 ( Score_IRQ_First + 14 )
+#define SCORE603E_IRQ15 ( Score_IRQ_First + 15 )
+
+#define SCORE603E_TIMER1_IRQ SCORE603E_IRQ00
+#define SCORE603E_TIMER2_IRQ SCORE603E_IRQ01
+#define SCORE603E_TIMER3_IRQ SCORE603E_IRQ02
+#define SCORE603E_85C30_1_IRQ SCORE603E_IRQ03
+#define SCORE603E_85C30_0_IRQ SCORE603E_IRQ04
+#define SCORE603E_RTC_IRQ SCORE603E_IRQ05
+#define SCORE603E_PCI_IRQ_0 SCORE603E_IRQ06
+#define SCORE603E_PCI_IRQ_1 SCORE603E_IRQ07
+#define SCORE603E_PCI_IRQ_2 SCORE603E_IRQ08
+#define SCORE603E_PCI_IRQ_3 SCORE603E_IRQ09
+#define SCORE603E_UNIVERSE_IRQ SCORE603E_IRQ10
+#define SCORE603E_1553_IRQ SCORE603E_IRQ11
+#define SCORE603E_MAIL_BOX_IRQ_0 SCORE603E_IRQ12
+#define SCORE603E_MAIL_BOX_IRQ_1 SCORE603E_IRQ13
+#define SCORE603E_MAIL_BOX_IRQ_2 SCORE603E_IRQ14
+#define SCORE603E_MAIL_BOX_IRQ_3 SCORE603E_IRQ15
/*
- * function to disable a particular irq at 8259 level. After calling
- * this function, even if the device asserts the interrupt line it will
- * not be propagated further to the processor
- *
- * RETURNS: 1/0 if the interrupt was enabled/disabled originally or
- * a value < 0 on error.
- */
-int BSP_irq_disable_at_i8259s (const rtems_irq_number irqLine);
-/*
- * function to enable a particular irq at 8259 level. After calling
- * this function, if the device asserts the interrupt line it will
- * be propagated further to the processor
+ * The Score FPGA maps all interrupts comming from the PMC card to
+ * the FPGA interrupt SCORE603E_PCI_IRQ_0 the PMC status word must be
+ * read to indicate which interrupt was chained to the FPGA.
*/
-int BSP_irq_enable_at_i8259s (const rtems_irq_number irqLine);
-/*
- * function to acknowledge a particular irq at 8259 level. After calling
- * this function, if a device asserts an enabled interrupt line it will
- * be propagated further to the processor. Mainly usefull for people
- * writing raw handlers as this is automagically done for RTEMS managed
- * handlers.
- */
-int BSP_irq_ack_at_i8259s (const rtems_irq_number irqLine);
+#define SCORE603E_IRQ16 ( Score_IRQ_First + 16 )
+#define SCORE603E_IRQ17 ( Score_IRQ_First + 17 )
+#define SCORE603E_IRQ18 ( Score_IRQ_First + 18 )
+#define SCORE603E_IRQ19 ( Score_IRQ_First + 19 )
+
/*
- * function to check if a particular irq is enabled at 8259 level. After calling
+ * IRQ'a read from the PMC card
*/
-int BSP_irq_enabled_at_i8259s (const rtems_irq_number irqLine);
-
-extern void BSP_rtems_irq_mng_init(unsigned cpuId);
-extern void BSP_i8259s_init(void);
+#define SCORE603E_85C30_4_IRQ SCORE603E_IRQ16 /* SCC 422-1 */
+#define SCORE603E_85C30_2_IRQ SCORE603E_IRQ17 /* SCC 232-1 */
+#define SCORE603E_85C30_5_IRQ SCORE603E_IRQ18 /* SCC 422-2 */
+#define SCORE603E_85C30_3_IRQ SCORE603E_IRQ19 /* SCC 232-2 */
-/* Stuff in irq_supp.h should eventually go into <rtems/irq.h> */
-/* #include <bsp/irq_supp.h> */
+#define MAX_BOARD_IRQS SCORE603E_IRQ19
#ifdef __cplusplus
-};
+}
#endif
#endif
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c b/c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c
index 21f1a89669..ea0e257a2e 100644
--- a/c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c
+++ b/c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c
@@ -22,16 +22,14 @@
#include <libcpu/spr.h>
#include <bsp/pci.h>
#include <bsp/residual.h>
-#include <bsp/openpic.h>
#include <bsp/irq.h>
#include <bsp.h>
#include <libcpu/raw_exception.h>
-#include <bsp/motorola.h>
#include <rtems/bspIo.h>
#define SHOW_ISA_PCI_BRIDGE_SETTINGS 1
#define SCAN_PCI_PRINT 1
-#define TRACE_IRQ_INIT 1
+#define TRACE_IRQ_INIT 0
typedef struct {
unsigned char bus; /* few chance the PCI/ISA bridge is not on first bus but ... */
@@ -40,223 +38,26 @@ typedef struct {
} pci_isa_bridge_device;
pci_isa_bridge_device* via_82c586 = 0;
-static pci_isa_bridge_device bridge;
extern unsigned int external_exception_vector_prolog_code_size[];
extern void external_exception_vector_prolog_code(void);
extern unsigned int decrementer_exception_vector_prolog_code_size[];
extern void decrementer_exception_vector_prolog_code(void);
-/*
- * default on/off function
- */
-static void nop_func(void){}
-/*
- * default isOn function
- */
-static int not_connected(void) {return 0;}
-/*
- * default possible isOn function
- */
-static int connected(void) {return 1;}
+static void IRQ_Default_rtems_irq_hdl( rtems_irq_hdl_param ptr ) {}
+static void IRQ_Default_rtems_irq_enable (const struct __rtems_irq_connect_data__ *ptr){}
+static void IRQ_Default_rtems_irq_disable(const struct __rtems_irq_connect_data__ *ptr){}
+static int IRQ_Default_rtems_irq_is_enabled(const struct __rtems_irq_connect_data__ *ptr){ return 1; }
static rtems_irq_connect_data rtemsIrq[BSP_IRQ_NUMBER];
static rtems_irq_global_settings initial_config;
-static rtems_irq_connect_data defaultIrq = {
- /* vectorIdex, hdl , handle , on , off , isOn */
- 0, nop_func , NULL , nop_func , nop_func , not_connected
-};
-static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER]={
- /*
- * actual priorities for interrupt :
- * 0 means that only current interrupt is masked
- * 255 means all other interrupts are masked
- */
- /*
- * ISA interrupts.
- * The second entry has a priority of 255 because
- * it is the slave pic entry and should always remain
- * unmasked.
- */
- 0,0,
- 255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- /*
- * PCI Interrupts
- */
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, /* for raven prio 0 means unactive... */
- /*
- * Processor exceptions handled as interrupts
- */
- 0
-};
-
-#if defined(mvme2100)
-static unsigned char mvme2100_openpic_initpolarities[16] = {
- 0, /* Not used - should be disabled */
- 0, /* DEC21143 Controller */
- 0, /* PMC/PC-MIP Type I Slot 0 */
- 0, /* PC-MIP Type I Slot 1 */
- 0, /* PC-MIP Type II Slot 0 */
- 0, /* PC-MIP Type II Slot 1 */
- 0, /* Not used - should be disabled */
- 0, /* PCI Expansion Interrupt A/Universe II (LINT0) */
- 0, /* PCI Expansion Interrupt B/Universe II (LINT1) */
- 0, /* PCI Expansion Interrupt C/Universe II (LINT2) */
- 0, /* PCI Expansion Interrupt D/Universe II (LINT3) */
- 0, /* Not used - should be disabled */
- 0, /* Not used - should be disabled */
- 1, /* 16550 UART */
- 0, /* Front panel Abort Switch */
- 0, /* RTC IRQ */
-};
-static unsigned char mvme2100_openpic_initsenses[] = {
- 0, /* Not used - should be disabled */
- 1, /* DEC21143 Controller */
- 1, /* PMC/PC-MIP Type I Slot 0 */
- 1, /* PC-MIP Type I Slot 1 */
- 1, /* PC-MIP Type II Slot 0 */
- 1, /* PC-MIP Type II Slot 1 */
- 0, /* Not used - should be disabled */
- 1, /* PCI Expansion Interrupt A/Universe II (LINT0) */
- 1, /* PCI Expansion Interrupt B/Universe II (LINT1) */
- 1, /* PCI Expansion Interrupt C/Universe II (LINT2) */
- 1, /* PCI Expansion Interrupt D/Universe II (LINT3) */
- 0, /* Not used - should be disabled */
- 0, /* Not used - should be disabled */
- 1, /* 16550 UART */
- 0, /* Front panel Abort Switch */
- 1, /* RTC IRQ */
-};
-#else
-static unsigned char mcp750_openpic_initpolarities[16] = {
- 1, /* 8259 cascade */
- 0, /* all the rest of them */
-};
-
-static unsigned char mcp750_openpic_initsenses[] = {
- 1, /* MCP750_INT_PCB(8259) */
- 0, /* MCP750_INT_FALCON_ECC_ERR */
- 1, /* MCP750_INT_PCI_ETHERNET */
- 1, /* MCP750_INT_PCI_PMC */
- 1, /* MCP750_INT_PCI_WATCHDOG_TIMER1 */
- 1, /* MCP750_INT_PCI_PRST_SIGNAL */
- 1, /* MCP750_INT_PCI_FALL_SIGNAL */
- 1, /* MCP750_INT_PCI_DEG_SIGNAL */
- 1, /* MCP750_INT_PCI_BUS1_INTA */
- 1, /* MCP750_INT_PCI_BUS1_INTB */
- 1, /* MCP750_INT_PCI_BUS1_INTC */
- 1, /* MCP750_INT_PCI_BUS1_INTD */
- 1, /* MCP750_INT_PCI_BUS2_INTA */
- 1, /* MCP750_INT_PCI_BUS2_INTB */
- 1, /* MCP750_INT_PCI_BUS2_INTC */
- 1, /* MCP750_INT_PCI_BUS2_INTD */
+static rtems_irq_connect_data defaultIrq = {
+/*name, hdl handle on off isOn */
+ 0, IRQ_Default_rtems_irq_hdl, NULL, IRQ_Default_rtems_irq_enable, IRQ_Default_rtems_irq_disable, IRQ_Default_rtems_irq_is_enabled
};
-#endif
-
-void VIA_isa_bridge_interrupts_setup(void)
-{
- pci_isa_bridge_device pci_dev;
- unsigned int temp;
- unsigned char tmp;
- unsigned char maxBus;
- unsigned found = 0;
- maxBus = pci_bus_count();
- pci_dev.function = 0; /* Assumes the bidge is the first function */
-
- for (pci_dev.bus = 0; pci_dev.bus < maxBus; pci_dev.bus++) {
-#ifdef SCAN_PCI_PRINT
- printk("isa_bridge_interrupts_setup: Scanning bus %d\n", pci_dev.bus);
-#endif
- for (pci_dev.device = 0; pci_dev.device < PCI_MAX_DEVICES; pci_dev.device++) {
-#ifdef SCAN_PCI_PRINT
- printk("isa_bridge_interrupts_setup: Scanning device %d\n", pci_dev.device);
-#endif
- pci_read_config_dword(pci_dev.bus, pci_dev.device, pci_dev.function,
- PCI_VENDOR_ID, &temp);
-#ifdef SCAN_PCI_PRINT
- printk("Vendor/device = %x\n", temp);
-#endif
- if ((temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_0 << 16)))
- ) {
- bridge = pci_dev;
- via_82c586 = &bridge;
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- /*
- * Should print : bus = 0, device = 11, function = 0 on a MCP750.
- */
- printk("Via PCI/ISA bridge found at bus = %d, device = %d, function = %d\n",
- via_82c586->bus,
- via_82c586->device,
- via_82c586->function);
-#endif
- found = 1;
- goto loop_exit;
-
- }
- }
- }
-loop_exit:
- if (!found) BSP_panic("VIA_82C586 PCI/ISA bridge not found!n");
-
- tmp = inb(0x810);
- if ( !(tmp & 0x2)) {
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- printk("This is a second generation MCP750 board\n");
- printk("We must reprogram the PCI/ISA bridge...\n");
-#endif
- pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
- 0x47, &tmp);
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);
-#endif
- /*
- * Enable 4D0/4D1 ISA interrupt level/edge config registers
- */
- tmp |= 0x20;
- pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
- 0x47, tmp);
- /*
- * Now program the ISA interrupt edge/level
- */
- tmp = ELCRS_INT9_LVL | ELCRS_INT10_LVL | ELCRS_INT11_LVL;
- outb(tmp, ISA8259_S_ELCR);
- tmp = ELCRM_INT5_LVL;
- outb(tmp, ISA8259_M_ELCR);;
- /*
- * Set the Interrupt inputs to non-inverting level interrupt
- */
- pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
- 0x54, &tmp);
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);
-#endif
- tmp = 0;
- pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
- 0x54, tmp);
- }
- else {
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- printk("This is a first generation MCP750 board\n");
- printk("We just show the actual value used by PCI/ISA bridge\n");
-#endif
- pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
- 0x47, &tmp);
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);
-#endif
- /*
- * Show the Interrupt inputs inverting/non-inverting level status
- */
- pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
- 0x54, &tmp);
-#ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS
- printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);
-#endif
- }
-}
+static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER];
/*
* This code assumes the exceptions management setup has already
@@ -266,54 +67,11 @@ loop_exit:
*/
void BSP_rtems_irq_mng_init(unsigned cpuId)
{
-#if !defined(mvme2100)
- int known_cpi_isa_bridge = 0;
-#endif
- rtems_raw_except_connect_data vectorDesc;
int i;
/*
* First initialize the Interrupt management hardware
*/
-#if defined(mvme2100)
-#ifdef TRACE_IRQ_INIT
- printk("Going to initialize EPIC interrupt controller (openpic compliant)\n");
-#endif
- openpic_init(1, mvme2100_openpic_initpolarities, mvme2100_openpic_initsenses);
-#else
-#ifdef TRACE_IRQ_INIT
- printk("Going to initialize raven interrupt controller (openpic compliant)\n");
-#endif
- openpic_init(1, mcp750_openpic_initpolarities, mcp750_openpic_initsenses);
-#endif
-
-#if !defined(mvme2100)
-#ifdef TRACE_IRQ_INIT
- printk("Going to initialize the PCI/ISA bridge IRQ related setting (VIA 82C586)\n");
-#endif
- if ( currentBoard == MESQUITE ) {
- VIA_isa_bridge_interrupts_setup();
- known_cpi_isa_bridge = 1;
- }
- if ( currentBoard == MVME_2300 ) {
- /* nothing to do for W83C553 bridge */
- known_cpi_isa_bridge = 1;
- }
- if ( currentBoard == MTX_WO_PP || currentBoard == MTX_W_PP ) {
- /* W83C554, don't to anything at the moment. gregm 11/6/2002 */
- known_cpi_isa_bridge = 1;
- }
-
- if (!known_cpi_isa_bridge) {
- printk("Please add code for PCI/ISA bridge init to libbsp/powerpc/shared/irq/irq_init.c\n");
- printk("If your card works correctly please add a test and set known_cpi_isa_bridge to true\n");
- printk("currentBoard = %i\n", currentBoard);
- }
-#ifdef TRACE_IRQ_INIT
- printk("Going to initialize the ISA PC legacy IRQ management hardware\n");
-#endif
- BSP_i8259s_init();
-#endif
/*
* Initialize RTEMS management interrupt table
@@ -322,9 +80,14 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
* re-init the rtemsIrq table
*/
for (i = 0; i < BSP_IRQ_NUMBER; i++) {
+ irqPrioTable[i] = 8;
rtemsIrq[i] = defaultIrq;
rtemsIrq[i].name = i;
+#ifdef BSP_SHARED_HANDLER_SUPPORT
+ rtemsIrq[i].next_handler = NULL;
+#endif
}
+
/*
* Init initial Interrupt management config
*/
@@ -341,27 +104,6 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
BSP_panic("Unable to initialize RTEMS interrupt Management!!! System locked\n");
}
- /*
- * We must connect the raw irq handler for the two
- * expected interrupt sources : decrementer and external interrupts.
- */
- vectorDesc.exceptIndex = ASM_DEC_VECTOR;
- vectorDesc.hdl.vector = ASM_DEC_VECTOR;
- vectorDesc.hdl.raw_hdl = decrementer_exception_vector_prolog_code;
- vectorDesc.hdl.raw_hdl_size = (unsigned) decrementer_exception_vector_prolog_code_size;
- vectorDesc.on = nop_func;
- vectorDesc.off = nop_func;
- vectorDesc.isOn = connected;
- if (!ppc_set_exception (&vectorDesc)) {
- BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
- }
- vectorDesc.exceptIndex = ASM_EXT_VECTOR;
- vectorDesc.hdl.vector = ASM_EXT_VECTOR;
- vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code;
- vectorDesc.hdl.raw_hdl_size = (unsigned) external_exception_vector_prolog_code_size;
- if (!ppc_set_exception (&vectorDesc)) {
- BSP_panic("Unable to initialize RTEMS external raw exception\n");
- }
#ifdef TRACE_IRQ_INIT
printk("RTEMS IRQ management is now operational\n");
#endif
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/no_pic.c b/c/src/lib/libbsp/powerpc/score603e/irq/no_pic.c
new file mode 100644
index 0000000000..c30fb20156
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/score603e/irq/no_pic.c
@@ -0,0 +1,84 @@
+/*
+ *
+ * This file contains the implementation of the function described in irq.h
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * 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 <bsp.h>
+#include <bsp/irq.h>
+#include <bsp/irq_supp.h>
+#include <libcpu/raw_exception.h>
+
+static rtems_irq_connect_data *rtems_hdl_tbl;
+static rtems_irq_connect_data dflt_entry;
+
+/*
+ * High level IRQ handler called from shared_raw_irq_code_entry
+ */
+int C_dispatch_irq_handler(
+ struct _BSP_Exception_frame *frame,
+ unsigned int excNum
+)
+{
+ register unsigned int irq;
+#if (HAS_PMC_PSC8)
+ uint16_t check_irq;
+ uint16_t status_word;
+#endif
+
+ if (excNum == ASM_DEC_VECTOR) {
+ bsp_irq_dispatch_list(rtems_hdl_tbl, BSP_DECREMENTER, dflt_entry.hdl);
+ return 0;
+ }
+
+ irq = read_and_clear_irq();
+
+#if (HAS_PMC_PSC8)
+ if (irq == SCORE603E_PCI_IRQ_0) {
+ status_word = read_and_clear_PMC_irq( irq );
+ for (check_irq=SCORE603E_IRQ16; check_irq<=SCORE603E_IRQ19; check_irq++) {
+ if ( Is_PMC_IRQ( check_irq, status_word )) {
+ bsp_irq_dispatch_list_base(rtems_hdl_tbl, check_irq, dflt_entry.hdl);
+ }
+ }
+ } else
+#endif
+ {
+ bsp_irq_dispatch_list_base(rtems_hdl_tbl, irq, dflt_entry.hdl);
+ }
+
+ return 0;
+}
+
+void
+BSP_enable_irq_at_pic(const rtems_irq_number irq)
+{
+ uint16_t vec_idx = irq - Score_IRQ_First;
+ unmask_irq( vec_idx );
+}
+
+int
+BSP_disable_irq_at_pic(const rtems_irq_number irq)
+{
+ uint16_t vec_idx = irq - Score_IRQ_First;
+ unmask_irq( vec_idx );
+ return 0;
+}
+
+int
+BSP_setup_the_pic(rtems_irq_global_settings *config)
+{
+ dflt_entry = config->defaultEntry;
+ rtems_hdl_tbl = config->irqHdlTbl;
+ init_irq_data_register();
+ return 1;
+}
diff --git a/c/src/lib/libbsp/powerpc/score603e/preinstall.am b/c/src/lib/libbsp/powerpc/score603e/preinstall.am
index 95a65a3e4a..a3c4e448bc 100644
--- a/c/src/lib/libbsp/powerpc/score603e/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/score603e/preinstall.am
@@ -85,14 +85,6 @@ $(PROJECT_INCLUDE)/bsp/consoleIo.h: ../../powerpc/shared/console/consoleIo.h $(P
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/consoleIo.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/consoleIo.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-config.h: include/irq-config.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-config.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-config.h
-
$(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
@@ -109,46 +101,6 @@ $(PROJECT_INCLUDE)/bsp/irq_supp.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bsps
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq_supp.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq_supp.h
-$(PROJECT_INCLUDE)/bsp/vectors.h: ../../powerpc/shared/vectors/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
-
-$(PROJECT_INCLUDE)/bsp/vmeUniverse.h: ../../shared/vmeUniverse/vmeUniverse.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vmeUniverse.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vmeUniverse.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/vme_am_defs.h: ../../shared/vmeUniverse/vme_am_defs.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vme_am_defs.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vme_am_defs.h
-
-$(PROJECT_INCLUDE)/bsp/VME.h: ../../shared/vmeUniverse/VME.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VME.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VME.h
-
-$(PROJECT_INCLUDE)/bsp/VMEConfig.h: vme/VMEConfig.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VMEConfig.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VMEConfig.h
-
-$(PROJECT_INCLUDE)/bsp/motorola.h: ../../powerpc/shared/motorola/motorola.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/motorola.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/motorola.h
-
-$(PROJECT_INCLUDE)/bsp/vmeUniverseDMA.h: ../../shared/vmeUniverse/vmeUniverseDMA.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vmeUniverseDMA.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vmeUniverseDMA.h
-
-$(PROJECT_INCLUDE)/bsp/bspVmeDmaList.h: ../../shared/vmeUniverse/bspVmeDmaList.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bspVmeDmaList.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bspVmeDmaList.h
-
-$(PROJECT_INCLUDE)/bsp/VMEDMA.h: ../../shared/vmeUniverse/VMEDMA.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VMEDMA.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VMEDMA.h
-
$(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)
diff --git a/c/src/lib/libbsp/powerpc/score603e/start/start.S b/c/src/lib/libbsp/powerpc/score603e/start/start.S
index 9ae4f0b017..f281668ca6 100644
--- a/c/src/lib/libbsp/powerpc/score603e/start/start.S
+++ b/c/src/lib/libbsp/powerpc/score603e/start/start.S
@@ -14,7 +14,7 @@
* the new terms are clearly indicated on the first page of each file where
* they apply.
*
- * $Id$
+ * $Id$
*/
#include "ppc-asm.h"
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/Hwr_init.c b/c/src/lib/libbsp/powerpc/score603e/startup/Hwr_init.c
index dc942e873a..8f97ec7e31 100644
--- a/c/src/lib/libbsp/powerpc/score603e/startup/Hwr_init.c
+++ b/c/src/lib/libbsp/powerpc/score603e/startup/Hwr_init.c
@@ -1,5 +1,12 @@
/* Hwr_init.c
*
+ * COPYRIGHT (c) 1989-2009.
+ * 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$
*/
@@ -82,8 +89,6 @@ void init_PCI(void)
{
/* DINK Monitor setsup and uses all 4 BAT registers. */
/* The fourth BAT register can be modified to access this area */
-
- printk("init_PCI:\n");
}
#define PPC_Get_HID0( _value ) \
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c b/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c
index c345bc7b8b..5a08b5e942 100644
--- a/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c
@@ -5,14 +5,14 @@
* The generic CPU dependent initialization has been performed
* before any of these are invoked.
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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:
+ * $Id$
*/
#include <string.h>
@@ -22,7 +22,8 @@
#include <rtems/libcsupport.h>
#include <rtems/bspIo.h>
#include <libcpu/cpuIdent.h>
-#define DEBUG 1
+
+#define DEBUG 0
/*
* Where the heap starts; is used by bsp_pretasking_hook;
@@ -32,12 +33,12 @@ unsigned int BSP_heap_start;
/*
* PCI Bus Frequency
*/
-unsigned int BSP_bus_frequency; /* XXX - Set this based upon the Score board */
+unsigned int BSP_bus_frequency;
/*
* processor clock frequency
*/
-unsigned int BSP_processor_frequency; /* XXX - Set this based upon the Score board */
+unsigned int BSP_processor_frequency;
/*
* Time base divisior (how many tick for 1 second).
@@ -90,15 +91,15 @@ void bsp_pretasking_hook(void)
uint32_t heap_start;
uint32_t heap_size;
+ heap_start = (BSP_heap_start + CPU_ALIGNMENT - 1) & ~(CPU_ALIGNMENT-1);
+ heap_size = (uint32_t) &RAM_END;
+ heap_size = heap_size - heap_start - Configuration.work_space_size;
+ heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
+
+
#if DEBUG
- printk("bsp_pretasking_hook: Set Heap\n");
+ printk("bsp_pretasking_hook: Set Heap start 0x%x size 0x%x\n", heap_start, heap_size);
#endif
- heap_start = (uint32_t) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = Configuration.work_space_start - (void *)&end;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
#if DEBUG
printk("bsp_pretasking_hook: bsp_libc_init\n");
@@ -121,6 +122,13 @@ void initialize_PMC();
void bsp_predriver_hook(void)
{
+ init_PCI();
+ initialize_universe();
+
+ #if DEBUG
+ printk("bsp_predriver_hook: initialize_PCI_bridge\n");
+ #endif
+ initialize_PCI_bridge ();
#if (HAS_PMC_PSC8)
#if DEBUG
@@ -181,17 +189,11 @@ void initialize_PMC() {
void bsp_postdriver_hook(void)
{
- extern void Init_EE_mask_init(void);
extern void open_dev_console(void);
#if DEBUG
printk("bsp_postdriver_hook: open_dev_console\n");
#endif
open_dev_console();
-
- #if DEBUG
- printk("bsp_postdriver_hook: Init_EE_mask_init\n");
- #endif
- Init_EE_mask_init();
#if DEBUG
printk("bsp_postdriver_hook: Finished procedure\n");
#endif
@@ -250,6 +252,9 @@ void bsp_start( void )
intrStackStart = (uint32_t) __rtems_end + INIT_STACK_SIZE;
intrStackSize = rtems_configuration_get_interrupt_stack_size();
BSP_heap_start = intrStackStart + intrStackSize;
+ printk("Interrupt Stack Start: 0x%x Size: 0x%x Heap Start: 0x%x\n",
+ intrStackStart, intrStackSize, BSP_heap_start
+ );
/*
* Initialize default raw exception handlers.
@@ -259,23 +264,10 @@ void bsp_start( void )
intrStackStart,
intrStackSize
);
- #if DEBUG
- printk("bsp_predriver_hook: init_RTC\n");
- #endif
-
-/* init_RTC(); */
- init_PCI();
- initialize_universe();
-
- #if DEBUG
- printk("bsp_predriver_hook: initialize_PCI_bridge\n");
- #endif
- initialize_PCI_bridge ();
msr_value = 0x2030;
_CPU_MSR_SET( msr_value );
-
_CPU_MSR_SET( msr_value );
/*
@@ -283,12 +275,9 @@ void bsp_start( void )
* tell the RTEMS configuration where it is. This memory is
* not malloc'ed. It is just "pulled from the air".
*/
-
- #if DEBUG
- printk("bsp_start: Calculate Wrokspace\n");
- #endif
work_space_start =
(unsigned char *)&RAM_END - rtems_configuration_get_work_space_size();
+ printk("Work Space Start: 0x%x\n", work_space_start );
if ( work_space_start <= (unsigned char *)&end ) {
printk( "bspstart: Not enough RAM!!!\n" );
@@ -305,24 +294,27 @@ void bsp_start( void )
#endif
bsp_clicks_per_usec = 66 / 4; /* XXX get from linkcmds */
-#if ( PPC_USE_DATA_CACHE )
- #if DEBUG
- printk("bsp_start: cache_enable\n");
- #endif
- instruction_cache_enable ();
- data_cache_enable ();
- #if DEBUG
- printk("bsp_start: END PPC_USE_DATA_CACHE\n");
+ #if ( PPC_USE_DATA_CACHE )
+ #if DEBUG
+ printk("bsp_start: cache_enable\n");
+ #endif
+ instruction_cache_enable ();
+ data_cache_enable ();
+ #if DEBUG
+ printk("bsp_start: END PPC_USE_DATA_CACHE\n");
+ #endif
#endif
-#endif
-
- /* Initalize interrupt support */
- if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
- BSP_panic( "Cannot intitialize interrupt support\n");
- }
+ /*
+ * Initalize RTEMS IRQ system
+ */
+ #if DEBUG
+ printk("bspstart: Call BSP_rtems_irq_mng_init\n");
+ #endif
+ BSP_rtems_irq_mng_init(0);
+
#if DEBUG
printk("bsp_start: end BSPSTART\n");
- ShowBATS();
+ ShowBATS();
#endif
}
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/genpvec.c b/c/src/lib/libbsp/powerpc/score603e/startup/genpvec.c
deleted file mode 100644
index 1b182f2204..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/startup/genpvec.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* genpvec.c
- *
- * These routines handle the external exception. Multiple ISRs occur off
- * of this one interrupt.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/chain.h>
-#include <rtems/bspIo.h>
-#include <assert.h>
-
-#include <stdio.h> /* for sprintf */
-
-/*
- * Proto types for this file
- */
-
-rtems_isr external_exception_ISR (
- rtems_vector_number vector /* IN */
-);
-
-#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
-{
- rtems_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];
- uint16_t Nodes_Used;
- rtems_chain_control ISR_Array [NUM_LIRQ];
-
-/* XXX */
-void init_irq_data_register(void);
-
-#if 0
-void initialize_external_exception_vector (void)
-{
- int i;
- rtems_isr_entry previous_isr;
- rtems_status_code status;
-
- Nodes_Used = 0;
-
- /*
- * Mask out all interupts until they have a handler installed.
- */
-
- for (i=0; i <NUM_LIRQ; i++)
- rtems_chain_initialize_empty( &ISR_Array[i] );
-
- init_irq_data_register();
-
- /*
- * 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 );
-}
-#endif
-
-void Init_EE_mask_init() {
-;
-}
-
-/*
- * This routine installs one of multiple ISRs for the general purpose
- * inerrupt.
- */
-rtems_isr_entry set_EE_vector(
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector /* vector number */
-)
-{
- uint16_t vec_idx = vector - Score_IRQ_First;
- uint32_t index;
-
- 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 NULL;
- }
-
- /*
- * Doing things in this order makes them more atomic
- */
-
- Nodes_Used++;
-
- index = Nodes_Used - 1;
-
- ISR_Nodes[index].handler = handler;
- ISR_Nodes[index].vector = vector;
-
- /* printf( "Vector Index: %04x, Vector: %d (%x)\n",
- vec_idx, vector, vector); */
-
- rtems_chain_append( &ISR_Array[vec_idx], &ISR_Nodes[index].Node );
-
- /*
- * Unmask the interrupt.
- */
- unmask_irq( vec_idx );
-
- return NULL;
-}
-
-/*
- * This interrupt service routine is called for an External Exception.
- */
-rtems_isr external_exception_ISR (
- rtems_vector_number vector /* IN */
-)
-{
- uint16_t index;
- EE_ISR_Type *node;
- uint16_t value;
-#if (HAS_PMC_PSC8)
- uint16_t PMC_irq;
- uint16_t check_irq;
- uint16_t status_word;
-#endif
-
- index = read_and_clear_irq();
- if ( index >= NUM_LIRQ ) {
- printk( "ERROR:: Invalid interrupt number (%02x)\n", index );
- return;
- }
-
-#if (HAS_PMC_PSC8)
- PMC_irq = SCORE603E_PCI_IRQ_0 - SCORE603E_IRQ00;
-
- if (index == PMC_irq) {
- status_word = read_and_clear_PMC_irq( index );
-
- for (check_irq=SCORE603E_IRQ16; check_irq<=SCORE603E_IRQ19; check_irq++) {
- if ( Is_PMC_IRQ( check_irq, status_word )) {
- index = check_irq - SCORE603E_IRQ00;
- node = (EE_ISR_Type *)(ISR_Array[ index ].first);
-
- if ( rtems_chain_is_tail( &ISR_Array[ index ], (void *)node ) ) {
- printk ("ERROR:: check %d interrupt %02d has no isr\n", check_irq, index);
- value = get_irq_mask();
- printk(" Mask = %02x\n", value);
- }
- while ( !rtems_chain_is_tail( &ISR_Array[ index ], (void *)node ) ) {
- (*node->handler)( node->vector );
- node = (EE_ISR_Type *) node->Node.next;
- }
- }
- }
- }
- else
-#endif
- {
- node = (EE_ISR_Type *)(ISR_Array[ index ].first);
- if ( rtems_chain_is_tail( &ISR_Array[ index ], (void *)node ) ) {
- printk( "ERROR:: interrupt %02x has no isr\n", index);
- value = get_irq_mask();
- printk(" Mask = %02x\n", value);
- return;
- }
- while ( !rtems_chain_is_tail( &ISR_Array[ index ], (void *)node ) ) {
- (*node->handler)( node->vector );
- node = (EE_ISR_Type *) node->Node.next;
- }
- }
-
-}
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/setvec.c b/c/src/lib/libbsp/powerpc/score603e/startup/setvec.c
deleted file mode 100644
index e6c5048a7c..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/startup/setvec.c
+++ /dev/null
@@ -1,70 +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
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * COPYRIGHT (c) 1995 by i-cubed ltd.
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies, and that the name of i-cubed limited not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * i-cubed limited makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id:
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-/*
- * This routine installs vector number 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/score603e/startup/vmeintr.c b/c/src/lib/libbsp/powerpc/score603e/startup/vmeintr.c
deleted file mode 100644
index db325333e5..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/startup/vmeintr.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* vmeintr.c
- *
- * VMEbus support routines for the Generation I board.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id:
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <rtems/vmeintr.h>
-
-/*PAGE
- *
- * VME_interrupt_Disable
- *
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile uint8_t *VME_interrupt_enable;
- uint8_t value;
-
- VME_interrupt_enable = 0;
- value = *VME_interrupt_enable;
- value &= ~mask; /* turn off interrupts for all levels in mask */
- *VME_interrupt_enable = value;
-}
-
-/*PAGE
- *
- * VME_interrupt_Enable
- *
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile uint8_t *VME_interrupt_enable;
- uint8_t value;
-
- VME_interrupt_enable = 0;
- 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/score603e/timer/timer.c b/c/src/lib/libbsp/powerpc/score603e/timer/timer.c
index 4e5c06c232..5566f4dc9c 100644
--- a/c/src/lib/libbsp/powerpc/score603e/timer/timer.c
+++ b/c/src/lib/libbsp/powerpc/score603e/timer/timer.c
@@ -7,11 +7,11 @@
* BSP_TIMER_AVG_OVERHEAD and BSP_TIMER_LEAST_VALID are required to be
* provided in bsp.h
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
+ * 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$
diff --git a/c/src/lib/libbsp/powerpc/score603e/tod/tod.c b/c/src/lib/libbsp/powerpc/score603e/tod/tod.c
index 1d2ab41851..3c2becd30b 100644
--- a/c/src/lib/libbsp/powerpc/score603e/tod/tod.c
+++ b/c/src/lib/libbsp/powerpc/score603e/tod/tod.c
@@ -3,6 +3,9 @@
*
* This part is found on the second generation of this board.
*
+ * COPYRIGHT (c) 1989-2009.
+ * 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.