Skip to contentSkip to conversation

dt-bindings: clocks: imx8mp: Add ID for usb suspend clock

PATCH Applied Li Jun 3 participants 8 messages Aug 24, 2022 – Sep 7, 2022

Subsystems (4)

v1 of 4 Applied Latest is v4 →

lore
Share & tools
lore

Li Jun

author
#0 lore raw

PATCH 1/2 dt-bindings: clocks: imx8mp: Add ID for usb suspend clock

usb suspend clock has a gate shared with usb_root_clk.

include/dt-bindings/clock/imx8mp-clock.h +2 -1
index 9d5cc2ddde89..1417b7b1b7df 100644
@@ -324,8 +324,9 @@
 #define IMX8MP_CLK_CLKOUT2_SEL			317
 #define IMX8MP_CLK_CLKOUT2_DIV			318
 #define IMX8MP_CLK_CLKOUT2			319
+#define IMX8MP_CLK_USB_SUSP			320
 
-#define IMX8MP_CLK_END				320
+#define IMX8MP_CLK_END				321
 
 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/2 clk: imx: imx8mp: add shared clk gate for usb suspend clk

32K usb suspend clock gate is shared with usb_root_clk.

drivers/clk/imx/clk-imx8mp.c +3 -1
index e89db568f5a8..5b66514bdd0c 100644
@@ -17,6 +17,7 @@
 
 static u32 share_count_nand;
 static u32 share_count_media;
+static u32 share_count_usb;
 
 static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy", "dummy", };
 static const char * const audio_pll1_bypass_sels[] = {"audio_pll1", "audio_pll1_ref_sel", };
@@ -673,7 +674,8 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
 	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
 	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
 	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
-	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
+	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0, &share_count_usb);
+	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0, &share_count_usb);
 	hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk", "usb_phy_ref", ccm_base + 0x44f0, 0);
 	hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk", "usdhc1", ccm_base + 0x4510, 0);
 	hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk", "usdhc2", ccm_base + 0x4520, 0);
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] clk: imx: imx8mp: add shared clk gate for usb suspend clk

Quoted 3 lines · Li Jun

32K usb suspend clock gate is shared with usb_root_clk.

Quoted 26 lines
drivers/clk/imx/clk-imx8mp.c +3 -1
index e89db568f5a8..5b66514bdd0c 100644
@@ -17,6 +17,7 @@
 
 static u32 share_count_nand;
 static u32 share_count_media;
+static u32 share_count_usb;
 
 static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy", "dummy", };
 static const char * const audio_pll1_bypass_sels[] = {"audio_pll1", "audio_pll1_ref_sel", };
@@ -673,7 +674,8 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
 	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
 	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
 	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
-	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
+	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0, &share_count_usb);
+	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0, &share_count_usb);
 	hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk", "usb_phy_ref", ccm_base + 0x44f0, 0);
 	hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk", "usdhc1", ccm_base + 0x4510, 0);
 	hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk", "usdhc2", ccm_base + 0x4520, 0);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#4 lore raw
In reply to Li Jun
Quoted 3 lines · Li Jun

usb suspend clock has a gate shared with usb_root_clk.

Quoted 19 lines
include/dt-bindings/clock/imx8mp-clock.h +2 -1
index 9d5cc2ddde89..1417b7b1b7df 100644
@@ -324,8 +324,9 @@
 #define IMX8MP_CLK_CLKOUT2_SEL			317
 #define IMX8MP_CLK_CLKOUT2_DIV			318
 #define IMX8MP_CLK_CLKOUT2			319
+#define IMX8MP_CLK_USB_SUSP			320
 
-#define IMX8MP_CLK_END				320
+#define IMX8MP_CLK_END				321
 
 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
Signature · 1 line
2.34.1
Applied
#5 lore raw
In reply to Li Jun
Quoted 3 lines · Li Jun

usb suspend clock has a gate shared with usb_root_clk.

Applied both, thanks!

Quoted 19 lines
include/dt-bindings/clock/imx8mp-clock.h +2 -1
index 9d5cc2ddde89..1417b7b1b7df 100644
@@ -324,8 +324,9 @@
 #define IMX8MP_CLK_CLKOUT2_SEL			317
 #define IMX8MP_CLK_CLKOUT2_DIV			318
 #define IMX8MP_CLK_CLKOUT2			319
+#define IMX8MP_CLK_USB_SUSP			320
 
-#define IMX8MP_CLK_END				320
+#define IMX8MP_CLK_END				321
 
 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
Signature · 1 line
2.34.1

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

#6 lore raw
Quoted 6 lines · Abel Vesa
Quoted 3 lines · Li Jun

usb suspend clock has a gate shared with usb_root_clk.

Applied both, thanks!

As discussed in the thread [1], I dropped this patch from my tree for now. You need to send a new version wil Fixes tag.

[1] https://lore.kernel.org/all/YxhxSdDGXfO%2F%[email protected]/

Quoted 20 lines
Quoted 20 lines
include/dt-bindings/clock/imx8mp-clock.h +2 -1
index 9d5cc2ddde89..1417b7b1b7df 100644
@@ -324,8 +324,9 @@
 #define IMX8MP_CLK_CLKOUT2_SEL			317
 #define IMX8MP_CLK_CLKOUT2_DIV			318
 #define IMX8MP_CLK_CLKOUT2			319
+#define IMX8MP_CLK_USB_SUSP			320
 
-#define IMX8MP_CLK_END				320
+#define IMX8MP_CLK_END				321
 
 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
Signature · 1 line
2.34.1
author
#7 lore raw

Hi Abel,

Quoted 14 lines

-----Original Message-----
From: Abel Vesa <[email protected]>
Sent: Wednesday, September 7, 2022 6:33 PM
To: Jun Li <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/2] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock

Quoted 1 line · Abel Vesa

On 22-08-24 16:04:21, Li Jun wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

usb suspend clock has a gate shared with usb_root_clk.

Applied both, thanks!

As discussed in the thread [1], I dropped this patch from my tree for now. You need to send a new version wil Fixes tag.

Thanks, I will resend those 2 patches with fix tag.

Li Jun

Quoted 30 lines

[1]
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
kernel.org%2Fall%2FYxhxSdDGXfO%252F%252Fbgc%40linaro.org%2F&amp;data=05 %7C01%7Cjun.li%40nxp.com%7Cf62126a63a4442644c9308da90bc54ed%7C686ea1d3b c2b4c6fa92cd99c5c301635%7C0%7C0%7C637981435790610771%7CUnknown%7CTWFpbG Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 D%7C3000%7C%7C%7C&amp;sdata=DRZzC7rKqNexnGN%2F%2FW5LXvhnhRwIN7CLC4KCu9z fTFA%3D&amp;reserved=0

Quoted 21 lines
Quoted 21 lines
include/dt-bindings/clock/imx8mp-clock.h +2 -2
index 9d5cc2ddde89..1417b7b1b7df 100644
@@ -324,8 +324,9 @@
 #define IMX8MP_CLK_CLKOUT2_SEL			317
 #define IMX8MP_CLK_CLKOUT2_DIV			318
 #define IMX8MP_CLK_CLKOUT2			319
+#define IMX8MP_CLK_USB_SUSP			320
 
-#define IMX8MP_CLK_END				320
+#define IMX8MP_CLK_END				321
 
 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
--

2.34.1