summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-01-19 08:46:47 -0500
committerTom Rini <[email protected]>2024-01-19 08:46:47 -0500
commitf4d54865061495bdb483f9ddc81183d1940f596c (patch)
tree203ec612e1a7b41602e5616c5f480d89caf1ff95 /drivers
parentcb493752394adec8db1d6f5e9b8fb3c43e13f10a (diff)
parent46371f269986976b3e969c0985820169b766ff76 (diff)
Merge branch '2024-01-18-assorted-fixes'
- A number of OS boot related cleanups, a number of TI platform fixes/cleanups, SMBIOS fixes, tweak get_maintainers.pl to report me for more places, fix the "clean the build" pytest and add a bootstage pytest, fix PKCS11 URI being omitted in some valid cases, make an iommu problem easier to debug on new platforms, nvme and pci improvements, refactor image-host code a bit, fix a typo in env setting, add a missing dependency for CMD_LICENSE, and correct how we call getchar() in some places.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/iommu-uclass.c13
-rw-r--r--drivers/nvme/nvme.c8
-rw-r--r--drivers/pci/pci-uclass.c11
3 files changed, 24 insertions, 8 deletions
diff --git a/drivers/iommu/iommu-uclass.c b/drivers/iommu/iommu-uclass.c
index 6babc0e3a67..dff3239cccb 100644
--- a/drivers/iommu/iommu-uclass.c
+++ b/drivers/iommu/iommu-uclass.c
@@ -86,16 +86,16 @@ int dev_iommu_enable(struct udevice *dev)
ret = dev_read_phandle_with_args(dev, "iommus",
"#iommu-cells", 0, i, &args);
if (ret) {
- debug("%s: dev_read_phandle_with_args failed: %d\n",
- __func__, ret);
+ log_err("%s: Failed to parse 'iommus' property for '%s': %d\n",
+ __func__, dev->name, ret);
return ret;
}
ret = uclass_get_device_by_ofnode(UCLASS_IOMMU, args.node,
&dev_iommu);
if (ret) {
- debug("%s: uclass_get_device_by_ofnode failed: %d\n",
- __func__, ret);
+ log_err("%s: Failed to find IOMMU device for '%s': %d\n",
+ __func__, dev->name, ret);
return ret;
}
dev->iommu = dev_iommu;
@@ -106,8 +106,11 @@ int dev_iommu_enable(struct udevice *dev)
ops = device_get_ops(dev->iommu);
if (ops && ops->connect) {
ret = ops->connect(dev);
- if (ret)
+ if (ret) {
+ log_err("%s: Failed to connect '%s' to IOMMU '%s': %d\n",
+ __func__, dev->name, dev->iommu->name, ret);
return ret;
+ }
}
}
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index c39cd41aa38..59a139baa0b 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -695,7 +695,9 @@ int nvme_scan_namespace(void)
if (ret) {
log_err("Failed to probe '%s': err=%dE\n", dev->name,
ret);
- return ret;
+ /* Bail if we ran out of memory, else keep trying */
+ if (ret != -EBUSY)
+ return ret;
}
}
@@ -835,8 +837,8 @@ int nvme_init(struct udevice *udev)
ndev->udev = udev;
INIT_LIST_HEAD(&ndev->namespaces);
if (readl(&ndev->bar->csts) == -1) {
- ret = -ENODEV;
- printf("Error: %s: Out of memory!\n", udev->name);
+ ret = -EBUSY;
+ printf("Error: %s: Controller not ready!\n", udev->name);
goto free_nvme;
}
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index e0d01f6a85d..1a48256de03 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -1611,6 +1611,17 @@ void *dm_pci_map_bar(struct udevice *dev, int bar, size_t offset, size_t len,
dm_pci_read_config32(udev, bar, &bar_response);
pci_bus_addr = (pci_addr_t)(bar_response & ~0xf);
+ /* This has a lot of baked in assumptions, but essentially tries
+ * to mirror the behavior of BAR assignment for 64 Bit enabled
+ * hosts and 64 bit placeable BARs in the auto assign code.
+ */
+#if defined(CONFIG_SYS_PCI_64BIT)
+ if (bar_response & PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ dm_pci_read_config32(udev, bar + 4, &bar_response);
+ pci_bus_addr |= (pci_addr_t)bar_response << 32;
+ }
+#endif /* CONFIG_SYS_PCI_64BIT */
+
if (~((pci_addr_t)0) - pci_bus_addr < offset)
return NULL;