arm64: dts: qcom: agatti: Fix IOMMU DT properties
PATCH 1/2 arm64: dts: qcom: agatti: Fix IOMMU DT properties
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/agatti.dtsi +3 -8
@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;
@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG
@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 { memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>; interconnects = <&mmnrt_virt MASTER_VIDEO_P0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>,
Signature · 1 line
2.51.0
PATCH 2/2 arm64: dts: qcom: agatti: Address Gunyah memory alignment needs
Gunyah hypervisor requires it's memory start address to be 2MB aligned. So the address map for Agatti is updated to incorporate that requirement. This should be a backwards compatible DT change which should work with legacy QHEE based firmware stack too.
--- arch/arm64/boot/dts/qcom/agatti.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/agatti.dtsi +2 -2
@@ -298,8 +298,8 @@ reserved_memory: reserved-memory { #size-cells = <2>; ranges; - hyp_mem: hyp@45700000 { - reg = <0x0 0x45700000 0x0 0x600000>; + hyp_mem: hyp@45600000 { + reg = <0x0 0x45600000 0x0 0x700000>; no-map; };
Signature · 1 line
2.51.0
Hey Everyone,
Quoted 10 lines · Sumit Garg
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
Quoted 9 lines
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
Suggested-by Prakash Gupta <[email protected]>Signed-off-by Sumit Garg <[email protected]>--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
Looks like I messed up this patch-set with email delivery leading to non-delivery. I resent it properly again here [1]. Apologies for the noise.
[1] https://lore.kernel.org/lkml/[email protected]/
-Sumit
Quoted 39 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +3
-9@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 { memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>; interconnects = <&mmnrt_virt MASTER_VIDEO_P0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, --2.51.0
Quoted 57 lines · Sumit Garg
Hey Everyone,
Quoted 10 lines · Sumit Garg
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
Quoted 9 lines
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
Suggested-by Prakash Gupta <[email protected]>Signed-off-by Sumit Garg <[email protected]>--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)Looks like I messed up this patch-set with email delivery leading to non-delivery. I resent it properly again here [1]. Apologies for the noise.
[1] https://lore.kernel.org/lkml/[email protected]/
-Sumit
Quoted 26 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +2
-4@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 {
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi venus: video-codec@5a00000 { · line 2340
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +1
-4memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>;
Are you planning to update the binding [1] with this change ? If so, how to handle the case of iommus for gunyah based vs non-gunyah based ?
Regards,
Vikash
Quoted 6 lines
Quoted 6 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +0
-1interconnects = <&mmnrt_virt MASTER_VIDEO_P0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, --2.51.0
Quoted 59 lines · Vikash Garodia
Quoted 57 lines · Sumit Garg
Hey Everyone,
Quoted 10 lines · Sumit Garg
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
Quoted 9 lines
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
Suggested-by Prakash Gupta <[email protected]>Signed-off-by Sumit Garg <[email protected]>--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)Looks like I messed up this patch-set with email delivery leading to non-delivery. I resent it properly again here [1]. Apologies for the noise.
[1] https://lore.kernel.org/lkml/[email protected]/
-Sumit
Quoted 26 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +2
-4@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 {
Quoted 9 lines
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi venus: video-codec@5a00000 { · line 2340
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +1
-4memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>;Are you planning to update the binding [1] with this change ?
Yeah I am planning to update bindings as per changes posted here [1].
Quoted 2 lines
If so, how to
handle the case of iommus for gunyah based vs non-gunyah based ?
Currently Agatti doesn't have any support for Linux running in EL2. This patch-set is just trying to enable Gunyah based stack.
[1] https://lore.kernel.org/all/aVOFL3jmNrFNiYV0@sumit-xelite/
-Sumit
Hi Sumit,
Quoted 70 lines · Sumit Garg
Quoted 59 lines · Vikash Garodia
Quoted 57 lines · Sumit Garg
Hey Everyone,
Quoted 10 lines · Sumit Garg
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
Quoted 9 lines
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
Suggested-by Prakash Gupta <[email protected]>Signed-off-by Sumit Garg <[email protected]>--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)Looks like I messed up this patch-set with email delivery leading to non-delivery. I resent it properly again here [1]. Apologies for the noise.
[1] https://lore.kernel.org/lkml/[email protected]/
-Sumit
Quoted 26 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +2
-4@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 {Quoted 9 lines
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi venus: video-codec@5a00000 { · line 2340
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +1
-4memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>;Are you planning to update the binding [1] with this change ?
Quoted 1 line
Yeah I am planning to update bindings as per changes posted here [1].
I tried a similar approach for the very same usecase [1], and what i learnt is that we cannot describe a range of iommus given the fact that there is no hardware which exist with *min* count of iommus interface. It is suppose to be a fixed number of iommus interface, OR i interpreted it differently then ?
[1] https://lore.kernel.org/all/[email protected]/
Quoted 10 lines
Quoted 3 lines
If so, how to
handle the case of iommus for gunyah based vs non-gunyah based ?Currently Agatti doesn't have any support for Linux running in EL2. This patch-set is just trying to enable Gunyah based stack.
[1] https://lore.kernel.org/all/aVOFL3jmNrFNiYV0@sumit-xelite/
-Sumit
Quoted 73 lines · Vikash Garodia
Hi Sumit,
Quoted 70 lines · Sumit Garg
Quoted 68 lines · Vikash Garodia
Quoted 57 lines · Sumit Garg
Hey Everyone,
Quoted 10 lines · Sumit Garg
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
Quoted 9 lines
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
Suggested-by Prakash Gupta <[email protected]>Signed-off-by Sumit Garg <[email protected]>--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)Looks like I messed up this patch-set with email delivery leading to non-delivery. I resent it properly again here [1]. Apologies for the noise.
[1] https://lore.kernel.org/lkml/[email protected]/
-Sumit
Quoted 26 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +2
-4@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 {Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi venus: video-codec@5a00000 { · line 2340
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +1
-4memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>;Are you planning to update the binding [1] with this change ?
Quoted 7 lines
Quoted 1 line
Yeah I am planning to update bindings as per changes posted here [1].
I tried a similar approach for the very same usecase [1], and what i learnt is that we cannot describe a range of iommus given the fact that there is no hardware which exist with *min* count of iommus interface. It is suppose to be a fixed number of iommus interface, OR i interpreted it differently then ?
You've interpreted it correctly. Sumit will need to drop the extra items from the corresponding iommus property definition.
Quoted 14 lines
[1] https://lore.kernel.org/all/[email protected]/
Quoted 10 lines
Quoted 3 lines
If so, how to
handle the case of iommus for gunyah based vs non-gunyah based ?Currently Agatti doesn't have any support for Linux running in EL2. This patch-set is just trying to enable Gunyah based stack.
[1] https://lore.kernel.org/all/aVOFL3jmNrFNiYV0@sumit-xelite/
-Sumit
Signature · 2 lines
With best wishes Dmitry
Quoted 76 lines · Dmitry Baryshkov
Quoted 75 lines · Vikash Garodia
Hi Sumit,
Quoted 71 lines · Sumit Garg
Quoted 59 lines · Vikash Garodia
Quoted 57 lines · Sumit Garg
Hey Everyone,
Quoted 10 lines · Sumit Garg
Fix IOMMU DT propeties for GPU, display and video peripherals via dropping SMMU stream IDs which relates to secure context bank.
This problem only surfaced when the Gunyah based firmware stack is ported on Agatti replacing the legacy QHEE based firmware stack. Assigning Linux kernel (HLOS) VMID to secure context bank stream IDs is treated as a fault by Gunyah hypervisor which were previously ignored by QHEE hypervisor.
Quoted 9 lines
The DT changes should be backwards compatible with legacy QHEE based firmware stack too.
Suggested-by Prakash Gupta <[email protected]>Signed-off-by Sumit Garg <[email protected]>--- arch/arm64/boot/dts/qcom/agatti.dtsi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)Looks like I messed up this patch-set with email delivery leading to non-delivery. I resent it properly again here [1]. Apologies for the noise.
[1] https://lore.kernel.org/lkml/[email protected]/
-Sumit
Quoted 26 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +2
-4@@ -1613,8 +1613,7 @@ gpu: gpu@5900000 { &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; interconnect-names = "gfx-mem"; - iommus = <&adreno_smmu 0 1>, - <&adreno_smmu 2 0>; + iommus = <&adreno_smmu 0 1>; operating-points-v2 = <&gpu_opp_table>; power-domains = <&rpmpd QCM2290_VDDCX>; qcom,gmu = <&gmu_wrapper>;@@ -1895,8 +1894,7 @@ mdss: display-subsystem@5e00000 { power-domains = <&dispcc MDSS_GDSC>; - iommus = <&apps_smmu 0x420 0x2>, - <&apps_smmu 0x421 0x0>; + iommus = <&apps_smmu 0x420 0x2>; interconnects = <&mmrt_virt MASTER_MDP0 RPM_ALWAYS_TAG &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG@@ -2339,10 +2337,7 @@ venus: video-codec@5a00000 {Quoted 9 lines
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi venus: video-codec@5a00000 { · line 2340
Quoted 7 lines
arch/arm64/boot/dts/qcom/agatti.dtsi +1
-4memory-region = <&pil_video_mem>; iommus = <&apps_smmu 0x860 0x0>, - <&apps_smmu 0x880 0x0>, - <&apps_smmu 0x861 0x04>, - <&apps_smmu 0x863 0x0>, - <&apps_smmu 0x804 0xe0>; + <&apps_smmu 0x880 0x0>;Are you planning to update the binding [1] with this change ?
Yeah I am planning to update bindings as per changes posted here [1].
Quoted 8 lines
Quoted 5 lines
I tried a similar approach for the very same usecase [1], and what i learnt is that we cannot describe a range of iommus given the fact that there is no hardware which exist with *min* count of iommus interface. It is suppose to be a fixed number of iommus interface, OR i interpreted it differently then ?
You've interpreted it correctly. Sumit will need to drop the extra items from the corresponding iommus property definition.
Thanks for the heads up. I will follow this advice instead.
-Sumit