Skip to contentSkip to conversation

dt-bindings: clock: loongson,ls2k: add ls2k1000 compatible

PATCH Superseded wjjsn 2 participants 4 messages Mar 22 1 message not in the archive

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

wjjsn

author
#1 lore raw

PATCH 1/2 dt-bindings: clock: loongson,ls2k: add ls2k1000 compatible

From: wjjsn <[email protected]>

Add a SoC-specific "loongson,ls2k1000-clk" compatible. Retain the existing "loongson,ls2k-clk" as a deprecated fallback for backward compatibility.

---
 .../devicetree/bindings/clock/loongson,ls2k-clk.yaml        | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml +5 -1
index c07ad1f85857..4d70bc4e7a13 100644
@@ -13,12 +13,16 @@ description: |
   Loongson-2 SoC clock control module is an integrated clock controller, which
   generates and supplies to all modules.
 
+  The "loongson,ls2k1000-clk" string should be used for Loongson-2K1000.
+  The "loongson,ls2k-clk" string is kept as a fallback for backward compatibility for Loongson-2K1000.
+
 properties:
   compatible:
     enum:
       - loongson,ls2k0300-clk
       - loongson,ls2k0500-clk
-      - loongson,ls2k-clk  # This is for Loongson-2K1000
+      - loongson,ls2k-clk
+      - loongson,ls2k1000-clk
       - loongson,ls2k2000-clk
 
   reg:
Signature · 1 line
2.43.0
#2 lore raw
Quoted 3 lines · wjjsn

From: wjjsn <[email protected]>

Add a SoC-specific "loongson,ls2k1000-clk" compatible.

Why?

Quoted 16 lines

Retain the existing "loongson,ls2k-clk" as a deprecated fallback for backward compatibility.

---
 .../devicetree/bindings/clock/loongson,ls2k-clk.yaml        | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml +0 -0
index c07ad1f85857..4d70bc4e7a13 100644
@@ -13,12 +13,16 @@ description: |
   Loongson-2 SoC clock control module is an integrated clock controller, which
   generates and supplies to all modules.
 

Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml description: | · line 24

Quoted 10 lines
Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml +4 -1
+  The "loongson,ls2k1000-clk" string should be used for Loongson-2K1000.
+  The "loongson,ls2k-clk" string is kept as a fallback for backward compatibility for Loongson-2K1000.
+
 properties:
   compatible:
     enum:
       - loongson,ls2k0300-clk
       - loongson,ls2k0500-clk
-      - loongson,ls2k-clk  # This is for Loongson-2K1000
+      - loongson,ls2k-clk

Naaah, never tested.

Best regards,
Krzysztof

author
#3 lore raw

PATCH 2/2 clk: loongson2: add support for ls2k1000 compatible

In reply to a message not in the archive

From: wjjsn <[email protected]>

Add driver support for the "loongson,ls2k1000-clk" compatible and update the Loongson-2K1000 DTS to use it while retaining "loongson,ls2k-clk" as a fallback.

---
 arch/loongarch/boot/dts/loongson-2k1000.dtsi | 2 +-
 drivers/clk/clk-loongson2.c                  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/loongarch/boot/dts/loongson-2k1000.dtsi +1 -1
index ab6a55937e9e..61cdae438cb0 100644
@@ -156,7 +156,7 @@ pctrl: pinctrl@1fe00420 {
 		};
 
 		clk: clock-controller@1fe00480 {
-			compatible = "loongson,ls2k-clk";
+			compatible = "loongson,ls2k1000-clk", "loongson,ls2k-clk";
 			reg = <0x0 0x1fe00480 0x0 0x58>;
 			#clock-cells = <1>;
 			clocks = <&ref_100m>;
drivers/clk/clk-loongson2.c +1 -0
index 9c4c6c99db3e..48d00578b26f 100644
@@ -441,6 +441,7 @@ static const struct of_device_id loongson2_clk_match_table[] = {
 	{ .compatible = "loongson,ls2k0300-clk", .data = &ls2k0300_clks },
 	{ .compatible = "loongson,ls2k0500-clk", .data = &ls2k0500_clks },
 	{ .compatible = "loongson,ls2k-clk", .data = &ls2k1000_clks },
+	{ .compatible = "loongson,ls2k1000-clk", .data = &ls2k1000_clks },
 	{ .compatible = "loongson,ls2k2000-clk", .data = &ls2k2000_clks },
 	{ }
 };
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH 2/2] clk: loongson2: add support for ls2k1000 compatible

Quoted 9 lines · wjjsn

From: wjjsn <[email protected]>

Add driver support for the "loongson,ls2k1000-clk" compatible and update the Loongson-2K1000 DTS to use it while retaining "loongson,ls2k-clk" as a fallback.

---
 arch/loongarch/boot/dts/loongson-2k1000.dtsi | 2 +-

This is not driver.

Quoted 1 line
 drivers/clk/clk-loongson2.c                  | 1 +

Why are you combining these? Please read submitting patches in DT and maintainer-soc profile to understand. Then read submitting patches and split your code in logical chunks.

arch/loongarch/boot/dts/loongson-2k1000.dtsi pctrl: pinctrl@1fe00420 { · line 159

Quoted 12 lines
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/loongarch/boot/dts/loongson-2k1000.dtsi +1 -1
index ab6a55937e9e..61cdae438cb0 100644
@@ -156,7 +156,7 @@ pctrl: pinctrl@1fe00420 {
 		};
 
 		clk: clock-controller@1fe00480 {
-			compatible = "loongson,ls2k-clk";
+			compatible = "loongson,ls2k1000-clk", "loongson,ls2k-clk";

You never tested your code. You have warning here.

drivers/clk/clk-loongson2.c static const struct of_device_id loongson2_clk_match_table[] = { · line 444

Quoted 12 lines
arch/loongarch/boot/dts/loongson-2k1000.dtsi +0 -0
 			reg = <0x0 0x1fe00480 0x0 0x58>;
 			#clock-cells = <1>;
 			clocks = <&ref_100m>;
drivers/clk/clk-loongson2.c +1 -0
index 9c4c6c99db3e..48d00578b26f 100644
@@ -441,6 +441,7 @@ static const struct of_device_id loongson2_clk_match_table[] = {
 	{ .compatible = "loongson,ls2k0300-clk", .data = &ls2k0300_clks },
 	{ .compatible = "loongson,ls2k0500-clk", .data = &ls2k0500_clks },
 	{ .compatible = "loongson,ls2k-clk", .data = &ls2k1000_clks },
+	{ .compatible = "loongson,ls2k1000-clk", .data = &ls2k1000_clks },

What is the point of this change? It's redundant.

drivers/clk/clk-loongson2.c static const struct of_device_id loongson2_clk_match_table[] = { · line 447

Quoted 3 lines
drivers/clk/clk-loongson2.c +0 -0
 	{ .compatible = "loongson,ls2k2000-clk", .data = &ls2k2000_clks },
 	{ }
 };

Best regards,
Krzysztof