riscv: sophgo: cv18xx: dts rework, part 2
Subsystems (4)
Inochi Amaoto
maintainercover riscv: sophgo: cv18xx: dts rework, part 2
The part 2 of dts rework replaces precise compatible for existed clock device with old wildcard one.
Inochi Amaoto (3):
dt-bindings: clock: sophgo: Use precise compatible for CV1800 series
SoC
clk: sophgo: Add support for newly added precise compatible
riscv: dts: sophgo: switch precise compatible for existed clock device
for CV18XX
.../bindings/clock/sophgo,cv1800-clk.yaml | 13 +++++++++---- arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 2 +- arch/riscv/boot/dts/sophgo/cv1812h.dtsi | 2 +- arch/riscv/boot/dts/sophgo/sg2002.dtsi | 2 +- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 5 files changed, 15 insertions(+), 7 deletions(-)
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
prerequisite-patch-id: 94fb3d26e017cf839b4dcb4bf85624614a94b9ac
prerequisite-patch-id: 8f4a8bdead0e4e3d6904adbc0fd150b7dffefc85
prerequisite-patch-id: b30e850690903c3ddc3d8bb77a99e97934dc9dde
prerequisite-patch-id: 6e1117694a53a0059b145ad4751ec204cae0db35 --
2.49.0
Inochi Amaoto
maintainerPATCH 1/3 dt-bindings: clock: sophgo: Use precise compatible for CV1800 series SoC
As previous binding uses a wildcard compatible for existed clock device of CV1800 series SoC, it is not suitable for existed requirement.
Add new precise compatible for existed clock devices of CV1800 series SoCs.
--- .../bindings/clock/sophgo,cv1800-clk.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml +9 -4
@@ -11,10 +11,15 @@ maintainers: properties: compatible: - enum: - - sophgo,cv1800-clk - - sophgo,cv1810-clk - - sophgo,sg2000-clk + oneOf: + - const: sophgo,cv1800-clk + deprecated: true + - const: sophgo,cv1800b-clk + - const: sophgo,cv1810-clk + deprecated: true + - const: sophgo,cv1812h-clk + - const: sophgo,sg2000-clk + - const: sophgo,sg2002-clk reg: maxItems: 1
Signature · 1 line
2.49.0
Inochi Amaoto
maintainerPATCH 2/3 clk: sophgo: Add support for newly added precise compatible
In reply to Inochi AmaotoAdd of device id definition for newly added precise compatible.
--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/clk/sophgo/clk-cv1800.c +3 -0
@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc }, { .compatible ="sophgo,cv1810-clk" , .data = &cv1810_desc }, + { .compatible ="sophgo,cv1812h-clk" , .data = &cv1800_desc }, { .compatible ="sophgo,sg2000-clk" , .data = &sg2000_desc }, + { .compatible ="sophgo,sg2002-clk" , .data = &sg2000_desc }, { } };MODULE_DEVICE_TABLE (of, cv1800_clk_ids);
Signature · 1 line
2.49.0
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Quoted 12 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1522
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +1
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc },
Given the same data is used here, should there not be fallbacks in the dt for some of these? For example, 1812 to 1800? Or is that not okay, because 1800 is not a real device id?
Quoted 10 lines
drivers/clk/sophgo/clk-cv1800.c +2
-0{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc }, + { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc }, { .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc }, + { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc }, { } };MODULE_DEVICE_TABLE (of, cv1800_clk_ids);Signature · 1 line
2.49.0
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Quoted 22 lines · Conor Dooley
Quoted 12 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1522
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +1
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc },Given the same data is used here, should there not be fallbacks in the dt for some of these? For example, 1812 to 1800? Or is that not okay, because 1800 is not a real device id?
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1526
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +2
-0{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc }, + { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc }, { .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc }, + { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
Actually, this one is a better example. sg2000 is not marked deprecated. sg2002 uses the same match data. Why is no fallback to sg2000 used for the sg2002 case?
Inochi Amaoto
maintainerRe: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Quoted 23 lines · Conor Dooley
Quoted 22 lines · Conor Dooley
Quoted 12 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1522
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +1
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc },Given the same data is used here, should there not be fallbacks in the dt for some of these? For example, 1812 to 1800? Or is that not okay, because 1800 is not a real device id?
Quoted 8 lines
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1526
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +2
-0{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc }, + { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc }, { .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc }, + { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },Actually, this one is a better example. sg2000 is not marked deprecated. sg2002 uses the same match data. Why is no fallback to sg2000 used for the sg2002 case?
Yeah, It is a good idea. I will take it, thanks,
Regards,
Inochi
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Quoted 33 lines · Inochi Amaoto
Quoted 23 lines · Conor Dooley
Quoted 22 lines · Conor Dooley
Quoted 12 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1522
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +1
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc },Given the same data is used here, should there not be fallbacks in the dt for some of these? For example, 1812 to 1800? Or is that not okay, because 1800 is not a real device id?
Quoted 8 lines
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1526
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +2
-0{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc }, + { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc }, { .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc }, + { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },Actually, this one is a better example. sg2000 is not marked deprecated. sg2002 uses the same match data. Why is no fallback to sg2000 used for the sg2002 case?
Quoted 1 line
Yeah, It is a good idea. I will take it, thanks,
Can you point out the difference in the dt-binding patch when you do, between the sg2000 being a real device and the others not?
Inochi Amaoto
maintainerRe: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Quoted 34 lines · Conor Dooley
Quoted 33 lines · Inochi Amaoto
Quoted 31 lines · Conor Dooley
Quoted 22 lines · Conor Dooley
Quoted 12 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1522
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +1
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc },Given the same data is used here, should there not be fallbacks in the dt for some of these? For example, 1812 to 1800? Or is that not okay, because 1800 is not a real device id?
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1526
Quoted 4 lines
drivers/clk/sophgo/clk-cv1800.c +2
-0{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc }, + { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc }, { .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc }, + { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },Actually, this one is a better example. sg2000 is not marked deprecated. sg2002 uses the same match data. Why is no fallback to sg2000 used for the sg2002 case?
Quoted 4 lines
Quoted 1 line
Yeah, It is a good idea. I will take it, thanks,
Can you point out the difference in the dt-binding patch when you do, between the sg2000 being a real device and the others not?
I will, thanks for the reminder.
Regards,
Inochi
Inochi Amaoto
maintainerRe: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
In reply to Conor DooleyQuoted 14 lines · Conor Dooley
Quoted 13 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>--- drivers/clk/sophgo/clk-cv1800.c | 3 +++ 1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
Quoted 6 lines
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1522
Quoted 3 lines
drivers/clk/sophgo/clk-cv1800.c +1
-0static const struct of_device_id cv1800_clk_ids[] = { { .compatible ="sophgo,cv1800-clk" , .data = &cv1800_desc }, + { .compatible ="sophgo,cv1800b-clk" , .data = &cv1800_desc },Given the same data is used here, should there not be fallbacks in the dt for some of these? For example, 1812 to 1800?
In default, there maybe not fallback for the whole series, I think. But it is possible to use cv1800b as
Quoted 1 line
Or is that not okay, because 1800 is not a real device id?
Yes, cv1800-clk and cv1810-clk is a old wildcard compatible, not a real one. As this is not prefered, I want to fix this to have a meaningful compatible.
Regards,
Inochi
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
In reply to Inochi AmaotoHi Inochi!
Quoted 17 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>---
drivers/clk/sophgo/clk-cv1800.c | 3 +++1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
static const structof_device_idcv1800_clk_ids[] = {
{ .compatible = "sophgo,cv1800-clk", .data =&cv1800_desc},drivers/clk/sophgo/clk-cv1800.c +1
-0+ { .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },{ .compatible = "sophgo,cv1810-clk", .data =
&cv1810_desc},
drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1524
Quoted 1 line
drivers/clk/sophgo/clk-cv1800.c +1
-0+ { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
^
Should it have been "cv1810_desc" instead?
Quoted 5 lines
{ .compatible = "sophgo,sg2000-clk", .data =
&sg2000_desc},drivers/clk/sophgo/clk-cv1800.c +1
-0+ { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },{ }
};
MODULE_DEVICE_TABLE(of,cv1800_clk_ids);
Signature · 1 line
Alexander Sverdlin.
Inochi Amaoto
maintainerRe: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Quoted 22 lines · Alexander Sverdlin
Hi Inochi!
Quoted 17 lines · Inochi Amaoto
Add of device id definition for newly added precise compatible.
Signed-off-by Inochi Amaoto <[email protected]>---
drivers/clk/sophgo/clk-cv1800.c | 3 +++1 file changed, 3 insertions(+)drivers/clk/sophgo/clk-cv1800.c +0
-0@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
static const structof_device_idcv1800_clk_ids[] = {
{ .compatible = "sophgo,cv1800-clk", .data =&cv1800_desc},drivers/clk/sophgo/clk-cv1800.c +1
-0+ { .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },{ .compatible = "sophgo,cv1810-clk", .data =
&cv1810_desc},drivers/clk/sophgo/clk-cv1800.c static int cv1800_clk_probe(struct platform_device *pdev) · line 1524
Quoted 1 line
drivers/clk/sophgo/clk-cv1800.c +1
-0+ { .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },^
Quoted 2 lines
Should it have been "
cv1810_desc" instead?
Yeah, this is a mistake. I will fix it.
Quoted 8 lines
Quoted 5 lines
{ .compatible = "sophgo,sg2000-clk", .data =
&sg2000_desc},drivers/clk/sophgo/clk-cv1800.c +1
-0+ { .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },{ }
};
MODULE_DEVICE_TABLE(of,cv1800_clk_ids);Signature · 1 line
Alexander Sverdlin.
Inochi Amaoto
maintainerPATCH 3/3 riscv: dts: sophgo: switch precise compatible for existed clock device for CV18XX
In reply to Inochi Amaotoreplace newly added precise compatible with old one for existed clock device of CV18XX series SoCs.
--- arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 2 +- arch/riscv/boot/dts/sophgo/cv1812h.dtsi | 2 +- arch/riscv/boot/dts/sophgo/sg2002.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/riscv/boot/dts/sophgo/cv1800b.dtsi +1 -1
@@ -29,7 +29,7 @@ pinctrl: pinctrl@3001000 { }; clk: clock-controller@3002000 { - compatible = "sophgo,cv1800-clk"; + compatible = "sophgo,cv1800b-clk"; reg = <0x03002000 0x1000>; clocks = <&osc>; #clock-cells = <1>;
arch/riscv/boot/dts/sophgo/cv1812h.dtsi +1 -1
@@ -31,7 +31,7 @@ pinctrl: pinctrl@3001000 { }; clk: clock-controller@3002000 { - compatible = "sophgo,cv1810-clk"; + compatible = "sophgo,cv1812h-clk"; reg = <0x03002000 0x1000>; clocks = <&osc>; #clock-cells = <1>;
arch/riscv/boot/dts/sophgo/sg2002.dtsi +1 -1
@@ -31,7 +31,7 @@ pinctrl: pinctrl@3001000 { }; clk: clock-controller@3002000 { - compatible = "sophgo,sg2000-clk"; + compatible = "sophgo,sg2002-clk"; reg = <0x03002000 0x1000>; clocks = <&osc>; #clock-cells = <1>;
Signature · 1 line
2.49.0