[PATCH 1/3] dt-bindings: vdec: Add binding document of Amlogic decoder accelerator

Zhentao Guo via B4 Relay posted 3 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH 1/3] dt-bindings: vdec: Add binding document of Amlogic decoder accelerator
Posted by Zhentao Guo via B4 Relay 3 months, 2 weeks ago
From: Zhentao Guo <zhentao.guo@amlogic.com>

Add dt-binding of the Amlogic hardware decoder accelerator.

Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com>
---
 .../bindings/media/amlogic,vcodec-dec.yaml         | 96 ++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml b/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml
new file mode 100644
index 000000000000..6cea8af72639
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2025 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/amlogic,vcodec-dec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Video Decode Accelerator
+
+maintainers:
+  - Zhentao Guo <zhentao.guo@amlogic.com>
+
+description: |
+  The Video Decoder Accelerator present on Amlogic SOCs.
+  It supports stateless h264 decoding.
+
+properties:
+  compatible:
+    const: amlogic,s4-vcodec-dec
+
+  reg:
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: dosbus
+      - const: dmcbus
+
+  interrupts:
+    maxItems: 3
+
+  interrupt-names:
+    items:
+      - const: mailbox_0
+      - const: mailbox_1
+      - const: mailbox_2
+
+  clocks:
+    maxItems: 3
+
+  clock-names:
+    items:
+      - const: vdec
+      - const: clk_vdec_mux
+      - const: clk_hevcf_mux
+
+  power-domains:
+    maxItems: 2
+
+  power-domain-names:
+    items:
+      - const: pwrc-vdec
+      - const: pwrc-hevc
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/amlogic,s4-pll-clkc.h>
+    #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
+    #include <dt-bindings/power/meson-s4-power.h>
+    video-codec@fe320000 {
+      compatible = "amlogic,s4-vcodec-dec";
+      reg = <0xfe320000 0x10000>,
+            <0xfe036000 0x2000>;
+      reg-names = "dosbus",
+                  "dmcbus";
+      interrupts = <GIC_SPI 91 IRQ_TYPE_EDGE_RISING>,
+                   <GIC_SPI 92 IRQ_TYPE_EDGE_RISING>,
+                   <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
+      interrupt-names = "mailbox_0",
+                        "mailbox_1",
+                        "mailbox_2";
+      clocks = <&clkc_periphs CLKID_DOS>,
+               <&clkc_periphs CLKID_VDEC_SEL>,
+               <&clkc_periphs CLKID_HEVCF_SEL>;
+      clock-names = "vdec",
+                    "clk_vdec_mux",
+                    "clk_hevcf_mux";
+      power-domains = <&pwrc PWRC_S4_DOS_VDEC_ID>,
+                      <&pwrc PWRC_S4_DOS_HEVC_ID>;
+      power-domain-names = "pwrc-vdec",
+                           "pwrc-hevc";
+    };

-- 
2.42.0
Re: [PATCH 1/3] dt-bindings: vdec: Add binding document of Amlogic decoder accelerator
Posted by Krzysztof Kozlowski 3 months, 2 weeks ago
On 27/10/2025 06:42, Zhentao Guo via B4 Relay wrote:
> From: Zhentao Guo <zhentao.guo@amlogic.com>
> 
> Add dt-binding of the Amlogic hardware decoder accelerator.

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

A nit, subject: drop second/last, redundant "binding document for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> 
> Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com>
> ---
>  .../bindings/media/amlogic,vcodec-dec.yaml         | 96 ++++++++++++++++++++++
>  1 file changed, 96 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml b/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml
> new file mode 100644
> index 000000000000..6cea8af72639
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml

Filename matching compatible.

> @@ -0,0 +1,96 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (C) 2025 Amlogic, Inc. All rights reserved
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/amlogic,vcodec-dec.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Amlogic Video Decode Accelerator
> +
> +maintainers:
> +  - Zhentao Guo <zhentao.guo@amlogic.com>
> +
> +description: |


Do not need '|' unless you need to preserve formatting.

> +  The Video Decoder Accelerator present on Amlogic SOCs.
> +  It supports stateless h264 decoding.
> +
> +properties:
> +  compatible:
> +    const: amlogic,s4-vcodec-dec
> +
> +  reg:
> +    maxItems: 2
> +
> +  reg-names:
> +    items:
> +      - const: dosbus
> +      - const: dmcbus

Is "bus" really name of this in datasheet?

> +
> +  interrupts:
> +    maxItems: 3
> +
> +  interrupt-names:
> +    items:
> +      - const: mailbox_0
> +      - const: mailbox_1
> +      - const: mailbox_2

Useless names, so just drop interrupt-names property.

> +
> +  clocks:
> +    maxItems: 3
> +
> +  clock-names:
> +    items:
> +      - const: vdec
> +      - const: clk_vdec_mux
> +      - const: clk_hevcf_mux
> +
> +  power-domains:
> +    maxItems: 2
> +
> +  power-domain-names:
> +    items:
> +      - const: pwrc-vdec

Drop pwrc

> +      - const: pwrc-hevc

Drop pwrc

Missing iommus. I really doubt hardware works without IOMMU.



Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: vdec: Add binding document of Amlogic decoder accelerator
Posted by Zhentao Guo 3 months, 2 weeks ago
在 2025/10/27 21:05, Krzysztof Kozlowski 写道:
> [You don't often get email from krzk@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> [ EXTERNAL EMAIL ]
>
> On 27/10/2025 06:42, Zhentao Guo via B4 Relay wrote:
>> From: Zhentao Guo <zhentao.guo@amlogic.com>
>>
>> Add dt-binding of the Amlogic hardware decoder accelerator.
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching. For bindings, the preferred subjects are
> explained here:
> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
>
> A nit, subject: drop second/last, redundant "binding document for". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
Thank you for pointing this out and providing the guidance. We'll revise 
the subjects according to the specifications.
>> Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com>
>> ---
>>   .../bindings/media/amlogic,vcodec-dec.yaml         | 96 ++++++++++++++++++++++
>>   1 file changed, 96 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml b/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml
>> new file mode 100644
>> index 000000000000..6cea8af72639
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/amlogic,vcodec-dec.yaml
> Filename matching compatible.
Yes, we will correct this.
>> @@ -0,0 +1,96 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +# Copyright (C) 2025 Amlogic, Inc. All rights reserved
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/media/amlogic,vcodec-dec.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Amlogic Video Decode Accelerator
>> +
>> +maintainers:
>> +  - Zhentao Guo <zhentao.guo@amlogic.com>
>> +
>> +description: |
>
> Do not need '|' unless you need to preserve formatting.
OK, I'll get rid of this.
>> +  The Video Decoder Accelerator present on Amlogic SOCs.
>> +  It supports stateless h264 decoding.
>> +
>> +properties:
>> +  compatible:
>> +    const: amlogic,s4-vcodec-dec
>> +
>> +  reg:
>> +    maxItems: 2
>> +
>> +  reg-names:
>> +    items:
>> +      - const: dosbus
>> +      - const: dmcbus
> Is "bus" really name of this in datasheet?
No, it is not from the datasheet, in fact it was inherited from the
older SOCs. Do you have any suggestions about this?
>> +
>> +  interrupts:
>> +    maxItems: 3
>> +
>> +  interrupt-names:
>> +    items:
>> +      - const: mailbox_0
>> +      - const: mailbox_1
>> +      - const: mailbox_2
> Useless names, so just drop interrupt-names property.
Yes, we don't need the interrupt names. I'll drop them.
>
>> +
>> +  clocks:
>> +    maxItems: 3
>> +
>> +  clock-names:
>> +    items:
>> +      - const: vdec
>> +      - const: clk_vdec_mux
>> +      - const: clk_hevcf_mux
>> +
>> +  power-domains:
>> +    maxItems: 2
>> +
>> +  power-domain-names:
>> +    items:
>> +      - const: pwrc-vdec
> Drop pwrc
>
>> +      - const: pwrc-hevc
> Drop pwrc
Ok, I'll drop the two pwrc(s) above.
>
> Missing iommus. I really doubt hardware works without IOMMU.

IOMMU is not supported by Amlogic SOCs, the decoder hardware needs to 
use contiguous memory.

>
>
> Best regards,
> Krzysztof
Re: [PATCH 1/3] dt-bindings: vdec: Add binding document of Amlogic decoder accelerator
Posted by Krzysztof Kozlowski 3 months, 2 weeks ago
On 28/10/2025 12:14, Zhentao Guo wrote:
>>> +properties:
>>> +  compatible:
>>> +    const: amlogic,s4-vcodec-dec
>>> +
>>> +  reg:
>>> +    maxItems: 2
>>> +
>>> +  reg-names:
>>> +    items:
>>> +      - const: dosbus
>>> +      - const: dmcbus
>> Is "bus" really name of this in datasheet?
> No, it is not from the datasheet, in fact it was inherited from the
> older SOCs. Do you have any suggestions about this?

dos, dmc

>>> +
>>> +  interrupts:
>>> +    maxItems: 3
>>> +
>>> +  interrupt-names:
>>> +    items:
>>> +      - const: mailbox_0
>>> +      - const: mailbox_1
>>> +      - const: mailbox_2
>> Useless names, so just drop interrupt-names property.
> Yes, we don't need the interrupt names. I'll drop them.
>>
>>> +
>>> +  clocks:
>>> +    maxItems: 3
>>> +
>>> +  clock-names:
>>> +    items:
>>> +      - const: vdec
>>> +      - const: clk_vdec_mux
>>> +      - const: clk_hevcf_mux
>>> +
>>> +  power-domains:
>>> +    maxItems: 2
>>> +
>>> +  power-domain-names:
>>> +    items:
>>> +      - const: pwrc-vdec
>> Drop pwrc
>>
>>> +      - const: pwrc-hevc
>> Drop pwrc
> Ok, I'll drop the two pwrc(s) above.
>>
>> Missing iommus. I really doubt hardware works without IOMMU.
> 
> IOMMU is not supported by Amlogic SOCs, the decoder hardware needs to 
> use contiguous memory.

I assume you speak about hardware, not drivers, so it is fine.

Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: vdec: Add binding document of Amlogic decoder accelerator
Posted by Zhentao Guo 3 months, 2 weeks ago
在 2025/10/28 19:33, Krzysztof Kozlowski 写道:
> [ EXTERNAL EMAIL ]
>
> On 28/10/2025 12:14, Zhentao Guo wrote:
>>>> +properties:
>>>> +  compatible:
>>>> +    const: amlogic,s4-vcodec-dec
>>>> +
>>>> +  reg:
>>>> +    maxItems: 2
>>>> +
>>>> +  reg-names:
>>>> +    items:
>>>> +      - const: dosbus
>>>> +      - const: dmcbus
>>> Is "bus" really name of this in datasheet?
>> No, it is not from the datasheet, in fact it was inherited from the
>> older SOCs. Do you have any suggestions about this?
> dos, dmc
Got it, thanks!
>
>>>> +
>>>> +  interrupts:
>>>> +    maxItems: 3
>>>> +
>>>> +  interrupt-names:
>>>> +    items:
>>>> +      - const: mailbox_0
>>>> +      - const: mailbox_1
>>>> +      - const: mailbox_2
>>> Useless names, so just drop interrupt-names property.
>> Yes, we don't need the interrupt names. I'll drop them.
>>>> +
>>>> +  clocks:
>>>> +    maxItems: 3
>>>> +
>>>> +  clock-names:
>>>> +    items:
>>>> +      - const: vdec
>>>> +      - const: clk_vdec_mux
>>>> +      - const: clk_hevcf_mux
>>>> +
>>>> +  power-domains:
>>>> +    maxItems: 2
>>>> +
>>>> +  power-domain-names:
>>>> +    items:
>>>> +      - const: pwrc-vdec
>>> Drop pwrc
>>>
>>>> +      - const: pwrc-hevc
>>> Drop pwrc
>> Ok, I'll drop the two pwrc(s) above.
>>> Missing iommus. I really doubt hardware works without IOMMU.
>> IOMMU is not supported by Amlogic SOCs, the decoder hardware needs to
>> use contiguous memory.
> I assume you speak about hardware, not drivers, so it is fine.
Yes, I mean the IOMMU hardware above.
>
> Best regards,
> Krzysztof

Thank you

Zhentao