diff options
author | 2015-02-09 23:37:16 +0000 | |
---|---|---|
committer | 2015-02-09 23:37:16 +0000 | |
commit | c3c20e4563ef38f4e932387be660a3096181b925 (patch) | |
tree | 2b9b7cdeb320395a4561c286dbc54ade69546189 | |
parent | convert a dozen fprintf/exit pairs to use err(). (diff) | |
download | wireguard-openbsd-c3c20e4563ef38f4e932387be660a3096181b925.tar.xz wireguard-openbsd-c3c20e4563ef38f4e932387be660a3096181b925.zip |
Add a quirk to find the AGP bridge on PowerMac7,2 and PowerMac7,3 which
is not present in the device-tree.
ok kettenis@
-rw-r--r-- | sys/arch/macppc/pci/pci_machdep.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/macppc/pci/pci_machdep.c b/sys/arch/macppc/pci/pci_machdep.c index de15b56c205..7936277a27b 100644 --- a/sys/arch/macppc/pci/pci_machdep.c +++ b/sys/arch/macppc/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.4 2015/01/24 20:59:42 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.5 2015/02/09 23:37:16 mpi Exp $ */ /* * Copyright (c) 2013 Martin Pieuchot @@ -254,7 +254,8 @@ ofw_enumerate_pcibus(struct pci_softc *sc, { pci_chipset_tag_t pc = sc->sc_pc; struct ofw_pci_register reg; - int node, b, d, f, ret; + int len, node, b, d, f, ret; + char compat[32]; pcireg_t bhlcr; pcitag_t tag; @@ -263,6 +264,15 @@ ofw_enumerate_pcibus(struct pci_softc *sc, else node = pc->pc_node; + /* The AGP bridge is not in the device-tree. */ + len = OF_getprop(node, "compatible", compat, sizeof(compat)); + if (len > 0 && strcmp(compat, "u3-agp") == 0) { + tag = PCITAG_CREATE(0, sc->sc_bus, 11, 0); + ret = pci_probe_device(sc, tag, match, pap); + if (match != NULL && ret != 0) + return (ret); + } + for (node = OF_child(node); node; node = OF_peer(node)) { if (OF_getprop(node, "reg", ®, sizeof(reg)) < sizeof(reg)) continue; |