Skip to content

Commit

Permalink
rpardini: config: rk35xx kernel patches: full revert of pci/nvme rk_p…
Browse files Browse the repository at this point in the history
…cie_link_up from Stephen/Radxa

- see armbian/linux-rockchip#221
  • Loading branch information
rpardini committed Oct 15, 2024
1 parent 5e50be6 commit 9ec7aea
Showing 1 changed file with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ricardo Pardini <ricardo@pardini.net>
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

0 comments on commit 9ec7aea

Please sign in to comment.