diff options
author | Stephen Hanson <Stephen.Hanson@Sun.COM> | 2010-04-01 05:05:27 -0700 |
---|---|---|
committer | Stephen Hanson <Stephen.Hanson@Sun.COM> | 2010-04-01 05:05:27 -0700 |
commit | 0db3240d392634cfff2f95fb6da34b56b8dc574f (patch) | |
tree | 72c18919b66de72acc76b19c55f911717001b0db /usr/src/uts/intel/io | |
parent | 44a7f51c1ec458963aa49ac450587ddf2af6e4c4 (diff) | |
download | illumos-gate-0db3240d392634cfff2f95fb6da34b56b8dc574f.tar.gz |
6688291 PCI-E slot number of 0 should be respected
6688321 pci enumerator should use SMBIOS for slot labels when available
6813504 IRQ routing table is more reliable than pcie slotcap register for giving slot labels
6813507 need to override incorrect slot-names property on Sun-Fire-X4600-M2 and Sun-Fire-X4600
6813522 need to override incorrect slot-names property on X2200-M2 and X2100-M2
6902034 pci_label_missing_lookup() relies on bus enumeration being invariant
6902039 pci_label_missing_lookup() mechanism can't be used if we already have a bogus slot name/num
6938519 hostbridge instance number incorect when using pci_label_missing_lookup()
Diffstat (limited to 'usr/src/uts/intel/io')
-rw-r--r-- | usr/src/uts/intel/io/pci/pci_boot.c | 34 | ||||
-rw-r--r-- | usr/src/uts/intel/io/pciex/pcie_nvidia.c | 12 | ||||
-rw-r--r-- | usr/src/uts/intel/io/pciex/pcie_nvidia.h | 5 |
3 files changed, 34 insertions, 17 deletions
diff --git a/usr/src/uts/intel/io/pci/pci_boot.c b/usr/src/uts/intel/io/pci/pci_boot.c index d0e5f821b1..850a5124d6 100644 --- a/usr/src/uts/intel/io/pci/pci_boot.c +++ b/usr/src/uts/intel/io/pci/pci_boot.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/types.h> @@ -1876,6 +1875,7 @@ process_devfunc(uchar_t bus, uchar_t dev, uchar_t func, uchar_t header, int pciex = 0; ushort_t is_pci_bridge = 0; struct pci_devfunc *devlist = NULL, *entry = NULL; + boolean_t slot_valid; gfx_entry_t *gfxp; pcie_req_id_t bdf; @@ -1935,8 +1935,8 @@ process_devfunc(uchar_t bus, uchar_t dev, uchar_t func, uchar_t header, ndi_devi_alloc_sleep(pci_bus_res[bus].dip, nodename, DEVI_SID_NODEID, &dip); - if (check_if_device_is_pciex(dip, bus, dev, func, &slot_num, - &is_pci_bridge) == B_TRUE) + if (check_if_device_is_pciex(dip, bus, dev, func, &slot_valid, + &slot_num, &is_pci_bridge) == B_TRUE) pciex = 1; bdf = PCI_GETBDF(bus, dev, func); @@ -2028,7 +2028,7 @@ process_devfunc(uchar_t bus, uchar_t dev, uchar_t func, uchar_t header, if (status & PCI_STAT_UDF) (void) ndi_prop_create_boolean(DDI_DEV_T_NONE, dip, "udf-supported"); - if (pciex && slot_num) { + if (pciex && slot_valid) { (void) ndi_prop_update_int(DDI_DEV_T_NONE, dip, "physical-slot#", slot_num); if (!is_pci_bridge) @@ -3041,12 +3041,28 @@ add_bus_slot_names_prop(int bus) { char slotprop[256]; int len; + extern int pci_irq_nroutes; + char *slotcap_name; + /* + * If no irq routing table, then go with the slot-names as set up + * in pciex_slot_names_prop() from slot capability register (if any). + */ + if (pci_irq_nroutes == 0) + return; + + /* + * Otherise delete the slot-names we already have and use the irq + * routing table values as returned by pci_slot_names_prop() instead, + * but keep any property of value "pcie0" as that can't be represented + * in the irq routing table. + */ if (pci_bus_res[bus].dip != NULL) { - /* simply return if the property is already defined */ - if (ddi_prop_exists(DDI_DEV_T_ANY, pci_bus_res[bus].dip, - DDI_PROP_DONTPASS, "slot-names")) - return; + if (ddi_prop_lookup_string(DDI_DEV_T_ANY, pci_bus_res[bus].dip, + DDI_PROP_DONTPASS, "slot-names", &slotcap_name) != + DDI_SUCCESS || strcmp(slotcap_name, "pcie0") != 0) + (void) ndi_prop_remove(DDI_DEV_T_NONE, + pci_bus_res[bus].dip, "slot-names"); } len = pci_slot_names_prop(bus, slotprop, sizeof (slotprop)); diff --git a/usr/src/uts/intel/io/pciex/pcie_nvidia.c b/usr/src/uts/intel/io/pciex/pcie_nvidia.c index 7bc62d4478..b792e6a564 100644 --- a/usr/src/uts/intel/io/pciex/pcie_nvidia.c +++ b/usr/src/uts/intel/io/pciex/pcie_nvidia.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -47,7 +46,8 @@ extern uint64_t mcfg_mem_base; boolean_t check_if_device_is_pciex(dev_info_t *cdip, uchar_t bus, uchar_t dev, - uchar_t func, ushort_t *slot_number, ushort_t *is_pci_bridge) + uchar_t func, boolean_t *slot_valid, ushort_t *slot_number, + ushort_t *is_pci_bridge) { boolean_t found_pciex = B_FALSE; ushort_t cap; @@ -56,7 +56,7 @@ check_if_device_is_pciex(dev_info_t *cdip, uchar_t bus, uchar_t dev, ushort_t status; uint32_t slot_cap; - *slot_number = 0; + *slot_valid = B_FALSE; status = (*pci_getw_func)(bus, dev, func, PCI_CONF_STAT); if (!(status & PCI_STAT_CAP)) @@ -93,6 +93,7 @@ check_if_device_is_pciex(dev_info_t *cdip, uchar_t bus, uchar_t dev, /* offset 14h is Slot Cap Register */ slot_cap = (*pci_getl_func)(bus, dev, func, capsp + PCIE_SLOTCAP); + *slot_valid = B_TRUE; *slot_number = PCIE_SLOTCAP_PHY_SLOT_NUM(slot_cap); @@ -133,6 +134,7 @@ look_for_any_pciex_device(uchar_t bus) uchar_t dev, func; uchar_t nfunc, header; ushort_t venid, slot_num, is_pci_bridge = 0; + boolean_t slot_valid; for (dev = 0; dev < 32; dev++) { nfunc = 1; @@ -164,7 +166,7 @@ look_for_any_pciex_device(uchar_t bus) nfunc = 8; if (check_if_device_is_pciex(NULL, bus, dev, func, - &slot_num, &is_pci_bridge) == B_TRUE) + &slot_valid, &slot_num, &is_pci_bridge) == B_TRUE) return (B_TRUE); } /* end of func */ } /* end of dev */ diff --git a/usr/src/uts/intel/io/pciex/pcie_nvidia.h b/usr/src/uts/intel/io/pciex/pcie_nvidia.h index 2b01966385..e0624ab2cb 100644 --- a/usr/src/uts/intel/io/pciex/pcie_nvidia.h +++ b/usr/src/uts/intel/io/pciex/pcie_nvidia.h @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _PCIEX_PCI_NVIDIA_H @@ -36,7 +35,7 @@ extern "C" { */ boolean_t look_for_any_pciex_device(uchar_t); boolean_t check_if_device_is_pciex(dev_info_t *, uchar_t, uchar_t, - uchar_t, ushort_t *, ushort_t *); + uchar_t, boolean_t *, ushort_t *, ushort_t *); boolean_t create_pcie_root_bus(uchar_t, dev_info_t *); void add_nvidia_isa_bridge_props(dev_info_t *, uchar_t, uchar_t, uchar_t); |