Skip to contentSkip to conversation

clk: imx93: fix and update

PATCH Applied Peng Fan (OSS) 3 participants 17 messages Oct 28, 2022 – Nov 21, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover clk: imx93: fix and update

From: Peng Fan <[email protected]>

V2:
Update commit log for patch 3
Add comment for critial clock for patch 5,6

patch 1 is reported by Dan and marked as fix

During our development, per updated reference mannual and design information, correct enet and drop tpm 1/3, lpit 1/2.

The TPM/LPIT patch 3,4 are not marked as fixes, there is no user, so update binding and driver both.

Patch 5 enable HSIO root always on
Patch 6 enable sysctr always on for cpuidle

Jacky Bai (2):
clk: imx: keep hsio bus clock always on
clk: imx93: keep sys ctr clock always on

Peng Fan (4):
clk: imx93: unmap anatop base in error handling path
clk: imx93: correct enet clock
dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry
clk: imx93: drop tpm1/3, lpit1/2 clk

 drivers/clk/imx/clk-imx93.c             | 38 ++++++++++++++-----------
 include/dt-bindings/clock/imx93-clock.h |  4 ---
 2 files changed, 21 insertions(+), 21 deletions(-)
Signature · 7 lines
2.37.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH 1/6 clk: imx93: unmap anatop base in error handling path

From: Peng Fan <[email protected]>

The anatop base is not unmapped during error handling path, fix it.

Fixes 24defbe194b6 ("clk: imx: add i.MX93 clk")
---
 drivers/clk/imx/clk-imx93.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/clk/imx/clk-imx93.c +9 -6
index 99cff1fd108b..9ef3fcbdd951 100644
@@ -258,7 +258,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	const struct imx93_clk_root *root;
 	const struct imx93_clk_ccgr *ccgr;
-	void __iomem *base = NULL;
+	void __iomem *base, *anatop_base;
 	int i, ret;
 
 	clk_hw_data = kzalloc(struct_size(clk_hw_data, hws,
@@ -285,20 +285,22 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 								    "sys_pll_pfd2", 1, 2);
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx93-anatop");
-	base = of_iomap(np, 0);
+	anatop_base = of_iomap(np, 0);
 	of_node_put(np);
-	if (WARN_ON(!base))
+	if (WARN_ON(!anatop_base))
 		return -ENOMEM;
 
-	clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", base + 0x1200,
+	clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", anatop_base + 0x1200,
 							&imx_fracn_gppll);
-	clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", base + 0x1400,
+	clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", anatop_base + 0x1400,
 							&imx_fracn_gppll);
 
 	np = dev->of_node;
 	base = devm_platform_ioremap_resource(pdev, 0);
-	if (WARN_ON(IS_ERR(base)))
+	if (WARN_ON(IS_ERR(base))) {
+		iounmap(anatop_base);
 		return PTR_ERR(base);
+	}
 
 	for (i = 0; i < ARRAY_SIZE(root_array); i++) {
 		root = &root_array[i];
@@ -327,6 +329,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 
 unregister_hws:
 	imx_unregister_hw_clocks(clks, IMX93_CLK_END);
+	iounmap(anatop_base);
 
 	return ret;
 }
Signature · 7 lines
2.37.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] clk: imx93: unmap anatop base in error handling path

Quoted 7 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

The anatop base is not unmapped during error handling path, fix it.

Fixes 24defbe194b6 ("clk: imx: add i.MX93 clk")
Quoted 56 lines
---
 drivers/clk/imx/clk-imx93.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/clk/imx/clk-imx93.c +9 -6
index 99cff1fd108b..9ef3fcbdd951 100644
@@ -258,7 +258,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	const struct imx93_clk_root *root;
 	const struct imx93_clk_ccgr *ccgr;
-	void __iomem *base = NULL;
+	void __iomem *base, *anatop_base;
 	int i, ret;
 
 	clk_hw_data = kzalloc(struct_size(clk_hw_data, hws,
@@ -285,20 +285,22 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 								    "sys_pll_pfd2", 1, 2);
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx93-anatop");
-	base = of_iomap(np, 0);
+	anatop_base = of_iomap(np, 0);
 	of_node_put(np);
-	if (WARN_ON(!base))
+	if (WARN_ON(!anatop_base))
 		return -ENOMEM;
 
-	clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", base + 0x1200,
+	clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", anatop_base + 0x1200,
 							&imx_fracn_gppll);
-	clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", base + 0x1400,
+	clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", anatop_base + 0x1400,
 							&imx_fracn_gppll);
 
 	np = dev->of_node;
 	base = devm_platform_ioremap_resource(pdev, 0);
-	if (WARN_ON(IS_ERR(base)))
+	if (WARN_ON(IS_ERR(base))) {
+		iounmap(anatop_base);
 		return PTR_ERR(base);
+	}
 
 	for (i = 0; i < ARRAY_SIZE(root_array); i++) {
 		root = &root_array[i];
@@ -327,6 +329,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 
 unregister_hws:
 	imx_unregister_hw_clocks(clks, IMX93_CLK_END);
+	iounmap(anatop_base);
 
 	return ret;
 }
Signature · 1 line
2.37.1
#3 lore raw

PATCH 2/6 clk: imx93: correct enet clock

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per update Reference Mannual, correct the enet clock parent to wakeup_axi_root.

Fixes 24defbe194b6 ("clk: imx: add i.MX93 clk")
---
 drivers/clk/imx/clk-imx93.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx93.c +1 -1
index 9ef3fcbdd951..7fdc30062a46 100644
@@ -240,7 +240,7 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_AUD_XCVR_GATE,	"aud_xcvr",	"audio_xcvr_root",	0x9b80, },
 	{ IMX93_CLK_SPDIF_GATE,		"spdif",	"spdif_root",		0x9c00, },
 	{ IMX93_CLK_HSIO_32K_GATE,	"hsio_32k",	"osc_32k",		0x9dc0, },
-	{ IMX93_CLK_ENET1_GATE,		"enet1",	"enet_root",		0x9e00, },
+	{ IMX93_CLK_ENET1_GATE,		"enet1",	"wakeup_axi_root",	0x9e00, },
 	{ IMX93_CLK_ENET_QOS_GATE,	"enet_qos",	"wakeup_axi_root",	0x9e40, },
 	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, },
 	{ IMX93_CLK_TSTMR1_GATE,	"tstmr1",	"bus_aon_root",		0x9ec0, },
Signature · 7 lines
2.37.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 2/6
#4 lore raw

Re: [PATCH 2/6] clk: imx93: correct enet clock

Quoted 8 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per update Reference Mannual, correct the enet clock parent to wakeup_axi_root.

Fixes 24defbe194b6 ("clk: imx: add i.MX93 clk")
Quoted 20 lines
---
 drivers/clk/imx/clk-imx93.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx93.c +1 -1
index 9ef3fcbdd951..7fdc30062a46 100644
@@ -240,7 +240,7 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_AUD_XCVR_GATE,	"aud_xcvr",	"audio_xcvr_root",	0x9b80, },
 	{ IMX93_CLK_SPDIF_GATE,		"spdif",	"spdif_root",		0x9c00, },
 	{ IMX93_CLK_HSIO_32K_GATE,	"hsio_32k",	"osc_32k",		0x9dc0, },
-	{ IMX93_CLK_ENET1_GATE,		"enet1",	"enet_root",		0x9e00, },
+	{ IMX93_CLK_ENET1_GATE,		"enet1",	"wakeup_axi_root",	0x9e00, },
 	{ IMX93_CLK_ENET_QOS_GATE,	"enet_qos",	"wakeup_axi_root",	0x9e40, },
 	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, },
 	{ IMX93_CLK_TSTMR1_GATE,	"tstmr1",	"bus_aon_root",		0x9ec0, },
Signature · 1 line
2.37.1
#5 lore raw

PATCH 3/6 dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per updated Reference Mannual, the TPM[1,3] LPIT[1,2] root clock entries are reserved, it is because writing the CCM registers does nothing because the TPM[1,3] and LPIT[1,2] IPs source from bus clk, not from the TPM[1,3] LPIT[1,2] entries. And because there is no SW entity is using the entries since adding them, let's drop them.

---
 include/dt-bindings/clock/imx93-clock.h | 4 ----
 1 file changed, 4 deletions(-)
include/dt-bindings/clock/imx93-clock.h +0 -4
index 19bc32788d81..8e02859d8ce2 100644
@@ -28,13 +28,9 @@
 #define IMX93_CLK_M33_SYSTICK		19
 #define IMX93_CLK_FLEXIO1		20
 #define IMX93_CLK_FLEXIO2		21
-#define IMX93_CLK_LPIT1			22
-#define IMX93_CLK_LPIT2			23
 #define IMX93_CLK_LPTMR1		24
 #define IMX93_CLK_LPTMR2		25
-#define IMX93_CLK_TPM1			26
 #define IMX93_CLK_TPM2			27
-#define IMX93_CLK_TPM3			28
 #define IMX93_CLK_TPM4			29
 #define IMX93_CLK_TPM5			30
 #define IMX93_CLK_TPM6			31
Signature · 7 lines
2.37.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Acked-by on v1 3/6
#6 lore raw

Re: [PATCH 3/6] dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry

Quoted 10 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per updated Reference Mannual, the TPM[1,3] LPIT[1,2] root clock entries are reserved, it is because writing the CCM registers does nothing because the TPM[1,3] and LPIT[1,2] IPs source from bus clk, not from the TPM[1,3] LPIT[1,2] entries. And because there is no SW entity is using the entries since adding them, let's drop them.

Best regards,
Krzysztof

Reviewed-by on v1 3/6
#7 lore raw

Re: [PATCH 3/6] dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry

In reply to Peng Fan (OSS)
Quoted 10 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per updated Reference Mannual, the TPM[1,3] LPIT[1,2] root clock entries are reserved, it is because writing the CCM registers does nothing because the TPM[1,3] and LPIT[1,2] IPs source from bus clk, not from the TPM[1,3] LPIT[1,2] entries. And because there is no SW entity is using the entries since adding them, let's drop them.

Quoted 25 lines
---
 include/dt-bindings/clock/imx93-clock.h | 4 ----
 1 file changed, 4 deletions(-)
include/dt-bindings/clock/imx93-clock.h +0 -4
index 19bc32788d81..8e02859d8ce2 100644
@@ -28,13 +28,9 @@
 #define IMX93_CLK_M33_SYSTICK		19
 #define IMX93_CLK_FLEXIO1		20
 #define IMX93_CLK_FLEXIO2		21
-#define IMX93_CLK_LPIT1			22
-#define IMX93_CLK_LPIT2			23
 #define IMX93_CLK_LPTMR1		24
 #define IMX93_CLK_LPTMR2		25
-#define IMX93_CLK_TPM1			26
 #define IMX93_CLK_TPM2			27
-#define IMX93_CLK_TPM3			28
 #define IMX93_CLK_TPM4			29
 #define IMX93_CLK_TPM5			30
 #define IMX93_CLK_TPM6			31
Signature · 1 line
2.37.1
#8 lore raw

PATCH 4/6 clk: imx93: drop tpm1/3, lpit1/2 clk

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per Reference Mannual System Clocks Table, LPIT1 and TPM1 sources from bus_aon_root LPIT2 and TPM3 sources from bus_wakeup_root

So update driver to reflect that.

---
 drivers/clk/imx/clk-imx93.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/clk/imx/clk-imx93.c +4 -8
index 7fdc30062a46..422ad3c89845 100644
@@ -64,13 +64,9 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_M33_SYSTICK,	"m33_systick_root",	0x0480,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_FLEXIO1,		"flexio1_root",		0x0500,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_FLEXIO2,		"flexio2_root",		0x0580,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_LPIT1,		"lpit1_root",		0x0600,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_LPIT2,		"lpit2_root",		0x0680,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_LPTMR1,		"lptmr1_root",		0x0700,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_LPTMR2,		"lptmr2_root",		0x0780,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_TPM1,		"tpm1_root",		0x0800,	TPM_SEL, },
 	{ IMX93_CLK_TPM2,		"tpm2_root",		0x0880,	TPM_SEL, },
-	{ IMX93_CLK_TPM3,		"tpm3_root",		0x0900,	TPM_SEL, },
 	{ IMX93_CLK_TPM4,		"tpm4_root",		0x0980,	TPM_SEL, },
 	{ IMX93_CLK_TPM5,		"tpm5_root",		0x0a00,	TPM_SEL, },
 	{ IMX93_CLK_TPM6,		"tpm6_root",		0x0a80,	TPM_SEL, },
@@ -177,13 +173,13 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_GPIO4_GATE,		"gpio4",	"bus_wakeup_root",	0x8940, },
 	{ IMX93_CLK_FLEXIO1_GATE,	"flexio1",	"flexio1_root",		0x8980, },
 	{ IMX93_CLK_FLEXIO2_GATE,	"flexio2",	"flexio2_root",		0x89c0, },
-	{ IMX93_CLK_LPIT1_GATE,		"lpit1",	"lpit1_root",		0x8a00, },
-	{ IMX93_CLK_LPIT2_GATE,		"lpit2",	"lpit2_root",		0x8a40, },
+	{ IMX93_CLK_LPIT1_GATE,		"lpit1",	"bus_aon_root",		0x8a00, },
+	{ IMX93_CLK_LPIT2_GATE,		"lpit2",	"bus_wakeup_root",	0x8a40, },
 	{ IMX93_CLK_LPTMR1_GATE,	"lptmr1",	"lptmr1_root",		0x8a80, },
 	{ IMX93_CLK_LPTMR2_GATE,	"lptmr2",	"lptmr2_root",		0x8ac0, },
-	{ IMX93_CLK_TPM1_GATE,		"tpm1",		"tpm1_root",		0x8b00, },
+	{ IMX93_CLK_TPM1_GATE,		"tpm1",		"bus_aon_root",		0x8b00, },
 	{ IMX93_CLK_TPM2_GATE,		"tpm2",		"tpm2_root",		0x8b40, },
-	{ IMX93_CLK_TPM3_GATE,		"tpm3",		"tpm3_root",		0x8b80, },
+	{ IMX93_CLK_TPM3_GATE,		"tpm3",		"bus_wakeup_root",	0x8b80, },
 	{ IMX93_CLK_TPM4_GATE,		"tpm4",		"tpm4_root",		0x8bc0, },
 	{ IMX93_CLK_TPM5_GATE,		"tpm5",		"tpm5_root",		0x8c00, },
 	{ IMX93_CLK_TPM6_GATE,		"tpm6",		"tpm6_root",		0x8c40, },
Signature · 1 line
2.37.1
Reviewed-by on v1 4/6
#9 lore raw

Re: [PATCH 4/6] clk: imx93: drop tpm1/3, lpit1/2 clk

Quoted 10 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Per Reference Mannual System Clocks Table, LPIT1 and TPM1 sources from bus_aon_root LPIT2 and TPM3 sources from bus_wakeup_root

So update driver to reflect that.

Quoted 43 lines
---
 drivers/clk/imx/clk-imx93.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/clk/imx/clk-imx93.c +4 -8
index 7fdc30062a46..422ad3c89845 100644
@@ -64,13 +64,9 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_M33_SYSTICK,	"m33_systick_root",	0x0480,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_FLEXIO1,		"flexio1_root",		0x0500,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_FLEXIO2,		"flexio2_root",		0x0580,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_LPIT1,		"lpit1_root",		0x0600,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_LPIT2,		"lpit2_root",		0x0680,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_LPTMR1,		"lptmr1_root",		0x0700,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_LPTMR2,		"lptmr2_root",		0x0780,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_TPM1,		"tpm1_root",		0x0800,	TPM_SEL, },
 	{ IMX93_CLK_TPM2,		"tpm2_root",		0x0880,	TPM_SEL, },
-	{ IMX93_CLK_TPM3,		"tpm3_root",		0x0900,	TPM_SEL, },
 	{ IMX93_CLK_TPM4,		"tpm4_root",		0x0980,	TPM_SEL, },
 	{ IMX93_CLK_TPM5,		"tpm5_root",		0x0a00,	TPM_SEL, },
 	{ IMX93_CLK_TPM6,		"tpm6_root",		0x0a80,	TPM_SEL, },
@@ -177,13 +173,13 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_GPIO4_GATE,		"gpio4",	"bus_wakeup_root",	0x8940, },
 	{ IMX93_CLK_FLEXIO1_GATE,	"flexio1",	"flexio1_root",		0x8980, },
 	{ IMX93_CLK_FLEXIO2_GATE,	"flexio2",	"flexio2_root",		0x89c0, },
-	{ IMX93_CLK_LPIT1_GATE,		"lpit1",	"lpit1_root",		0x8a00, },
-	{ IMX93_CLK_LPIT2_GATE,		"lpit2",	"lpit2_root",		0x8a40, },
+	{ IMX93_CLK_LPIT1_GATE,		"lpit1",	"bus_aon_root",		0x8a00, },
+	{ IMX93_CLK_LPIT2_GATE,		"lpit2",	"bus_wakeup_root",	0x8a40, },
 	{ IMX93_CLK_LPTMR1_GATE,	"lptmr1",	"lptmr1_root",		0x8a80, },
 	{ IMX93_CLK_LPTMR2_GATE,	"lptmr2",	"lptmr2_root",		0x8ac0, },
-	{ IMX93_CLK_TPM1_GATE,		"tpm1",		"tpm1_root",		0x8b00, },
+	{ IMX93_CLK_TPM1_GATE,		"tpm1",		"bus_aon_root",		0x8b00, },
 	{ IMX93_CLK_TPM2_GATE,		"tpm2",		"tpm2_root",		0x8b40, },
-	{ IMX93_CLK_TPM3_GATE,		"tpm3",		"tpm3_root",		0x8b80, },
+	{ IMX93_CLK_TPM3_GATE,		"tpm3",		"bus_wakeup_root",	0x8b80, },
 	{ IMX93_CLK_TPM4_GATE,		"tpm4",		"tpm4_root",		0x8bc0, },
 	{ IMX93_CLK_TPM5_GATE,		"tpm5",		"tpm5_root",		0x8c00, },
 	{ IMX93_CLK_TPM6_GATE,		"tpm6",		"tpm6_root",		0x8c40, },
Signature · 1 line
2.37.1
#10 lore raw

PATCH 5/6 clk: imx: keep hsio bus clock always on

In reply to Peng Fan (OSS)

From: Jacky Bai <[email protected]>

During Linux System suspend/resume stress test after System Sleep enabled, system will stuck sometimes. It is because NICMIX is powered down, which HSIOMIX(always on) is not powered down. When NICMIX powering down, HSIOMIX will get a hardware handshake, without HSIO ROOT clk, the handshake will lose. Then after NICMIX power on when system resume, the access to HSIOMIX through NICMIX would be broken. So keep HSIO ROOT always on.

[Peng Fan] rewrite commit message

---
 drivers/clk/imx/clk-imx93.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clk/imx/clk-imx93.c +5 -1
index 422ad3c89845..7dace96f36df 100644
@@ -109,7 +109,11 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_CCM_CKO2,		"ccm_cko2_root",	0x1d00,	CKO2_SEL, },
 	{ IMX93_CLK_CCM_CKO3,		"ccm_cko3_root",	0x1d80,	CKO1_SEL, },
 	{ IMX93_CLK_CCM_CKO4,		"ccm_cko4_root",	0x1e00,	CKO2_SEL, },
-	{ IMX93_CLK_HSIO,		"hsio_root",		0x1e80,	LOW_SPEED_IO_SEL, },
+	/*
+	 * Critical because clk is used for handshake between HSIOMIX and NICMIX when
+	 * NICMIX power down/on during system suspend/resume
+	 */
+	{ IMX93_CLK_HSIO,		"hsio_root",		0x1e80,	LOW_SPEED_IO_SEL, CLK_IS_CRITICAL},
 	{ IMX93_CLK_HSIO_USB_TEST_60M,	"hsio_usb_test_60m_root", 0x1f00, LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_HSIO_ACSCAN_80M,	"hsio_acscan_80m_root",	0x1f80,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_HSIO_ACSCAN_480M,	"hsio_acscan_480m_root", 0x2000, MISC_SEL, },
Signature · 1 line
2.37.1
Reviewed-by on v1 5/6
#11 lore raw

Re: [PATCH 5/6] clk: imx: keep hsio bus clock always on

Quoted 10 lines · Peng Fan (OSS)

From: Jacky Bai <[email protected]>

During Linux System suspend/resume stress test after System Sleep enabled, system will stuck sometimes. It is because NICMIX is powered down, which HSIOMIX(always on) is not powered down. When NICMIX powering down, HSIOMIX will get a hardware handshake, without HSIO ROOT clk, the handshake will lose. Then after NICMIX power on when system resume, the access to HSIOMIX through NICMIX would be broken. So keep HSIO ROOT always on.

Quoted 4 lines

[Peng Fan] rewrite commit message

Quoted 24 lines
---
 drivers/clk/imx/clk-imx93.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clk/imx/clk-imx93.c +5 -1
index 422ad3c89845..7dace96f36df 100644
@@ -109,7 +109,11 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_CCM_CKO2,		"ccm_cko2_root",	0x1d00,	CKO2_SEL, },
 	{ IMX93_CLK_CCM_CKO3,		"ccm_cko3_root",	0x1d80,	CKO1_SEL, },
 	{ IMX93_CLK_CCM_CKO4,		"ccm_cko4_root",	0x1e00,	CKO2_SEL, },
-	{ IMX93_CLK_HSIO,		"hsio_root",		0x1e80,	LOW_SPEED_IO_SEL, },
+	/*
+	 * Critical because clk is used for handshake between HSIOMIX and NICMIX when
+	 * NICMIX power down/on during system suspend/resume
+	 */
+	{ IMX93_CLK_HSIO,		"hsio_root",		0x1e80,	LOW_SPEED_IO_SEL, CLK_IS_CRITICAL},
 	{ IMX93_CLK_HSIO_USB_TEST_60M,	"hsio_usb_test_60m_root", 0x1f00, LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_HSIO_ACSCAN_80M,	"hsio_acscan_80m_root",	0x1f80,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_HSIO_ACSCAN_480M,	"hsio_acscan_480m_root", 0x2000, MISC_SEL, },
Signature · 1 line
2.37.1
#12 lore raw

PATCH 6/6 clk: imx93: keep sys ctr clock always on

In reply to Peng Fan (OSS)

From: Jacky Bai <[email protected]>

Keep sys ctr clock always on to make sure its register can be accessed for cpuidle.

---
 drivers/clk/imx/clk-imx93.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/imx/clk-imx93.c +2 -1
index 7dace96f36df..b42a877ecca1 100644
@@ -242,7 +242,8 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_HSIO_32K_GATE,	"hsio_32k",	"osc_32k",		0x9dc0, },
 	{ IMX93_CLK_ENET1_GATE,		"enet1",	"wakeup_axi_root",	0x9e00, },
 	{ IMX93_CLK_ENET_QOS_GATE,	"enet_qos",	"wakeup_axi_root",	0x9e40, },
-	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, },
+	/* Critical because clk accessed during CPU idle */
+	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, CLK_IS_CRITICAL},
 	{ IMX93_CLK_TSTMR1_GATE,	"tstmr1",	"bus_aon_root",		0x9ec0, },
 	{ IMX93_CLK_TSTMR2_GATE,	"tstmr2",	"bus_wakeup_root",	0x9f00, },
 	{ IMX93_CLK_TMC_GATE,		"tmc",		"osc_24m",		0x9f40, },
Signature · 1 line
2.37.1
Reviewed-by on v1 6/6
#13 lore raw

Re: [PATCH 6/6] clk: imx93: keep sys ctr clock always on

Quoted 8 lines · Peng Fan (OSS)

From: Jacky Bai <[email protected]>

Keep sys ctr clock always on to make sure its register can be accessed for cpuidle.

Quoted 21 lines
---
 drivers/clk/imx/clk-imx93.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/imx/clk-imx93.c +2 -1
index 7dace96f36df..b42a877ecca1 100644
@@ -242,7 +242,8 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_HSIO_32K_GATE,	"hsio_32k",	"osc_32k",		0x9dc0, },
 	{ IMX93_CLK_ENET1_GATE,		"enet1",	"wakeup_axi_root",	0x9e00, },
 	{ IMX93_CLK_ENET_QOS_GATE,	"enet_qos",	"wakeup_axi_root",	0x9e40, },
-	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, },
+	/* Critical because clk accessed during CPU idle */
+	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, CLK_IS_CRITICAL},
 	{ IMX93_CLK_TSTMR1_GATE,	"tstmr1",	"bus_aon_root",		0x9ec0, },
 	{ IMX93_CLK_TSTMR2_GATE,	"tstmr2",	"bus_wakeup_root",	0x9f00, },
 	{ IMX93_CLK_TMC_GATE,		"tmc",		"osc_24m",		0x9f40, },
Signature · 1 line
2.37.1
author
#14 lore raw
In reply to Peng Fan (OSS)

Hi Abel, Stephen

Quoted 5 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

V2:
Update commit log for patch 3
Add comment for critial clock for patch 5,6

V2 was not added to patch subject when I send out this patchset. If you need to repost with V2, please let me know.

Thanks,
Peng.

Quoted 26 lines

patch 1 is reported by Dan and marked as fix

During our development, per updated reference mannual and design information, correct enet and drop tpm 1/3, lpit 1/2.

The TPM/LPIT patch 3,4 are not marked as fixes, there is no user, so update binding and driver both.

Patch 5 enable HSIO root always on
Patch 6 enable sysctr always on for cpuidle

Jacky Bai (2):
clk: imx: keep hsio bus clock always on
clk: imx93: keep sys ctr clock always on

Peng Fan (4):
clk: imx93: unmap anatop base in error handling path
clk: imx93: correct enet clock
dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry
clk: imx93: drop tpm1/3, lpit1/2 clk

  drivers/clk/imx/clk-imx93.c             | 38 ++++++++++++++-----------
  include/dt-bindings/clock/imx93-clock.h |  4 ---
  2 files changed, 21 insertions(+), 21 deletions(-)
#15 lore raw
Quoted 11 lines · Peng Fan

Hi Abel, Stephen

Quoted 5 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

V2:
Update commit log for patch 3
Add comment for critial clock for patch 5,6

V2 was not added to patch subject when I send out this patchset. If you need to repost with V2, please let me know.

Sorry for the late reply.

No need to resend.

Quoted 30 lines

Thanks,
Peng.

Quoted 26 lines

patch 1 is reported by Dan and marked as fix

During our development, per updated reference mannual and design information, correct enet and drop tpm 1/3, lpit 1/2.

The TPM/LPIT patch 3,4 are not marked as fixes, there is no user, so update binding and driver both.

Patch 5 enable HSIO root always on
Patch 6 enable sysctr always on for cpuidle

Jacky Bai (2):
clk: imx: keep hsio bus clock always on
clk: imx93: keep sys ctr clock always on

Peng Fan (4):
clk: imx93: unmap anatop base in error handling path
clk: imx93: correct enet clock
dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry
clk: imx93: drop tpm1/3, lpit1/2 clk

  drivers/clk/imx/clk-imx93.c             | 38 ++++++++++++++-----------
  include/dt-bindings/clock/imx93-clock.h |  4 ---
  2 files changed, 21 insertions(+), 21 deletions(-)
Applied
#16 lore raw
In reply to Peng Fan (OSS)
Quoted 5 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

V2:
Update commit log for patch 3
Add comment for critial clock for patch 5,6

Applied all. Thanks.

Quoted 29 lines

patch 1 is reported by Dan and marked as fix

During our development, per updated reference mannual and design information, correct enet and drop tpm 1/3, lpit 1/2.

The TPM/LPIT patch 3,4 are not marked as fixes, there is no user, so update binding and driver both.

Patch 5 enable HSIO root always on
Patch 6 enable sysctr always on for cpuidle

Jacky Bai (2):
clk: imx: keep hsio bus clock always on
clk: imx93: keep sys ctr clock always on

Peng Fan (4):
clk: imx93: unmap anatop base in error handling path
clk: imx93: correct enet clock
dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry
clk: imx93: drop tpm1/3, lpit1/2 clk

 drivers/clk/imx/clk-imx93.c             | 38 ++++++++++++++-----------
 include/dt-bindings/clock/imx93-clock.h |  4 ---
 2 files changed, 21 insertions(+), 21 deletions(-)
Signature · 1 line
2.37.1