reset: thead: Scope TH1520 reset driver to VO subsystem
A message that is not in the archive (sent off-list or not yet received): CGME20250810211419eucas1p173e5fefcfaae437d8b5531d1406ff6a6@eucas1p1.samsung.com
PATCH 1/1 reset: thead: Scope TH1520 reset driver to VO subsystem
The reset controller driver for the TH1520 was using the generic compatible string "thead,th1520-reset". However, the current implementation only manages the resets for the Video Output (VO) subsystem.
Using a generic compatible is incorrect as it implies control over all reset units on the SoC. This could lead to conflicts if support for other reset controllers on the TH1520 is added in the future like AP.
To ensure correctness and prevent future issues, this patch renames the compatible string to "thead,th1520-reset-vo". The device tree bindings, the th1520.dtsi file, and the driver itself are updated to use this new, more specific compatible. The device tree node label is also renamed from 'rst' to 'rst_vo' for clarity.
--- Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml | 6 +++--- arch/riscv/boot/dts/thead/th1520.dtsi | 6 +++--- drivers/reset/reset-th1520.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +3 -3
@@ -16,7 +16,7 @@ maintainers: properties: compatible: enum: - - thead,th1520-reset + - thead,th1520-reset-vo reg: maxItems: 1
@@ -36,8 +36,8 @@ examples: soc { #address-cells = <2>; #size-cells = <2>; - rst: reset-controller@ffef528000 { - compatible = "thead,th1520-reset"; + rst_vo: reset-controller@ffef528000 { + compatible = "thead,th1520-reset-vo"; reg = <0xff 0xef528000 0x0 0x1000>; #reset-cells = <1>; };
arch/riscv/boot/dts/thead/th1520.dtsi +3 -3
@@ -235,7 +235,7 @@ aon: aon { compatible = "thead,th1520-aon"; mboxes = <&mbox_910t 1>; mbox-names = "aon"; - resets = <&rst TH1520_RESET_ID_GPU_CLKGEN>; + resets = <&rst_vo TH1520_RESET_ID_GPU_CLKGEN>; reset-names = "gpu-clkgen"; #power-domain-cells = <1>; };
@@ -500,8 +500,8 @@ clk: clock-controller@ffef010000 { #clock-cells = <1>; }; - rst: reset-controller@ffef528000 { - compatible = "thead,th1520-reset"; + rst_vo: reset-controller@ffef528000 { + compatible = "thead,th1520-reset-vo"; reg = <0xff 0xef528000 0x0 0x4f>; #reset-cells = <1>; };
drivers/reset/reset-th1520.c +1 -1
@@ -116,7 +116,7 @@ static int th1520_reset_probe(struct platform_device *pdev) }static const struct of_device_id th1520_reset_match[] = { - { .compatible ="thead,th1520-reset" }, + { .compatible ="thead,th1520-reset-vo" }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, th1520_reset_match);
---
base-commit: 561c80369df0733ba0574882a1635287b20f9de2
change-id: 20250810-fix_reset_2-a618d7426534
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Quoted 29 lines · Michal Wilczynski
The reset controller driver for the TH1520 was using the generic compatible string "thead,th1520-reset". However, the current implementation only manages the resets for the Video Output (VO) subsystem.
Using a generic compatible is incorrect as it implies control over all reset units on the SoC. This could lead to conflicts if support for other reset controllers on the TH1520 is added in the future like AP.
To ensure correctness and prevent future issues, this patch renames the compatible string to "thead,th1520-reset-vo". The device tree bindings, the
th1520.dtsifile, and the driver itself are updated to use this new, more specific compatible. The device tree node label is also renamed from 'rst' to 'rst_vo' for clarity.Fixes 30e7573babdc ("dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller")Reported-by Icenowy Zheng <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>--- Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml | 6 +++--- arch/riscv/boot/dts/thead/th1520.dtsi | 6 +++--- drivers/reset/reset-th1520.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +0
-0
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml maintainers: · line 19
Quoted 5 lines
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +1
-1@@ -16,7 +16,7 @@ maintainers: properties: compatible: enum: - - thead,th1520-reset + - thead,th1520-reset-vo
I think we should mark thead,th1520-reset as deprecated instead of removing it completely, to demonstrate the ABI problem and make the situation clear.
Quoted 42 lines
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +2
-2reg: maxItems: 1@@ -36,8 +36,8 @@ examples: soc { #address-cells = <2>; #size-cells = <2>; - rst: reset-controller@ffef528000 { - compatible = "thead,th1520-reset"; + rst_vo: reset-controller@ffef528000 { + compatible = "thead,th1520-reset-vo"; reg = <0xff 0xef528000 0x0 0x1000>; #reset-cells = <1>; };arch/riscv/boot/dts/thead/th1520.dtsi +3
-3@@ -235,7 +235,7 @@ aon: aon { compatible = "thead,th1520-aon"; mboxes = <&mbox_910t 1>; mbox-names = "aon"; - resets = <&rst TH1520_RESET_ID_GPU_CLKGEN>; + resets = <&rst_vo TH1520_RESET_ID_GPU_CLKGEN>; reset-names = "gpu-clkgen"; #power-domain-cells = <1>; };@@ -500,8 +500,8 @@ clk: clock-controller@ffef010000 { #clock-cells = <1>; }; - rst: reset-controller@ffef528000 { - compatible = "thead,th1520-reset"; + rst_vo: reset-controller@ffef528000 { + compatible = "thead,th1520-reset-vo"; reg = <0xff 0xef528000 0x0 0x4f>; #reset-cells = <1>; };drivers/reset/reset-th1520.c +0
-0
drivers/reset/reset-th1520.c static int th1520_reset_probe(struct platform_device *pdev) · line 119
Quoted 5 lines
drivers/reset/reset-th1520.c +1
-1@@ -116,7 +116,7 @@ static int th1520_reset_probe(struct platform_device *pdev) }static const struct of_device_id th1520_reset_match[] = { - { .compatible ="thead,th1520-reset" }, + { .compatible ="thead,th1520-reset-vo" },
And this change actually breaks compatibility with older devicetrees. thead,th1520-reset has been part of the ABI, and we should keep the compatible string to maintain the compatibility.
With these two changes, I think the changes could be seperated into different patches, one for the dt-binding, one for the driver, and one for the devicetree, which could make their scope more clear.
Thanks,
Yao Zi
Quoted 12 lines
drivers/reset/reset-th1520.c +0
-1{/* sentinel */ } };MODULE_DEVICE_TABLE (of, th1520_reset_match); ---base-commit:
561c80369df0733ba0574882a1635287b20f9de2
change-id: 20250810-fix_reset_2-a618d7426534Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Quoted 6 lines · Michal Wilczynski
The reset controller driver for the TH1520 was using the generic compatible string "thead,th1520-reset". However, the current implementation only manages the resets for the Video Output (VO) subsystem.
Using a generic compatible is incorrect as it implies control over all
Depends, it does not need to imply that.
But in general this is why we ask - and writing bindings have it documented - to post COMPLETE bindings.
Quoted 10 lines
reset units on the SoC. This could lead to conflicts if support for other reset controllers on the TH1520 is added in the future like AP.
To ensure correctness and prevent future issues, this patch renames the compatible string to "thead,th1520-reset-vo". The device tree bindings, the
th1520.dtsifile, and the driver itself are updated to use this new, more specific compatible. The device tree node label is also renamed from 'rst' to 'rst_vo' for clarity.Fixes 30e7573babdc ("dt-bindings: reset: Add T-HEAD TH1520 SoC Reset Controller")
That's not a commit from the current RC. Where is cc stable?
Quoted 6 lines
Reported-by Icenowy Zheng <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>--- Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml | 6 +++--- arch/riscv/boot/dts/thead/th1520.dtsi | 6 +++--- drivers/reset/reset-th1520.c | 2 +-
Please run scripts/checkpatch.pl on the patches and fix reported warnings. After that, run also 'scripts/checkpatch.pl --strict' on the patches and (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml maintainers: · line 19
Quoted 12 lines
3 files changed, 7 insertions(+), 7 deletions(-)Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +1
-1@@ -16,7 +16,7 @@ maintainers: properties: compatible: enum: - - thead,th1520-reset + - thead,th1520-reset-vo
No, don't rename the compatible. That's ABI break and this was ALREADY released.
That's a NAK because you break ABI for not important reason - style.
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml examples: · line 39
Quoted 10 lines
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +1
-2reg: maxItems: 1@@ -36,8 +36,8 @@ examples: soc { #address-cells = <2>; #size-cells = <2>; - rst: reset-controller@ffef528000 { - compatible = "thead,th1520-reset"; + rst_vo: reset-controller@ffef528000 {
Drop the label. Why is it here in the first place?
Quoted 33 lines
Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +1
-0+ compatible = "thead,th1520-reset-vo"; reg = <0xff 0xef528000 0x0 0x1000>; #reset-cells = <1>; };arch/riscv/boot/dts/thead/th1520.dtsi +3
-3@@ -235,7 +235,7 @@ aon: aon { compatible = "thead,th1520-aon"; mboxes = <&mbox_910t 1>; mbox-names = "aon"; - resets = <&rst TH1520_RESET_ID_GPU_CLKGEN>; + resets = <&rst_vo TH1520_RESET_ID_GPU_CLKGEN>; reset-names = "gpu-clkgen"; #power-domain-cells = <1>; };@@ -500,8 +500,8 @@ clk: clock-controller@ffef010000 { #clock-cells = <1>; }; - rst: reset-controller@ffef528000 { - compatible = "thead,th1520-reset"; + rst_vo: reset-controller@ffef528000 { + compatible = "thead,th1520-reset-vo"; reg = <0xff 0xef528000 0x0 0x4f>; #reset-cells = <1>; };drivers/reset/reset-th1520.c +0
-0
drivers/reset/reset-th1520.c static int th1520_reset_probe(struct platform_device *pdev) · line 119
Quoted 5 lines
drivers/reset/reset-th1520.c +1
-1@@ -116,7 +116,7 @@ static int th1520_reset_probe(struct platform_device *pdev) }static const struct of_device_id th1520_reset_match[] = { - { .compatible ="thead,th1520-reset" }, + { .compatible ="thead,th1520-reset-vo" },
NAK, actual ABI break.
Best regards,
Krzysztof
Drew Fustini
maintainerQuoted 4 lines · Michal Wilczynski
The reset controller driver for the TH1520 was using the generic compatible string "thead,th1520-reset". However, the current implementation only manages the resets for the Video Output (VO) subsystem.
Looking at Section 5.4 on Page 451 of the TH1520 System User Manual [1], it does seem like we would ultimately need 6 separate nodes for reset controllers:
0xFF_EF01_4000: AP_SUBSYS
0xFF_EC02_C000: MISC_SUBSYS
0xFF_E404_0000: VI_SUBSYS
0xFF_EF52_8000: VO_SUBSYS
0xFF_ECC3_0000: VP_SUBSYS
0xFF_EF04_0000: DSP_SUBSYS
Maybe we should take this opportunity to document the bindings for all the resets that the REE (e.g. Linux) can control?
It seemed like that was overkill for the 2 resets needed for the GPU, but, as Krzysztof noted in this thread, problems arise when bindings are introduced that are not complete.
Thanks,
Drew
Quoted 9 lines · Drew Fustini
Quoted 4 lines · Michal Wilczynski
The reset controller driver for the TH1520 was using the generic compatible string "thead,th1520-reset". However, the current implementation only manages the resets for the Video Output (VO) subsystem.
Looking at Section 5.4 on Page 451 of the TH1520 System User Manual [1], it does seem like we would ultimately need 6 separate nodes for reset controllers:
Yes, this is true. And another six nodes for clock controllers (there's already one).
Quoted 9 lines
0xFF_EF01_4000:
AP_SUBSYS
0xFF_EC02_C000:MISC_SUBSYS
0xFF_E404_0000:VI_SUBSYS
0xFF_EF52_8000:VO_SUBSYS
0xFF_ECC3_0000:VP_SUBSYS
0xFF_EF04_0000:DSP_SUBSYSMaybe we should take this opportunity to document the bindings for all the resets that the REE (e.g. Linux) can control?
It's worth noting that with either mainline U-Boot or vendor U-Boot, no core is configured to run as REE. IOW, AON_SUBSYS could be accessed by AP cores as well.
I think introducing read-only clock support to Linux could help us to correctly describe pvt clocks which are now replaced with a aonsys placeholder and resolve issues like what is described in 0370395d45ca ("clk: thead: Mark essential bus clocks as CLK_IGNORE_UNUSED").
Futhermore, there may be downstream projects, e.g. U-Boot, make use of these TEE-only devices, which could benefit if we have these devices documented and described in devicetree, too. Thus I think the AON clock and reset controllers should be documented as well if we're going to document every reset/clock controller in a batch.
Quoted 8 lines
It seemed like that was overkill for the 2 resets needed for the GPU, but, as Krzysztof noted in this thread, problems arise when bindings are introduced that are not complete.
Thanks,
Drew
Best regards,
Yao Zi
Drew Fustini
maintainerQuoted 21 lines · Yao Zi
Quoted 9 lines · Drew Fustini
Quoted 4 lines · Michal Wilczynski
The reset controller driver for the TH1520 was using the generic compatible string "thead,th1520-reset". However, the current implementation only manages the resets for the Video Output (VO) subsystem.
Looking at Section 5.4 on Page 451 of the TH1520 System User Manual [1], it does seem like we would ultimately need 6 separate nodes for reset controllers:
Yes, this is true. And another six nodes for clock controllers (there's already one).
Quoted 7 lines
0xFF_EF01_4000:
AP_SUBSYS
0xFF_EC02_C000:MISC_SUBSYS
0xFF_E404_0000:VI_SUBSYS
0xFF_EF52_8000:VO_SUBSYS
0xFF_ECC3_0000:VP_SUBSYS
0xFF_EF04_0000:DSP_SUBSYS
Quoted 6 lines
Quoted 2 lines
Maybe we should take this opportunity to document the bindings for all the resets that the REE (e.g. Linux) can control?
It's worth noting that with either mainline U-Boot or vendor U-Boot, no core is configured to run as REE. IOW,
AON_SUBSYScould be accessed by AP cores as well.
Interesting, I didn't know that the AP cores could access TEE resources.
Quoted 11 lines
I think introducing read-only clock support to Linux could help us to correctly describe pvt clocks which are now replaced with a aonsys placeholder and resolve issues like what is described in
0370395d45ca("clk: thead: Mark essential bus clocks asCLK_IGNORE_UNUSED").Futhermore, there may be downstream projects, e.g. U-Boot, make use of these TEE-only devices, which could benefit if we have these devices documented and described in devicetree, too. Thus I think the AON clock and reset controllers should be documented as well if we're going to document every reset/clock controller in a batch.
I think that does make sense to document the AONSYS clock and reset controllers in the DT bindings as they are part of the hardware and described in the t-head documentation. It would be great to be able to make use of more functionality in the t-head sdk like the ability to reboot the board.
Thanks,
Drew