summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/include/amba.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 00:01:30 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 00:01:30 +0000
commit1982a1957492daa80511504c955d765386c31055 (patch)
treea1758de0e0d2f2a2e858a8047b4514e2359a2875 /c/src/lib/libbsp/sparc/leon3/include/amba.h
parent2007-09-05 Daniel Hellstrom <daniel@gaisler.com> (diff)
downloadrtems-1982a1957492daa80511504c955d765386c31055.tar.bz2
2007-09-05 Daniel Hellstrom <daniel@gaisler.com>
* Makefile.am, preinstall.am, amba/amba.c, include/amba.h, include/leon.h: LEON3 AMBA PnP bus scanning moved to shared/amba/amba.c and shared/include/ambapp.h. The AMBA scanning was improved to take account for PnP info address translation. This is useful when scanning remote AMBA busses for example when a board connected with PCI has an AMBA bus that needs to be scanned, before the addresses was hard coded. Also, LEON2 now have AMBA PnP bus scanning support. By using the new AMBA scanning routines it is possible to isolate the AMBA scanning code to ambapp.c, however existing drivers should be updated to use them in order to save space.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/amba.h70
1 files changed, 13 insertions, 57 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/include/amba.h b/c/src/lib/libbsp/sparc/leon3/include/amba.h
index fb98df9582..9167ff111f 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/amba.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/amba.h
@@ -13,6 +13,9 @@
* $Id$
*/
+#ifndef __AMBA_H__
+#define __AMBA_H__
+
#define LEON3_IO_AREA 0xfff00000
#define LEON3_CONF_AREA 0xff000
#define LEON3_AHB_SLAVE_CONF_AREA (1 << 11)
@@ -24,64 +27,17 @@
#define LEON3_APB_SLAVES 16
#define LEON3_APBUARTS 8
-/* Vendor codes */
-#define VENDOR_GAISLER 1
-#define VENDOR_PENDER 2
-#define VENDOR_ESA 4
-#define VENDOR_OPENCORES 8
-
-/* Gaisler Research device id's */
-#define GAISLER_LEON3 0x03
-#define GAISLER_LEON3DSU 0x04
-#define GAISLER_ETHAHB 0x05
-#define GAISLER_APBMST 0x06
-#define GAISLER_AHBUART 0x07
-#define GAISLER_SRCTRL 0x08
-#define GAISLER_SDCTRL 0x09
-#define GAISLER_APBUART 0x0C
-#define GAISLER_IRQMP 0x0D
-#define GAISLER_AHBRAM 0x0E
-#define GAISLER_GPTIMER 0x11
-#define GAISLER_PCITRG 0x12
-#define GAISLER_PCISBRG 0x13
-#define GAISLER_PCIFBRG 0x14
-#define GAISLER_PCITRACE 0x15
-#define GAISLER_DMACTRL 0x16
-#define GAISLER_PIOPORT 0x1A
-#define GAISLER_ETHMAC 0x1D
-
-#define GAISLER_SPACEWIRE 0x01f
-
-/* European Space Agency device id's */
-#define ESA_LEON2 0x2
-#define ESA_MCTRL 0xF
-
-/* Opencores device id's */
-#define OPENCORES_PCIBR 0x4
-#define OPENCORES_ETHMAC 0x5
-
-
-/*
- *
- * Macros for manipulating Configuration registers
- *
- */
-
-
-#define amba_get_confword(tab, index, word) (*((tab).addr[(index)]+(word)))
-
-#define amba_vendor(x) (((x) >> 24) & 0xff)
-
-#define amba_device(x) (((x) >> 12) & 0xfff)
-
-#define amba_ahb_get_membar(tab, index, nr) (*((tab).addr[(index)]+4+(nr)))
-
-#define amba_apb_get_membar(tab, index) (*((tab).addr[(index)]+1))
-
-#define amba_membar_start(mbar) (((mbar) & 0xfff00000) & (((mbar) & 0xfff0) << 16))
+#include <ambapp.h>
-#define amba_iobar_start(base, iobar) ((base) | ((((iobar) & 0xfff00000)>>12) & (((iobar) & 0xfff0)<<4)) )
+#ifdef __cplusplus
+extern "C" {
+#endif
-#define amba_irq(conf) ((conf) & 0xf)
+/* The AMBA Plug&Play info of the bus that the LEON3 sits on */
+extern amba_confarea_type amba_conf;
+#ifdef __cplusplus
+}
+#endif
+#endif /* __AMBA_H__ */