source: rtems/c/src/lib/libbsp/sparc/leon3/amba/amba.c @ 95518e59

4.115
Last change on this file since 95518e59 was 95518e59, checked in by Daniel Hellstrom <daniel@…>, on 04/06/12 at 10:05:07

SPARC BSPs: implemented shared-irq using libbsp/shared layer

The implementation use IRQ number instead of vector number since
some IRQs does not have a unique vector, for example the extended
interrupts all enter the same trap vector entry.

Added support for the LEON3 extended interrupt controller when using
the shared IRQ layer.

ERC32 patches untested.

Signed-off-by: Daniel Hellstrom <daniel@…>

Regenerate

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  AMBA Plag & Play Bus Driver
3 *
4 *  This driver hook performs bus scanning.
5 *
6 *  COPYRIGHT (c) 2004.
7 *  Gaisler Research
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#include <bsp.h>
17
18/* Structure containing address to devices found on the Amba Plug&Play bus */
19amba_confarea_type amba_conf;
20
21/* GRLIB extended IRQ controller register */
22extern void leon3_ext_irq_init(void);
23
24/* Pointers to Interrupt Controller configuration registers */
25volatile LEON3_IrqCtrl_Regs_Map *LEON3_IrqCtrl_Regs;
26
27/*
28 *  amba_initialize
29 *
30 *  Must be called just before drivers are initialized.
31 *  Used to scan system bus. Probes for AHB masters, AHB slaves and
32 *  APB slaves. Addresses to configuration areas of the AHB masters,
33 *  AHB slaves, APB slaves and APB master are storeds in
34 *  amba_ahb_masters, amba_ahb_slaves and amba.
35 */
36
37extern int scan_uarts(void);
38
39void amba_initialize(void)
40{
41  int i;
42  amba_apb_device dev;
43
44  /* Scan the AMBA Plug&Play info at the default LEON3 area */
45  amba_scan(&amba_conf,LEON3_IO_AREA,NULL);
46
47  /* Find LEON3 Interrupt controler */
48  i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev);
49  if ( i > 0 ){
50    /* Found APB IRQ_MP Interrupt Controller */
51    LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
52  }
53
54  /* Init Extended IRQ controller if available */
55  leon3_ext_irq_init();
56
57  /* find GP Timer */
58  i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev);
59  if ( i > 0 ){
60    LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start;
61  }
62
63  /* find UARTS */
64  scan_uarts();
65}
Note: See TracBrowser for help on using the repository browser.