Add clock support for CMU_HSI2
Subsystems (6)
A message that is not in the archive (sent off-list or not yet received): CGME20250529111705epcas5p25e80695086d6dc0d37343082b7392be7@epcas5p2.samsung.com
v3 cover Add clock support for CMU_HSI2
This series sorts clock yaml and adds clock support for the CMU_HSI2 block.
Patch[1/4]: dt-bindings: clock: exynosautov920: sort clock definitions
- Sorts the compatible strings for clocks
Patch[2/4]: dt-bindings: clock: exynosautov920: add hsi2 clock definitions
- Adds DT binding for CMU_HSI2 and clock definitions
Patch[3/4]: clk: samsung: exynosautov920: add block hsi2 clock support
- Adds CMU_HSI2 clock driver support
Patch[4/4]: arm64: dts: exynosautov920: add CMU_HSI2 clock DT nodes
- Adds dt node for CMU_HSI2
---
Changes in v3:
- Added a patch to sort the compatible strings for clock definitions in yaml, as pointed by Krzysztof Kozlowski
Link to v2: https://lore.kernel.org/all/[email protected]/
Got a comment from Krzysztof Kozlowski
Changes in v2:
- Added cover letter with the patches
- Submit the patches as a series as they are inter-dependent as pointed by Krzysztof Kozlowski
Links to v1:
[1/3]: https://lore.kernel.org/all/[email protected]/
[2/3]: https://lore.kernel.org/all/[email protected]/
[3/3]: https://lore.kernel.org/all/[email protected]/
Raghav Sharma (4):
dt-bindings: clock: exynosautov920: sort clock definitions
dt-bindings: clock: exynosautov920: add hsi2 clock definitions
clk: samsung: exynosautov920: add block hsi2 clock support
arm64: dts: exynosautov920: add cmu_hsi2 clock DT nodes
.../clock/samsung,exynosautov920-clock.yaml | 37 ++++++++-- .../arm64/boot/dts/exynos/exynosautov920.dtsi | 17 +++++ drivers/clk/samsung/clk-exynosautov920.c | 72 +++++++++++++++++++ .../clock/samsung,exynosautov920.h | 9 +++ 4 files changed, 129 insertions(+), 6 deletions(-)
base-commit: 3be1a7a31fbda82f3604b6c31e4f390110de1b46
Signature · 1 line
2.34.1
PATCH v3 1/4 dt-bindings: clock: exynosautov920: sort clock definitions
Sort all the clock compatible strings in alphabetical order
--- .../bindings/clock/samsung,exynosautov920-clock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/samsung,exynosautov920-clock.yaml +4 -4
@@ -32,15 +32,15 @@ description: | properties: compatible: enum: - - samsung,exynosautov920-cmu-top - samsung,exynosautov920-cmu-cpucl0 - samsung,exynosautov920-cmu-cpucl1 - samsung,exynosautov920-cmu-cpucl2 - - samsung,exynosautov920-cmu-peric0 - - samsung,exynosautov920-cmu-peric1 - - samsung,exynosautov920-cmu-misc - samsung,exynosautov920-cmu-hsi0 - samsung,exynosautov920-cmu-hsi1 + - samsung,exynosautov920-cmu-misc + - samsung,exynosautov920-cmu-peric0 + - samsung,exynosautov920-cmu-peric1 + - samsung,exynosautov920-cmu-top clocks: minItems: 1
Signature · 1 line
2.34.1
Re: [PATCH v3 1/4] dt-bindings: clock: exynosautov920: sort clock definitions
Quoted 7 lines · Raghav Sharma
Sort all the clock compatible strings in alphabetical order
Signed-off-by Raghav Sharma <[email protected]>--- .../bindings/clock/samsung,exynosautov920-clock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
RE: [PATCH v3 1/4] dt-bindings: clock: exynosautov920: sort clock definitions
In reply to Raghav SharmaHi Raghav
Quoted 15 lines
-----Original Message-----
From: Raghav Sharma <[email protected]>
Sent: Thursday, May 29, 2025 4:57 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Raghav Sharma <[email protected]>
Subject: [PATCH v3 1/4] dt-bindings: clock: exynosautov920: sort clock definitions
Quoted 4 lines
Sort all the clock compatible strings in alphabetical order
Signed-off-by Raghav Sharma <[email protected]>---
PATCH v3 2/4 dt-bindings: clock: exynosautov920: add hsi2 clock definitions
In reply to Raghav SharmaAdd device tree clock binding definitions for CMU_HSI2
--- .../clock/samsung,exynosautov920-clock.yaml | 29 +++++++++++++++++-- .../clock/samsung,exynosautov920.h | 9 ++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/clock/samsung,exynosautov920-clock.yaml +27 -2
@@ -37,6 +37,7 @@ properties: - samsung,exynosautov920-cmu-cpucl2 - samsung,exynosautov920-cmu-hsi0 - samsung,exynosautov920-cmu-hsi1 + - samsung,exynosautov920-cmu-hsi2 - samsung,exynosautov920-cmu-misc - samsung,exynosautov920-cmu-peric0 - samsung,exynosautov920-cmu-peric1
@@ -44,11 +45,11 @@ properties: clocks: minItems: 1 - maxItems: 4 + maxItems: 5 clock-names: minItems: 1 - maxItems: 4 + maxItems: 5 "#clock-cells": const: 1
@@ -201,6 +202,30 @@ allOf: - const: usbdrd - const: mmc_card + - if: + properties: + compatible: + contains: + const: samsung,exynosautov920-cmu-hsi2 + + then: + properties: + clocks: + items: + - description: External reference clock (38.4 MHz) + - description: CMU_HSI2 NOC clock (from CMU_TOP) + - description: CMU_HSI2 NOC UFS clock (from CMU_TOP) + - description: CMU_HSI2 UFS EMBD clock (from CMU_TOP) + - description: CMU_HSI2 ETHERNET clock (from CMU_TOP) + + clock-names: + items: + - const: oscclk + - const: noc + - const: ufs + - const: embd + - const: ethernet + required: - compatible - "#clock-cells"
include/dt-bindings/clock/samsung,exynosautov920.h +9 -0
@@ -286,4 +286,13 @@#define CLK_MOUT_HSI1_USBDRD_USER 3#define CLK_MOUT_HSI1_USBDRD 4 +/* CMU_HSI2 */ +#define FOUT_PLL_ETH 1 +#define CLK_MOUT_HSI2_NOC_UFS_USER 2 +#define CLK_MOUT_HSI2_UFS_EMBD_USER 3 +#define CLK_MOUT_HSI2_ETHERNET 4 +#define CLK_MOUT_HSI2_ETHERNET_USER 5 +#define CLK_DOUT_HSI2_ETHERNET 6 +#define CLK_DOUT_HSI2_ETHERNET_PTP 7 +#endif /* _DT_BINDINGS_CLOCK_EXYNOSAUTOV920_H */
Signature · 1 line
2.34.1
Re: [PATCH v3 2/4] dt-bindings: clock: exynosautov920: add hsi2 clock definitions
Quoted 8 lines · Raghav Sharma
Add device tree clock binding definitions for
CMU_HSI2Signed-off-by Raghav Sharma <[email protected]>--- .../clock/samsung,exynosautov920-clock.yaml | 29 +++++++++++++++++-- .../clock/samsung,exynosautov920.h | 9 ++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
RE: [PATCH v3 2/4] dt-bindings: clock: exynosautov920: add hsi2 clock definitions
In reply to Raghav SharmaQuoted 17 lines
-----Original Message-----
From: Raghav Sharma <[email protected]>
Sent: Thursday, May 29, 2025 4:57 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Raghav Sharma <[email protected]>
Subject: [PATCH v3 2/4] dt-bindings: clock: exynosautov920: add hsi2 clock definitions
Quoted 4 lines
Add device tree clock binding definitions for
CMU_HSI2Signed-off-by Raghav Sharma <[email protected]>---
PATCH v3 3/4 clk: samsung: exynosautov920: add block hsi2 clock support
In reply to Raghav SharmaRegister compatible and cmu_info data to support clocks. CMU_HSI2, this provides clocks for HSI2 block
--- drivers/clk/samsung/clk-exynosautov920.c | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
drivers/clk/samsung/clk-exynosautov920.c +72 -0
@@ -26,6 +26,7 @@#define CLKS_NR_MISC (CLK_DOUT_MISC_OSC_DIV2 + 1)#define CLKS_NR_HSI0 (CLK_DOUT_HSI0_PCIE_APB + 1)#define CLKS_NR_HSI1 (CLK_MOUT_HSI1_USBDRD + 1) +#define CLKS_NR_HSI2 (CLK_DOUT_HSI2_ETHERNET_PTP + 1)/* ---- CMU_TOP ------------------------------------------------------------ */
@@ -1752,6 +1753,74 @@ static const struct samsung_cmu_info hsi1_cmu_info __initconst = { .clk_name = "noc", }; +/* ---- CMU_HSI2 --------------------------------------------------------- */ + +/* Register Offset definitions for CMU_HSI2 (0x16b00000) */ +#define PLL_LOCKTIME_PLL_ETH 0x0 +#define PLL_CON3_PLL_ETH 0x10c +#define PLL_CON0_MUX_CLKCMU_HSI2_ETHERNET_USER 0x600 +#define PLL_CON0_MUX_CLKCMU_HSI2_NOC_UFS_USER 0x610 +#define PLL_CON0_MUX_CLKCMU_HSI2_UFS_EMBD_USER 0x630 +#define CLK_CON_MUX_MUX_CLK_HSI2_ETHERNET 0x1000 +#define CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET 0x1800 +#define CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET_PTP 0x1804 + +static const unsigned long hsi2_clk_regs[]__initconst = { +PLL_LOCKTIME_PLL_ETH , +PLL_CON3_PLL_ETH , +PLL_CON0_MUX_CLKCMU_HSI2_ETHERNET_USER , +PLL_CON0_MUX_CLKCMU_HSI2_NOC_UFS_USER , +PLL_CON0_MUX_CLKCMU_HSI2_UFS_EMBD_USER , +CLK_CON_MUX_MUX_CLK_HSI2_ETHERNET , +CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET , +CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET_PTP , +}; + +static const struct samsung_pll_clock hsi2_pll_clks[]__initconst = { +/* CMU_HSI2_PLL */ +PLL (pll_531x,FOUT_PLL_ETH ,"fout_pll_eth" ,"oscclk" , +PLL_LOCKTIME_PLL_ETH ,PLL_CON3_PLL_ETH ,NULL ), +}; + +/* List of parent clocks for Muxes in CMU_HSI2 */ +PNAME (mout_clkcmu_hsi2_noc_ufs_user_p) = {"oscclk" ,"dout_clkcmu_hsi2_noc_ufs" }; +PNAME (mout_clkcmu_hsi2_ufs_embd_user_p) = {"oscclk" ,"dout_clkcmu_hsi2_ufs_embd" }; +PNAME (mout_hsi2_ethernet_p) = {"fout_pll_eth" ,"mout_clkcmu_hsi2_ethernet_user" }; +PNAME (mout_clkcmu_hsi2_ethernet_user_p) = {"oscclk" ,"dout_clkcmu_hsi2_ethernet" }; + +static const struct samsung_mux_clock hsi2_mux_clks[]__initconst = { +MUX (CLK_MOUT_HSI2_NOC_UFS_USER ,"mout_clkcmu_hsi2_noc_ufs_user" , + mout_clkcmu_hsi2_noc_ufs_user_p,PLL_CON0_MUX_CLKCMU_HSI2_NOC_UFS_USER ,4 ,1 ), +MUX (CLK_MOUT_HSI2_UFS_EMBD_USER ,"mout_clkcmu_hsi2_ufs_embd_user" , + mout_clkcmu_hsi2_ufs_embd_user_p,PLL_CON0_MUX_CLKCMU_HSI2_UFS_EMBD_USER ,4 ,1 ), +MUX (CLK_MOUT_HSI2_ETHERNET ,"mout_hsi2_ethernet" , + mout_hsi2_ethernet_p,CLK_CON_MUX_MUX_CLK_HSI2_ETHERNET ,0 ,1 ), +MUX (CLK_MOUT_HSI2_ETHERNET_USER ,"mout_clkcmu_hsi2_ethernet_user" , + mout_clkcmu_hsi2_ethernet_user_p,PLL_CON0_MUX_CLKCMU_HSI2_ETHERNET_USER ,4 ,1 ), +}; + +static const struct samsung_div_clock hsi2_div_clks[]__initconst = { +DIV (CLK_DOUT_HSI2_ETHERNET ,"dout_hsi2_ethernet" , +"mout_hsi2_ethernet" ,CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET , +0 ,4 ), +DIV (CLK_DOUT_HSI2_ETHERNET_PTP ,"dout_hsi2_ethernet_ptp" , +"mout_hsi2_ethernet" ,CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET_PTP , +0 ,4 ), +}; + +static const struct samsung_cmu_info hsi2_cmu_info__initconst = { + .pll_clks = hsi2_pll_clks, + .nr_pll_clks =ARRAY_SIZE (hsi2_pll_clks), + .mux_clks = hsi2_mux_clks, + .nr_mux_clks =ARRAY_SIZE (hsi2_mux_clks), + .div_clks = hsi2_div_clks, + .nr_div_clks =ARRAY_SIZE (hsi2_div_clks), + .nr_clk_ids =CLKS_NR_HSI2 , + .clk_regs = hsi2_clk_regs, + .nr_clk_regs =ARRAY_SIZE (hsi2_clk_regs), + .clk_name ="noc" , +}; +static int __init exynosautov920_cmu_probe (struct platform_device *pdev) {const struct samsung_cmu_info *info;
@@ -1779,6 +1848,9 @@ static const struct of_device_id exynosautov920_cmu_of_match[] = { }, { .compatible = "samsung,exynosautov920-cmu-hsi1", .data = &hsi1_cmu_info, + }, { + .compatible = "samsung,exynosautov920-cmu-hsi2", + .data = &hsi2_cmu_info, }, { } };
Signature · 1 line
2.34.1
RE: [PATCH v3 3/4] clk: samsung: exynosautov920: add block hsi2 clock support
HI Raghav
Quoted 15 lines
-----Original Message-----
From: Raghav Sharma <[email protected]>
Sent: Thursday, May 29, 2025 4:57 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Raghav Sharma <[email protected]>
Subject: [PATCH v3 3/4] clk: samsung: exynosautov920: add block hsi2 clock support
Quoted 5 lines
Register compatible and
cmu_infodata to support clocks.CMU_HSI2, this provides clocks for HSI2 blockSigned-off-by Raghav Sharma <[email protected]>---
PATCH v3 4/4 arm64: dts: exynosautov920: add CMU_HSI2 clock DT nodes
In reply to Raghav SharmaAdd required dt node for CMU_HSI2 block, which
provides clocks to ufs and ethernet IPs
--- arch/arm64/boot/dts/exynos/exynosautov920.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +17 -0
@@ -1048,6 +1048,23 @@ pinctrl_hsi1: pinctrl@16450000 { interrupts = <GIC_SPI 456 IRQ_TYPE_LEVEL_HIGH>; }; + cmu_hsi2: clock-controller@16b00000 { + compatible = "samsung,exynosautov920-cmu-hsi2"; + reg = <0x16b00000 0x8000>; + #clock-cells = <1>; + + clocks = <&xtcxo>, + <&cmu_top DOUT_CLKCMU_HSI2_NOC>, + <&cmu_top DOUT_CLKCMU_HSI2_NOC_UFS>, + <&cmu_top DOUT_CLKCMU_HSI2_UFS_EMBD>, + <&cmu_top DOUT_CLKCMU_HSI2_ETHERNET>; + clock-names = "oscclk", + "noc", + "ufs", + "embd", + "ethernet"; + }; + pinctrl_hsi2: pinctrl@16c10000 { compatible = "samsung,exynosautov920-pinctrl"; reg = <0x16c10000 0x10000>;
Signature · 1 line
2.34.1
RE: [PATCH v3 4/4] arm64: dts: exynosautov920: add CMU_HSI2 clock DT nodes
Hi Raghav
Quoted 15 lines
-----Original Message-----
From: Raghav Sharma <[email protected]>
Sent: Thursday, May 29, 2025 4:57 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Raghav Sharma <[email protected]>
Subject: [PATCH v3 4/4] arm64: dts: exynosautov920: addCMU_HSI2clock DT nodes
Quoted 5 lines
Add required dt node for
CMU_HSI2block, which provides clocks to ufs and ethernet IPsSigned-off-by Raghav Sharma <[email protected]>---
Quoted 38 lines
arch/arm64/boot/dts/exynos/exynosautov920.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)arch/arm64/boot/dts/exynos/exynosautov920.dtsi +17
-0@@ -1048,6 +1048,23 @@ pinctrl_hsi1: pinctrl@16450000 { interrupts = <GIC_SPI 456 IRQ_TYPE_LEVEL_HIGH>; }; + cmu_hsi2: clock-controller@16b00000 { + compatible = "samsung,exynosautov920-cmu-hsi2"; + reg = <0x16b00000 0x8000>; + #clock-cells = <1>; + + clocks = <&xtcxo>, + <&cmu_top DOUT_CLKCMU_HSI2_NOC>, + <&cmu_top DOUT_CLKCMU_HSI2_NOC_UFS>, + <&cmu_top DOUT_CLKCMU_HSI2_UFS_EMBD>, + <&cmu_top DOUT_CLKCMU_HSI2_ETHERNET>; + clock-names = "oscclk", + "noc", + "ufs", + "embd", + "ethernet"; + }; +arch/arm64/boot/dts/exynos/exynosautov920.dtsi +0
-1pinctrl_hsi2: pinctrl@16c10000 { compatible = "samsung,exynosautov920-pinctrl"; reg = <0x16c10000 0x10000>; --2.34.1
Krzysztof Kozlowski
AppliedQuoted 9 lines · Raghav Sharma
This series sorts clock yaml and adds clock support for the
CMU_HSI2block.Patch[1/4]: dt-bindings: clock: exynosautov920: sort clock definitions
- Sorts the compatible strings for clocksPatch[2/4]: dt-bindings: clock: exynosautov920: add hsi2 clock definitions
- Adds DT binding forCMU_HSI2and clock definitions[...]
Applied, thanks!
[1/4] dt-bindings: clock: exynosautov920: sort clock definitions
https://git.kernel.org/krzk/linux/c/3d6470990bfc8600609177962a53201cb0640daa [2/4] dt-bindings: clock: exynosautov920: add hsi2 clock definitions https://git.kernel.org/krzk/linux/c/da5cb65d25f747236a003b82525eb6de5d49a2e6 [3/4] clk: samsung: exynosautov920: add block hsi2 clock support https://git.kernel.org/krzk/linux/c/2d539f31ab0eb3eb3bd9491b7dcd52dec7967e15 [4/4] arm64: dts: exynosautov920: add CMU_HSI2 clock DT nodes https://git.kernel.org/krzk/linux/c/e2016763590f571cdc3912d6a7ec848d2b61e6c2
Best regards,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>