summaryrefslogtreecommitdiffstats
path: root/platforms/astbmc/slots.c
Commit message (Collapse)AuthorAgeFilesLines
* astbmc/slot: Add _add_slot_info()Oliver O'Halloran2018-09-131-9/+15
| | | | | | | | | | | | Currently slot_table_get_slot_info() scans the platform defined slot table looking for a slot table entry that matches the device and adds the relevant information to the struct pci_device. This patch splits the searching and adding of the slot information into separate functions so that we can allow the platform code to use a different searching critera. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* slots: Add power limit supportOliver O'Halloran2018-04-111-0/+5
| | | | | | | | Add support for sourcing power limit information from either the DT slot heirachy or the slot table. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* Revert "platforms/astbmc/slots.c: Allow comparison of bus numbers when ↵Stewart Smith2018-03-221-1/+1
| | | | | | | | | | | | | | | | | matching slots" This reverts commit bda7cc4d0354eb3f66629d410b2afc08c79f795f. Ben says: It's on purpose that we do NOT compare the bus numbers, they are always 0 in the slot table we do a hierarchical walk of the tree, matching only the devfn's along the way bcs the bus numbering isn't fixed this breaks all slot naming etc... stuff on anything using the "skiboot" slot tables (P8 opp typically) Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* astbmc: Add methods for handing DT based slotsOliver O'Halloran2017-09-151-0/+48
| | | | | Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/pci-slots: Move slot-label construction to a helperOliver O'Halloran2017-09-151-32/+2
| | | | | | | | Move this out of the astbmc specific part into a generic helper. This allows us to use it more commonly. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/pcie-slots: Make dynamic slot creation genericOliver O'Halloran2017-09-151-62/+12
| | | | | | | | | | | astbmc has some code to handle devices that are behind a "slot" on a riser card that can't be added to the static slot tables for a system. We probably want to use this code outside the slot table handling so move it somewhere generic and rework it so slot table specifics aren't buried inside it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc/slots.c: Allow comparison of bus numbers when matching slotsAlistair Popple2017-06-211-1/+1
| | | | | | | | When matching devices on multiple down stream PLX busses we need to compare more than just the device-id of the PCIe BDFN, so increase the mask to do so. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* astbmc/p8dnu: Enable PCI slot's power supply on PEX8718 in hot-add pathGavin Shan2017-02-221-2/+4
| | | | | | | | | | | | | | | | | | This issue is reported from superMicro's "p8dnu" platform. PEX8718 is connected to PHB direct slot. We create dynamic PCI slots for its (2) downstream ports and all of them support surprise hotplug capability. The problem is power supply lost on hot-remove and it isn't turned on automatically on hot-add. It means the PCIe link behind the slot isn't up and the PCI adapter behind the slot can't be probed successfully. This fixes the issue by forcing to turn on the power supply on hardware when user (kernel) requests to do so, as we did for PEX9733. Reported-by: Hank Chang <hankmax0000@gmail.com> Signed-off-by: Gavin Shan <gwhsan@linux.vnet.ibm.com> Tested-by: Willie Liauw <williel@supermicro.com.tw> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* astbmc/p8dnu: Enable PCI slot's power supply on PEX9733 in hot-add pathGavin Shan2017-02-221-0/+13
| | | | | | | | | | | | | | | | | | | This issue is reported from superMicro's "p8dnu" platform. PEX9733 is connected to PHB direct slot. We create dynamic PCI slots for its (5) downstream ports and all of them support surprise hotplug capability. The problem is power supply lost on hot-remove and it isn't turned on automatically on hot-add. It means the PCIe link behind the slot isn't up and the PCI adapter behind the slot can't be probed successfully. This fixes the issue by forcing to turn on the power supply on hardware when user (kernel) requests to do so. Those PCI slots are identified by additional flag (PCI_SLOT_FLAG_FORCE_POWERON). Reported-by: Hank Chang <hankmax0000@gmail.com> Signed-off-by: Gavin Shan <gwhsan@linux.vnet.ibm.com> Tested-by: Willie Liauw <williel@supermicro.com.tw> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* BMC/PCI: Check slot tables against detected devicesStewart Smith2016-12-131-0/+87
| | | | | | | | | | | | | | | | | | On BMC machines, we have slot tables of built in PHBs, slots and devices that are physically present in the system (such as the BMC itself). We can use these tables to check what we *detected* against what *should* be in the system and throw an error if they differ. We have seen this occur a couple of times while still booting, giving the user just an empty petitboot screen and not much else to go on. This patch helps in that we get a skiboot error message, and at some point in the future when we pump them up to the OS we could get a big friendly error message telling you you're having a bad day. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Russell Currey <ruscur@russell.cc> [stewart@linux.vnet.ibm.com: add barreleye] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Support dynamic PCI slotGavin Shan2016-10-111-6/+46
| | | | | | | | | | | | | | | We might insert a PCIe switch to PHB direct slot and the downstream ports of the PCIe switch supports PCI hotplug. This creates dynamic PCI slots for the downstream ports in the scenario: * The dynamic PCI slot's label has fixed encoding: "S<domain><bus_num>". * No associated platform slot. * The management on dynamic PCI slot relies on the generic layer implemented in pcie-slot.c. Requested-by: Li Meng <shlimeng@cn.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Introduce slot_init_info() helper functionGavin Shan2016-10-111-10/+18
| | | | | | | | | | This moves the logic initializing PCI slot to helper function slot_info_info() so that it can be reused by subsequent patch supporting dynamic PCI slot creation. No functional changes introduced. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: ibm, slot-label not depend on ibm, slot-location-codeGavin Shan2016-10-111-1/+2
| | | | | | | | | "ibm,slot-label" should not depend on "ibm,slot-location-code". The later one can not be populted because of oversized "ibm,slot-label" or PHB's base location code. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Fix coding style in slot_table_get_slot_info()Gavin Shan2016-10-111-1/+1
| | | | | | | Remove the unnecessary space before @pd argument. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvlink: Associate and allocate NPUs using slotsRussell Currey2016-07-201-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocating BDFNs to NPU devices and associating NPU devices with PCI devices of GPUs both rely on comparing PBCQ handles. This will fail if a system has multiple sets of GPUs behind a single PHB. Rework this to instead use slot locations. The following changes are introduced: - Groups of NPU links that connect to the same GPU are presented in the slot table entries as st_npu_slot, using ST_LOC_NPU_GROUP - NPU links are created with the ibm,npu-group-id property replacing the ibm,pbcq property, which is used in BDFN allocation and GPU association - Slot comparison is handled slightly differently for NPU devices as the function of the BDFN is ignored, since the device number represents the physical GPU the link is connected to - BDFN allocation for NPU devices is now derived from the groups in the slot table. For Garrison, the same BDFNs are generated as before. - Association with GPU PCI devices is performed by comparing the slot label. This means for future machines with NPUs that slot labels are compulsory to have NVLink functionality working. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Fix the PCI slot location codeGavin Shan2016-06-211-4/+9
| | | | | | | | | | | | | | | | After commit aa928bfbd891 ("platforms/astbmc: Support PCI slot") is merged, we have the assumption that PHB's base location code is always valid. It's not true on openPower platforms, including Garrison. It causes the PCI slot location code isn't exposed via device-tree. This fixes the above issue. The PCI slot location code contains the label only if PHB's base location code is invalid. Reported-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Tested-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Support PCI slotGavin Shan2016-06-141-15/+43
| | | | | | | | | | | | | This reworks PCI stuff for astbmc platform to support PCI slot: * The PCI slot is created in slot_table_get_slot_info(). * There are no platform dependent operations provided to PCI slots at current stage. * The slot location code is populated accordingly. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* plat/bmc: Add infrastructure for slot tablesBenjamin Herrenschmidt2015-09-011-0/+100
This adds some basic infrastructure for simple slot tables allowing us to name slots and built-in devices on OPP machines. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add IBM (C) in new file, trim trailing whitespace] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud