2021-09-07 08:42:09

by Guillaume Ranquet

[permalink] [raw]
Subject: [PATCH 0/4] MT8195 HDMI Tx support

This small series aims at implementing basic HDMI TX support for the
MT8195 SoC family.

This series has been tested on a chromium 5.10 kernel but not yet on an
upstream 5.14.
It builds, boots and probe on 5.14 but due to some missing dependencies
in the drm chain, it couldn't be tested as of today.
I'm still working to get this series fully tested on 5.14.

This series is based on:

- Add Mediatek Soc DRM (vdosys0) support for mt8195
https://lore.kernel.org/linux-mediatek/[email protected]/
- Add MediaTek SoC DRM (vdosys1) support for mt8195
https://lore.kernel.org/linux-mediatek/[email protected]/

Guillaume Ranquet (4):
phy: mediatek: add support for phy-mtk-hdmi-mt8195
drm/mediatek: add mt8195 hdmi TX support
dt-bindings: phy: Add binding for Mediatek MT8195 HDMI PHY
dt-bindings: display: mediatek: add MT8195 hdmi bindings

.../mediatek/mediatek,mt8195-hdmi-ddc.yaml | 46 +
.../mediatek/mediatek,mt8195-hdmi.yaml | 99 +
.../phy/mediatek,mtk8195-hdmi-phy.yaml | 71 +
drivers/gpu/drm/mediatek/Kconfig | 10 +
drivers/gpu/drm/mediatek/Makefile | 4 +-
drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.c | 2413 +++++++++++++++++
drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.h | 147 +
.../gpu/drm/mediatek/mtk_mt8195_hdmi_ddc.c | 541 ++++
.../gpu/drm/mediatek/mtk_mt8195_hdmi_ddc.h | 20 +
.../gpu/drm/mediatek/mtk_mt8195_hdmi_regs.h | 276 ++
drivers/phy/mediatek/Makefile | 1 +
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 777 ++++++
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.h | 179 ++
13 files changed, 4583 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml
create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mtk8195-hdmi-phy.yaml
create mode 100644 drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.c
create mode 100644 drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.h
create mode 100644 drivers/gpu/drm/mediatek/mtk_mt8195_hdmi_ddc.c
create mode 100644 drivers/gpu/drm/mediatek/mtk_mt8195_hdmi_ddc.h
create mode 100644 drivers/gpu/drm/mediatek/mtk_mt8195_hdmi_regs.h
create mode 100644 drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
create mode 100644 drivers/phy/mediatek/phy-mtk-hdmi-mt8195.h

--
2.31.1


2021-09-07 09:33:44

by Guillaume Ranquet

[permalink] [raw]
Subject: [PATCH 4/4] dt-bindings: display: mediatek: add MT8195 hdmi bindings

Add Mediatek HDMI and HDMI-DDC bindings for MT8195 SoC.

Signed-off-by: Guillaume Ranquet <[email protected]>
---
.../mediatek/mediatek,mt8195-hdmi-ddc.yaml | 46 +++++++++
.../mediatek/mediatek,mt8195-hdmi.yaml | 99 +++++++++++++++++++
2 files changed, 145 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml

diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
new file mode 100644
index 000000000000..ae3cc0ae457f
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek HDMI DDC Device Tree Bindings for mt8195
+
+maintainers:
+ - CK Hu <[email protected]>
+ - Jitao shi <[email protected]>
+
+description: |
+ The HDMI DDC i2c controller is used to interface with the HDMI DDC pins.
+
+properties:
+ compatible:
+ enum:
+ - mediatek,mt8195-hdmi-ddc
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ items:
+ - const: ddc-i2c
+
+required:
+ - compatible
+ - clocks
+ - clock-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/mt8195-clk.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ hdmiddc0: ddc_i2c {
+ compatible = "mediatek,mt8195-hdmi-ddc";
+ clocks = <&clk26m>;
+ clock-names = "ddc-i2c";
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml
new file mode 100644
index 000000000000..b5d5f7f79c71
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/mediatek/mediatek,mt8195-hdmi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek HDMI Encoder Device Tree Bindings for mt8195
+
+maintainers:
+ - CK Hu <[email protected]>
+ - Jitao shi <[email protected]>
+
+description: |
+ The Mediatek HDMI encoder can generate HDMI 1.4a or MHL 2.0 signals from
+ its parallel input.
+
+properties:
+ compatible:
+ enum:
+ - mediatek,mt8195-hdmi
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: PLL divider
+ - description: PLL divider
+ - description: HDCP engine clock
+ - description: PLL divider
+ - description: HDCP engine clock
+ - description: Bus clock
+ - description: HDMI clock for vpp_split module
+
+ clock-names:
+ items:
+ - const: univpll_d6_d4
+ - const: msdcpll_d2
+ - const: hdmi_apb_sel
+ - const: univpll_d4_d8
+ - const: hdcp_sel
+ - const: hdcp24_sel
+ - const: split_hdmi
+
+ phys:
+ maxItems: 1
+
+ phy-names:
+ items:
+ - const: hdmi
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - phys
+ - phy-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/mt8195-clk.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ hdmi0: hdmi@1c300000 {
+ compatible = "mediatek,mt8195-hdmi";
+ reg = <0 0x1c300000 0 0x1000>;
+ power-domains = <&spm MT8195_POWER_DOMAIN_HDMI_TX>;
+ clocks = <&topckgen CLK_TOP_UNIVPLL_D6_D4>,
+ <&topckgen CLK_TOP_MSDCPLL_D2>,
+ <&topckgen CLK_TOP_HDMI_APB>,
+ <&topckgen CLK_TOP_UNIVPLL_D4_D8>,
+ <&topckgen CLK_TOP_HDCP>,
+ <&topckgen CLK_TOP_HDCP_24M>,
+ <&vppsys1 CLK_VPP1_VPP_SPLIT_HDMI>;
+ clock-names = "univpll_d6_d4",
+ "msdcpll_d2",
+ "hdmi_apb_sel",
+ "univpll_d4_d8",
+ "hdcp_sel",
+ "hdcp24_sel",
+ "split_hdmi";
+ interrupts = <GIC_SPI 677 IRQ_TYPE_LEVEL_HIGH 0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&hdmi_pin>;
+ phys = <&hdmi_phy>;
+ phy-names = "hdmi";
+ cec = <&cec>;
+ ddc-i2c-bus = <&hdmiddc0>;
+ status = "disabled";
+ };
+
+...
--
2.31.1

2021-09-07 14:53:22

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 4/4] dt-bindings: display: mediatek: add MT8195 hdmi bindings

On Tue, 07 Sep 2021 10:37:21 +0200, Guillaume Ranquet wrote:
> Add Mediatek HDMI and HDMI-DDC bindings for MT8195 SoC.
>
> Signed-off-by: Guillaume Ranquet <[email protected]>
> ---
> .../mediatek/mediatek,mt8195-hdmi-ddc.yaml | 46 +++++++++
> .../mediatek/mediatek,mt8195-hdmi.yaml | 99 +++++++++++++++++++
> 2 files changed, 145 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
> create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.example.dts:19:18: fatal error: dt-bindings/clock/mt8195-clk.h: No such file or directory
19 | #include <dt-bindings/clock/mt8195-clk.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:379: Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.example.dt.yaml] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1438: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1525170

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-09-07 17:41:43

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 4/4] dt-bindings: display: mediatek: add MT8195 hdmi bindings

On Tue, Sep 07, 2021 at 09:51:44AM -0500, Rob Herring wrote:
> On Tue, 07 Sep 2021 10:37:21 +0200, Guillaume Ranquet wrote:
> > Add Mediatek HDMI and HDMI-DDC bindings for MT8195 SoC.
> >
> > Signed-off-by: Guillaume Ranquet <[email protected]>
> > ---
> > .../mediatek/mediatek,mt8195-hdmi-ddc.yaml | 46 +++++++++
> > .../mediatek/mediatek,mt8195-hdmi.yaml | 99 +++++++++++++++++++
> > 2 files changed, 145 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
> > create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml
> >
>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.example.dts:19:18: fatal error: dt-bindings/clock/mt8195-clk.h: No such file or directory
> 19 | #include <dt-bindings/clock/mt8195-clk.h>
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.lib:379: Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.example.dt.yaml] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:1438: dt_binding_check] Error 2

Last I checked this is still not upstream. I'd suggest you adjust the
example to not need this header.

Rob

2021-09-22 16:21:28

by Chun-Kuang Hu

[permalink] [raw]
Subject: Re: [PATCH 4/4] dt-bindings: display: mediatek: add MT8195 hdmi bindings

Hi, Guillaume:

Rob Herring <[email protected]> 於 2021年9月7日 週二 下午10:51寫道:
>
> On Tue, 07 Sep 2021 10:37:21 +0200, Guillaume Ranquet wrote:
> > Add Mediatek HDMI and HDMI-DDC bindings for MT8195 SoC.

Move this patch before the driver patch which refer to this patch.

> >
> > Signed-off-by: Guillaume Ranquet <[email protected]>
> > ---
> > .../mediatek/mediatek,mt8195-hdmi-ddc.yaml | 46 +++++++++
> > .../mediatek/mediatek,mt8195-hdmi.yaml | 99 +++++++++++++++++++
> > 2 files changed, 145 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml

I think this file should be merged into mediatek,hdmi-ddc.yaml [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml?h=v5.15-rc2

> > create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.yaml

I think this file should be merged into mediatek,hdmi.yaml [2].

[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml?h=v5.15-rc2

Regards,
Chun-Kuang.

> >
>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.example.dts:19:18: fatal error: dt-bindings/clock/mt8195-clk.h: No such file or directory
> 19 | #include <dt-bindings/clock/mt8195-clk.h>
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.lib:379: Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi.example.dt.yaml] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:1438: dt_binding_check] Error 2
>
> doc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/patch/1525170
>
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit.
>