arm64: dts: ti: k3-am65-main: Disable RNG node
Subsystems (2)
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. Disable this node.
---
Changes from v1:
- Added comment in dtsi file
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
@@ -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
PATCH v2 4/4 arm64: dts: ti: k3-j7200-mcu-wakeup: Add SA2UL node
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.
---
Changes from v1:
- Added comment in dtsi file
- Added extra context to commit message
.../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
@@ -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
PATCH v2 2/4 arm64: dts: ti: k3-am65-main: Move SA2UL to unused PSI-L thread ID
In reply to Andrew DavisThe 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
@@ -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
PATCH v2 3/4 arm64: dts: ti: k3-am65-main: Do not exclusively claim SA2UL
In reply to Andrew DavisThe 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
@@ -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
Hi Andrew
On July 6, 2022 thus sayeth Andrew Davis:
Quoted 18 lines
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. Disable this node.
Signed-off-by Andrew Davis <[email protected]>---
Changes from v1:
- Added comment in dtsi filearch/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
arch/arm64/boot/dts/ti/k3-am65-main.dtsi rng: rng@4e10000 { · line 130
Quoted 4 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 */
Just curious about how we should document disabling nodes. I was assuming the reasoning should be described in the bindings?
I would like to start disabling nodes by default in our dtsi files and enabling them in our top dts file, making it easier for others to use our device tree for a more focused purpose than our dev boards. I just didn't know where I should document why I disabled the nodes :)
~Bryan
Quoted 29 lines · Bryan Brattlof
Hi Andrew
On July 6, 2022 thus sayeth Andrew Davis:
Quoted 18 lines
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. Disable this node.
Signed-off-by Andrew Davis <[email protected]>---
Changes from v1:
- Added comment in dtsi filearch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0
-0arch/arm64/boot/dts/ti/k3-am65-main.dtsi rng: rng@4e10000 { · line 130
Quoted 4 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 */Just curious about how we should document disabling nodes. I was assuming the reasoning should be described in the bindings?
Quoted 5 lines
I would like to start disabling nodes by default in our dtsi files and enabling them in our top dts file, making it easier for others to use our device tree for a more focused purpose than our dev boards. I just didn't know where I should document why I disabled the nodes :)
This got push-back last time this was suggested, I'll have to lookup the history. IIRC we landed on the other way around, all things should be described by default, then the specific board can enable/disable what is not used as needed.
I was worried this topic would come up with this patch series and was almost just going to delete the whole RNG node instead of disabling it to avoid that. My reasoning for disabling here anyway is that this device *cannot* be used by *any* board, it is not just a board level configuration decision like disabling I2C nodes by default or similar that was proposed last time we had the "nodes disabled by default" discussion.
Andrew
Quoted 1 line
~Bryan
Nishanth Menon
maintainerQuoted 36 lines · Andrew Davis
Quoted 29 lines · Bryan Brattlof
Hi Andrew
On July 6, 2022 thus sayeth Andrew Davis:
Quoted 18 lines
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. Disable this node.
Signed-off-by Andrew Davis <[email protected]>---
Changes from v1:
- Added comment in dtsi filearch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0
-0arch/arm64/boot/dts/ti/k3-am65-main.dtsi rng: rng@4e10000 { · line 130
Quoted 4 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 */Just curious about how we should document disabling nodes. I was assuming the reasoning should be described in the bindings?
Quoted 5 lines
I would like to start disabling nodes by default in our dtsi files and enabling them in our top dts file, making it easier for others to use our device tree for a more focused purpose than our dev boards. I just didn't know where I should document why I disabled the nodes :)
Quoted 4 lines
This got push-back last time this was suggested, I'll have to lookup the history. IIRC we landed on the other way around, all things should be described by default, then the specific board can enable/disable what is not used as needed.
See thread https://lore.kernel.org/linux-arm-kernel/[email protected]/
Quoted 7 lines
I was worried this topic would come up with this patch series and was almost just going to delete the whole RNG node instead of disabling it to avoid that. My reasoning for disabling here anyway is that this device *cannot* be used by *any* board, it is not just a board level configuration decision like disabling I2C nodes by default or similar that was proposed last time we had the "nodes disabled by default" discussion.
Hmm.. If that is the case, then why even have it in dts - is that because of cases where OPTEE is'nt the TEE and users may want to directly use it? OR is it because OPTEE can potentially use device tree itself and discover the rng location from dt?
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
Quoted 52 lines · Nishanth Menon
Quoted 36 lines · Andrew Davis
Quoted 29 lines · Bryan Brattlof
Hi Andrew
On July 6, 2022 thus sayeth Andrew Davis:
Quoted 18 lines
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. Disable this node.
Signed-off-by Andrew Davis <[email protected]>---
Changes from v1:
- Added comment in dtsi filearch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0
-0arch/arm64/boot/dts/ti/k3-am65-main.dtsi rng: rng@4e10000 { · line 130
Quoted 4 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 */Just curious about how we should document disabling nodes. I was assuming the reasoning should be described in the bindings?
Quoted 5 lines
I would like to start disabling nodes by default in our dtsi files and enabling them in our top dts file, making it easier for others to use our device tree for a more focused purpose than our dev boards. I just didn't know where I should document why I disabled the nodes :)
Quoted 4 lines
This got push-back last time this was suggested, I'll have to lookup the history. IIRC we landed on the other way around, all things should be described by default, then the specific board can enable/disable what is not used as needed.
See thread https://lore.kernel.org/linux-arm-kernel/[email protected]/
Quoted 7 lines
I was worried this topic would come up with this patch series and was almost just going to delete the whole RNG node instead of disabling it to avoid that. My reasoning for disabling here anyway is that this device *cannot* be used by *any* board, it is not just a board level configuration decision like disabling I2C nodes by default or similar that was proposed last time we had the "nodes disabled by default" discussion.
Quoted 5 lines
Hmm.. If that is the case, then why even have it in dts - is that because of cases where OPTEE is'nt the TEE and users may want to directly use it? OR is it because OPTEE can potentially use device tree itself and discover the rng location from dt?
Hadn't thought about the second case, but it could also be valid if we started using DT in our OPTEE. The intention was for the first case, this node has valid hardware description, didn't feel right to delete it due to it being unusable by Linux.
Andrew
Nishanth Menon
maintainerQuoted 59 lines · Andrew Davis
Quoted 52 lines · Nishanth Menon
Quoted 36 lines · Andrew Davis
Quoted 29 lines · Bryan Brattlof
Hi Andrew
On July 6, 2022 thus sayeth Andrew Davis:
Quoted 18 lines
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. Disable this node.
Signed-off-by Andrew Davis <[email protected]>---
Changes from v1:
- Added comment in dtsi filearch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/ti/k3-am65-main.dtsi +0
-0arch/arm64/boot/dts/ti/k3-am65-main.dtsi rng: rng@4e10000 { · line 130
Quoted 4 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 */Just curious about how we should document disabling nodes. I was assuming the reasoning should be described in the bindings?
Quoted 5 lines
I would like to start disabling nodes by default in our dtsi files and enabling them in our top dts file, making it easier for others to use our device tree for a more focused purpose than our dev boards. I just didn't know where I should document why I disabled the nodes :)
Quoted 4 lines
This got push-back last time this was suggested, I'll have to lookup the history. IIRC we landed on the other way around, all things should be described by default, then the specific board can enable/disable what is not used as needed.
See thread https://lore.kernel.org/linux-arm-kernel/[email protected]/
Quoted 7 lines
I was worried this topic would come up with this patch series and was almost just going to delete the whole RNG node instead of disabling it to avoid that. My reasoning for disabling here anyway is that this device *cannot* be used by *any* board, it is not just a board level configuration decision like disabling I2C nodes by default or similar that was proposed last time we had the "nodes disabled by default" discussion.
Quoted 5 lines
Hmm.. If that is the case, then why even have it in dts - is that because of cases where OPTEE is'nt the TEE and users may want to directly use it? OR is it because OPTEE can potentially use device tree itself and discover the rng location from dt?
Quoted 4 lines
Hadn't thought about the second case, but it could also be valid if we started using DT in our OPTEE. The intention was for the first case, this node has valid hardware description, didn't feel right to delete it due to it being unusable by Linux.
Fair enough, it is a bit late for me to let this series cook in list and then apply and wait for linux-next stability before I tag for next kernel, I suggest improving the commit message with rationale in the next rev.
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D