From: Zhentao Guo <zhentao.guo@amlogic.com>
Describe the initial support for the V4L2 stateless video decoder
driver used with the Amlogic S4 (S805X2) platform.
Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com>
---
.../bindings/media/amlogic,s4-vcodec-dec.yaml | 87 ++++++++++++++++++++++
1 file changed, 87 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml b/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml
new file mode 100644
index 000000000000..401a5a32902e
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml
@@ -0,0 +1,87 @@
+# 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: dos
+ - const: dmc
+
+ interrupts:
+ maxItems: 3
+
+ 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: vdec
+ - const: hevc
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - interrupts
+ - 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 0x20>;
+ amlogic,canvas = <&canvas>;
+ reg-names = "dos",
+ "dmc";
+ interrupts = <GIC_SPI 91 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 92 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
+ 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 = "vdec",
+ "hevc";
+ };
--
2.42.0
Hi,
On Mon, Nov 24, 2025 at 4:32 AM Zhentao Guo via B4 Relay
<devnull+zhentao.guo.amlogic.com@kernel.org> wrote:
>
> From: Zhentao Guo <zhentao.guo@amlogic.com>
>
> Describe the initial support for the V4L2 stateless video decoder
> driver used with the Amlogic S4 (S805X2) platform.
>
> Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com>
> ---
> .../bindings/media/amlogic,s4-vcodec-dec.yaml | 87 ++++++++++++++++++++++
> 1 file changed, 87 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml b/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml
> new file mode 100644
> index 000000000000..401a5a32902e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml
> @@ -0,0 +1,87 @@
> +# 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: dos
> + - const: dmc
Neil has commented on the driver patch (in v1) to use the existing
canvas driver.
The same applies to the binding: you can replace the whole "dmc"
registers with an "amlogic,canvas" property (see
Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml for
an example).
[...]
> +required:
> + - compatible
> + - reg
> + - reg-names
> + - interrupts
> + - clocks
> + - clock-names
> + - power-domains
> + - power-domain-names
I did a quick:
$ git grep RESET_DOS
{include/dt-bindings/reset/amlogic,arch/arm64/boot/dts/amlogic/}*.h
-> that lists DOS reset lines for most (all?) SoCs that were supported
by the old vdec driver as well as DOS reset lines for the S4 SoC (for
which you're adding support here).
If some of those reset lines are wired in hardware to the DOS region
then you should include them in the binding.
For reference in case you are not already familiar with it: [0] "[...]
make bindings complete even if a driver doesn’t support some features.
For example, if a device has an interrupt, then include the
‘interrupts’ property even if the driver is only polled mode".
(the same also applies to any additional clocks or power-domains that
are wired as inputs into the hardware which you have not listed yet as
they are not needed for the initially supported codecs)
Best regards,
Martin
[0] https://docs.kernel.org/devicetree/bindings/writing-bindings.html
Hi Martain,
在 2025/12/17 7:43, Martin Blumenstingl 写道:
> [ EXTERNAL EMAIL ]
>
> Hi,
>
> On Mon, Nov 24, 2025 at 4:32 AM Zhentao Guo via B4 Relay
> <devnull+zhentao.guo.amlogic.com@kernel.org> wrote:
>> From: Zhentao Guo <zhentao.guo@amlogic.com>
>>
>> Describe the initial support for the V4L2 stateless video decoder
>> driver used with the Amlogic S4 (S805X2) platform.
>>
>> Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com>
>> ---
>> .../bindings/media/amlogic,s4-vcodec-dec.yaml | 87 ++++++++++++++++++++++
>> 1 file changed, 87 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml b/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml
>> new file mode 100644
>> index 000000000000..401a5a32902e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/amlogic,s4-vcodec-dec.yaml
>> @@ -0,0 +1,87 @@
>> +# 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: dos
>> + - const: dmc
> Neil has commented on the driver patch (in v1) to use the existing
> canvas driver.
> The same applies to the binding: you can replace the whole "dmc"
> registers with an "amlogic,canvas" property (see
> Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml for
> an example).
Indeed, only a section of the dmc registers is for canvas. For the reset
part of the registers, canvas driver should not access them directely.
For example, on S805X2 platform, the DMC registers range from 0xfe036000
to 0xfe038000. The canvas registers only range from 0xfe036048
to 0xfe03605c.
The decoder driver also need to access the register 0xfe036000, which is
not contained in the range of canvas registers, so we still need to
remap this register in the decoder driver. Therefore, the property 'dmc'
is still needed.
>
> [...]
>> +required:
>> + - compatible
>> + - reg
>> + - reg-names
>> + - interrupts
>> + - clocks
>> + - clock-names
>> + - power-domains
>> + - power-domain-names
> I did a quick:
> $ git grep RESET_DOS
> {include/dt-bindings/reset/amlogic,arch/arm64/boot/dts/amlogic/}*.h
> -> that lists DOS reset lines for most (all?) SoCs that were supported
> by the old vdec driver as well as DOS reset lines for the S4 SoC (for
> which you're adding support here).
> If some of those reset lines are wired in hardware to the DOS region
> then you should include them in the binding.
> For reference in case you are not already familiar with it: [0] "[...]
> make bindings complete even if a driver doesn’t support some features.
> For example, if a device has an interrupt, then include the
> ‘interrupts’ property even if the driver is only polled mode".
> (the same also applies to any additional clocks or power-domains that
> are wired as inputs into the hardware which you have not listed yet as
> they are not needed for the initially supported codecs)
Yes, I also noticed this issue. The DOS reset line should be added. We
will fix this in the next patch version. Thanks for your suggestions!
> Best regards,
> Martin
>
BRs
Zhentao
> [0] https://docs.kernel.org/devicetree/bindings/writing-bindings.html
On 24/11/2025 04:32, Zhentao Guo via B4 Relay wrote: > From: Zhentao Guo <zhentao.guo@amlogic.com> > > Describe the initial support for the V4L2 stateless video decoder > driver used with the Amlogic S4 (S805X2) platform. > > Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com> > --- > .../bindings/media/amlogic,s4-vcodec-dec.yaml | 87 ++++++++++++++++++++++ > 1 file changed, 87 insertions(+) > Never tested, although maybe you imply this by RFC. If that is the case, explain IN THE FIRST paragraph of your cover letter why this is RFC, why this is not ready for review and mention that because of this you did not test your own code. Best regards, Krzysztof
在 2025/11/25 19:31, Krzysztof Kozlowski 写道: > [ EXTERNAL EMAIL ] > > On 24/11/2025 04:32, Zhentao Guo via B4 Relay wrote: >> From: Zhentao Guo <zhentao.guo@amlogic.com> >> >> Describe the initial support for the V4L2 stateless video decoder >> driver used with the Amlogic S4 (S805X2) platform. >> >> Signed-off-by: Zhentao Guo <zhentao.guo@amlogic.com> >> --- >> .../bindings/media/amlogic,s4-vcodec-dec.yaml | 87 ++++++++++++++++++++++ >> 1 file changed, 87 insertions(+) >> > > Never tested, although maybe you imply this by RFC. If that is the case, > explain IN THE FIRST paragraph of your cover letter why this is RFC, why > this is not ready for review and mention that because of this you did > not test your own code. This is my fault, I didn't test the dtbs check carefully. This will not happen again! The reason for the RFC tag is that there are still some Fluster test failures and we are resolving them. > Best regards, > Krzysztof BRs Zhentao
© 2016 - 2026 Red Hat, Inc.