summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/include
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2011-12-16 14:10:57 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:17 +0200
commit46e41c98b30e9084e8a706129a78327da27c22a4 (patch)
tree5101111e5fc61a31cabf9c1370a06aa98051f7ae /c/src/lib/libbsp/sparc/shared/include
parentLEON3: new Console driver, APBUART driver using Driver Manager (diff)
downloadrtems-46e41c98b30e9084e8a706129a78327da27c22a4.tar.bz2
LEON: replaced old BSP PCI layer with new generic libpci PCI layer
The old code used a limited PCI configuration library, which was duplicated into LEON2 and LEON3 BSP pci.c together with respective Host controller PCI interface. The LEON2 BSP had support for AT697 PCI, and LEON3 for GRPCI PCI Host controller. With this update new PCI Host drivers are added, and all support the new generic PCI Library: * AT697 PCI (LEON2 only) * GRPCI (LEON2-GRLIB and LEON3) * GRPCI2 (LEON2-GRLIB and LEON3) * Actel PCIF GRLIB Wrapper (LEON3 only) The LEON2 BSP is defined as big-endian PCI in bsp.h, since the AT697 supports only big-endian PCI.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/include')
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/grpci2.h61
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/pci.h56
2 files changed, 61 insertions, 56 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/include/grpci2.h b/c/src/lib/libbsp/sparc/shared/include/grpci2.h
new file mode 100644
index 0000000000..6316c7abb9
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/grpci2.h
@@ -0,0 +1,61 @@
+/* GRLIB GRPCI2 PCI HOST driver.
+ *
+ * COPYRIGHT (c) 2011
+ * Cobham Gaisler AB.
+ *
+ * The license and distribution terms for this file may be
+ * found in found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef __GRPCI2_H__
+#define __GRPCI2_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void grpci2_register_drv(void);
+
+/* Driver Resources:
+ *
+ * PCI Interrupts
+ * ==============
+ * The interrupt settings are normally autodetected from Plyg&Play, however
+ * if IRQs are routed using custom GPIO pins in order to reduce the PIN count
+ * reserved for PCI, the options below can be used to tell GRPCI2 driver which
+ * System IRQ a PCI interrupt is connected to.
+ * Name="INTA#", Type=INT, System Interrupt number that PCI INTA is connected to
+ * Name="INTB#", Type=INT, System Interrupt number that PCI INTB is connected to
+ * Name="INTC#", Type=INT, System Interrupt number that PCI INTC is connected to
+ * Name="INTD#", Type=INT, System Interrupt number that PCI INTD is connected to
+ *
+ * Name="IRQmask", Type=INT,
+ *
+ * PCI Bytetwisting (endianess)
+ * ============================
+ * Name="byteTwisting", Type=INT, Enable/Disable Bytetwisting by hardware
+ *
+ * PCI Host's Target BARs setup
+ * ============================
+ * The Host's BARs are not configured by the configuration routines, by default
+ * the BARs are configured disabled (BAR=0) except for BAR0 which is mapped to
+ * the Main Memory for the Host.
+ * Name="tgtBarCfg", Type=PTR (*grpci2_pcibar_cfg), Target PCI BARs of Host
+ */
+
+/* When the Host acts as a target on the PCI bus, the PCI BARs of the host's
+ * configuration space determine at which PCI address the Host will be accessed
+ * at and when accessing a BAR which AMBA address it will be translated to.
+ */
+struct grpci2_pcibar_cfg {
+ unsigned int pciadr; /* PCI address of BAR (BAR content) */
+ unsigned int ahbadr; /* 'pciadr' translated to this AHB Address */
+ unsigned int barsize; /* PCI BAR Size, must be a power of 2 */
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/c/src/lib/libbsp/sparc/shared/include/pci.h b/c/src/lib/libbsp/sparc/shared/include/pci.h
deleted file mode 100644
index bb7afd2d4d..0000000000
--- a/c/src/lib/libbsp/sparc/shared/include/pci.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file
- * @ingroup sparc_bsp
- * @defgroup pci PCI
- * @ingroup pci
- * @brief PCI defines and function prototypes
- */
-
-/*
- * Copyright 1994, Drew Eckhardt
- * Copyright 1997, 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
- *
- * For more information, please consult the following manuals (look at
- * http://www.pcisig.com/ for how to get them):
- *
- * PCI BIOS Specification
- * PCI Local Bus Specification
- * PCI to PCI Bridge Specification
- * PCI System Design Guide
- */
-
-#ifndef RTEMS_PCI_H
-#define RTEMS_PCI_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/pci.h>
-
-/*
- * Return the number of PCI busses in the system
- */
-extern unsigned char BusCountPCI(void);
-extern int init_pci(void);
-
-extern int dma_to_pci(unsigned int addr, unsigned int paddr, unsigned int len);
-extern int dma_from_pci(unsigned int addr, unsigned int paddr, unsigned int len);
-extern void pci_mem_enable(unsigned char bus, unsigned char slot, unsigned char function);
-extern void pci_master_enable(unsigned char bus, unsigned char slot, unsigned char function);
-
-/* scan for a specific device */
-/* find a particular PCI device
- * (currently, only bus0 is scanned for device/fun0)
- *
- * RETURNS: zero on success, bus/dev/fun in *pbus / *pdev / *pfun
- */
-int
-BSP_pciFindDevice(unsigned short vendorid, unsigned short deviceid,
- int instance, int *pbus, int *pdev, int *pfun);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* RTEMS_PCI_H */