source: rtems/c/src/lib/libbsp/powerpc/score603e/irq/irq_init.c @ 31a5ec8

4.9
Last change on this file since 31a5ec8 was 31a5ec8, checked in by Jennifer Averett <Jennifer.Averett@…>, on May 5, 2009 at 4:18:06 PM

2009-05-05 Jennifer Averett <jennifer.averett@…>

  • 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.
  • Property mode set to 100644
File size: 3.4 KB
Line 
1/* irq_init.c
2 *
3 *  This file contains the implementation of rtems initialization
4 *  related to interrupt handling.
5 *
6 *  CopyRight (C) 1999 valette@crf.canon.fr
7 *
8 * Enhanced by Jay Kulpinski <jskulpin@eng01.gdds.com>
9 * to make it valid for MVME2300 Motorola boards.
10 *
11 * Till Straumann <strauman@slac.stanford.edu>, 12/20/2001:
12 * Use the new interface to openpic_init
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#include <libcpu/io.h>
22#include <libcpu/spr.h>
23#include <bsp/pci.h>
24#include <bsp/residual.h>
25#include <bsp/irq.h>
26#include <bsp.h>
27#include <libcpu/raw_exception.h>
28#include <rtems/bspIo.h>
29
30#define SHOW_ISA_PCI_BRIDGE_SETTINGS 1
31#define SCAN_PCI_PRINT               1
32#define TRACE_IRQ_INIT               0
33
34typedef struct {
35  unsigned char bus;    /* few chance the PCI/ISA bridge is not on first bus but ... */
36  unsigned char device;
37  unsigned char function;
38} pci_isa_bridge_device;
39
40pci_isa_bridge_device* via_82c586 = 0;
41
42extern unsigned int external_exception_vector_prolog_code_size[];
43extern void external_exception_vector_prolog_code(void);
44extern unsigned int decrementer_exception_vector_prolog_code_size[];
45extern void decrementer_exception_vector_prolog_code(void);
46
47static void IRQ_Default_rtems_irq_hdl( rtems_irq_hdl_param ptr ) {}
48static void IRQ_Default_rtems_irq_enable (const struct __rtems_irq_connect_data__ *ptr){}
49static void IRQ_Default_rtems_irq_disable(const struct __rtems_irq_connect_data__ *ptr){}
50static int  IRQ_Default_rtems_irq_is_enabled(const struct __rtems_irq_connect_data__ *ptr){ return 1; }
51
52static rtems_irq_connect_data           rtemsIrq[BSP_IRQ_NUMBER];
53static rtems_irq_global_settings        initial_config;
54
55static rtems_irq_connect_data           defaultIrq = {
56/*name,  hdl                            handle  on                              off                             isOn */
57  0,     IRQ_Default_rtems_irq_hdl,     NULL,   IRQ_Default_rtems_irq_enable,   IRQ_Default_rtems_irq_disable,  IRQ_Default_rtems_irq_is_enabled
58};
59
60static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER];
61
62  /*
63   * This code assumes the exceptions management setup has already
64   * been done. We just need to replace the exceptions that will
65   * be handled like interrupt. On mcp750/mpc750 and many PPC processors
66   * this means the decrementer exception and the external exception.
67   */
68void BSP_rtems_irq_mng_init(unsigned cpuId)
69{
70  int i;
71
72  /*
73   * First initialize the Interrupt management hardware
74   */
75
76  /*
77   * Initialize RTEMS management interrupt table
78   */
79    /*
80     * re-init the rtemsIrq table
81     */
82    for (i = 0; i < BSP_IRQ_NUMBER; i++) {
83      irqPrioTable[i]  = 8;
84      rtemsIrq[i]      = defaultIrq;
85      rtemsIrq[i].name = i;
86#ifdef BSP_SHARED_HANDLER_SUPPORT
87      rtemsIrq[i].next_handler = NULL;
88#endif
89    }
90
91    /*
92     * Init initial Interrupt management config
93     */
94    initial_config.irqNb        = BSP_IRQ_NUMBER;
95    initial_config.defaultEntry = defaultIrq;
96    initial_config.irqHdlTbl    = rtemsIrq;
97    initial_config.irqBase      = BSP_LOWEST_OFFSET;
98    initial_config.irqPrioTbl   = irqPrioTable;
99
100    if (!BSP_rtems_irq_mngt_set(&initial_config)) {
101      /*
102       * put something here that will show the failure...
103       */
104      BSP_panic("Unable to initialize RTEMS interrupt Management!!! System locked\n");
105    }
106
107#ifdef TRACE_IRQ_INIT
108    printk("RTEMS IRQ management is now operational\n");
109#endif
110}
Note: See TracBrowser for help on using the repository browser.