source: rtems/c/src/lib/libbsp/sparc/leon3/include/amba.h @ ad6a58d

4.104.114.84.95
Last change on this file since ad6a58d was ad6a58d, checked in by Joel Sherrill <joel.sherrill@…>, on 07/12/06 at 20:57:29

2006-07-12 Jerry Needell <jerry.needell@…>

  • amba/amba.c, clock/ckinit.c, include/amba.h, timer/timer.c: Search for the Timer Register when initializing the amba rather than before each potential use.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  AMBA Plag & Play Bus Driver Macros
3 *
4 *  Macros used for AMBA Plug & Play 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<<<<<<< amba.h
14 *  $Id$
15=======
16 *  $Id$
17>>>>>>> 1.3
18 */
19
20#define LEON3_IO_AREA 0xfff00000
21#define LEON3_CONF_AREA 0xff000
22#define LEON3_AHB_SLAVE_CONF_AREA (1 << 11)
23
24#define LEON3_AHB_CONF_WORDS 8
25#define LEON3_APB_CONF_WORDS 2
26#define LEON3_AHB_MASTERS 64
27#define LEON3_AHB_SLAVES 64
28#define LEON3_APB_SLAVES 16
29#define LEON3_APBUARTS 8
30
31/* Vendor codes */
32#define VENDOR_GAISLER   1
33#define VENDOR_PENDER    2
34#define VENDOR_ESA       4
35#define VENDOR_OPENCORES 8
36
37/* Gaisler Research device id's */
38#define GAISLER_LEON3    0x03
39#define GAISLER_LEON3DSU 0x04
40#define GAISLER_ETHAHB   0x05
41#define GAISLER_APBMST   0x06
42#define GAISLER_AHBUART  0x07
43#define GAISLER_SRCTRL   0x08
44#define GAISLER_SDCTRL   0x09
45#define GAISLER_APBUART  0x0C
46#define GAISLER_IRQMP    0x0D
47#define GAISLER_AHBRAM   0x0E
48#define GAISLER_GPTIMER  0x11
49#define GAISLER_PCITRG   0x12
50#define GAISLER_PCISBRG  0x13
51#define GAISLER_PCIFBRG  0x14
52#define GAISLER_PCITRACE 0x15
53#define GAISLER_DMACTRL  0x16
54#define GAISLER_PIOPORT  0x1A
55#define GAISLER_ETHMAC   0x1D
56 
57#define GAISLER_SPACEWIRE 0x01f
58
59/* European Space Agency device id's */
60#define ESA_LEON2        0x2
61#define ESA_MCTRL        0xF
62
63/* Opencores device id's */
64#define OPENCORES_PCIBR  0x4 
65#define OPENCORES_ETHMAC 0x5
66
67
68/*
69 *
70 * Macros for manipulating Configuration registers 
71 *
72 */
73
74
75#define amba_get_confword(tab, index, word) (*((tab).addr[(index)]+(word)))
76
77#define amba_vendor(x) (((x) >> 24) & 0xff)
78
79#define amba_device(x) (((x) >> 12) & 0xfff)
80
81#define amba_ahb_get_membar(tab, index, nr) (*((tab).addr[(index)]+4+(nr)))
82
83#define amba_apb_get_membar(tab, index) (*((tab).addr[(index)]+1))
84
85#define amba_membar_start(mbar) (((mbar) & 0xfff00000) & (((mbar) & 0xfff0) << 16))
86
87#define amba_iobar_start(base, iobar) ((base) | ((((iobar) & 0xfff00000)>>12) & (((iobar) & 0xfff0)<<4)) )
88
89#define amba_irq(conf) ((conf) & 0xf)
90
91
Note: See TracBrowser for help on using the repository browser.