From: Thierry Reding <[email protected]>

This node contains two sets of properties, one for the case where the
VPR is resizable (in which case the VPR region will be dynamically
allocated at boot time) and another case where the VPR is fixed in size
and initialized by early firmware.

The firmware running on the device is responsible for updating the node
with the real physical address for the fixed VPR case and remove the
properties needed only for resizable VPR. Similarly, if the VPR is
resizable, the firmware should remove the "reg" property since it is no
longer needed.

Signed-off-by: Thierry Reding <[email protected]>
---
Changes in v3:
- comment out fixed VPR properties, assume resizable by default
- rename node to "protected"
---
 arch/arm64/boot/dts/nvidia/tegra264.dtsi | 33 ++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra264.dtsi 
b/arch/arm64/boot/dts/nvidia/tegra264.dtsi
index 4c701abd25a8..85a18d99d643 100644
--- a/arch/arm64/boot/dts/nvidia/tegra264.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra264.dtsi
@@ -24,6 +24,39 @@ shmem_bpmp: shmem@86070000 {
                        reg = <0x0 0x86070000 0x0 0x2000>;
                        no-map;
                };
+
+               vpr: protected {
+                       compatible = "nvidia,tegra-video-protection-region";
+                       status = "disabled";
+
+                       /*
+                        * Two variants exist for this. For fixed VPR, the
+                        * firmware is supposed to update the "reg" property
+                        * with the fixed memory region configured as VPR.
+                        *
+                        * For resizable VPR we don't care about the exact
+                        * address and instead want a reserved region to be
+                        * allocated with a certain size and alignment at
+                        * boot time.
+                        *
+                        * The below assumes resizable VPR by default. If the
+                        * firmwares sets up fixed VPR, it is responsible for
+                        * adding the missing "reg" property, removing any of
+                        * the unused properties, as well as adding a unit-
+                        * address matching the "reg" property.
+                        */
+
+                       /* fixed VPR */
+                       /*
+                       reg = <0x0 0x0 0x0 0x0>;
+                       no-map;
+                       */
+
+                       /* resizable VPR */
+                       size = <0x0 0x70000000>;
+                       alignment = <0x0 0x100000>;
+                       reusable;
+               };
        };
 
        /* SYSTEM MMIO */

-- 
2.54.0


Reply via email to