Shelley Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/72733 )
Change subject: soc/qualcomm/sc7280: Enable pcie device at runtime ......................................................................
soc/qualcomm/sc7280: Enable pcie device at runtime
If we need to initialize pcie on this device (based on sku id), then enable the pcie device and it's children at runtime.
BUG=b:262586570 BRANCH=None TEST=Test on a zombie device with NVMe enabled and make sure NVMe device is enabled.
Change-Id: I6c191e368e54acde919112bbfa966b8d303290a1 Signed-off-by: Shelley Chen shchen@google.com --- M src/soc/qualcomm/sc7280/soc.c 1 file changed, 36 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/72733/1
diff --git a/src/soc/qualcomm/sc7280/soc.c b/src/soc/qualcomm/sc7280/soc.c index 268f080..72dda24 100644 --- a/src/soc/qualcomm/sc7280/soc.c +++ b/src/soc/qualcomm/sc7280/soc.c @@ -7,9 +7,27 @@ #include <soc/cpucp.h> #include <soc/pcie.h>
+static void sc7280_enable_pci_resources(struct device *dev) +{ + struct bus *link; + struct device *child; + + if (dev == NULL) + return; + + /* If device not enabled, enabled it */ + dev_set_enabled(dev, 1); + + /* Also enable the children if there are any */ + for (link = dev->link_list; link; link = link->next) + for (child = link->children; child; child = child->sibling) + sc7280_enable_pci_resources(child); +} + static struct device_operations pci_domain_ops = { .read_resources = &qcom_pci_domain_read_resources, .set_resources = &pci_domain_set_resources, + .enable_resources = &sc7280_enable_pci_resources, .scan_bus = &pci_domain_scan_bus, .enable = &qcom_setup_pcie_host, };