summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-02-08 18:55:51 +0300
committerTom Rini <trini@konsulko.com>2021-02-08 18:55:51 +0300
commite14d5762de1db84cae6d84d59c1e40f3eb26c4c3 (patch)
treedf6a771bc0dacd2de8c8d42c2bd39e5f5ea12686 /drivers
parenta10d06add73ec0bd9e93b4b517fa2068ef1ca132 (diff)
parent24a0f8cfe5c85aef5a20baf34ee7b77004b07b04 (diff)
downloadu-boot-e14d5762de1db84cae6d84d59c1e40f3eb26c4c3.tar.xz
Merge git://git.denx.de/u-boot-marvell
- Espressobin: Set default env values at runtime (Pali) - Espressobin: Set the maximum slave SPI speed to 40MHz (Pali) - theadorable: PCIe test code enhancement and early deemphasis enabling (Stefan) - pci_mvebu: Disable config access to PCI host bridge ports (Stefan) - mv_sdhci: parse device-tree entry (Baruch)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mv_sdhci.c4
-rw-r--r--drivers/pci/pci_mvebu.c66
2 files changed, 31 insertions, 39 deletions
diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c
index 556dd38046..4dc4a0d2be 100644
--- a/drivers/mmc/mv_sdhci.c
+++ b/drivers/mmc/mv_sdhci.c
@@ -118,6 +118,10 @@ static int mv_sdhci_probe(struct udevice *dev)
host->mmc->dev = dev;
host->mmc->priv = host;
+ ret = mmc_of_parse(dev, &plat->cfg);
+ if (ret)
+ return ret;
+
ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
if (ret)
return ret;
diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
index 374c4aa243..3ab03e3675 100644
--- a/drivers/pci/pci_mvebu.c
+++ b/drivers/pci/pci_mvebu.c
@@ -153,28 +153,21 @@ static int mvebu_pcie_read_config(const struct udevice *bus, pci_dev_t bdf,
u32 reg;
u32 data;
- debug("PCIE CFG read: (b,d,f)=(%2d,%2d,%2d) ",
- PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf));
-
- /* Only allow one other device besides the local one on the local bus */
- if (PCI_BUS(bdf) == local_bus && PCI_DEV(bdf) != local_dev) {
- if (local_dev == 0 && PCI_DEV(bdf) != 1) {
- debug("- out of range\n");
- /*
- * If local dev is 0, the first other dev can
- * only be 1
- */
- *valuep = pci_get_ff(size);
- return 0;
- } else if (local_dev != 0 && PCI_DEV(bdf) != 0) {
- debug("- out of range\n");
- /*
- * If local dev is not 0, the first other dev can
- * only be 0
- */
- *valuep = pci_get_ff(size);
- return 0;
- }
+ debug("PCIE CFG read: loc_bus=%d loc_dev=%d (b,d,f)=(%2d,%2d,%2d) ",
+ local_bus, local_dev, PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf));
+
+ /* Don't access the local host controller via this API */
+ if (PCI_BUS(bdf) == local_bus && PCI_DEV(bdf) == local_dev) {
+ debug("- skipping host controller\n");
+ *valuep = pci_get_ff(size);
+ return 0;
+ }
+
+ /* If local dev is 0, the first other dev can only be 1 */
+ if (PCI_BUS(bdf) == local_bus && local_dev == 0 && PCI_DEV(bdf) != 1) {
+ debug("- out of range\n");
+ *valuep = pci_get_ff(size);
+ return 0;
}
/* write address */
@@ -196,25 +189,20 @@ static int mvebu_pcie_write_config(struct udevice *bus, pci_dev_t bdf,
int local_dev = PCI_DEV(pcie->dev);
u32 data;
- debug("PCIE CFG write: (b,d,f)=(%2d,%2d,%2d) ",
- PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf));
+ debug("PCIE CFG write: loc_bus=%d loc_dev=%d (b,d,f)=(%2d,%2d,%2d) ",
+ local_bus, local_dev, PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf));
debug("(addr,val)=(0x%04x, 0x%08lx)\n", offset, value);
- /* Only allow one other device besides the local one on the local bus */
- if (PCI_BUS(bdf) == local_bus && PCI_DEV(bdf) != local_dev) {
- if (local_dev == 0 && PCI_DEV(bdf) != 1) {
- /*
- * If local dev is 0, the first other dev can
- * only be 1
- */
- return 0;
- } else if (local_dev != 0 && PCI_DEV(bdf) != 0) {
- /*
- * If local dev is not 0, the first other dev can
- * only be 0
- */
- return 0;
- }
+ /* Don't access the local host controller via this API */
+ if (PCI_BUS(bdf) == local_bus && PCI_DEV(bdf) == local_dev) {
+ debug("- skipping host controller\n");
+ return 0;
+ }
+
+ /* If local dev is 0, the first other dev can only be 1 */
+ if (PCI_BUS(bdf) == local_bus && local_dev == 0 && PCI_DEV(bdf) != 1) {
+ debug("- out of range\n");
+ return 0;
}
writel(PCIE_CONF_ADDR(bdf, offset), pcie->base + PCIE_CONF_ADDR_OFF);