* [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280
2023-09-29 8:38 [PATCH 0/3] Enable venus on Fairphone 5 / non-ChromeOS sc7280 venus support Luca Weiss
@ 2023-09-29 8:38 ` Luca Weiss
2023-09-29 8:41 ` Bryan O'Donoghue
2023-09-29 11:37 ` Konrad Dybcio
2023-09-29 8:38 ` [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common Luca Weiss
2023-09-29 8:38 ` [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node Luca Weiss
2 siblings, 2 replies; 10+ messages in thread
From: Luca Weiss @ 2023-09-29 8:38 UTC (permalink / raw)
To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
Andy Gross, Bjorn Andersson, Konrad Dybcio,
Mauro Carvalho Chehab, cros-qcom-dts-watchers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree, Luca Weiss
Not all SC7280 devices ship with ChromeOS firmware. Other devices need
PAS for image authentication. That requires the predefined virtual
address ranges to be passed via scm calls. Define them to enable Venus
on non-CrOS SC7280 devices.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
drivers/media/platform/qcom/venus/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 054b8e74ba4f..5c6baa0f4d45 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -881,6 +881,10 @@ static const struct venus_resources sc7280_res = {
.vmem_size = 0,
.vmem_addr = 0,
.dma_mask = 0xe0000000 - 1,
+ .cp_start = 0,
+ .cp_size = 0x25800000,
+ .cp_nonpixel_start = 0x1000000,
+ .cp_nonpixel_size = 0x24800000,
.fwname = "qcom/vpu-2.0/venus.mbn",
};
--
2.42.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280
2023-09-29 8:38 ` [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280 Luca Weiss
@ 2023-09-29 8:41 ` Bryan O'Donoghue
2023-09-29 11:37 ` Konrad Dybcio
1 sibling, 0 replies; 10+ messages in thread
From: Bryan O'Donoghue @ 2023-09-29 8:41 UTC (permalink / raw)
To: Luca Weiss, Stanimir Varbanov, Vikash Garodia, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
cros-qcom-dts-watchers, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree
On 29/09/2023 09:38, Luca Weiss wrote:
> Not all SC7280 devices ship with ChromeOS firmware. Other devices need
> PAS for image authentication. That requires the predefined virtual
> address ranges to be passed via scm calls. Define them to enable Venus
> on non-CrOS SC7280 devices.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> drivers/media/platform/qcom/venus/core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 054b8e74ba4f..5c6baa0f4d45 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -881,6 +881,10 @@ static const struct venus_resources sc7280_res = {
> .vmem_size = 0,
> .vmem_addr = 0,
> .dma_mask = 0xe0000000 - 1,
> + .cp_start = 0,
> + .cp_size = 0x25800000,
> + .cp_nonpixel_start = 0x1000000,
> + .cp_nonpixel_size = 0x24800000,
> .fwname = "qcom/vpu-2.0/venus.mbn",
> };
>
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280
2023-09-29 8:38 ` [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280 Luca Weiss
2023-09-29 8:41 ` Bryan O'Donoghue
@ 2023-09-29 11:37 ` Konrad Dybcio
1 sibling, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2023-09-29 11:37 UTC (permalink / raw)
To: Luca Weiss, Stanimir Varbanov, Vikash Garodia,
Bryan O'Donoghue, Andy Gross, Bjorn Andersson,
Mauro Carvalho Chehab, cros-qcom-dts-watchers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree
On 29.09.2023 10:38, Luca Weiss wrote:
> Not all SC7280 devices ship with ChromeOS firmware. Other devices need
> PAS for image authentication. That requires the predefined virtual
> address ranges to be passed via scm calls. Define them to enable Venus
> on non-CrOS SC7280 devices.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
The media tree (or at least venus) moves quite slugglishly..
But looks like applying just the DT patches (which I expect to get
in first) results in a non-platform-killing:
[ 25.851120] qcom-venus aa00000.video-codec: Adding to iommu group 11
[ 25.851618] qcom-venus aa00000.video-codec: non legacy binding
[ 25.916562] qcom-venus aa00000.video-codec: invalid setting for UC_REGION
[ 25.916569] qcom-venus aa00000.video-codec: failed to reset venus core
[ 25.919000] qcom-venus: probe of aa00000.video-codec failed with error -22
So it should be okay either way.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common
2023-09-29 8:38 [PATCH 0/3] Enable venus on Fairphone 5 / non-ChromeOS sc7280 venus support Luca Weiss
2023-09-29 8:38 ` [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280 Luca Weiss
@ 2023-09-29 8:38 ` Luca Weiss
2023-09-29 8:43 ` Bryan O'Donoghue
2023-09-29 11:39 ` Konrad Dybcio
2023-09-29 8:38 ` [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node Luca Weiss
2 siblings, 2 replies; 10+ messages in thread
From: Luca Weiss @ 2023-09-29 8:38 UTC (permalink / raw)
To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
Andy Gross, Bjorn Andersson, Konrad Dybcio,
Mauro Carvalho Chehab, cros-qcom-dts-watchers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree, Luca Weiss
If the video-firmware node is present, the venus driver assumes we're on
a non-TZ system. Move the video-firmware node to chrome-common.dtsi so
we can use venus on a TZ board.
At the same time let's disable the venus node by default as is custom on
such nodes.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi | 8 ++++++++
arch/arm64/boot/dts/qcom/sc7280.dtsi | 6 ++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
index 5d462ae14ba1..cd491e46666d 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
@@ -104,6 +104,14 @@ &scm {
dma-coherent;
};
+&venus {
+ status = "okay";
+
+ video-firmware {
+ iommus = <&apps_smmu 0x21a2 0x0>;
+ };
+};
+
&watchdog {
status = "okay";
};
diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 66f1eb83cca7..fa53f54d4675 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -3740,6 +3740,8 @@ venus: video-codec@aa00000 {
<&apps_smmu 0x2184 0x20>;
memory-region = <&video_mem>;
+ status = "disabled";
+
video-decoder {
compatible = "venus-decoder";
};
@@ -3748,10 +3750,6 @@ video-encoder {
compatible = "venus-encoder";
};
- video-firmware {
- iommus = <&apps_smmu 0x21a2 0x0>;
- };
-
venus_opp_table: opp-table {
compatible = "operating-points-v2";
--
2.42.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common
2023-09-29 8:38 ` [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common Luca Weiss
@ 2023-09-29 8:43 ` Bryan O'Donoghue
2023-09-29 11:39 ` Konrad Dybcio
1 sibling, 0 replies; 10+ messages in thread
From: Bryan O'Donoghue @ 2023-09-29 8:43 UTC (permalink / raw)
To: Luca Weiss, Stanimir Varbanov, Vikash Garodia, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
cros-qcom-dts-watchers, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree
On 29/09/2023 09:38, Luca Weiss wrote:
> If the video-firmware node is present, the venus driver assumes we're on
> a non-TZ system. Move the video-firmware node to chrome-common.dtsi so
> we can use venus on a TZ board.
>
> At the same time let's disable the venus node by default as is custom on
> such nodes.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi | 8 ++++++++
> arch/arm64/boot/dts/qcom/sc7280.dtsi | 6 ++----
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
> index 5d462ae14ba1..cd491e46666d 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
> @@ -104,6 +104,14 @@ &scm {
> dma-coherent;
> };
>
> +&venus {
> + status = "okay";
> +
> + video-firmware {
> + iommus = <&apps_smmu 0x21a2 0x0>;
> + };
> +};
> +
> &watchdog {
> status = "okay";
> };
> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> index 66f1eb83cca7..fa53f54d4675 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> @@ -3740,6 +3740,8 @@ venus: video-codec@aa00000 {
> <&apps_smmu 0x2184 0x20>;
> memory-region = <&video_mem>;
>
> + status = "disabled";
> +
> video-decoder {
> compatible = "venus-decoder";
> };
> @@ -3748,10 +3750,6 @@ video-encoder {
> compatible = "venus-encoder";
> };
>
> - video-firmware {
> - iommus = <&apps_smmu 0x21a2 0x0>;
> - };
> -
> venus_opp_table: opp-table {
> compatible = "operating-points-v2";
>
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common
2023-09-29 8:38 ` [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common Luca Weiss
2023-09-29 8:43 ` Bryan O'Donoghue
@ 2023-09-29 11:39 ` Konrad Dybcio
1 sibling, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2023-09-29 11:39 UTC (permalink / raw)
To: Luca Weiss, Stanimir Varbanov, Vikash Garodia,
Bryan O'Donoghue, Andy Gross, Bjorn Andersson,
Mauro Carvalho Chehab, cros-qcom-dts-watchers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree
On 29.09.2023 10:38, Luca Weiss wrote:
> If the video-firmware node is present, the venus driver assumes we're on
> a non-TZ system.
On a system that doesn't use TZ for kickstarting Venus
Chrome devices have something running in EL3, so TZ is present,
just not the standard qcom one that we've grown to.. love..
Move the video-firmware node to chrome-common.dtsi so
> we can use venus on a TZ board.
On non-Chrome boards
> At the same time let's disable the venus node by default as is custom on
> such nodes.
I think that's not what you tried to say
The contents look good!
Konrad
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node
2023-09-29 8:38 [PATCH 0/3] Enable venus on Fairphone 5 / non-ChromeOS sc7280 venus support Luca Weiss
2023-09-29 8:38 ` [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280 Luca Weiss
2023-09-29 8:38 ` [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common Luca Weiss
@ 2023-09-29 8:38 ` Luca Weiss
2023-09-29 8:44 ` Bryan O'Donoghue
2023-09-29 11:39 ` Konrad Dybcio
2 siblings, 2 replies; 10+ messages in thread
From: Luca Weiss @ 2023-09-29 8:38 UTC (permalink / raw)
To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
Andy Gross, Bjorn Andersson, Konrad Dybcio,
Mauro Carvalho Chehab, cros-qcom-dts-watchers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree, Luca Weiss
Enable the venus node so that the video encoder/decoder will start
working.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 2de0b8c26c35..d29f10f822c9 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -665,3 +665,8 @@ &usb_1_qmpphy {
status = "okay";
};
+
+&venus {
+ firmware-name = "qcom/qcm6490/fairphone5/venus.mbn";
+ status = "okay";
+};
--
2.42.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node
2023-09-29 8:38 ` [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node Luca Weiss
@ 2023-09-29 8:44 ` Bryan O'Donoghue
2023-09-29 11:39 ` Konrad Dybcio
1 sibling, 0 replies; 10+ messages in thread
From: Bryan O'Donoghue @ 2023-09-29 8:44 UTC (permalink / raw)
To: Luca Weiss, Stanimir Varbanov, Vikash Garodia, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
cros-qcom-dts-watchers, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree
On 29/09/2023 09:38, Luca Weiss wrote:
> Enable the venus node so that the video encoder/decoder will start
> working.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> index 2de0b8c26c35..d29f10f822c9 100644
> --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> @@ -665,3 +665,8 @@ &usb_1_qmpphy {
>
> status = "okay";
> };
> +
> +&venus {
> + firmware-name = "qcom/qcm6490/fairphone5/venus.mbn";
> + status = "okay";
> +};
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node
2023-09-29 8:38 ` [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node Luca Weiss
2023-09-29 8:44 ` Bryan O'Donoghue
@ 2023-09-29 11:39 ` Konrad Dybcio
1 sibling, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2023-09-29 11:39 UTC (permalink / raw)
To: Luca Weiss, Stanimir Varbanov, Vikash Garodia,
Bryan O'Donoghue, Andy Gross, Bjorn Andersson,
Mauro Carvalho Chehab, cros-qcom-dts-watchers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
linux-arm-msm, linux-kernel, devicetree
On 29.09.2023 10:38, Luca Weiss wrote:
> Enable the venus node so that the video encoder/decoder will start
> working.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 10+ messages in thread