From 9ec7aea9dbf835345d6d50c0a434c0f8fc05e3b3 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 20 Sep 2024 15:16:22 +0200 Subject: [PATCH] rpardini: config: rk35xx kernel patches: full revert of pci/nvme rk_pcie_link_up from Stephen/Radxa - see https://github.com/armbian/linux-rockchip/pull/221 --- ...link_up-hook-from-struct-dw_pcie_ops.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 userpatches/kernel/rk35xx-vendor-6.1/3000-Reapply-PCI-rockchip-dw-remove-.link_up-hook-from-struct-dw_pcie_ops.patch diff --git a/userpatches/kernel/rk35xx-vendor-6.1/3000-Reapply-PCI-rockchip-dw-remove-.link_up-hook-from-struct-dw_pcie_ops.patch b/userpatches/kernel/rk35xx-vendor-6.1/3000-Reapply-PCI-rockchip-dw-remove-.link_up-hook-from-struct-dw_pcie_ops.patch new file mode 100644 index 000000000000..1165abf4ca8a --- /dev/null +++ b/userpatches/kernel/rk35xx-vendor-6.1/3000-Reapply-PCI-rockchip-dw-remove-.link_up-hook-from-struct-dw_pcie_ops.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ricardo Pardini +Date: Fri, 20 Sep 2024 15:13:47 +0200 +Subject: Reapply "PCI: rockchip: dw: remove .link_up() hook from struct + dw_pcie_ops" + +This reverts commit 16a7adc42e350ee3ff96298f295ae01f52f103bb. +--- + drivers/pci/controller/dwc/pcie-dw-rockchip.c | 13 ---------- + 1 file changed, 13 deletions(-) + +diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c +index 94b221b5b6148..ba462061f6a0c 100644 +--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c ++++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c +@@ -267,32 +267,20 @@ static inline void rk_pcie_link_status_clear(struct rk_pcie *rk_pcie) + static inline void rk_pcie_disable_ltssm(struct rk_pcie *rk_pcie) + { + rk_pcie_writel_apb(rk_pcie, 0x0, 0xc0008); + } + + static inline void rk_pcie_enable_ltssm(struct rk_pcie *rk_pcie) + { + rk_pcie_writel_apb(rk_pcie, 0x0, 0xC000C); + } + +-static int rk_pcie_link_up(struct dw_pcie *pci) +-{ +- struct rk_pcie *rk_pcie = to_rk_pcie(pci); +- u32 val; +- +- val = rk_pcie_readl_apb(rk_pcie, PCIE_CLIENT_LTSSM_STATUS); +- if ((val & (RDLH_LINKUP | SMLH_LINKUP)) == 0x30000) +- return 1; +- +- return 0; +-} +- + static void rk_pcie_enable_debug(struct rk_pcie *rk_pcie) + { + if (!IS_ENABLED(CONFIG_DEBUG_FS)) + return; + + rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_PTN_HIT_D0, + PCIE_CLIENT_DBG_TRANSITION_DATA); + rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_PTN_HIT_D1, + PCIE_CLIENT_DBG_TRANSITION_DATA); + rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_TRN_HIT_D0, +@@ -819,21 +807,20 @@ static const struct of_device_id rk_pcie_of_match[] = { + .compatible = "rockchip,rk3588-pcie", + .data = NULL, + }, + {}, + }; + + MODULE_DEVICE_TABLE(of, rk_pcie_of_match); + + static const struct dw_pcie_ops dw_pcie_ops = { + .start_link = rk_pcie_establish_link, +- .link_up = rk_pcie_link_up, + }; + + static void rk_pcie_fast_link_setup(struct rk_pcie *rk_pcie) + { + u32 val; + + /* LTSSM EN ctrl mode */ + val = rk_pcie_readl_apb(rk_pcie, PCIE_CLIENT_HOT_RESET_CTRL); + val |= (PCIE_LTSSM_ENABLE_ENHANCE | PCIE_LTSSM_APP_DLY2_EN) + | ((PCIE_LTSSM_APP_DLY2_EN | PCIE_LTSSM_ENABLE_ENHANCE) << 16); +-- +Armbian +