source: rtems/c/src/lib/libbsp/sparc/leon3/amba/amba.c @ 54a169db

4.115
Last change on this file since 54a169db was 54a169db, checked in by Daniel Hellstrom <daniel@…>, on 02/02/12 at 14:46:26

LEON3: CPU index intialization moved to bspstart.c

PR 2009/bsps

All LEON3/4 systems have a CPU-id, if on a single-CPU system the
ID is always zero. On a multicore system it ranges from 0 to 15.

The CPU index should always by updated even in a non-MP RTEMS OS
since the CPU running RTEMS may not always be CPU0. For example
when RTEMS runs on CPU1 and Linux on CPU0 in a mixed ASMP system.

The old code executed within the IRQ controller initialization code
makes no sense since the ASR register is a CPU register, it has
nothing to do with AMBA initialization either.

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

  • Property mode set to 100644
File size: 1.5 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/* Pointers to Interrupt Controller configuration registers */
22volatile LEON3_IrqCtrl_Regs_Map *LEON3_IrqCtrl_Regs;
23
24/*
25 *  amba_initialize
26 *
27 *  Must be called just before drivers are initialized.
28 *  Used to scan system bus. Probes for AHB masters, AHB slaves and
29 *  APB slaves. Addresses to configuration areas of the AHB masters,
30 *  AHB slaves, APB slaves and APB master are storeds in
31 *  amba_ahb_masters, amba_ahb_slaves and amba.
32 */
33
34extern int scan_uarts(void);
35
36void amba_initialize(void)
37{
38  int i;
39  amba_apb_device dev;
40
41  /* Scan the AMBA Plug&Play info at the default LEON3 area */
42  amba_scan(&amba_conf,LEON3_IO_AREA,NULL);
43
44  /* Find LEON3 Interrupt controler */
45  i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev);
46  if ( i > 0 ){
47    /* Found APB IRQ_MP Interrupt Controller */
48    LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
49  }
50
51  /* find GP Timer */
52  i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev);
53  if ( i > 0 ){
54    LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start;
55  }
56
57  /* find UARTS */
58  scan_uarts();
59}
Note: See TracBrowser for help on using the repository browser.