Re: [PATCH RFC v2 1/3] media: dt-bindings: Add Amlogic V4L2 video decoder
From: Zhentao Guo
Date: Tue Dec 16 2025 - 21:38:50 EST
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@xxxxxxxxxx> wrote:
From: Zhentao Guo <zhentao.guo@xxxxxxxxxxx>
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@xxxxxxxxxxx>
---
.../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@xxxxxxxxxxx>
+
+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