summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2013-11-22 10:22:56 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2013-11-22 10:22:56 +0100
commitfc9df7d5a2fcbabcb386f144921be364300d5ed0 (patch)
tree0bbb62b576db821003e60422317a27cdc18da79e
parent646a3b8ccec627d7080c1100a3efd00b2d0e87fe (diff)
AT697 PCI: abort whhen a peripheral PCI system detected
-rw-r--r--c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c b/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c
index f89b157e22..b5f04fded2 100644
--- a/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c
+++ b/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c
@@ -442,6 +442,13 @@ int at697pci_hw_init(struct at697pci_priv *priv)
return -1;
}
+ /* If not in system slot we are not host and we must abort.
+ * This is a host only driver.
+ */
+ if ((regs->pciis & 0x1000) != 0) {
+ return -1;
+ }
+
/* Reset PCI Core */
regs->pciic = 0xffffffff;
@@ -580,7 +587,7 @@ int at697pci_init1(struct drvmgr_dev *dev)
if (at697pci_init(priv)) {
DBG("Failed to initialize at697pci driver\n");
- return DRVMGR_FAIL;
+ return DRVMGR_EIO;
}
/* Host is always Big-Endian */