Skip to contentSkip to conversation

clk: en7523: reset PCIE HB on init for AN7581

PATCH In review Christian Marangi 2 participants 4 messages Jul 8 – Jul 9 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: en7523: reset PCIE HB on init for AN7581

It was reported that PCIE HB should be reset for AN7581 or some instability or link training issue will be present on warm boot scenario.

Reset PCIE HB on clk HW init to handle warm boot problem with PCIe.

---
 drivers/clk/clk-en7523.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/clk-en7523.c +7 -0
index 1ab0e2eca5d3..c450d89bfa96 100644
@@ -57,6 +57,7 @@
 
 #define REG_RST_CTRL2			0x830
 #define REG_RST_CTRL1			0x834
+#define   REG_PCIE_HB_RST		BIT(29)
 #define EN751221_REG_RST_DMT		0x84
 #define EN751221_REG_RST_USB		0xec
 
@@ -853,6 +854,12 @@ static int en7581_clk_hw_init(struct platform_device *pdev,
 	val = readl(base + REG_NP_SCU_PCIC);
 	writel(val | 3, base + REG_NP_SCU_PCIC);
 
+	val = readl(base + REG_RST_CTRL1);
+	val |= REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+	val &= ~REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+
 	return en7581_reset_register(&pdev->dev, base, en7581_rst_map,
 				     ARRAY_SIZE(en7581_rst_map),
 				     en7581_rst_ofs);
Signature · 1 line
2.53.0
#1 lore raw

Hi Christian,

Thanks for the patch.

Quoted 23 lines · Christian Marangi

It was reported that PCIE HB should be reset for AN7581 or some instability or link training issue will be present on warm boot scenario.

Reset PCIE HB on clk HW init to handle warm boot problem with PCIe.

---
 drivers/clk/clk-en7523.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/clk-en7523.c +1 -0
index 1ab0e2eca5d3..c450d89bfa96 100644
@@ -57,6 +57,7 @@
 
 #define REG_RST_CTRL2			0x830
 #define REG_RST_CTRL1			0x834
+#define   REG_PCIE_HB_RST		BIT(29)
 #define EN751221_REG_RST_DMT		0x84
 #define EN751221_REG_RST_USB		0xec
 

drivers/clk/clk-en7523.c static int en7581_clk_hw_init(struct platform_device *pdev, · line 862

Quoted 9 lines
drivers/clk/clk-en7523.c +6 -0
@@ -853,6 +854,12 @@ static int en7581_clk_hw_init(struct platform_device *pdev,
 	val = readl(base + REG_NP_SCU_PCIC);
 	writel(val | 3, base + REG_NP_SCU_PCIC);
 
+	val = readl(base + REG_RST_CTRL1);
+	val |= REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+	val &= ~REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+

Sashiko has a question about whether or not a delay or a flush is needed between the writel() calls?

https://sashiko.dev/#/patchset/20260708084045.8380-1-ansuelsmth%40gmail.com

Brian

#2 lore raw
Quoted 41 lines · Brian Masney

Hi Christian,

Thanks for the patch.

Quoted 23 lines · Christian Marangi

It was reported that PCIE HB should be reset for AN7581 or some instability or link training issue will be present on warm boot scenario.

Reset PCIE HB on clk HW init to handle warm boot problem with PCIe.

---
 drivers/clk/clk-en7523.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/clk-en7523.c +1 -0
index 1ab0e2eca5d3..c450d89bfa96 100644
@@ -57,6 +57,7 @@
 
 #define REG_RST_CTRL2			0x830
 #define REG_RST_CTRL1			0x834
+#define   REG_PCIE_HB_RST		BIT(29)
 #define EN751221_REG_RST_DMT		0x84
 #define EN751221_REG_RST_USB		0xec
 

drivers/clk/clk-en7523.c static int en7581_clk_hw_init(struct platform_device *pdev, · line 862

Quoted 9 lines
drivers/clk/clk-en7523.c +6 -0
@@ -853,6 +854,12 @@ static int en7581_clk_hw_init(struct platform_device *pdev,
 	val = readl(base + REG_NP_SCU_PCIC);
 	writel(val | 3, base + REG_NP_SCU_PCIC);
 
+	val = readl(base + REG_RST_CTRL1);
+	val |= REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+	val &= ~REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+

Sashiko has a question about whether or not a delay or a flush is needed between the writel() calls?

Quoted 2 lines

https://sashiko.dev/#/patchset/20260708084045.8380-1-ansuelsmth%40gmail.com

Hi Brian, from the test done by me and Airoha with their CI on 10000 test, no delay is needed. If we want to be on the save side I can add it anyway for consistency with the other code. What do you think?

Signature · 1 line
	Ansuel
Reviewed-by
#3 lore raw
Quoted 42 lines · Christian Marangi
Quoted 41 lines · Brian Masney

Hi Christian,

Thanks for the patch.

Quoted 23 lines · Christian Marangi

It was reported that PCIE HB should be reset for AN7581 or some instability or link training issue will be present on warm boot scenario.

Reset PCIE HB on clk HW init to handle warm boot problem with PCIe.

---
 drivers/clk/clk-en7523.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/clk-en7523.c +1 -0
index 1ab0e2eca5d3..c450d89bfa96 100644
@@ -57,6 +57,7 @@
 
 #define REG_RST_CTRL2			0x830
 #define REG_RST_CTRL1			0x834
+#define   REG_PCIE_HB_RST		BIT(29)
 #define EN751221_REG_RST_DMT		0x84
 #define EN751221_REG_RST_USB		0xec
 

drivers/clk/clk-en7523.c static int en7581_clk_hw_init(struct platform_device *pdev, · line 862

Quoted 9 lines
drivers/clk/clk-en7523.c +6 -0
@@ -853,6 +854,12 @@ static int en7581_clk_hw_init(struct platform_device *pdev,
 	val = readl(base + REG_NP_SCU_PCIC);
 	writel(val | 3, base + REG_NP_SCU_PCIC);
 
+	val = readl(base + REG_RST_CTRL1);
+	val |= REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+	val &= ~REG_PCIE_HB_RST;
+	writel(val, base + REG_RST_CTRL1);
+

Sashiko has a question about whether or not a delay or a flush is needed between the writel() calls?

Quoted 6 lines
Quoted 2 lines

https://sashiko.dev/#/patchset/20260708084045.8380-1-ansuelsmth%40gmail.com

Hi Brian, from the test done by me and Airoha with their CI on 10000 test, no delay is needed. If we want to be on the save side I can add it anyway for consistency with the other code. What do you think?

10,000 test is probably good enough then.