diff options
author | Tom Rini <trini@konsulko.com> | 2022-01-20 12:40:20 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-20 12:40:20 -0500 |
commit | 2d7a463e82daeba4f6a7fb59bac0fe94d6f6d3a2 (patch) | |
tree | 96e28ce689933dd4ebd120309a9caa2e02897d48 /drivers/pci | |
parent | 3918376e91dac7711cf04bd06f8de80e797edfea (diff) | |
parent | 8f880c3d89432e9988b23bb7099d6360c14a206f (diff) | |
download | u-boot-2d7a463e82daeba4f6a7fb59bac0fe94d6f6d3a2.tar.gz |
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- fdt_support: Add fdt_for_each_node_by_compatible() helper macro
(Marek)
- turris_omnia: Fixup SATA or PCIe nodes at runtime in DT blob (Pali)
- pci_mvebu: Add support for Kirkwood PCIe controllers (Pali)
- SPL: More verifications for kwbimage in SPL (Pali)
- mvebu: Remove comphy_update_map() (Pali)
- Minor misc stuff
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/Kconfig | 6 | ||||
-rw-r--r-- | drivers/pci/pci_mvebu.c | 16 | ||||
-rw-r--r-- | drivers/pci/pcie_layerscape_fixup_common.c | 12 |
3 files changed, 21 insertions, 13 deletions
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 630d6e6cc5..69141344c8 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -262,13 +262,13 @@ config PCIE_IPROC Say Y here if you want to enable Broadcom iProc PCIe controller, config PCI_MVEBU - bool "Enable Armada XP/38x PCIe driver" - depends on ARCH_MVEBU + bool "Enable Kirkwood / Armada 370/XP/375/38x PCIe driver" + depends on (ARCH_KIRKWOOD || ARCH_MVEBU) select MISC select DM_RESET help Say Y here if you want to enable PCIe controller support on - Armada XP/38x SoCs. + Kirkwood and Armada 370/XP/375/38x SoCs. config PCIE_DW_COMMON bool diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c index b3ea034a28..d99a99bae9 100644 --- a/drivers/pci/pci_mvebu.c +++ b/drivers/pci/pci_mvebu.c @@ -498,6 +498,13 @@ static int mvebu_pcie_probe(struct udevice *dev) mvebu_pcie_set_local_bus_nr(pcie, 0); mvebu_pcie_set_local_dev_nr(pcie, 1); + /* + * Kirkwood arch code already maps mbus windows for PCIe IO and MEM. + * So skip calling mvebu_mbus_add_window_by_id() function as it would + * fail on error "conflicts with another window" which means conflict + * with existing PCIe window mappings. + */ +#ifndef CONFIG_ARCH_KIRKWOOD if (resource_size(&pcie->mem) && mvebu_mbus_add_window_by_id(pcie->mem_target, pcie->mem_attr, (phys_addr_t)pcie->mem.start, @@ -519,6 +526,7 @@ static int mvebu_pcie_probe(struct udevice *dev) pcie->io.start = 0; pcie->io.end = -1; } +#endif /* Setup windows and configure host bridge */ mvebu_pcie_setup_wins(pcie); @@ -725,10 +733,17 @@ static int mvebu_pcie_bind(struct udevice *parent) } ports_count = 0; +#ifdef CONFIG_ARCH_KIRKWOOD + mem.start = KW_DEFADR_PCI_MEM; + mem.end = KW_DEFADR_PCI_MEM + KW_DEFADR_PCI_MEM_SIZE - 1; + io.start = KW_DEFADR_PCI_IO; + io.end = KW_DEFADR_PCI_IO + KW_DEFADR_PCI_IO_SIZE - 1; +#else mem.start = MBUS_PCI_MEM_BASE; mem.end = MBUS_PCI_MEM_BASE + MBUS_PCI_MEM_SIZE - 1; io.start = MBUS_PCI_IO_BASE; io.end = MBUS_PCI_IO_BASE + MBUS_PCI_IO_SIZE - 1; +#endif /* First phase: Fill mvebu_pcie struct for each port */ ofnode_for_each_subnode(subnode, dev_ofnode(parent)) { @@ -809,6 +824,7 @@ static int mvebu_pcie_bind(struct udevice *parent) static const struct udevice_id mvebu_pcie_ids[] = { { .compatible = "marvell,armada-xp-pcie" }, { .compatible = "marvell,armada-370-pcie" }, + { .compatible = "marvell,kirkwood-pcie" }, { } }; diff --git a/drivers/pci/pcie_layerscape_fixup_common.c b/drivers/pci/pcie_layerscape_fixup_common.c index faccf6c141..095874a927 100644 --- a/drivers/pci/pcie_layerscape_fixup_common.c +++ b/drivers/pci/pcie_layerscape_fixup_common.c @@ -48,8 +48,7 @@ static int lx2_board_fix_fdt(void *fdt) 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) { + fdt_for_each_node_by_compatible(off, fdt, -1, "fsl,lx2160a-pcie") { fdt_setprop(fdt, off, "compatible", "fsl,ls2088a-pcie", strlen("fsl,ls2088a-pcie") + 1); @@ -89,14 +88,10 @@ static int lx2_board_fix_fdt(void *fdt) fdt_setprop(fdt, off, "reg-names", reg_names, names_len); fdt_delprop(fdt, off, "apio-wins"); fdt_delprop(fdt, off, "ppio-wins"); - 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_for_each_node_by_compatible(off, fdt, -1, "fsl,lx2160a-pcie-ep") { fdt_setprop_string(fdt, off, "compatible", "fsl,lx2160ar2-pcie-ep"); prop = fdt_getprop(fdt, off, "apio-wins", NULL); @@ -113,9 +108,6 @@ static int lx2_board_fix_fdt(void *fdt) 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; |