source: rtems/c/src/lib/libbsp/powerpc/psim/irq/irq_init.c @ b094233

4.104.115
Last change on this file since b094233 was b094233, checked in by Till Straumann <strauman@…>, on Sep 11, 2009 at 5:13:42 PM

2009-09-11 Till Straumann <strauman@…>

  • Makefile.am, preinstall.am, irq/no_pic.c (REMOVED), irq/irq.h, irq/irq_init.c: use openpic from 'shared' area instead of no_pic.
  • inlude/psim.h: use openpic from 'shared' area instead of no_pic. Added 'extern' declaration for (linker-script defined) RamBase? and RamSize? symbols. Let CPP macros expand to these symbols instead of static constants. Added register definitions for OpenPIC in the register area. Added register definitions for ethernet controller in the register area.
  • startup/linkcmds: Increased RamSize? to 16M. Increased 'RAM' memory region to 32M (there is really no disadvantage in making this large). Added comment explaining the inter-relation between RamSize?, the size of the memory region, the device-tree property "oea-memory-size" and the DBAT setting.
  • tools/psim-shared: Try to determine RamSize? from executable and set 'oea-memory-size' accordingly. May be overridden if 'RAM_SIZE' envvar is set. Added openpic to device-tree. Added ethernet controller to device-tree (commented because a PSIM patch is currently required to use this device).
  • startup/bspstart: Increase DBAT0 mapping to size of 32M.
  • Property mode set to 100644
File size: 2.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 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  irq_init.c,v 1.6.2.5 2003/09/04 18:45:20 joel Exp
16 */
17
18#include <libcpu/io.h>
19#include <libcpu/spr.h>
20#include <bsp/irq.h>
21#include <bsp.h>
22#include <psim.h>
23#include <libcpu/raw_exception.h>
24#include <rtems/bspIo.h>
25#include <bsp/openpic.h>
26
27static rtems_irq_connect_data      rtemsIrq[BSP_IRQ_NUMBER];
28static rtems_irq_global_settings   initial_config;
29static rtems_irq_connect_data      defaultIrq = {
30  /* vectorIdex, hdl  , handle  , on  , off , isOn */
31      0,          NULL, NULL    , NULL, NULL, NULL
32};
33static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER]={
34  /*
35   * Processor exceptions handled as interrupts
36   */
37  0
38};
39
40  /*
41   * This code assumes the exceptions management setup has already
42   * been done. We just need to replace the exceptions that will
43   * be handled like interrupt. On mcp750/mpc750 and many PPC processors
44   * this means the decrementer exception and the external exception.
45   */
46void BSP_rtems_irq_mng_init(unsigned cpuId)
47{
48  int i;
49 
50  /*
51   * First initialize the Interrupt management hardware
52   */
53  OpenPIC = (void*)PSIM.OpenPIC;
54  openpic_init(1,0,0,16,0,0);
55
56  /*
57   * Initialize Rtems management interrupt table
58   */
59  /*
60   * re-init the rtemsIrq table
61   */
62  for (i = 0; i < BSP_IRQ_NUMBER; i++) {
63    rtemsIrq[i]      = defaultIrq;
64    rtemsIrq[i].name = i;
65  }
66  /*
67   * Init initial Interrupt management config
68   */
69  initial_config.irqNb        = BSP_IRQ_NUMBER;
70  initial_config.defaultEntry = defaultIrq;
71  initial_config.irqHdlTbl    = rtemsIrq;
72  initial_config.irqBase      = BSP_LOWEST_OFFSET;
73  initial_config.irqPrioTbl   = irqPrioTable;
74
75  for (i = BSP_PCI_IRQ_LOWEST_OFFSET; i< BSP_PCI_IRQ_NUMBER; i++ ) {
76        irqPrioTable[i] = 8;
77  }
78
79  if (!BSP_rtems_irq_mngt_set(&initial_config)) {
80    /*
81     * put something here that will show the failure...
82     */
83    BSP_panic(
84      "Unable to initialize RTEMS interrupt Management!!! System locked\n"
85    );
86  }
87 
88  #ifdef TRACE_IRQ_INIT 
89    printk("RTEMS IRQ management is now operationnal\n");
90  #endif
91}
Note: See TracBrowser for help on using the repository browser.