diff options
author | Tom Rini <trini@konsulko.com> | 2020-09-25 12:55:06 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-09-25 12:55:06 -0400 |
commit | 253388acd6d0d52205ed9a32282f990e055bb87d (patch) | |
tree | a84e1d53a94b4ea3dbf1d1994ebf02606aa41503 /drivers/pci | |
parent | 1da91d9bcd6e5ef046c1df0d373d0df87b1e8a72 (diff) | |
parent | 8ec619f8fd847eb80d75fa0a582e1fa3c74a21a7 (diff) | |
download | u-boot-253388acd6d0d52205ed9a32282f990e055bb87d.zip u-boot-253388acd6d0d52205ed9a32282f990e055bb87d.tar.gz u-boot-253388acd6d0d52205ed9a32282f990e055bb87d.tar.bz2 |
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
- Bug fixes related to PCIe, pfe, xfi, gpio, reset, vid, env, and usb on
layerscape products
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie_layerscape_fixup.c | 6 | ||||
-rw-r--r-- | drivers/pci/pcie_layerscape_fixup_common.c | 26 |
2 files changed, 32 insertions, 0 deletions
diff --git a/drivers/pci/pcie_layerscape_fixup.c b/drivers/pci/pcie_layerscape_fixup.c index 8315b0b..1709cd3 100644 --- a/drivers/pci/pcie_layerscape_fixup.c +++ b/drivers/pci/pcie_layerscape_fixup.c @@ -188,6 +188,12 @@ static void fdt_fixup_pcie_ls(void *blob) pci_find_next_device(&dev)) { for (bus = dev; device_is_on_pci_bus(bus);) bus = bus->parent; + + /* Only do the fixups for layerscape PCIe controllers */ + if (!device_is_compatible(bus, "fsl,ls-pcie") && + !device_is_compatible(bus, CONFIG_FSL_PCIE_COMPAT)) + continue; + pcie_rc = dev_get_priv(bus); streamid = pcie_next_streamid(pcie_rc->stream_id_cur, diff --git a/drivers/pci/pcie_layerscape_fixup_common.c b/drivers/pci/pcie_layerscape_fixup_common.c index fef0a75..0a42997 100644 --- a/drivers/pci/pcie_layerscape_fixup_common.c +++ b/drivers/pci/pcie_layerscape_fixup_common.c @@ -41,6 +41,8 @@ int lx2_board_fix_fdt(void *fdt) { "config_axi_slave", "config" } }; int off = -1, i; + const fdt32_t *prop; + u32 ob_wins, ib_wins; off = fdt_node_offset_by_compatible(fdt, -1, "fsl,lx2160a-pcie"); while (off != -FDT_ERR_NOTFOUND) { @@ -86,6 +88,30 @@ int lx2_board_fix_fdt(void *fdt) off = fdt_node_offset_by_compatible(fdt, off, "fsl,lx2160a-pcie"); } + + /* Fixup PCIe EP nodes */ + off = -1; + off = fdt_node_offset_by_compatible(fdt, off, "fsl,lx2160a-pcie-ep"); + while (off != -FDT_ERR_NOTFOUND) { + fdt_setprop_string(fdt, off, "compatible", + "fsl,lx2160ar2-pcie-ep"); + prop = fdt_getprop(fdt, off, "apio-wins", NULL); + if (!prop) { + printf("%s: Failed to fixup PCIe EP node @0x%x\n", + __func__, off); + continue; + } + + ob_wins = fdt32_to_cpu(*prop); + ib_wins = (ob_wins == 256) ? 24 : 8; + fdt_setprop_u32(fdt, off, "num-ib-windows", ib_wins); + fdt_setprop_u32(fdt, off, "num-ob-windows", ob_wins); + fdt_delprop(fdt, off, "apio-wins"); + + off = fdt_node_offset_by_compatible(fdt, off, + "fsl,lx2160a-pcie-ep"); + } + return 0; } |