Enable decoder for mt8183
Subsystems (4)
v3 cover Enable decoder for mt8183
This series enables the hardware decoder present on mt8183. At first glance, the only missing piece is the devicetree node for it, however, simply adding it as is would cause an address collision between the first register iospace and the clock-controller node, so a rework of the dt-binding and driver, as well as addition of a new syscon phandle property, were needed first.
Tested that H264 decoding works with the hardware decoder on mt8183-kukui-jacuzzi-juniper-sku16, giving a fluster score of 98/135 on the JVT-AVC_V1 test suite. And ensured other SoCs (MT8192 and MT8195) still work as usual.
Changes in v3:
- Switched the handling of the VDEC_HW_ACTIVE bit to use a syscon instead of the 'active' clock
Changes in v2:
- Merged commit 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) into commit 3 (media: dt-bindings: mediatek,vcodec:
Remove VDEC_SYS for mt8183)
- Further constrained properties in dt-binding
- Added CLK_IGNORE_UNUSED flag to active clock
- Reformatted reg-names in DT node
Nícolas F. R. A. Prado (5):
media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183
media: dt-bindings: mediatek,vcodec: Don't require assigned-clocks
media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE
media: mediatek: vcodec: Read HW active status from syscon on MT8183
Yunfei Dong (1):
arm64: dts: mediatek: mt8183: Add decoder
.../media/mediatek,vcodec-decoder.yaml | 69 +++++++++++++++--- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 30 ++++++++ .../mediatek/vcodec/mtk_vcodec_dec_drv.c | 71 ++++++++++++++++--- .../mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 +- .../mediatek/vcodec/mtk_vcodec_dec_hw.h | 3 +- .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 + 6 files changed, 153 insertions(+), 25 deletions(-)
Signature · 1 line
2.41.0
PATCH v3 1/6 media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183
MT8173 and MT8183 have different clocks, and consequently clock-names. Relax the number of clocks and set clock-names based on compatible.
---
Changes in v3:
- Reintroduced this commit from v1 since the active clock is no longer used.
- Further constrained clocks as suggested in v1.
.../media/mediatek,vcodec-decoder.yaml | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +28 -9
@@ -27,18 +27,12 @@ properties: maxItems: 1 clocks: + minItems: 1 maxItems: 8 clock-names: - items: - - const: vcodecpll - - const: univpll_d2 - - const: clk_cci400_sel - - const: vdec_sel - - const: vdecpll - - const: vencpll - - const: venc_lt_sel - - const: vdec_bus_clk_src + minItems: 1 + maxItems: 8 assigned-clocks: true
@@ -88,6 +82,15 @@ allOf: required: - mediatek,scp + properties: + clocks: + minItems: 1 + maxItems: 1 + + clock-names: + items: + - const: vdec + - if: properties: compatible:
@@ -99,6 +102,22 @@ allOf: required: - mediatek,vpu + properties: + clocks: + minItems: 8 + maxItems: 8 + + clock-names: + items: + - const: vcodecpll + - const: univpll_d2 + - const: clk_cci400_sel + - const: vdec_sel + - const: vdecpll + - const: vencpll + - const: venc_lt_sel + - const: vdec_bus_clk_src + additionalProperties: false examples:
Signature · 1 line
2.41.0
Re: [PATCH v3 1/6] media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183
Quoted 8 lines · Nícolas F. R. A. Prado
MT8173 and MT8183 have different clocks, and consequently clock-names. Relax the number of clocks and set clock-names based on compatible.
Reviewed-by AngeloGioacchino Del Regno <[email protected]>Reviewed-by Matthias Brugger <[email protected]>Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Best regards,
Krzysztof
PATCH v3 2/6 media: dt-bindings: mediatek,vcodec: Don't require assigned-clocks
In reply to Nícolas F. R. A. PradoOn MT8183 it's not necessary to configure the parent for the clocks. Remove the assigned-clocks and assigned-clock-parents from the required list.
---
(no changes since v1)
.../devicetree/bindings/media/mediatek,vcodec-decoder.yaml | 2 -- 1 file changed, 2 deletions(-)
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0 -2
@@ -67,8 +67,6 @@ required: - clocks - clock-names - iommus - - assigned-clocks - - assigned-clock-parents allOf: - if:
Signature · 1 line
2.41.0
PATCH v3 3/6 media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
In reply to Nícolas F. R. A. PradoThe binding expects the first register space to be VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.
In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the VDEC_SYS register space, it's not straightforward to remove it.
In order to avoid the same address conflict to happen on mt8183, since the only current use of the VDEC_SYS register space in the driver is to read the status of a hardware controlled clock, remove the VDEC_SYS register space from the binding and describe an extra syscon that will be used to directly check the hardware status.
Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.
Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon property
Changes in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible
.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +30 -0
@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11 + interrupts: maxItems: 1
@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg
@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1
@@ -101,6 +128,9 @@ allOf: - mediatek,vpu properties: + reg: + minItems: 12 + clocks: minItems: 8 maxItems: 8
Signature · 1 line
2.41.0
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 45 lines · Nícolas F. R. A. Prado
The binding expects the first register space to be
VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the
VDEC_SYSregister space, it's not straightforward to remove it.In order to avoid the same address conflict to happen on mt8183, since the only current use of the
VDEC_SYSregister space in the driver is to read the status of a hardware controlled clock, remove theVDEC_SYSregister space from the binding and describe an extra syscon that will be used to directly check the hardware status.Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon propertyChanges in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0
-0
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +4
-0@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11
maxItems: 12
Quoted 43 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +23
-0+ interrupts: maxItems: 1@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml allOf: · line 132
Quoted 5 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +2
-0@@ -101,6 +128,9 @@ allOf: - mediatek,vpu properties: + reg: + minItems: 12
What about reg-names here? They should be also defined and in sync with regs.
Best regards,
Krzysztof
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 103 lines · Krzysztof Kozlowski
Quoted 45 lines · Nícolas F. R. A. Prado
The binding expects the first register space to be
VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the
VDEC_SYSregister space, it's not straightforward to remove it.In order to avoid the same address conflict to happen on mt8183, since the only current use of the
VDEC_SYSregister space in the driver is to read the status of a hardware controlled clock, remove theVDEC_SYSregister space from the binding and describe an extra syscon that will be used to directly check the hardware status.Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon propertyChanges in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0
-0Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +4
-0@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11maxItems: 12
Quoted 45 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +23
-0+ interrupts: maxItems: 1@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1@@ -101,6 +128,9 @@ allOf: - mediatek,vpu
Quoted 7 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml allOf: · line 132
Quoted 3 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +2
-0properties: + reg: + minItems: 12What about reg-names here? They should be also defined and in sync with regs.
That's intentional. As described in the commit message, mt8173 will keep having the VDEC_SYS iospace, while mt8183 won't. And we use the presence of reg-names to tell them apart.
So, mt8173 has 12 regs, no reg-names and no syscon, while mt8183 has 11 regs, with reg-names and the syscon.
Thanks,
Nícolas
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 112 lines · Nícolas F. R. A. Prado
Quoted 103 lines · Krzysztof Kozlowski
Quoted 45 lines · Nícolas F. R. A. Prado
The binding expects the first register space to be
VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the
VDEC_SYSregister space, it's not straightforward to remove it.In order to avoid the same address conflict to happen on mt8183, since the only current use of the
VDEC_SYSregister space in the driver is to read the status of a hardware controlled clock, remove theVDEC_SYSregister space from the binding and describe an extra syscon that will be used to directly check the hardware status.Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon propertyChanges in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0
-0Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +4
-0@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11maxItems: 12
Quoted 45 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +23
-0+ interrupts: maxItems: 1@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1@@ -101,6 +128,9 @@ allOf: - mediatek,vpuQuoted 7 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml allOf: · line 132
Quoted 3 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +2
-0properties: + reg: + minItems: 12What about reg-names here? They should be also defined and in sync with regs.
Quoted 6 lines
That's intentional. As described in the commit message, mt8173 will keep having the
VDEC_SYSiospace, while mt8183 won't. And we use the presence of reg-names to tell them apart.So, mt8173 has 12 regs, no reg-names and no syscon, while mt8183 has 11 regs, with reg-names and the syscon.
reg-names is not the way to tell apart variants. Compatible is. If you add reg-names for one variant, it's expected to have it defined for other as well, because the order of items in reg is always fixed.
Best regards,
Krzysztof
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 117 lines · Krzysztof Kozlowski
Quoted 116 lines · Nícolas F. R. A. Prado
Quoted 103 lines · Krzysztof Kozlowski
Quoted 45 lines · Nícolas F. R. A. Prado
The binding expects the first register space to be
VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the
VDEC_SYSregister space, it's not straightforward to remove it.In order to avoid the same address conflict to happen on mt8183, since the only current use of the
VDEC_SYSregister space in the driver is to read the status of a hardware controlled clock, remove theVDEC_SYSregister space from the binding and describe an extra syscon that will be used to directly check the hardware status.Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon propertyChanges in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0
-0Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +4
-0@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11maxItems: 12
Quoted 45 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +23
-0+ interrupts: maxItems: 1@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1@@ -101,6 +128,9 @@ allOf: - mediatek,vpuQuoted 7 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml allOf: · line 132
Quoted 3 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +2
-0properties: + reg: + minItems: 12What about reg-names here? They should be also defined and in sync with regs.
That's intentional. As described in the commit message, mt8173 will keep having the
VDEC_SYSiospace, while mt8183 won't. And we use the presence of reg-names to tell them apart.
Quoted 6 lines
Quoted 2 lines
So, mt8173 has 12 regs, no reg-names and no syscon, while mt8183 has 11 regs, with reg-names and the syscon.
reg-names is not the way to tell apart variants. Compatible is. If you add reg-names for one variant, it's expected to have it defined for other as well, because the order of items in reg is always fixed.
But differentiating with compatible in this case would be wrong, since it's not not something inherent to the SoC. We really just want to be able to tell whether the vdecsys iospace is supplied as a reg or as a syscon.
This series focuses on getting the mt8183 decoder working, and as part of that introduces the binding and DT node for mt8183 with vdecsys as a syscon instead of a reg, to avoid introducing new 'duplicate unit-address' DT warnings.
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Thanks,
Nícolas
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 121 lines · Nícolas F. R. A. Prado
Quoted 120 lines · Krzysztof Kozlowski
Quoted 118 lines · Nícolas F. R. A. Prado
Quoted 103 lines · Krzysztof Kozlowski
Quoted 45 lines · Nícolas F. R. A. Prado
The binding expects the first register space to be
VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the
VDEC_SYSregister space, it's not straightforward to remove it.In order to avoid the same address conflict to happen on mt8183, since the only current use of the
VDEC_SYSregister space in the driver is to read the status of a hardware controlled clock, remove theVDEC_SYSregister space from the binding and describe an extra syscon that will be used to directly check the hardware status.Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon propertyChanges in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0
-0Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +4
-0@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11maxItems: 12
Quoted 45 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +23
-0+ interrupts: maxItems: 1@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1@@ -101,6 +128,9 @@ allOf: - mediatek,vpuQuoted 7 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml allOf: · line 132
Quoted 3 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +2
-0properties: + reg: + minItems: 12What about reg-names here? They should be also defined and in sync with regs.
That's intentional. As described in the commit message, mt8173 will keep having the
VDEC_SYSiospace, while mt8183 won't. And we use the presence of reg-names to tell them apart.So, mt8173 has 12 regs, no reg-names and no syscon, while mt8183 has 11 regs, with reg-names and the syscon.
Quoted 7 lines
Quoted 3 lines
reg-names is not the way to tell apart variants. Compatible is. If you add reg-names for one variant, it's expected to have it defined for other as well, because the order of items in reg is always fixed.
But differentiating with compatible in this case would be wrong, since it's not not something inherent to the SoC. We really just want to be able to tell whether the vdecsys iospace is supplied as a reg or as a syscon.
Wait, you should not have one device or even family of devices taking their IO space with two different methods. It's exactly the same device, the same bus.
Quoted 4 lines
This series focuses on getting the mt8183 decoder working, and as part of that introduces the binding and DT node for mt8183 with vdecsys as a syscon instead of a reg, to avoid introducing new 'duplicate unit-address' DT warnings.
I got patches 1, 2, 3 and 6, nothing more so I cannot comment on what else you are trying to do here. Since you did not cc me, it's not relevant.
Your DTS change does nothing like switching from MMIO to syscon.
But anyway this variant comes with some set of regs and reg-names. Other variant comes with different set. In all cases they should be defined, even by "defined" means not allowed.
Quoted 7 lines
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Sure, but I don't understand how does it affect defining and making specific regs/reg-names or keeping them loose.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 126 lines · Krzysztof Kozlowski
Quoted 125 lines · Nícolas F. R. A. Prado
Quoted 123 lines · Krzysztof Kozlowski
Quoted 112 lines · Nícolas F. R. A. Prado
Quoted 103 lines · Krzysztof Kozlowski
Quoted 45 lines · Nícolas F. R. A. Prado
The binding expects the first register space to be
VDEC_SYS. But on mt8183, which uses the stateless decoders, this space is used only for controlling clocks and resets, which are better described as separate clock-controller and reset-controller nodes.In fact, in mt8173's devicetree there are already such separate clock-controller nodes, which cause duplicate addresses between the vdecsys node and the vcodec node. But for this SoC, since the stateful decoder code makes other uses of the
VDEC_SYSregister space, it's not straightforward to remove it.In order to avoid the same address conflict to happen on mt8183, since the only current use of the
VDEC_SYSregister space in the driver is to read the status of a hardware controlled clock, remove theVDEC_SYSregister space from the binding and describe an extra syscon that will be used to directly check the hardware status.Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Removed the active clock
- Added a mediatek,vdecsys syscon propertyChanges in v2:
- Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice
- Added maxItems to reg-names
- Constrained clocks for each compatible
- Reordered properties for each compatible.../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +0
-0Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +4
-0@@ -21,8 +21,13 @@ properties: - mediatek,mt8183-vcodec-dec reg: + minItems: 11 maxItems: 12 + reg-names: + minItems: 11 + maxItems: 11maxItems: 12
Quoted 45 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +23
-0+ interrupts: maxItems: 1@@ -60,6 +65,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg@@ -79,8 +88,26 @@ allOf: then: required: - mediatek,scp + - mediatek,vdecsys properties: + reg: + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg + clocks: minItems: 1 maxItems: 1@@ -101,6 +128,9 @@ allOf: - mediatek,vpuQuoted 7 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml allOf: · line 132
Quoted 3 lines
Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +2
-0properties: + reg: + minItems: 12What about reg-names here? They should be also defined and in sync with regs.
Quoted 6 lines
That's intentional. As described in the commit message, mt8173 will keep having the
VDEC_SYSiospace, while mt8183 won't. And we use the presence of reg-names to tell them apart.So, mt8173 has 12 regs, no reg-names and no syscon, while mt8183 has 11 regs, with reg-names and the syscon.
reg-names is not the way to tell apart variants. Compatible is. If you add reg-names for one variant, it's expected to have it defined for other as well, because the order of items in reg is always fixed.
Quoted 7 lines
Quoted 3 lines
But differentiating with compatible in this case would be wrong, since it's not not something inherent to the SoC. We really just want to be able to tell whether the vdecsys iospace is supplied as a reg or as a syscon.
Wait, you should not have one device or even family of devices taking their IO space with two different methods. It's exactly the same device, the same bus.
The VDEC_SYS IO space is arguably not part of the vcodec IO space, since it is declared by a different node. Hence we shouldn't be getting it through reg, but instead through a syscon, to avoid clashing addresses.
In other words, the VDEC_SYS IO space shouldn't have been in the binding as a 'reg' in the first place. And since we want to:
1. Keep backward compatibility
2. Fix the 'duplicate unit-address' DT warning
We will need to support both ways - reg or syscon - of passing the VDEC_SYS IO space moving forward.
Quoted 8 lines
Quoted 5 lines
This series focuses on getting the mt8183 decoder working, and as part of that introduces the binding and DT node for mt8183 with vdecsys as a syscon instead of a reg, to avoid introducing new 'duplicate unit-address' DT warnings.
I got patches 1, 2, 3 and 6, nothing more so I cannot comment on what else you are trying to do here. Since you did not cc me, it's not relevant.
That's ok, the driver changes aren't relevant to this discussion.
Quoted 2 lines
Your DTS change does nothing like switching from MMIO to syscon.
The original downstream DT node used MMIO for VDEC_SYS, but I've adapted that commit to use a syscon. So the commit is implicitly doing the switch, it just doesn't show because the node wasn't upstreamed before on mt8183.
Quoted 4 lines
But anyway this variant comes with some set of regs and reg-names. Other variant comes with different set. In all cases they should be defined, even by "defined" means not allowed.
I'm not sure what you mean. Are you suggesting to disable reg-names on mt8173?
Quoted 11 lines
Quoted 8 lines
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Sure, but I don't understand how does it affect defining and making specific regs/reg-names or keeping them loose.
We need some way to tell in the driver whether the first reg is VDEC_SYS or not. Since so far reg-names have not been used for the vcodec, the simplest, and cleanest, way to do it, is to add reg-names when VDEC_SYS is not present. When the other SoCs are updated to no longer have the first reg as VDEC_SYS, they would also have reg-names added to their binding, to clearly indicate that.
For example, for mt8173 we currently have
vcodec_dec: vcodec@16000000 {
compatible = "mediatek,mt8173-vcodec-dec";
reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */
<0 0x16020000 0 0x1000>, /* VDEC_MISC */
<0 0x16021000 0 0x800>, /* VDEC_LD */
<0 0x16021800 0 0x800>, /* VDEC_TOP */
<0 0x16022000 0 0x1000>, /* VDEC_CM */
<0 0x16023000 0 0x1000>, /* VDEC_AD */
<0 0x16024000 0 0x1000>, /* VDEC_AV */
<0 0x16025000 0 0x1000>, /* VDEC_PP */
<0 0x16026800 0 0x800>, /* VDEC_HWD */
<0 0x16027000 0 0x800>, /* VDEC_HWQ */
<0 0x16027800 0 0x800>, /* VDEC_HWB */
<0 0x16028400 0 0x400>; /* VDEC_HWG */In a future series, when removing VDEC_SYS from it, it would become
vcodec_dec: vcodec@16020000 {
compatible = "mediatek,mt8173-vcodec-dec";
reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */
<0 0x16021000 0 0x800>, /* VDEC_LD */
<0 0x16021800 0 0x800>, /* VDEC_TOP */
<0 0x16022000 0 0x1000>, /* VDEC_CM */
<0 0x16023000 0 0x1000>, /* VDEC_AD */
<0 0x16024000 0 0x1000>, /* VDEC_AV */
<0 0x16025000 0 0x1000>, /* VDEC_PP */
<0 0x16026800 0 0x800>, /* VDEC_HWD */
<0 0x16027000 0 0x800>, /* VDEC_HWQ */
<0 0x16027800 0 0x800>, /* VDEC_HWB */
<0 0x16028400 0 0x400>; /* VDEC_HWG */
reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp",
"hwd", "hwq", "hwb", "hwg";
mediatek,vdecsys = <&vdecsys>;Thanks,
Nícolas
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 6 lines · Nícolas F. R. A. Prado
Quoted 4 lines
But anyway this variant comes with some set of regs and reg-names. Other variant comes with different set. In all cases they should be defined, even by "defined" means not allowed.
I'm not sure what you mean. Are you suggesting to disable reg-names on mt8173?
That's one of the options if for some reason you don't want to define them.
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Quoted 8 lines
Quoted 2 lines
Sure, but I don't understand how does it affect defining and making specific regs/reg-names or keeping them loose.
We need some way to tell in the driver whether the first reg is
VDEC_SYSor not. Since so far reg-names have not been used for the vcodec, the simplest, and cleanest, way to do it, is to add reg-names whenVDEC_SYSis not present. When the other SoCs are updated to no longer have the first reg asVDEC_SYS, they would also have reg-names added to their binding, to clearly indicate that.
Don't use reg-names for that. The order of entries is anyway strict.
Quoted 20 lines
For example, for mt8173 we currently have
vcodec_dec: vcodec@16000000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */ <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */In a future series, when removing
VDEC_SYSfrom it, it would become
Quoted 15 lines
vcodec_dec: vcodec@16020000 {
compatible = "mediatek,mt8173-vcodec-dec";
reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */
<0 0x16021000 0 0x800>, /* VDEC_LD */
<0 0x16021800 0 0x800>, /* VDEC_TOP */
<0 0x16022000 0 0x1000>, /* VDEC_CM */
<0 0x16023000 0 0x1000>, /* VDEC_AD */
<0 0x16024000 0 0x1000>, /* VDEC_AV */
<0 0x16025000 0 0x1000>, /* VDEC_PP */
<0 0x16026800 0 0x800>, /* VDEC_HWD */
<0 0x16027000 0 0x800>, /* VDEC_HWQ */
<0 0x16027800 0 0x800>, /* VDEC_HWB */
<0 0x16028400 0 0x400>; /* VDEC_HWG */
reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp",
"hwd", "hwq", "hwb", "hwg";So you want to use reg-names to avoid ABI break. This is not the reason not to define reg-names for other case.
Best regards,
Krzysztof
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 23 lines · Krzysztof Kozlowski
Quoted 6 lines · Nícolas F. R. A. Prado
Quoted 4 lines
But anyway this variant comes with some set of regs and reg-names. Other variant comes with different set. In all cases they should be defined, even by "defined" means not allowed.
I'm not sure what you mean. Are you suggesting to disable reg-names on mt8173?
That's one of the options if for some reason you don't want to define them.
Quoted 13 lines
Quoted 12 lines
Quoted 9 lines
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Sure, but I don't understand how does it affect defining and making specific regs/reg-names or keeping them loose.
Quoted 7 lines
Quoted 5 lines
We need some way to tell in the driver whether the first reg is
VDEC_SYSor not. Since so far reg-names have not been used for the vcodec, the simplest, and cleanest, way to do it, is to add reg-names whenVDEC_SYSis not present. When the other SoCs are updated to no longer have the first reg asVDEC_SYS, they would also have reg-names added to their binding, to clearly indicate that.Don't use reg-names for that. The order of entries is anyway strict.
Since the order of entries is strict, if I remove VDEC_SYS from mt8183, I also need to remove it from mt8173, is that what you mean? I would still check for the presence of reg-names in the driver to differentiate whether the old or new binding is used, you just don't want different reg-names between compatibles in the binding?
Quoted 37 lines
Quoted 21 lines
For example, for mt8173 we currently have
vcodec_dec: vcodec@16000000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */ <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */In a future series, when removing
VDEC_SYSfrom it, it would becomeQuoted 15 lines
vcodec_dec: vcodec@16020000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */ reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp", "hwd", "hwq", "hwb", "hwg";
Quoted 2 lines
So you want to use reg-names to avoid ABI break. This is not the reason not to define reg-names for other case.
There will be an ABI break anyway when the first reg is removed (as shown above), I'm just trying to avoid churn: adding a reg-name that will be removed later.
Thanks,
Nícolas
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 30 lines · Nícolas F. R. A. Prado
Quoted 29 lines · Krzysztof Kozlowski
Quoted 6 lines · Nícolas F. R. A. Prado
Quoted 4 lines
But anyway this variant comes with some set of regs and reg-names. Other variant comes with different set. In all cases they should be defined, even by "defined" means not allowed.
I'm not sure what you mean. Are you suggesting to disable reg-names on mt8173?
That's one of the options if for some reason you don't want to define them.
Quoted 18 lines
Quoted 10 lines
Quoted 9 lines
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Quoted 2 lines
Sure, but I don't understand how does it affect defining and making specific regs/reg-names or keeping them loose.
We need some way to tell in the driver whether the first reg is
VDEC_SYSor not. Since so far reg-names have not been used for the vcodec, the simplest, and cleanest, way to do it, is to add reg-names whenVDEC_SYSis not present. When the other SoCs are updated to no longer have the first reg asVDEC_SYS, they would also have reg-names added to their binding, to clearly indicate that.
Quoted 4 lines
Quoted 1 line
Don't use reg-names for that. The order of entries is anyway strict.
Since the order of entries is strict, if I remove
VDEC_SYSfrom mt8183, I also need to remove it from mt8173, is that what you mean?
It's different compatible, so it can have different entries.
Quoted 4 lines
I would still check for
the presence of reg-names in the driver to differentiate whether the old or new binding is used, you just don't want different reg-names between compatibles in the binding?
I wrote already what I want:
In all cases they should be defined, even by "defined" means not allowed.
Now of course the best would be if the reg-names are always the same, at least in respect of order of items. This is what we try to do for all devices.
Quoted 38 lines
Quoted 38 lines
Quoted 37 lines
For example, for mt8173 we currently have
vcodec_dec: vcodec@16000000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */ <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */In a future series, when removing
VDEC_SYSfrom it, it would becomevcodec_dec: vcodec@16020000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */ reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp", "hwd", "hwq", "hwb", "hwg";
Quoted 6 lines
Quoted 2 lines
So you want to use reg-names to avoid ABI break. This is not the reason not to define reg-names for other case.
There will be an ABI break anyway when the first reg is removed (as shown above), I'm just trying to avoid churn: adding a reg-name that will be removed later.
So remove the reg-name now and there will be no "later"?
Best regards,
Krzysztof
Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183
Quoted 90 lines · Krzysztof Kozlowski
Quoted 30 lines · Nícolas F. R. A. Prado
Quoted 29 lines · Krzysztof Kozlowski
Quoted 6 lines · Nícolas F. R. A. Prado
Quoted 4 lines
But anyway this variant comes with some set of regs and reg-names. Other variant comes with different set. In all cases they should be defined, even by "defined" means not allowed.
I'm not sure what you mean. Are you suggesting to disable reg-names on mt8173?
That's one of the options if for some reason you don't want to define them.
Quoted 18 lines
Quoted 10 lines
Quoted 9 lines
But in a separate series we could drop vdecsys from mt8173's reg as well, passing it as a syscon instead, which would solve the warning on that platform, though some more driver changes would be needed to be able to handle it for that SoC. The newer SoCs like mt8192, mt8195, etc, should also get vdecsys dropped from their regs to have a correct memory description.
Quoted 2 lines
Sure, but I don't understand how does it affect defining and making specific regs/reg-names or keeping them loose.
We need some way to tell in the driver whether the first reg is
VDEC_SYSor not. Since so far reg-names have not been used for the vcodec, the simplest, and cleanest, way to do it, is to add reg-names whenVDEC_SYSis not present. When the other SoCs are updated to no longer have the first reg asVDEC_SYS, they would also have reg-names added to their binding, to clearly indicate that.Quoted 4 lines
Quoted 1 line
Don't use reg-names for that. The order of entries is anyway strict.
Since the order of entries is strict, if I remove
VDEC_SYSfrom mt8183, I also need to remove it from mt8173, is that what you mean?It's different compatible, so it can have different entries.
Quoted 4 lines
I would still check for
the presence of reg-names in the driver to differentiate whether the old or new binding is used, you just don't want different reg-names between compatibles in the binding?I wrote already what I want:
In all cases they should be defined, even by "defined" means not allowed.
Now of course the best would be if the reg-names are always the same, at least in respect of order of items. This is what we try to do for all devices.
Quoted 38 lines
Quoted 38 lines
Quoted 37 lines
For example, for mt8173 we currently have
vcodec_dec: vcodec@16000000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */ <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */In a future series, when removing
VDEC_SYSfrom it, it would becomevcodec_dec: vcodec@16020000 { compatible = "mediatek,mt8173-vcodec-dec"; reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ <0 0x16023000 0 0x1000>, /* VDEC_AD */ <0 0x16024000 0 0x1000>, /* VDEC_AV */ <0 0x16025000 0 0x1000>, /* VDEC_PP */ <0 0x16026800 0 0x800>, /* VDEC_HWD */ <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */ reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp", "hwd", "hwq", "hwb", "hwg";
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
So you want to use reg-names to avoid ABI break. This is not the reason not to define reg-names for other case.
There will be an ABI break anyway when the first reg is removed (as shown above), I'm just trying to avoid churn: adding a reg-name that will be removed later.
So remove the reg-name now and there will be no "later"?
OK, I'll send a v4 with VDEC_SYS also removed from mt8173.
Thanks,
Nícolas
PATCH v3 4/6 media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE
In reply to Nícolas F. R. A. PradoThe VDEC_HW_ACTIVE bit is located at offset 0, bit 4 of the VDECSYS iospace. Only the mask was previously defined, with the address being implicit. Explicitly define the address, and append a '_MASK' suffix to the mask, to make accesses to this bit clearer.
This commit brings no functional change.
---
Changes in v3:
- Added this commit
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +2 -2
@@ -50,8 +50,8 @@ static irqreturn_t mtk_vcodec_dec_irq_handler(int irq, void *priv) ctx =mtk_vcodec_get_curr_ctx (dev,MTK_VDEC_CORE );/* check if HW active or not */ - cg_status =readl (dev->reg_base[0 ]); -if ((cg_status &VDEC_HW_ACTIVE ) !=0 ) { + cg_status =readl (dev->reg_base[0 ] +VDEC_HW_ACTIVE_ADDR ); +if ((cg_status &VDEC_HW_ACTIVE_MASK ) !=0 ) {mtk_v4l2_err ("DEC ISR, VDEC active is not 0x0 (0x%08x)" , cg_status);return IRQ_HANDLED ;
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c +2 -2
@@ -75,8 +75,8 @@ static irqreturn_t mtk_vdec_hw_irq_handler(int irq, void *priv) ctx =mtk_vcodec_get_curr_ctx (dev->main_dev, dev->hw_idx);/* check if HW active or not */ - cg_status =readl (dev->reg_base[VDEC_HW_SYS ]); -if (cg_status &VDEC_HW_ACTIVE ) { + cg_status =readl (dev->reg_base[VDEC_HW_SYS ] +VDEC_HW_ACTIVE_ADDR ); +if (cg_status &VDEC_HW_ACTIVE_MASK ) {mtk_v4l2_err ("vdec active is not 0x0 (0x%08x)" , cg_status);return IRQ_HANDLED ;
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h +2 -1
@@ -12,7 +12,8 @@#include "mtk_vcodec_drv.h" -#define VDEC_HW_ACTIVE 0x10 +#define VDEC_HW_ACTIVE_ADDR 0x0 +#define VDEC_HW_ACTIVE_MASK 0x10#define VDEC_IRQ_CFG 0x11#define VDEC_IRQ_CLR 0x10#define VDEC_IRQ_CFG_REG 0xa4
Signature · 1 line
2.41.0
AngeloGioacchino Del Regno
maintainerRe: [PATCH v3 4/6] media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE
Il 20/06/23 02:03, Nícolas F. R. A. Prado ha scritto:
Quoted 19 lines
The
VDEC_HW_ACTIVEbit is located at offset 0, bit 4 of the VDECSYS iospace. Only the mask was previously defined, with the address being implicit. Explicitly define the address, and append a '_MASK' suffix to the mask, to make accesses to this bit clearer.This commit brings no functional change.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Changes in v3:
- Added this commitdrivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-)
..snip..
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h line 16
Quoted 11 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h +2
-1@@ -12,7 +12,8 @@#include "mtk_vcodec_drv.h" -#define VDEC_HW_ACTIVE 0x10 +#define VDEC_HW_ACTIVE_ADDR 0x0 +#define VDEC_HW_ACTIVE_MASK 0x10
#define VDEC_HW_ACTIVE_MASK BIT(4)
...because it's a bit, as you wrote in the commit description :-)
Cheers,
Angelo
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h line 19
Quoted 3 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h +0
-0#define VDEC_IRQ_CFG 0x11#define VDEC_IRQ_CLR 0x10#define VDEC_IRQ_CFG_REG 0xa4
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 5/6 media: mediatek: vcodec: Read HW active status from syscon on MT8183
In reply to Nícolas F. R. A. PradoRemove the requirement of a VDEC_SYS reg iospace for MT8183. To achieve that, rely on a vdecsys syscon to be passed through the DT, and use it to directly read the VDEC_HW_ACTIVE bit during IRQ handling to check whether the HW is active.
The old behavior is still present when reg-names aren't supplied, as MT8173 still relies on it.
---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.
Changes in v3:
- Switched handling of VDEC_HW_ACTIVE to use a syscon instead of the 'active' clock
- Reworded commit
- Removed changes to subdev part of driver, since they aren't used by MT8183
.../mediatek/vcodec/mtk_vcodec_dec_drv.c | 71 ++++++++++++++++--- .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 + 2 files changed, 61 insertions(+), 11 deletions(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +60 -11
@@ -8,10 +8,12 @@#include <linux/slab.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of_device.h> #include <linux/of.h> #include <linux/pm_runtime.h> +#include <linux/regmap.h> #include <media/v4l2-event.h> #include <media/v4l2-mem2mem.h> #include <media/videobuf2-dma-contig.h>
@@ -38,22 +40,37 @@ static int mtk_vcodec_get_hw_count(struct mtk_vcodec_dev *dev) } } +static bool mtk_vcodec_is_hw_active (struct mtk_vcodec_dev *dev) +{ +u32 cg_status =0 ; +int val, ret; + +if (!dev->reg_base[VDEC_SYS ]) { + ret =regmap_read (dev->vdecsys_regmap,VDEC_HW_ACTIVE_ADDR , &val); +if (ret) { +mtk_v4l2_err ("Failed to read VDEC active status" ); +return false; + } + +return (val &VDEC_HW_ACTIVE_MASK ) ==0 ; + } + + cg_status =readl (dev->reg_base[VDEC_SYS ] +VDEC_HW_ACTIVE_ADDR ); +return (cg_status &VDEC_HW_ACTIVE_MASK ) ==0 ; +} +static irqreturn_t mtk_vcodec_dec_irq_handler (int irq,void *priv) {struct mtk_vcodec_dev *dev = priv;struct mtk_vcodec_ctx *ctx; -u32 cg_status =0 ;unsigned int dec_done_status =0 ;void __iomem *vdec_misc_addr = dev->reg_base[VDEC_MISC ] +VDEC_IRQ_CFG_REG ; ctx =mtk_vcodec_get_curr_ctx (dev,MTK_VDEC_CORE ); -/* check if HW active or not */ - cg_status =readl (dev->reg_base[0 ] +VDEC_HW_ACTIVE_ADDR ); -if ((cg_status &VDEC_HW_ACTIVE_MASK ) !=0 ) { -mtk_v4l2_err ("DEC ISR, VDEC active is not 0x0 (0x%08x)" , - cg_status); +if (!mtk_vcodec_is_hw_active (dev)) { +mtk_v4l2_err ("DEC ISR, VDEC active is not 0x0" );return IRQ_HANDLED ; }
@@ -82,6 +99,25 @@ static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) {struct platform_device *pdev = dev->plat_dev;int reg_num, i; +struct resource *res; +bool no_vdecsys_reg = false; +static const char *const mtk_dec_reg_names[] = { +"misc" , +"ld" , +"top" , +"cm" , +"ad" , +"av" , +"pp" , +"hwd" , +"hwq" , +"hwb" , +"hwg" + }; + + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"misc" ); +if (res) + no_vdecsys_reg = true;/* Sizeof(u32) * 4 bytes for each register base. */ reg_num = of_property_count_elems_of_size(pdev->dev.of_node, "reg",
@@ -91,12 +127,22 @@ static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev)return -EINVAL ; } -for (i =0 ; i < reg_num; i++) { - dev->reg_base[i] =devm_platform_ioremap_resource (pdev, i); -if (IS_ERR (dev->reg_base[i])) -return PTR_ERR (dev->reg_base[i]); +if (!no_vdecsys_reg) { +for (i =0 ; i < reg_num; i++) { + dev->reg_base[i] =devm_platform_ioremap_resource (pdev, i); +if (IS_ERR (dev->reg_base[i])) +return PTR_ERR (dev->reg_base[i]); + +mtk_v4l2_debug (2 ,"reg[%d] base=%p" , i, dev->reg_base[i]); + } + }else { +for (i =0 ; i < reg_num; i++) { + dev->reg_base[i+1 ] =devm_platform_ioremap_resource_byname (pdev, mtk_dec_reg_names[i]); +if (IS_ERR (dev->reg_base[i+1 ])) +return PTR_ERR (dev->reg_base[i+1 ]); -mtk_v4l2_debug (2 ,"reg[%d] base=%p" , i, dev->reg_base[i]); +mtk_v4l2_debug (2 ,"reg[%d] base=%p" , i+1 , dev->reg_base[i+1 ]); + } }return 0 ;
@@ -118,6 +164,9 @@ static int mtk_vcodec_init_dec_resources(struct mtk_vcodec_dev *dev)if (dev->dec_irq <0 )return dev->dec_irq; + dev->vdecsys_regmap =syscon_regmap_lookup_by_phandle_optional (pdev->dev.of_node, +"mediatek,vdecsys" ); +irq_set_status_flags (dev->dec_irq,IRQ_NOAUTOEN ); ret =devm_request_irq (&pdev->dev, dev->dec_irq, mtk_vcodec_dec_irq_handler,0 , pdev->name, dev);
drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h +1 -0
@@ -489,6 +489,7 @@ struct mtk_vcodec_dev {void __iomem *reg_base[NUM_MAX_VCODEC_REG_BASE ];const struct mtk_vcodec_dec_pdata *vdec_pdata;const struct mtk_vcodec_enc_pdata *venc_pdata; +struct regmap *vdecsys_regmap;struct mtk_vcodec_fw *fw_handler;
Signature · 1 line
2.41.0
AngeloGioacchino Del Regno
maintainerRe: [PATCH v3 5/6] media: mediatek: vcodec: Read HW active status from syscon on MT8183
Il 20/06/23 02:03, Nícolas F. R. A. Prado ha scritto:
Quoted 53 lines
Remove the requirement of a
VDEC_SYSreg iospace for MT8183. To achieve that, rely on a vdecsys syscon to be passed through the DT, and use it to directly read theVDEC_HW_ACTIVEbit during IRQ handling to check whether the HW is active.The old behavior is still present when reg-names aren't supplied, as MT8173 still relies on it.
Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
I dropped the tags from this commit since a syscon is now used instead of an extra clock.Changes in v3:
- Switched handling ofVDEC_HW_ACTIVEto use a syscon instead of the 'active' clock
- Reworded commit
- Removed changes to subdev part of driver, since they aren't used by MT8183.../mediatek/vcodec/mtk_vcodec_dec_drv.c | 71 ++++++++++++++++--- .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 + 2 files changed, 61 insertions(+), 11 deletions(-)drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +9
-0@@ -8,10 +8,12 @@#include <linux/slab.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of_device.h> #include <linux/of.h> #include <linux/pm_runtime.h> +#include <linux/regmap.h> #include <media/v4l2-event.h> #include <media/v4l2-mem2mem.h> #include <media/videobuf2-dma-contig.h> @@ -38,22 +40,37 @@ static int mtk_vcodec_get_hw_count(struct mtk_vcodec_dev *dev) } } +static bool mtk_vcodec_is_hw_active (struct mtk_vcodec_dev *dev) +{ +u32 cg_status =0 ; +int val, ret; + +if (!dev->reg_base[VDEC_SYS ]) { + ret =regmap_read (dev->vdecsys_regmap,VDEC_HW_ACTIVE_ADDR , &val);
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c static int mtk_vcodec_get_hw_count(struct mtk_vcodec_dev *dev) · line 59
Quoted 10 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +10
-0+if (ret) { +mtk_v4l2_err ("Failed to read VDEC active status" ); +return false; + } + +return (val &VDEC_HW_ACTIVE_MASK ) ==0 ; + } + + cg_status =readl (dev->reg_base[VDEC_SYS ] +VDEC_HW_ACTIVE_ADDR ); +return (cg_status &VDEC_HW_ACTIVE_MASK ) ==0 ;
You can either do...
{
if (dev->vdecsys_regmap) {
ret = regmap_read(......., &cg_status);
if (ret) {
mtk_v4l2_err(...)
return false;
}
} else {
cg_status = readl(....)
}
return !FIELD_GET(VDEC_HW_ACTIVE_MASK, cg_status);
}.... or ....
{
if (dev->vdecsys_regmap)
return !regmap_test_bits(dev->vdecsys_regmap, VDEC_HW_ACTIVE_ADDR,
VDEC_HW_ACTIVE_MASK);
cg_status = readl(....);
return !FIELD_GET(VDEC_HW_ACTIVE_MASK, cg_status);
}That's way cleaner :-)
Quoted 24 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +4
-6+} +static irqreturn_t mtk_vcodec_dec_irq_handler (int irq,void *priv) {struct mtk_vcodec_dev *dev = priv;struct mtk_vcodec_ctx *ctx; -u32 cg_status =0 ;unsigned int dec_done_status =0 ;void __iomem *vdec_misc_addr = dev->reg_base[VDEC_MISC ] +VDEC_IRQ_CFG_REG ; ctx =mtk_vcodec_get_curr_ctx (dev,MTK_VDEC_CORE ); -/* check if HW active or not */ - cg_status =readl (dev->reg_base[0 ] +VDEC_HW_ACTIVE_ADDR ); -if ((cg_status &VDEC_HW_ACTIVE_MASK ) !=0 ) { -mtk_v4l2_err ("DEC ISR, VDEC active is not 0x0 (0x%08x)" , - cg_status); +if (!mtk_vcodec_is_hw_active (dev)) { +mtk_v4l2_err ("DEC ISR, VDEC active is not 0x0" );return IRQ_HANDLED ; }
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) · line 103
Quoted 5 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +2
-0@@ -82,6 +99,25 @@ static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) {struct platform_device *pdev = dev->plat_dev;int reg_num, i; +struct resource *res; +bool no_vdecsys_reg = false;
bool has_vdecsys_reg;
Quoted 5 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +5
-0+static const char *const mtk_dec_reg_names[] = { +"misc" , +"ld" , +"top" , +"cm" ,
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) · line 118
Quoted 10 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +10
-0+"ad" , +"av" , +"pp" , +"hwd" , +"hwq" , +"hwb" , + "hwg" + }; + + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"misc" );
/* * If we have reg-names in devicetree, this means that we're on a new * register organization, which implies that the VDEC_SYS iospace gets * R/W through a syscon (regmap). * Here we try to get the "misc" iostart only to check if we have reg-names */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "misc"); if (res) has_vdecsys_reg = false; else has_vdecsys_reg = true;
Quoted 6 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +2
-0+if (res) + no_vdecsys_reg = true;/* Sizeof(u32) * 4 bytes for each register base. */ reg_num = of_property_count_elems_of_size(pdev->dev.of_node, "reg",
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) · line 130
Quoted 8 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +1
-4@@ -91,12 +127,22 @@ static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev)return -EINVAL ; } -for (i =0 ; i < reg_num; i++) { - dev->reg_base[i] =devm_platform_ioremap_resource (pdev, i); -if (IS_ERR (dev->reg_base[i])) -return PTR_ERR (dev->reg_base[i]); +if (!no_vdecsys_reg) {
...so here you invert the branch
if (has_vdecsys_reg) {
.... byname ioremap ....
parse syscon regmap here, not later!
} else {
.... by id ioremap ....
}Quoted 20 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +14
-1+for (i =0 ; i < reg_num; i++) { + dev->reg_base[i] =devm_platform_ioremap_resource (pdev, i); +if (IS_ERR (dev->reg_base[i])) +return PTR_ERR (dev->reg_base[i]); + +mtk_v4l2_debug (2 ,"reg[%d] base=%p" , i, dev->reg_base[i]); + } + }else { +for (i =0 ; i < reg_num; i++) { + dev->reg_base[i+1 ] =devm_platform_ioremap_resource_byname (pdev, mtk_dec_reg_names[i]); +if (IS_ERR (dev->reg_base[i+1 ])) +return PTR_ERR (dev->reg_base[i+1 ]); -mtk_v4l2_debug (2 ,"reg[%d] base=%p" , i, dev->reg_base[i]); +mtk_v4l2_debug (2 ,"reg[%d] base=%p" , i+1 , dev->reg_base[i+1 ]); + } }return 0 ;
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c static int mtk_vcodec_init_dec_resources(struct mtk_vcodec_dev *dev) · line 169
Quoted 6 lines
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +3
-0@@ -118,6 +164,9 @@ static int mtk_vcodec_init_dec_resources(struct mtk_vcodec_dev *dev)if (dev->dec_irq <0 )return dev->dec_irq; + dev->vdecsys_regmap =syscon_regmap_lookup_by_phandle_optional (pdev->dev.of_node, +"mediatek,vdecsys" ); +
It makes no sense to try to get a handle to this syscon if we're on the older layout with vdecsys in the reg list: in that case, we can safely assume that we don't have any mediatek,vdecsys syscon.
Cheers,
Angelo
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 6/6 arm64: dts: mediatek: mt8183: Add decoder
In reply to Nícolas F. R. A. PradoFrom: Yunfei Dong <[email protected]>
Add node for the hardware decoder present on the MT8183 SoC.
---
Changes in v3:
- Dropped 'active' clock and added the 'mediatek,vdecsys' syscon phandle property instead
Changes in v2:
- Reformatted reg-names to fit in fewer lines
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/mediatek/mt8183.dtsi +30 -0
@@ -2019,6 +2019,36 @@ vdecsys: syscon@16000000 { #clock-cells = <1>; }; + vcodec_dec: video-codec@16020000 { + compatible = "mediatek,mt8183-vcodec-dec"; + reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */ + <0 0x16021000 0 0x800>, /* VDEC_VLD */ + <0 0x16021800 0 0x800>, /* VDEC_TOP */ + <0 0x16022000 0 0x1000>, /* VDEC_MC */ + <0 0x16023000 0 0x1000>, /* VDEC_AVCVLD */ + <0 0x16024000 0 0x1000>, /* VDEC_AVCMV */ + <0 0x16025000 0 0x1000>, /* VDEC_PP */ + <0 0x16026800 0 0x800>, /* VP8_VD */ + <0 0x16027000 0 0x800>, /* VP6_VD */ + <0 0x16027800 0 0x800>, /* VP8_VL */ + <0 0x16028400 0 0x400>; /* VP9_VD */ + reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp", + "hwd", "hwq", "hwb", "hwg"; + interrupts = <GIC_SPI 250 IRQ_TYPE_LEVEL_LOW>; + iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>, + <&iommu M4U_PORT_HW_VDEC_PP_EXT>, + <&iommu M4U_PORT_HW_VDEC_VLD_EXT>, + <&iommu M4U_PORT_HW_VDEC_AVC_MV_EXT>, + <&iommu M4U_PORT_HW_VDEC_PRED_RD_EXT>, + <&iommu M4U_PORT_HW_VDEC_PRED_WR_EXT>, + <&iommu M4U_PORT_HW_VDEC_PPWRAP_EXT>; + mediatek,scp = <&scp>; + mediatek,vdecsys = <&vdecsys>; + power-domains = <&spm MT8183_POWER_DOMAIN_VDEC>; + clocks = <&vdecsys CLK_VDEC_VDEC>; + clock-names = "vdec"; + }; + larb1: larb@16010000 { compatible = "mediatek,mt8183-smi-larb"; reg = <0 0x16010000 0 0x1000>;
Signature · 1 line
2.41.0