[PATCH v2] arm64: dts: ti: k3-j722s-main: Add E5010 JPEG Encoder

Brandon Brnich posted 1 patch 2 months ago
arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)
[PATCH v2] arm64: dts: ti: k3-j722s-main: Add E5010 JPEG Encoder
Posted by Brandon Brnich 2 months ago
This adds node for E5010 JPEG Encoder which is a stateful JPEG Encoder
present in J722s SoC, supporting baseline encoding of semiplanar based
YUV420 and YUV422 raw video formats to JPEG encoding, with resolutions
supported from 64x64 to 8kx8k.

Signed-off-by: Brandon Brnich <b-brnich@ti.com>
---

Changes in v2:
  - remove invalid clock-names attribute

 arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
index 5cfa7bf36641..fb24c14614b4 100644
--- a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
@@ -385,6 +385,16 @@ c7x_1: dsp@7e200000 {
 		ti,sci-proc-ids = <0x31 0xff>;
 		status = "disabled";
 	};
+
+	e5010: e5010@fd20000 {
+		compatible = "img,e5010-jpeg-enc";
+		reg = <0x00 0xfd20000 0x00 0x100>,
+		      <0x00 0xfd20200 0x00 0x200>;
+		reg-names = "core","mmu";
+		clocks = <&k3_clks 201 0>;
+		power-domains = <&k3_pds 201 TI_SCI_PD_EXCLUSIVE>;
+		interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+	};
 };
 
 &main_bcdma_csi {
-- 
2.34.1
Re: [PATCH v2] arm64: dts: ti: k3-j722s-main: Add E5010 JPEG Encoder
Posted by devarsh 2 months ago
Hi Brandon,

Thanks for the patch.
On 04/08/25 23:31, Brandon Brnich wrote:
> This adds node for E5010 JPEG Encoder which is a stateful JPEG Encoder
> present in J722s SoC, supporting baseline encoding of semiplanar based
> YUV420 and YUV422 raw video formats to JPEG encoding, with resolutions
> supported from 64x64 to 8kx8k.
> 
> Signed-off-by: Brandon Brnich <b-brnich@ti.com>
> ---
> 
> Changes in v2:
>   - remove invalid clock-names attribute
> 
>  arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
> index 5cfa7bf36641..fb24c14614b4 100644
> --- a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
> @@ -385,6 +385,16 @@ c7x_1: dsp@7e200000 {
>  		ti,sci-proc-ids = <0x31 0xff>;
>  		status = "disabled";
>  	};
> +
> +	e5010: e5010@fd20000 {
> +		compatible = "img,e5010-jpeg-enc";

This is missing ti specific compatible. As we don't use the IP block
directly but there is a wrapper used to integrate with TI platform, so
it is better to use TI specific compatible too to account for the future
compatibility as discussed here [1]. You can refer AM62A device-tree [2]
for references on this.

[1]:
https://lore.kernel.org/all/50d97c30-4926-0bbf-1209-dfd25043e359@ti.com/
[2] :
https://gitlab.com/linux-kernel/linux-next/-/blob/master/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi?ref_type=heads#L1150

Regards
Devarsh
Re: [PATCH v2] arm64: dts: ti: k3-j722s-main: Add E5010 JPEG Encoder
Posted by Krzysztof Kozlowski 2 months ago
On 04/08/2025 20:01, Brandon Brnich wrote:
> This adds node for E5010 JPEG Encoder which is a stateful JPEG Encoder
> present in J722s SoC, supporting baseline encoding of semiplanar based
> YUV420 and YUV422 raw video formats to JPEG encoding, with resolutions
> supported from 64x64 to 8kx8k.
> 
> Signed-off-by: Brandon Brnich <b-brnich@ti.com>
> ---
> 
> Changes in v2:
>   - remove invalid clock-names attribute
> 
>  arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
> index 5cfa7bf36641..fb24c14614b4 100644
> --- a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
> @@ -385,6 +385,16 @@ c7x_1: dsp@7e200000 {
>  		ti,sci-proc-ids = <0x31 0xff>;
>  		status = "disabled";
>  	};
> +
> +	e5010: e5010@fd20000 {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation


> +		compatible = "img,e5010-jpeg-enc";

Wrong compatible. This is TI, not IMG.


Best regards,
Krzysztof
Re: [PATCH v2] arm64: dts: ti: k3-j722s-main: Add E5010 JPEG Encoder
Posted by Brandon Brnich 2 months ago
Hi Krzysztof,

Thanks for the review.

On 8/5/2025 1:02 AM, Krzysztof Kozlowski wrote:
> On 04/08/2025 20:01, Brandon Brnich wrote:
>> This adds node for E5010 JPEG Encoder which is a stateful JPEG Encoder
>> present in J722s SoC, supporting baseline encoding of semiplanar based
>> YUV420 and YUV422 raw video formats to JPEG encoding, with resolutions
>> supported from 64x64 to 8kx8k.
>>
>> Signed-off-by: Brandon Brnich <b-brnich@ti.com>
>> ---
>>
>> Changes in v2:
>>    - remove invalid clock-names attribute
>>
>>   arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
>> index 5cfa7bf36641..fb24c14614b4 100644
>> --- a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
>> +++ b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
>> @@ -385,6 +385,16 @@ c7x_1: dsp@7e200000 {
>>   		ti,sci-proc-ids = <0x31 0xff>;
>>   		status = "disabled";
>>   	};
>> +
>> +	e5010: e5010@fd20000 {
> 
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

I got this name from the already present node in the am62a device 
tree[0]. Should I replace both of these with more generic name such as 
jpegenc?

> 
> 
>> +		compatible = "img,e5010-jpeg-enc";
> 
> Wrong compatible. This is TI, not IMG.

Devarsh has pointed out the same, I will update compatible that matches 
TI version in v3.

Best,
Brandon

[0]: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi#n1149

> 
> 
> Best regards,
> Krzysztof
Re: [PATCH v2] arm64: dts: ti: k3-j722s-main: Add E5010 JPEG Encoder
Posted by Brandon Brnich 2 months ago
Hello,

On 8/5/2025 8:34 AM, Brandon Brnich wrote:
> Hi Krzysztof,
> 
> Thanks for the review.
> 
> On 8/5/2025 1:02 AM, Krzysztof Kozlowski wrote:
>> On 04/08/2025 20:01, Brandon Brnich wrote:
>>> This adds node for E5010 JPEG Encoder which is a stateful JPEG Encoder
>>> present in J722s SoC, supporting baseline encoding of semiplanar based
>>> YUV420 and YUV422 raw video formats to JPEG encoding, with resolutions
>>> supported from 64x64 to 8kx8k.
>>>
>>> Signed-off-by: Brandon Brnich <b-brnich@ti.com>
>>> ---
>>>
>>> Changes in v2:
>>>    - remove invalid clock-names attribute
>>>
>>>   arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 10 ++++++++++
>>>   1 file changed, 10 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi b/arch/arm64/ 
>>> boot/dts/ti/k3-j722s-main.dtsi
>>> index 5cfa7bf36641..fb24c14614b4 100644
>>> --- a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
>>> +++ b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
>>> @@ -385,6 +385,16 @@ c7x_1: dsp@7e200000 {
>>>           ti,sci-proc-ids = <0x31 0xff>;
>>>           status = "disabled";
>>>       };
>>> +
>>> +    e5010: e5010@fd20000 {
>>
>> Node names should be generic. See also an explanation and list of
>> examples (not exhaustive) in DT specification:
>> https://devicetree-specification.readthedocs.io/en/latest/chapter2- 
>> devicetree-basics.html#generic-names-recommendation
> 
> I got this name from the already present node in the am62a device 
> tree[0]. Should I replace both of these with more generic name such as 
> jpegenc?

Please ignore above comment, I was thinking about the label and not the 
node name. I understand node name needs to be jpeg-encoder.

Should label also be more generic? I see a few examples where the label 
is jpegenc or something more generic than the specific part name. But I 
don't see any specific rules in the devicetree specs on labels.


> 
>>
>>
>>> +        compatible = "img,e5010-jpeg-enc";
>>
>> Wrong compatible. This is TI, not IMG.
> 
> Devarsh has pointed out the same, I will update compatible that matches 
> TI version in v3.
> 
> Best,
> Brandon
> 
> [0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ 
> tree/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi#n1149
> 
>>
>>
>> Best regards,
>> Krzysztof
>