Skip to contentSkip to conversation

arm64: dts: ti: k3-am65-main: Disable RNG node

PATCH Applied Andrew Davis 3 participants 9 messages Aug 23, 2022 – Sep 9, 2022

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

PATCH v2 1/4 arm64: dts: ti: k3-am65-main: Disable RNG node

The hardware random number generator is used by OP-TEE and is access is denied to other users with SoC level bus firewalls. Any access to this device from Linux will result in firewall errors.

We could remove this node, but it is still valid device description, and it is possible it could be re-enabled in the bootloader if OP-TEE is not used. So only disable this node for now.

---

Changes from v1:
- Added comment in DT
- Explained why it is only disabled in commit message

 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +1 -0
index 8919fede3cd7..b3e714e1abed 100644
@@ -127,6 +127,7 @@ rng: rng@4e10000 {
 			reg = <0x0 0x4e10000 0x0 0x7d>;
 			interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&k3_clks 136 1>;
+			status = "disabled"; /* Used by OP-TEE */
 		};
 	};
 
Signature · 1 line
2.36.1
#1 lore raw

PATCH v2 2/4 arm64: dts: ti: k3-am65-main: Move SA2UL to unused PSI-L thread ID

The first TX and first two RX PSI-L threads for SA2UL are used by SYSFW on High Security(HS) devices. Use the next available threads to prevent resource allocation conflicts.

---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +2 -2
index b3e714e1abed..165f53bd058b 100644
@@ -117,8 +117,8 @@ crypto: crypto@4e00000 {
 		#size-cells = <2>;
 		ranges = <0x0 0x04e00000 0x00 0x04e00000 0x0 0x30000>;
 
-		dmas = <&main_udmap 0xc000>, <&main_udmap 0x4000>,
-				<&main_udmap 0x4001>;
+		dmas = <&main_udmap 0xc001>, <&main_udmap 0x4002>,
+				<&main_udmap 0x4003>;
 		dma-names = "tx", "rx1", "rx2";
 		dma-coherent;
 
Signature · 1 line
2.36.1
Reviewed-by on v2 2/4
#2 lore raw

Re: [PATCH v2 2/4] arm64: dts: ti: k3-am65-main: Move SA2UL to unused PSI-L thread ID

Quoted 14 lines · Andrew Davis

The first TX and first two RX PSI-L threads for SA2UL are used by SYSFW on High Security(HS) devices. Use the next available threads to prevent resource allocation conflicts.

---
  arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0 -0
index b3e714e1abed..165f53bd058b 100644

arch/arm64/boot/dts/ti/k3-am65-main.dtsi crypto: crypto@4e00000 { · line 124

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +2 -2
@@ -117,8 +117,8 @@ crypto: crypto@4e00000 {
  		#size-cells = <2>;
  		ranges = <0x0 0x04e00000 0x00 0x04e00000 0x0 0x30000>;
 
-		dmas = <&main_udmap 0xc000>, <&main_udmap 0x4000>,
-				<&main_udmap 0x4001>;
+		dmas = <&main_udmap 0xc001>, <&main_udmap 0x4002>,
+				<&main_udmap 0x4003>;
  		dma-names = "tx", "rx1", "rx2";
  		dma-coherent;
 
#3 lore raw

PATCH v2 3/4 arm64: dts: ti: k3-am65-main: Do not exclusively claim SA2UL

In reply to Andrew Davis

The SA2UL hardware is also used by SYSFW and OP-TEE. It should be requested using the shared TI-SCI flags instead of the exclusive flags or the request will fail.

---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +1 -1
index 165f53bd058b..4005a73cfea9 100644
@@ -112,7 +112,7 @@ main_uart2: serial@2820000 {
 	crypto: crypto@4e00000 {
 		compatible = "ti,am654-sa2ul";
 		reg = <0x0 0x4e00000 0x0 0x1200>;
-		power-domains = <&k3_pds 136 TI_SCI_PD_EXCLUSIVE>;
+		power-domains = <&k3_pds 136 TI_SCI_PD_SHARED>;
 		#address-cells = <2>;
 		#size-cells = <2>;
 		ranges = <0x0 0x04e00000 0x00 0x04e00000 0x0 0x30000>;
Signature · 1 line
2.36.1
Reviewed-by on v2 3/4
#4 lore raw

Re: [PATCH v2 3/4] arm64: dts: ti: k3-am65-main: Do not exclusively claim SA2UL

Quoted 14 lines · Andrew Davis

The SA2UL hardware is also used by SYSFW and OP-TEE. It should be requested using the shared TI-SCI flags instead of the exclusive flags or the request will fail.

---
  arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0 -0
index 165f53bd058b..4005a73cfea9 100644

arch/arm64/boot/dts/ti/k3-am65-main.dtsi main_uart2: serial@2820000 { · line 118

Quoted 8 lines
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +1 -1
@@ -112,7 +112,7 @@ main_uart2: serial@2820000 {
  	crypto: crypto@4e00000 {
  		compatible = "ti,am654-sa2ul";
  		reg = <0x0 0x4e00000 0x0 0x1200>;
-		power-domains = <&k3_pds 136 TI_SCI_PD_EXCLUSIVE>;
+		power-domains = <&k3_pds 136 TI_SCI_PD_SHARED>;
  		#address-cells = <2>;
  		#size-cells = <2>;
  		ranges = <0x0 0x04e00000 0x00 0x04e00000 0x0 0x30000>;
#5 lore raw

PATCH v2 4/4 arm64: dts: ti: k3-j7200-mcu-wakeup: Add SA2UL node

In reply to Andrew Davis

J7200 has an instance of SA2UL in the MCU domain.
Add DT node for the same.

The device is marked TI_SCI_PD_SHARED as parts of this IP are also shared with the security co-processor and OP-TEE.

The RNG node is added but marked disabled as it is firewalled off for exclusive use by OP-TEE. Any access to this device from Linux will result in firewall errors. We add the node for completeness of the hardware description.

---
 .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi      | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi +20 -0
index ff13bbeed30c..e5be78a58682 100644
@@ -375,4 +375,24 @@ mcu_r5fss0_core1: r5f@41400000 {
 			ti,loczrama = <1>;
 		};
 	};
+
+	mcu_crypto: crypto@40900000 {
+		compatible = "ti,j721e-sa2ul";
+		reg = <0x00 0x40900000 0x00 0x1200>;
+		power-domains = <&k3_pds 265 TI_SCI_PD_SHARED>;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges = <0x00 0x40900000 0x00 0x40900000 0x00 0x30000>;
+		dmas = <&mcu_udmap 0xf501>, <&mcu_udmap 0x7502>,
+		       <&mcu_udmap 0x7503>;
+		dma-names = "tx", "rx1", "rx2";
+		dma-coherent;
+
+		rng: rng@40910000 {
+			compatible = "inside-secure,safexcel-eip76";
+			reg = <0x00 0x40910000 0x00 0x7d>;
+			interrupts = <GIC_SPI 945 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled"; /* Used by OP-TEE */
+		};
+	};
 };
Signature · 1 line
2.36.1
Reviewed-by on v2 4/4
#6 lore raw

Re: [PATCH v2 4/4] arm64: dts: ti: k3-j7200-mcu-wakeup: Add SA2UL node

Quoted 35 lines · Andrew Davis

J7200 has an instance of SA2UL in the MCU domain.
Add DT node for the same.

The device is marked TI_SCI_PD_SHARED as parts of this IP are also shared with the security co-processor and OP-TEE.

The RNG node is added but marked disabled as it is firewalled off for exclusive use by OP-TEE. Any access to this device from Linux will result in firewall errors. We add the node for completeness of the hardware description.

---
  .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi      | 20 +++++++++++++++++++
  1 file changed, 20 insertions(+)
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi +11 -0
index ff13bbeed30c..e5be78a58682 100644
@@ -375,4 +375,24 @@ mcu_r5fss0_core1: r5f@41400000 {
  			ti,loczrama = <1>;
  		};
  	};
+
+	mcu_crypto: crypto@40900000 {
+		compatible = "ti,j721e-sa2ul";
+		reg = <0x00 0x40900000 0x00 0x1200>;
+		power-domains = <&k3_pds 265 TI_SCI_PD_SHARED>;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges = <0x00 0x40900000 0x00 0x40900000 0x00 0x30000>;
+		dmas = <&mcu_udmap 0xf501>, <&mcu_udmap 0x7502>,
+		       <&mcu_udmap 0x7503>;
+		dma-names = "tx", "rx1", "rx2";

arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi mcu_r5fss0_core1: r5f@41400000 { · line 398

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi +9 -0
+		dma-coherent;
+
+		rng: rng@40910000 {
+			compatible = "inside-secure,safexcel-eip76";
+			reg = <0x00 0x40910000 0x00 0x7d>;
+			interrupts = <GIC_SPI 945 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled"; /* Used by OP-TEE */
+		};
+	};
  };
Reviewed-by on v2 1/4
#7 lore raw
In reply to Andrew Davis
Quoted 23 lines · Andrew Davis

The hardware random number generator is used by OP-TEE and is access is denied to other users with SoC level bus firewalls. Any access to this device from Linux will result in firewall errors.

We could remove this node, but it is still valid device description, and it is possible it could be re-enabled in the bootloader if OP-TEE is not used. So only disable this node for now.

---

Changes from v1:
- Added comment in DT
- Explained why it is only disabled in commit message

  arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 +
  1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0 -0
index 8919fede3cd7..b3e714e1abed 100644

arch/arm64/boot/dts/ti/k3-am65-main.dtsi rng: rng@4e10000 { · line 133

Quoted 7 lines
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +1 -0
@@ -127,6 +127,7 @@ rng: rng@4e10000 {
  			reg = <0x0 0x4e10000 0x0 0x7d>;
  			interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
  			clocks = <&k3_clks 136 1>;
+			status = "disabled"; /* Used by OP-TEE */
  		};
  	};
 
maintainer Applied
#8 lore raw
In reply to Andrew Davis

Hi Andrew Davis,

Quoted 9 lines · Andrew Davis

The hardware random number generator is used by OP-TEE and is access is denied to other users with SoC level bus firewalls. Any access to this device from Linux will result in firewall errors.

We could remove this node, but it is still valid device description, and it is possible it could be re-enabled in the bootloader if OP-TEE is not used. So only disable this node for now.

[...]

I have applied the following to branch master on [1]. Thank you!

[1/4] arm64: dts: ti: k3-am65-main: Disable RNG node

      commit: 1ad4669b4bbe6b72784acdb5b24f72b22ad8f1d1
[2/4] arm64: dts: ti: k3-am65-main: Move SA2UL to unused PSI-L thread ID
      commit: 530eaa573a33fdd86725fdd2b979cbbbc539d47c
[3/4] arm64: dts: ti: k3-am65-main: Do not exclusively claim SA2UL
      commit: 49611f43e035f30be685fcf7468f23e85ce2ee06
[4/4] arm64: dts: ti: k3-j7200-mcu-wakeup: Add SA2UL node
      commit: d683a73980a61cc5d8abea7f3f996028e64e9144

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
--
Vignesh