summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/score603e/irq
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/powerpc/score603e/irq')
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c180
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/irq.c495
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/irq.h153
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c131
-rw-r--r--c/src/lib/libbsp/powerpc/score603e/irq/no_pic.c82
5 files changed, 0 insertions, 1041 deletions
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c b/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c
deleted file mode 100644
index 9c08d1d7de..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/irq/FPGA.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * FPGA.c -- Bridge for second and subsequent generations
- */
-
-/*
- * COPYRIGHT (c) 1989-2014.
- * 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.org/license/LICENSE.
- */
-
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <string.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include <rtems/libio.h>
-#include <rtems/libcsupport.h>
-#include <rtems/bspIo.h>
-
-/*
- * initialize FPGA
- */
-void initialize_PCI_bridge (void)
-{
- /* Note: Accept DINKs setup of the PCI Bridge and don't
- * change anything.
- */
-}
-
-void set_irq_mask(
- uint16_t value
-)
-{
- volatile uint16_t *loc;
-
- loc = (uint16_t*)SCORE603E_FPGA_MASK_DATA;
-
- *loc = value;
-}
-
-uint16_t get_irq_mask( void )
-{
- volatile uint16_t *loc;
- uint16_t value;
-
- loc = (uint16_t*)SCORE603E_FPGA_MASK_DATA;
-
- value = *loc;
-
- 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
-)
-{
- 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 init_irq_data_register(void)
-{
- uint32_t index;
- uint32_t i;
-
- set_irq_mask( 0xffff );
-
- /*
- * Clear any existing interupts from the vector data register.
- */
- for (i=0; i<20; i++) {
- index = (*SCORE603E_FPGA_VECT_DATA);
- if ( (index&0x10) != 0x10 )
- break;
- }
-}
-
-uint16_t read_and_clear_PMC_irq(
- uint16_t irq
-)
-{
- uint16_t status_word = irq;
-
- status_word = (*BSP_PMC_STATUS_ADDRESS);
-
- return status_word;
-}
-
-bool Is_PMC_IRQ(
- uint32_t pmc_irq,
- uint16_t status_word
-)
-{
- bool result = false;
-
- switch(pmc_irq) {
- case SCORE603E_85C30_4_IRQ:
- result = Is_PMC_85C30_4_IRQ( status_word ) ? true : false;
- break;
- case SCORE603E_85C30_2_IRQ:
- result = Is_PMC_85C30_2_IRQ( status_word ) ? true : false;
- break;
- case SCORE603E_85C30_5_IRQ:
- result = Is_PMC_85C30_5_IRQ( status_word ) ? true : false;
- break;
- case SCORE603E_85C30_3_IRQ:
- result = Is_PMC_85C30_3_IRQ( status_word ) ? true : false;
- break;
- default:
- assert( 0 );
- break;
- }
-
- return result;
-}
-
-uint16_t read_and_clear_irq(void)
-{
- uint16_t irq;
-
-
- irq = (*SCORE603E_FPGA_VECT_DATA);
- Processor_Synchronize();
- if ((irq & 0xffff0) != 0x10) {
- 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 431d0a94fb..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/irq/irq.c
+++ /dev/null
@@ -1,495 +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 the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#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/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;
-}
-
-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;
-}
-
-void bsp_interrupt_handler_default( rtems_vector_number vector )
-{
- if (vector != BSP_DECREMENTER) {
- printk( "Spurious interrupt: 0x%08x\n", vector);
- }
-}
-
diff --git a/c/src/lib/libbsp/powerpc/score603e/irq/irq.h b/c/src/lib/libbsp/powerpc/score603e/irq/irq.h
deleted file mode 100644
index 97977a75e7..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/irq/irq.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* irq.h
- *
- * This include file describe the data structure and the functions implemented
- * by RTEMS to write interrupt handlers.
- *
- * 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
- * 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 the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#ifndef BSP_POWERPC_IRQ_H
-#define BSP_POWERPC_IRQ_H
-
-#define BSP_SHARED_HANDLER_SUPPORT 1
-#include <rtems/irq.h>
-
-#ifndef ASM
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
- * rtems_irq_number Definitions
- */
-
-/*
- * ISA IRQ handler related definitions
- */
-#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
- */
-#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_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)
-#define BSP_MISC_IRQ_LOWEST_OFFSET (BSP_PROCESSOR_IRQ_MAX_OFFSET + 1)
-#define BSP_MISC_IRQ_MAX_OFFSET (BSP_MISC_IRQ_LOWEST_OFFSET + BSP_MISC_IRQ_NUMBER - 1)
-/*
- * Summary
- */
-#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 Processor execption handled as RTEMS IRQ symbolic name definition
- */
-#define BSP_DECREMENTER (BSP_PROCESSOR_IRQ_LOWEST_OFFSET)
-
-/*
- * First Score Unique IRQ
- */
-#define Score_IRQ_First ( BSP_PCI_IRQ_LOWEST_OFFSET )
-
-/*
- * 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
-
-extern void BSP_rtems_irq_mng_init(unsigned cpuId);
-
-#ifdef __cplusplus
-}
-#endif
-
-#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
deleted file mode 100644
index 25128ad214..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* irq_init.c
- *
- * This file contains the implementation of rtems initialization
- * related to interrupt handling.
- *
- * CopyRight (C) 1999 valette@crf.canon.fr
- *
- * Enhanced by Jay Kulpinski <jskulpin@eng01.gdds.com>
- * to make it valid for MVME2300 Motorola boards.
- *
- * Till Straumann <strauman@slac.stanford.edu>, 12/20/2001:
- * Use the new interface to openpic_init
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#include <libcpu/io.h>
-#include <libcpu/spr.h>
-#include <bsp/pci.h>
-#include <bsp/residual.h>
-#include <bsp/irq.h>
-#include <bsp.h>
-#include <bsp/vectors.h>
-#include <rtems/bspIo.h>
-
-#define SHOW_ISA_PCI_BRIDGE_SETTINGS 1
-#define SCAN_PCI_PRINT 1
-#define TRACE_IRQ_INIT 0
-
-typedef struct {
- unsigned char bus; /* few chance the PCI/ISA bridge is not on first bus but ... */
- unsigned char device;
- unsigned char function;
-} pci_isa_bridge_device;
-
-pci_isa_bridge_device* via_82c586 = 0;
-
-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);
-
-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 = {
- .name = 0,
- .hdl = IRQ_Default_rtems_irq_hdl,
- .handle = NULL,
- .on = IRQ_Default_rtems_irq_enable,
- .on = IRQ_Default_rtems_irq_disable,
- .isOn = IRQ_Default_rtems_irq_is_enabled
-};
-
-static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER];
-
- /*
- * This code assumes the exceptions management setup has already
- * been done. We just need to replace the exceptions that will
- * be handled like interrupt. On mcp750/mpc750 and many PPC processors
- * this means the decrementer exception and the external exception.
- */
-void BSP_rtems_irq_mng_init(unsigned cpuId)
-{
- int i;
-
- /*
- * First initialize the Interrupt management hardware
- */
-
- /*
- * Initialize RTEMS management interrupt table
- */
- /*
- * 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
- */
- initial_config.irqNb = BSP_IRQ_NUMBER;
- initial_config.defaultEntry = defaultIrq;
- initial_config.irqHdlTbl = rtemsIrq;
- initial_config.irqBase = BSP_LOWEST_OFFSET;
- initial_config.irqPrioTbl = irqPrioTable;
-
- if (!BSP_rtems_irq_mngt_set(&initial_config)) {
- /*
- * put something here that will show the failure...
- */
- BSP_panic("Unable to initialize RTEMS interrupt Management!!! System locked\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
deleted file mode 100644
index 37b9ca62af..0000000000
--- a/c/src/lib/libbsp/powerpc/score603e/irq/no_pic.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * 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.org/license/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <bsp/irq_supp.h>
-#include <bsp/vectors.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(
- 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;
-}