Skip to contentSkip to conversation

arm64: dts: ti: k3-am62: use opp_efuse_table for opp-table syscon

PATCH In review Dhruva Gole 2 participants 2 messages Aug 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: ti: k3-am62: use opp_efuse_table for opp-table syscon

Add another entry in the wkup_conf for the syscon node, and then use that for the syscon in opp-table.

Marking entire wkup_conf as "syscon", "simple-mfd" is wrong and needs to be addressed similar to how other child-nodes in wkup_conf are implemented in the same file.

---

Based on the discussion we had on [0] for AM62P/A devices setting OPP, Here we fix the AM625's opp-table using the syscon region in wkup_conf.

Build tested on top of linux-next.

Cc Bryan Brattlof <[email protected]>
Cc Vignesh Raghavendra <[email protected]>
Cc Vibhore Vardhan <[email protected]>

---

 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi | 5 +++++
 arch/arm64/boot/dts/ti/k3-am625.dtsi       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi +5 -0
index e0afafd532a5..3aff8af549a5 100644
@@ -22,6 +22,11 @@ chipid: chipid@14 {
 			reg = <0x14 0x4>;
 		};
 
+		opp_efuse_table: syscon@18 {
+			compatible = "ti,am62-opp-efuse-table", "syscon";
+			reg = <0x18 0x4>;
+		};
+
 		cpsw_mac_syscon: ethernet-mac-syscon@200 {
 			compatible = "ti,am62p-cpsw-mac-efuse", "syscon";
 			reg = <0x200 0x8>;
arch/arm64/boot/dts/ti/k3-am625.dtsi +1 -1
index c3d1db47dc9f..c249883a8a8d 100644
@@ -108,7 +108,7 @@ cpu3: cpu@3 {
 	a53_opp_table: opp-table {
 		compatible = "operating-points-v2-ti-cpu";
 		opp-shared;
-		syscon = <&wkup_conf>;
+		syscon = <&opp_efuse_table>;
 
 		opp-200000000 {
 			opp-hz = /bits/ 64 <200000000>;

base-commit: 1ca4237ad9ce29b0c66fe87862f1da54ac56a1e8

Signature · 1 line
2.34.1
#1 lore raw

On August 27, 2024 thus sayeth Dhruva Gole:

Quoted 46 lines

Add another entry in the wkup_conf for the syscon node, and then use that for the syscon in opp-table.

Marking entire wkup_conf as "syscon", "simple-mfd" is wrong and needs to be addressed similar to how other child-nodes in wkup_conf are implemented in the same file.

---

Based on the discussion we had on [0] for AM62P/A devices setting OPP, Here we fix the AM625's opp-table using the syscon region in wkup_conf.

Build tested on top of linux-next.

Cc Bryan Brattlof <[email protected]>
Cc Vignesh Raghavendra <[email protected]>
Cc Vibhore Vardhan <[email protected]>

---

 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi | 5 +++++
 arch/arm64/boot/dts/ti/k3-am625.dtsi       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi +5 -0
index e0afafd532a5..3aff8af549a5 100644
@@ -22,6 +22,11 @@ chipid: chipid@14 {
 			reg = <0x14 0x4>;
 		};
 
+		opp_efuse_table: syscon@18 {
+			compatible = "ti,am62-opp-efuse-table", "syscon";
+			reg = <0x18 0x4>;
+		};
+
 		cpsw_mac_syscon: ethernet-mac-syscon@200 {
 			compatible = "ti,am62p-cpsw-mac-efuse", "syscon";
 			reg = <0x200 0x8>;
arch/arm64/boot/dts/ti/k3-am625.dtsi +0 -0
index c3d1db47dc9f..c249883a8a8d 100644

arch/arm64/boot/dts/ti/k3-am625.dtsi cpu3: cpu@3 { · line 111

Quoted 5 lines
arch/arm64/boot/dts/ti/k3-am625.dtsi +1 -1
@@ -108,7 +108,7 @@ cpu3: cpu@3 {
 	a53_opp_table: opp-table {
 		compatible = "operating-points-v2-ti-cpu";
 		opp-shared;
-		syscon = <&wkup_conf>;
+		syscon = <&opp_efuse_table>;

Ah I wish it was as easy as this. Unfortunately ti-cpufreq.c embeds the 0x18 offset from the start of the WKUP_CRTL_MMR to get to the JTAG_USER_ID[0] for the AM62x. For the AM62Ax and AM62Px I used a 0x0 offset which is why this works for them. (Essentially hacking around the issue until I could find a way to fix this)

I think we may need some coordination between the different maintainers to get this fixed without breaking DFS for the AM62x for a release. That or we could add some logic in the driver to check for an offset in this property eg: 'syscon = <&opp_efuse_table 0x18>;' and use that. The end goal is to not need the offset at all so this is a lot of noise generation just to keep things working while we clean it up.

All of the solutions I can think of are super messy unfortunately.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/cpufreq/ti-cpufreq.c#n302

~Bryan