Skip to contentSkip to conversation

soc: ti: k3-ringacc: Add additional register regions

PATCH Applied Vignesh Raghavendra 4 participants 6 messages Aug 9, 2023 – Aug 11, 2023

Subsystems (2)
lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

cover soc: ti: k3-ringacc: Add additional register regions

Ringacc on TI K3 SoCs have configuration registers region which is usually hidden from Linux and configured via Device Manager Firmware APIs. But certain early SWs like bootloader which run before Device Manager is fully up would need to directly configure these registers and thus require to be in DT description.

This add bindings for the cfg region and also adds them to DT files. Backward compatibility is maintained to existing DT by only mandating existing regions to be present and this new region as optional.

Nishanth: I am hoping its possible for you to take bindings and DT via k3-dts-next once reviewed.

Vignesh Raghavendra (2):
dt-bindings: soc: ti: k3-ringacc: Describe cfg reg region
arm64: dts: ti: k3: Add cfg reg region to ringacc node

 Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml | 9 +++++++--
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi                 | 5 +++--
 arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi                  | 6 ++++--
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi                | 5 +++--
 arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi          | 6 ++++--
 arch/arm64/boot/dts/ti/k3-j721e-main.dtsi                | 5 +++--
 arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi          | 5 +++--
 arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi               | 5 +++--
 arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi         | 5 +++--
 arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi               | 5 +++--
 arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi         | 5 +++--
 11 files changed, 39 insertions(+), 22 deletions(-)
Signature · 1 line
2.41.0
author maintainer
#1 lore raw

PATCH 1/2 dt-bindings: soc: ti: k3-ringacc: Describe cfg reg region

RINGACC module on K3 SoCs have CFG register region which is usually configured by a Device Management firmware. But certain entities such as bootloader (like U-Boot) may have to access them directly. Describe this region in the binding documentation for completeness of module description.

Keep the binding compatible with existing DTS files by requiring first four regions to be present at least.

---
 Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml +7 -2
index 22cf9002fee7..a08959c6e072 100644
@@ -34,18 +34,22 @@ properties:
       - const: ti,am654-navss-ringacc
 
   reg:
+    minItems: 4
     items:
       - description: real time registers regions
       - description: fifos registers regions
       - description: proxy gcfg registers regions
       - description: proxy target registers regions
+      - description: configuration registers region
 
   reg-names:
+    minItems: 4
     items:
       - const: rt
       - const: fifos
       - const: proxy_gcfg
       - const: proxy_target
+      - const: cfg
 
   msi-parent: true
 
@@ -80,8 +84,9 @@ examples:
             reg = <0x0 0x3c000000 0x0 0x400000>,
                   <0x0 0x38000000 0x0 0x400000>,
                   <0x0 0x31120000 0x0 0x100>,
-                  <0x0 0x33000000 0x0 0x40000>;
-            reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+                  <0x0 0x33000000 0x0 0x40000>,
+                  <0x0 0x31080000 0x0 0x40000>;
+                  reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
             ti,num-rings = <818>;
             ti,sci-rm-range-gp-rings = <0x2>; /* GP ring range */
             ti,sci = <&dmsc>;
Signature · 1 line
2.41.0
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: soc: ti: k3-ringacc: Describe cfg reg region

Quoted 10 lines · Vignesh Raghavendra

RINGACC module on K3 SoCs have CFG register region which is usually configured by a Device Management firmware. But certain entities such as bootloader (like U-Boot) may have to access them directly. Describe this region in the binding documentation for completeness of module description.

Keep the binding compatible with existing DTS files by requiring first four regions to be present at least.

Thanks,
Conor.

author maintainer
#3 lore raw

PATCH 2/2 arm64: dts: ti: k3: Add cfg reg region to ringacc node

In reply to Vignesh Raghavendra

Add register range of ringacc cfg node to all k3 SoC dtsi files. This is normally under Device Management firmware control but some entities like bootloader have to access directly and thus required to be present in DT.

---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi         | 5 +++--
 arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi          | 6 ++++--
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi        | 5 +++--
 arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi  | 6 ++++--
 arch/arm64/boot/dts/ti/k3-j721e-main.dtsi        | 5 +++--
 arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi  | 5 +++--
 arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi       | 5 +++--
 arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 5 +++--
 arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi       | 5 +++--
 arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 5 +++--
 10 files changed, 32 insertions(+), 20 deletions(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +3 -2
index d08f086d7d01..bc460033a37a 100644
@@ -776,8 +776,9 @@ ringacc: ringacc@3c000000 {
 			reg = <0x0 0x3c000000 0x0 0x400000>,
 			      <0x0 0x38000000 0x0 0x400000>,
 			      <0x0 0x31120000 0x0 0x100>,
-			      <0x0 0x33000000 0x0 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x0 0x33000000 0x0 0x40000>,
+			      <0x0 0x31080000 0x0 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <818>;
 			ti,sci-rm-range-gp-rings = <0x1>; /* GP ring range */
 			ti,sci = <&dmsc>;
arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi +4 -2
index 7b1f94a89eca..1c16c3cac612 100644
@@ -197,8 +197,10 @@ mcu_ringacc: ringacc@2b800000 {
 			reg = <0x0 0x2b800000 0x0 0x400000>,
 			      <0x0 0x2b000000 0x0 0x400000>,
 			      <0x0 0x28590000 0x0 0x100>,
-			      <0x0 0x2a500000 0x0 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x0 0x2a500000 0x0 0x40000>,
+			      <0x0 0x28440000 0x0 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg",
+				    "proxy_target", "cfg";
 			ti,num-rings = <286>;
 			ti,sci-rm-range-gp-rings = <0x1>; /* GP ring range */
 			ti,sci = <&dmsc>;
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi +3 -2
index 6eaade5aeb42..e695f7881733 100644
@@ -267,8 +267,9 @@ main_ringacc: ringacc@3c000000 {
 			reg = <0x00 0x3c000000 0x00 0x400000>,
 			      <0x00 0x38000000 0x00 0x400000>,
 			      <0x00 0x31120000 0x00 0x100>,
-			      <0x00 0x33000000 0x00 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x00 0x33000000 0x00 0x40000>,
+			      <0x00 0x31080000 0x00 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <1024>;
 			ti,sci-rm-range-gp-rings = <0x1>; /* GP ring range */
 			ti,sci = <&dmsc>;
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi +4 -2
index ee7860913c38..04f39b081dc0 100644
@@ -329,8 +329,10 @@ mcu_ringacc: ringacc@2b800000 {
 			reg = <0x00 0x2b800000 0x00 0x400000>,
 			      <0x00 0x2b000000 0x00 0x400000>,
 			      <0x00 0x28590000 0x00 0x100>,
-			      <0x00 0x2a500000 0x00 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x00 0x2a500000 0x00 0x40000>,
+			      <0x00 0x28440000 0x00 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg",
+				    "proxy_target", "cfg";
 			ti,num-rings = <286>;
 			ti,sci-rm-range-gp-rings = <0x1>; /* GP ring range */
 			ti,sci = <&dmsc>;
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi +3 -2
index 3acd55ffd4ff..68a8abf59d24 100644
@@ -368,8 +368,9 @@ main_ringacc: ringacc@3c000000 {
 			reg = <0x0 0x3c000000 0x0 0x400000>,
 			      <0x0 0x38000000 0x0 0x400000>,
 			      <0x0 0x31120000 0x0 0x100>,
-			      <0x0 0x33000000 0x0 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x0 0x33000000 0x0 0x40000>,
+			      <0x0 0x31080000 0x0 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <1024>;
 			ti,sci-rm-range-gp-rings = <0x1>; /* GP ring range */
 			ti,sci = <&dmsc>;
arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi +3 -2
index c1b6f8d7d189..c5ede7bbc263 100644
@@ -448,8 +448,9 @@ mcu_ringacc: ringacc@2b800000 {
 			reg = <0x0 0x2b800000 0x0 0x400000>,
 			      <0x0 0x2b000000 0x0 0x400000>,
 			      <0x0 0x28590000 0x0 0x100>,
-			      <0x0 0x2a500000 0x0 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x0 0x2a500000 0x0 0x40000>,
+			      <0x0 0x28440000 0x0 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <286>;
 			ti,sci-rm-range-gp-rings = <0x1>; /* GP ring range */
 			ti,sci = <&dmsc>;
arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi +3 -2
index dc7920a35237..20548d95ab13 100644
@@ -1065,8 +1065,9 @@ main_ringacc: ringacc@3c000000 {
 			reg = <0x0 0x3c000000 0x0 0x400000>,
 			      <0x0 0x38000000 0x0 0x400000>,
 			      <0x0 0x31120000 0x0 0x100>,
-			      <0x0 0x33000000 0x0 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x0 0x33000000 0x0 0x40000>,
+			      <0x0 0x31080000 0x0 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <1024>;
 			ti,sci-rm-range-gp-rings = <0x1>;
 			ti,sci = <&sms>;
arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi +3 -2
index 736ec5fa0ea2..bba2d75324b8 100644
@@ -455,8 +455,9 @@ mcu_ringacc: ringacc@2b800000 {
 			reg = <0x0 0x2b800000 0x0 0x400000>,
 			      <0x0 0x2b000000 0x0 0x400000>,
 			      <0x0 0x28590000 0x0 0x100>,
-			      <0x0 0x2a500000 0x0 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x0 0x2a500000 0x0 0x40000>,
+			      <0x0 0x28440000 0x0 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <286>;
 			ti,sci-rm-range-gp-rings = <0x1>;
 			ti,sci = <&sms>;
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +3 -2
index a04c44708a09..29adf3c6a70d 100644
@@ -966,8 +966,9 @@ main_ringacc: ringacc@3c000000 {
 			reg = <0x00 0x3c000000 0x00 0x400000>,
 			      <0x00 0x38000000 0x00 0x400000>,
 			      <0x00 0x31120000 0x00 0x100>,
-			      <0x00 0x33000000 0x00 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x00 0x33000000 0x00 0x40000>,
+			      <0x00 0x31080000 0x00 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <1024>;
 			ti,sci-rm-range-gp-rings = <0x1>;
 			ti,sci = <&sms>;
arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi +3 -2
index 740ee794d7b9..42709489c5d1 100644
@@ -455,8 +455,9 @@ mcu_ringacc: ringacc@2b800000 {
 			reg = <0x00 0x2b800000 0x00 0x400000>,
 			      <0x00 0x2b000000 0x00 0x400000>,
 			      <0x00 0x28590000 0x00 0x100>,
-			      <0x00 0x2a500000 0x00 0x40000>;
-			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
+			      <0x00 0x2a500000 0x00 0x40000>,
+			      <0x00 0x28440000 0x00 0x40000>;
+			reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target", "cfg";
 			ti,num-rings = <286>;
 			ti,sci-rm-range-gp-rings = <0x1>;
 			ti,sci = <&sms>;
Signature · 1 line
2.41.0
maintainer Applied
#4 lore raw
In reply to Vignesh Raghavendra

Hi Vignesh Raghavendra,

Quoted 11 lines · Vignesh Raghavendra

Ringacc on TI K3 SoCs have configuration registers region which is usually hidden from Linux and configured via Device Manager Firmware APIs. But certain early SWs like bootloader which run before Device Manager is fully up would need to directly configure these registers and thus require to be in DT description.

This add bindings for the cfg region and also adds them to DT files. Backward compatibility is maintained to existing DT by only mandating existing regions to be present and this new region as optional.

[...]

I have assumed here with Conor's ack that this will flow through TI SoC tree. Do let me know if that is not the case.

I have applied the following to branch ti-k3-dts-next on [1]. Thank you!

[1/2] dt-bindings: soc: ti: k3-ringacc: Describe cfg reg region

      commit: 4f1e869915b7a8c48a0501ad0b102002013a7b7a
[2/2] arm64: dts: ti: k3: Add cfg reg region to ringacc node
      commit: 702110c2be999c1ad354ca6e14e8583ebcea2462

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#5 lore raw
In reply to Vignesh Raghavendra

Hi Vignesh,

Quoted 6 lines · Vignesh Raghavendra

Ringacc on TI K3 SoCs have configuration registers region which is usually hidden from Linux and configured via Device Manager Firmware APIs. But certain early SWs like bootloader which run before Device Manager is fully up would need to directly configure these registers and thus require to be in DT description.

Quoted 6 lines

This add bindings for the cfg region and also adds them to DT files. Backward compatibility is maintained to existing DT by only mandating existing regions to be present and this new region as optional.

Nishanth: I am hoping its possible for you to take bindings and DT via k3-dts-next once reviewed.

I have similar concern/question as for the DMA side, let me copy that here as well:
These regions were 'hidden' from Linux or other open coded access for a reason.
If I recall the main reason is security and the need to make sure that the allocation of the channels not been violated.

IMho the boot loader should be no exception and it should be using the DM firmware to configure the DMAs.

Or has the security concern been dropped and SW can do whatever it wants?

Quoted 18 lines

Vignesh Raghavendra (2):
dt-bindings: soc: ti: k3-ringacc: Describe cfg reg region
arm64: dts: ti: k3: Add cfg reg region to ringacc node

  Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml | 9 +++++++--
  arch/arm64/boot/dts/ti/k3-am65-main.dtsi                 | 5 +++--
  arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi                  | 6 ++++--
  arch/arm64/boot/dts/ti/k3-j7200-main.dtsi                | 5 +++--
  arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi          | 6 ++++--
  arch/arm64/boot/dts/ti/k3-j721e-main.dtsi                | 5 +++--
  arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi          | 5 +++--
  arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi               | 5 +++--
  arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi         | 5 +++--
  arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi               | 5 +++--
  arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi         | 5 +++--
  11 files changed, 39 insertions(+), 22 deletions(-)
Signature · 1 line
Péter