diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2010-01-29 20:37:12 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2010-01-29 20:37:12 +0000 |
commit | 8429f8e8f432853c0dfa4e4d5eaa6d5e803190f6 (patch) | |
tree | 5b014206bca870c7e4135d083d7c7f280bce4c99 /sys/powerpc | |
parent | 41c2274481e9402a537556cc60f64b26e7aa6565 (diff) | |
download | src-test2-8429f8e8f432853c0dfa4e4d5eaa6d5e803190f6.tar.gz src-test2-8429f8e8f432853c0dfa4e4d5eaa6d5e803190f6.zip |
Notes
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/mpc85xx/pci_ocp.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/sys/powerpc/mpc85xx/pci_ocp.c b/sys/powerpc/mpc85xx/pci_ocp.c index 4fe4fbcb5773..00aa9da65473 100644 --- a/sys/powerpc/mpc85xx/pci_ocp.c +++ b/sys/powerpc/mpc85xx/pci_ocp.c @@ -297,7 +297,7 @@ pci_ocp_probe(device_t dev) { char buf[128]; struct pci_ocp_softc *sc; - const char *mpcid, *type; + const char *type; device_t parent; u_long start, size; uintptr_t devtype; @@ -327,33 +327,18 @@ pci_ocp_probe(device_t dev) cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_VENDOR, 2); if (cfgreg != 0x1057 && cfgreg != 0x1957) goto out; - cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_DEVICE, 2); - switch (cfgreg) { - case 0x000a: - mpcid = "8555E"; - break; - case 0x0012: - mpcid = "8548E"; - break; - case 0x0013: - mpcid = "8548"; - break; - /* - * Documentation from Freescale is incorrect. - * Use right values after documentation is corrected. - */ - case 0x0030: - mpcid = "8544E"; - break; - case 0x0031: - mpcid = "8544"; - break; - case 0x0032: - mpcid = "8544"; - break; - default: + + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_CLASS, 1); + if (cfgreg != PCIC_PROCESSOR) + goto out; + + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_SUBCLASS, 1); + if (cfgreg != PCIS_PROCESSOR_POWERPC) + goto out; + + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_PROGIF, 1); + if (cfgreg != 0) /* RC mode = 0, EP mode = 1 */ goto out; - } type = "PCI"; cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_CAP_PTR, 1); @@ -376,7 +361,7 @@ pci_ocp_probe(device_t dev) goto out; snprintf(buf, sizeof(buf), - "Freescale MPC%s %s host controller", mpcid, type); + "Freescale on-chip %s host controller", type); device_set_desc_copy(dev, buf); error = BUS_PROBE_DEFAULT; |