|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ricardo Pardini <ricardo@pardini.net> |
| 3 | +Date: Mon, 3 Nov 2025 21:02:03 +0100 |
| 4 | +Subject: 6.18-rc4: temporary fixes for pcie probe failure due to ASPM stuff |
| 5 | + |
| 6 | +- https://lore.kernel.org/linux-amlogic/20251031161323.GA1688975@bhelgaas/ |
| 7 | +- https://lists.infradead.org/pipermail/linux-amlogic/2025-November/025692.html |
| 8 | +--- |
| 9 | + arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 +- |
| 10 | + drivers/pci/controller/dwc/pci-meson.c | 42 +--------- |
| 11 | + 2 files changed, 5 insertions(+), 39 deletions(-) |
| 12 | + |
| 13 | +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi |
| 14 | +index 111111111111..222222222222 100644 |
| 15 | +--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi |
| 16 | ++++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi |
| 17 | +@@ -138,7 +138,7 @@ pcie: pcie@fc000000 { |
| 18 | + reg = <0x0 0xfc000000 0x0 0x400000>, |
| 19 | + <0x0 0xff648000 0x0 0x2000>, |
| 20 | + <0x0 0xfc400000 0x0 0x200000>; |
| 21 | +- reg-names = "elbi", "cfg", "config"; |
| 22 | ++ reg-names = "dbi", "cfg", "config"; |
| 23 | + interrupts = <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>; |
| 24 | + #interrupt-cells = <1>; |
| 25 | + interrupt-map-mask = <0 0 0 0>; |
| 26 | +diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c |
| 27 | +index 111111111111..222222222222 100644 |
| 28 | +--- a/drivers/pci/controller/dwc/pci-meson.c |
| 29 | ++++ b/drivers/pci/controller/dwc/pci-meson.c |
| 30 | +@@ -109,10 +109,6 @@ static int meson_pcie_get_mems(struct platform_device *pdev, |
| 31 | + { |
| 32 | + struct dw_pcie *pci = &mp->pci; |
| 33 | + |
| 34 | +- pci->dbi_base = devm_platform_ioremap_resource_byname(pdev, "elbi"); |
| 35 | +- if (IS_ERR(pci->dbi_base)) |
| 36 | +- return PTR_ERR(pci->dbi_base); |
| 37 | +- |
| 38 | + mp->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg"); |
| 39 | + if (IS_ERR(mp->cfg_base)) |
| 40 | + return PTR_ERR(mp->cfg_base); |
| 41 | +@@ -338,40 +334,10 @@ static struct pci_ops meson_pci_ops = { |
| 42 | + static bool meson_pcie_link_up(struct dw_pcie *pci) |
| 43 | + { |
| 44 | + struct meson_pcie *mp = to_meson_pcie(pci); |
| 45 | +- struct device *dev = pci->dev; |
| 46 | +- u32 speed_okay = 0; |
| 47 | +- u32 cnt = 0; |
| 48 | +- u32 state12, state17, smlh_up, ltssm_up, rdlh_up; |
| 49 | +- |
| 50 | +- do { |
| 51 | +- state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12); |
| 52 | +- state17 = meson_cfg_readl(mp, PCIE_CFG_STATUS17); |
| 53 | +- smlh_up = IS_SMLH_LINK_UP(state12); |
| 54 | +- rdlh_up = IS_RDLH_LINK_UP(state12); |
| 55 | +- ltssm_up = IS_LTSSM_UP(state12); |
| 56 | +- |
| 57 | +- if (PM_CURRENT_STATE(state17) < PCIE_GEN3) |
| 58 | +- speed_okay = 1; |
| 59 | +- |
| 60 | +- if (smlh_up) |
| 61 | +- dev_dbg(dev, "smlh_link_up is on\n"); |
| 62 | +- if (rdlh_up) |
| 63 | +- dev_dbg(dev, "rdlh_link_up is on\n"); |
| 64 | +- if (ltssm_up) |
| 65 | +- dev_dbg(dev, "ltssm_up is on\n"); |
| 66 | +- if (speed_okay) |
| 67 | +- dev_dbg(dev, "speed_okay\n"); |
| 68 | +- |
| 69 | +- if (smlh_up && rdlh_up && ltssm_up && speed_okay) |
| 70 | +- return true; |
| 71 | +- |
| 72 | +- cnt++; |
| 73 | +- |
| 74 | +- udelay(10); |
| 75 | +- } while (cnt < WAIT_LINKUP_TIMEOUT); |
| 76 | +- |
| 77 | +- dev_err(dev, "error: wait linkup timeout\n"); |
| 78 | +- return false; |
| 79 | ++ u32 state12; |
| 80 | ++ |
| 81 | ++ state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12); |
| 82 | ++ return IS_SMLH_LINK_UP(state12) && IS_RDLH_LINK_UP(state12); |
| 83 | + } |
| 84 | + |
| 85 | + static int meson_pcie_host_init(struct dw_pcie_rp *pp) |
| 86 | +-- |
| 87 | +Armbian |
| 88 | + |
0 commit comments