Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
@ 2026-12-01 20:12 Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 01/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

This series moves the Amlogic Meson HDMI TX PHY handling (covering GXBB,
GXL, GXM, and G12A SoCs) out of the meson_dw_hdmi DRM driver and into a
dedicated generic PHY driver.

Until now, meson_dw_hdmi directly manipulated the HHI system controller
registers (HHI_HDMI_PHY_CNTL0..5) to configure analog parameters, toggle
resets, and manage power states, as well as manually ungating HDMI
clocks and power domains already described in the DT.

By extracting this logic into a standalone PHY driver under
drivers/phy/amlogic/:
- Hardware representation in the DT is cleaner, modeling the HDMI TX PHY
  as a child node of the HHI syscon referenced via standard "phys"
  properties.
- The DRM bridge driver relies on the standard generic PHY API
  (phy_init, phy_configure, phy_power_on/off, phy_exit) rather than
  touching syscon registers directly.
- Legacy DTs lacking the "phys" property remain supported via a
  temporary fallback helper (meson_hdmi_phy_create_legacy) to preserve
  backward compatibility to be removed on next phase of component
  removal.

Overview of the series:
- Patches 1-2: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
  add SoC-specific compatibles in the DT schema, and allow the "#phy-cells"
  property under the HHI syscon.
- Patch 3: Add a driver matching SoC-specific HHI system controller,
  make it the phy provider, and creating auxiliary device for the phy
  driver to register.
- Patch 4: Rename the Meson8 HDMI TX PHY driver to be more SoC generic.
- Patch 5: Add GXBB, GXL, GXM and G12A SoCs to the Meson HDMI TX PHY
  driver, implementing the HDMI PHY configuration ops, along with the
  temporary legacy creation helper.
- Patch 6: Document the optional "phys" and properties in the
  amlogic,meson-dw-hdmi binding.
- Patch 7: Make meson-ee-pwrc power up the domain memories when the
  domain is already on at probe time, as this is a prerequisite for
  dropping the explicit write from meson_dw_hdmi.
- Patches 8-9: Clean up manual HHI clock/power-domain writes in
  meson_dw_hdmi (relying on runtime PM instead) and convert the driver
  to use the generic PHY framework.
- Patches 10-13: Add the "#phy-cells" property to the sysctrl node and
  wire up the "phys" phandle for G12, GXBB, and GXL Device Trees.

Tested on:
- Khadas VIM1 (GXL)
- dtbs_check and dt_binding_check run cleanly with no new warnings.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
Changes in v6:
After Rob's feedback:
- Remove Patch 2: Meson gx phy now exposed from hhi sysctrl.
- Patch 2: Add phy-cells to the DT binding.
- Add Patch 3: Add a driver for the hhi sysctrl as phy provider.
- Patch 5: Add a path to register the driver as auxiliary device.
- Patch 10-13: Add phy-cells as SoC-specific hhi sysctrl.
- Link to v5: https://patch.msgid.link/20261127-meson-drm-create-hdmitx-phy-v5-0-88c43eb95468@aliel.fr

Changes in v5:
- Add Patch 4: Rename Meson8 HDMI TX driver to prepare other SoCs
               integration. Martin's review.
- Patch 5: Adapt the GXBB, GXL, GXM and G12A SoCs code to Patch 4.
- Link to v4: https://patch.msgid.link/20261123-meson-drm-create-hdmitx-phy-v4-0-3fb94f5534ca@aliel.fr

Changes in v4:
- Patch 2: Change commit title. Sashiko and Neil review.
- Patch 4: Change the phy min_rate to 15.9 MHz mathematical limit.
           Thanks to Sashiko's review.
- Patch 8: Drop introduced double free with phy_destroy.
           Add missing device_link_remove()
           Change the device_link order and use prepare/complete in the
           VPU drv for drm_mode_config_helper. Sashiko's review.
- Link to v3: https://patch.msgid.link/20261121-meson-drm-create-hdmitx-phy-v3-0-f8f471788076@aliel.fr

Changes in v3:
- Patch 6: reuse meson_ee_pwrc_mem_power_up() in meson_ee_pwrc_on()
  function.
- Patch 8: revert the code to v1 and add a device link to solve
  suspend/resume order in dpm_list.
- Link to v2: https://patch.msgid.link/20261120-meson-drm-create-hdmitx-phy-v2-0-93d622d9bb07@aliel.fr

Changes in v2:
- Patches 5,9-11: Remove unecessary "phy-names" for uniq phy.
                  Thanks to Neil's feedback.
- Add Patch 6: Power up the memories when the domain is already on.
               From Sashiko's feedback.
- Patch 4: Add a 600MHz max_rate and a 25Mhz min_rate check and
           exclude PHY_HDMI_MODE_FRL for phy_validate. Thx Sashiko.
- Patch 8: Move phy_init in dw_hdmi_phy_init and phy_exit
           in dw_hdmi_phy_disable. From Sashiko review.
- Link to v1: https://patch.msgid.link/20261117-meson-drm-create-hdmitx-phy-v1-0-9e0ac931381c@aliel.fr

To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Kevin Hilman <khilman@baylibre.com>
To: Jerome Brunet <jbrunet@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Vinod Koul <vkoul@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
To: Ronald Claveau <linux-kernel-dev@aliel.fr>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: Ulf Hansson <ulfh@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-phy@lists.infradead.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-pm@vger.kernel.org

---
Ronald Claveau (13):
      dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
      dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells
      soc: amlogic: Add Meson GX HHI system controller driver
      phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
      phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
      dt-bindings: display: amlogic,meson-dw-hdmi: Add phys
      pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains
      drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
      drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
      arm64: dts: amlogic: g12: Use the HHI system controller as HDMI PHY provider
      arm64: dts: amlogic: meson-gx: Add #phy-cells to the HHI system controller
      arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
      arm64: dts: amlogic: Add HDMI TX PHY node for GXL

 .../bindings/display/amlogic,meson-dw-hdmi.yaml    |   4 +
 .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  |  49 ++-
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi  |   4 +-
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi          |   1 +
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   3 +
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |   3 +
 drivers/gpu/drm/meson/Kconfig                      |   2 +
 drivers/gpu/drm/meson/meson_drv.c                  |  16 +-
 drivers/gpu/drm/meson/meson_dw_hdmi.c              | 223 +++++-----
 drivers/phy/amlogic/Kconfig                        |  13 +-
 drivers/phy/amlogic/Makefile                       |   2 +-
 drivers/phy/amlogic/phy-meson-hdmi-tx.c            | 454 +++++++++++++++++++++
 drivers/phy/amlogic/phy-meson8-hdmi-tx.c           | 160 --------
 drivers/pmdomain/amlogic/meson-ee-pwrc.c           |  19 +-
 drivers/soc/amlogic/Kconfig                        |  13 +
 drivers/soc/amlogic/Makefile                       |   1 +
 drivers/soc/amlogic/meson-gx-hhi-sysctrl.c         |  58 +++
 include/linux/phy/phy-meson-hdmi-tx.h              |  19 +
 18 files changed, 730 insertions(+), 314 deletions(-)
---
base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09

Best regards,
--  
Ronald Claveau <linux-kernel-dev@aliel.fr>



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v6 01/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells Ronald Claveau via B4 Relay
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The conditional schemas select on "compatible" with a bare enum. On a
list such as:

  compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";

an enum applied to the whole array only matches single-entry lists, so
the if: blocks never match as intended and the per-variant constraints
are not applied reliably.

Wrap the enums in "contains" so that the conditions match on any entry
of the compatible list.

Doing so exposes the "phy" child node of "amlogic,meson-gx-hhi-sysctrl":
it was forbidden (phy: false), but some DT legitimately describe an
"amlogic,g12a-mipi-dphy-analog" PHY node under this system controller,
which resulted in dtbs_check warnings such as:

  system-controller@0 (amlogic,meson-gx-hhi-sysctrl): False schema does
  not allow {'compatible': ['amlogic,g12a-mipi-dphy-analog'],
  '#phy-cells': 0, ...}

Allow the phy child node for amlogic,meson-gx-hhi-sysctrl by referencing
the amlogic,g12a-mipi-dphy-analog binding instead of rejecting it.

Fixes: 4d023beb3998 ("dt-bindings: soc: amlogic: document System Control registers")
Fixes: 960a4140ade8 ("dt-bindings: soc: amlogic,meson-gx-hhi-sysctrl: Document the System Control registers found on early Meson SoC")
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  | 32 +++++++++++++---------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
index f3a85c67ce8a..285edac4c082 100644
--- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
@@ -40,8 +40,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-hhi-sysctrl
     then:
       properties:
         clock-controller:
@@ -53,9 +54,10 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-gx-hhi-sysctrl
-            - amlogic,meson-axg-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-gx-hhi-sysctrl
+              - amlogic,meson-axg-hhi-sysctrl
     then:
       properties:
         clock-controller:
@@ -67,9 +69,10 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-gx-ao-sysctrl
-            - amlogic,meson-axg-ao-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-gx-ao-sysctrl
+              - amlogic,meson-axg-ao-sysctrl
     then:
       properties:
         clock-controller:
@@ -81,17 +84,20 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-gx-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-gx-hhi-sysctrl
     then:
       properties:
-        phy: false
+        phy:
+          $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
 
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-axg-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-axg-hhi-sysctrl
     then:
       properties:
         phy:

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 01/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:27   ` sashiko-bot
  2026-12-01 20:12 ` [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver Ronald Claveau via B4 Relay
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY found on GXBB, GXL, GXM and G12A SoCs is controlled
through registers of the HHI system controller and has no resources of
its own. Instead of describing it as a child node, let the HHI system
controller act as the PHY provider, so that the HDMI TX controller can
reference it with "phys = <&sysctrl>". The PHY itself is instantiated
by the meson-gx-hhi-sysctrl driver as an auxiliary device.

Add the "#phy-cells" property (const 0) and forbid it for the other
system controller variants. Add it to the example.

The HDMI TX PHY registers differ between SoC families, so the driver
needs to know which family it is running on. Add SoC-specific
compatibles (amlogic,meson-gxbb-hhi-sysctrl, amlogic,meson-gxl-hhi-sysctrl,
amlogic,meson-g12a-hhi-sysctrl) to select the PHY variant.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
index 285edac4c082..f277e22a98ff 100644
--- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
@@ -14,6 +14,9 @@ properties:
     items:
       - enum:
           - amlogic,meson-hhi-sysctrl
+          - amlogic,meson-g12a-hhi-sysctrl
+          - amlogic,meson-gxl-hhi-sysctrl
+          - amlogic,meson-gxbb-hhi-sysctrl
           - amlogic,meson-gx-hhi-sysctrl
           - amlogic,meson-gx-ao-sysctrl
           - amlogic,meson-axg-hhi-sysctrl
@@ -36,6 +39,12 @@ properties:
   phy:
     type: object
 
+  "#phy-cells":
+    const: 0
+    description:
+      Present on SoCs where the HDMI TX PHY is controlled through the
+      HHI registers. The system controller acts as the PHY provider.
+
 allOf:
   - if:
       properties:
@@ -50,12 +59,16 @@ allOf:
 
         pinctrl: false
         phy: false
+        "#phy-cells": false
 
   - if:
       properties:
         compatible:
           contains:
             enum:
+              - amlogic,meson-g12a-hhi-sysctrl
+              - amlogic,meson-gxl-hhi-sysctrl
+              - amlogic,meson-gxbb-hhi-sysctrl
               - amlogic,meson-gx-hhi-sysctrl
               - amlogic,meson-axg-hhi-sysctrl
     then:
@@ -80,12 +93,14 @@ allOf:
 
         power-controller: false
         phy: false
+        "#phy-cells": false
 
   - if:
       properties:
         compatible:
           contains:
             enum:
+              - amlogic,meson-g12a-hhi-sysctrl
               - amlogic,meson-gx-hhi-sysctrl
     then:
       properties:
@@ -104,6 +119,7 @@ allOf:
           oneOf:
             - $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
             - $ref: /schemas/phy/amlogic,meson-axg-mipi-pcie-analog.yaml
+        "#phy-cells": false
 
 required:
   - compatible
@@ -124,6 +140,7 @@ examples:
         sysctrl: system-controller@0 {
             compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
             reg = <0 0x400>;
+            #phy-cells = <0>;
 
             clock-controller {
                 compatible = "amlogic,gxbb-clkc";

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 01/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:24   ` sashiko-bot
  2026-12-01 20:12 ` [PATCH v6 04/13] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY on GXBB, GXL, GXM and G12A SoCs is controlled through
registers of the HHI system controller and has no resources of its
own, so it is not described in the device tree.

Add a driver binding the HHI system controller. It registers the
controller as a PHY provider ("#phy-cells = <0>") and creates an
auxiliary device named after the SoC family, selected from the
SoC-specific compatible. The auxiliary device is bound by the HDMI TX
PHY driver, which creates the PHY with the system controller node as
provider node.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/soc/amlogic/Kconfig                | 13 +++++++
 drivers/soc/amlogic/Makefile               |  1 +
 drivers/soc/amlogic/meson-gx-hhi-sysctrl.c | 58 ++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+)

diff --git a/drivers/soc/amlogic/Kconfig b/drivers/soc/amlogic/Kconfig
index d08e398bdad4..c0d05d92078b 100644
--- a/drivers/soc/amlogic/Kconfig
+++ b/drivers/soc/amlogic/Kconfig
@@ -36,4 +36,17 @@ config MESON_MX_SOCINFO
 	  Meson8b and Meson8m2 SoC family information about the type
 	  and version.
 
+config MESON_GX_HHI_SYSCTRL
+	tristate "Amlogic Meson GX HHI System Controller driver"
+	depends on ARCH_MESON || COMPILE_TEST
+	depends on OF
+	default ARCH_MESON
+	select AUXILIARY_BUS
+	select GENERIC_PHY
+	help
+	  Say yes to enable the HHI system controller driver for
+	  Amlogic Meson GXBB, GXL, GXM and G12 SoCs. It registers
+	  the system controller as the provider of the internal
+	  HDMI TX PHY.
+
 endmenu
diff --git a/drivers/soc/amlogic/Makefile b/drivers/soc/amlogic/Makefile
index c25f835e6a26..b3cc34a5ae57 100644
--- a/drivers/soc/amlogic/Makefile
+++ b/drivers/soc/amlogic/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_MESON_CANVAS) += meson-canvas.o
 obj-$(CONFIG_MESON_CLK_MEASURE) += meson-clk-measure.o
 obj-$(CONFIG_MESON_GX_SOCINFO) += meson-gx-socinfo.o
 obj-$(CONFIG_MESON_MX_SOCINFO) += meson-mx-socinfo.o
+obj-$(CONFIG_MESON_GX_HHI_SYSCTRL) += meson-gx-hhi-sysctrl.o
diff --git a/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c b/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c
new file mode 100644
index 000000000000..d4ef41e422a2
--- /dev/null
+++ b/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Amlogic Meson GX HHI System Controller
+ *
+ * Copyright (C) 2026 Ronald Claveau <linux-kernel-dev@aliel.fr>
+ */
+
+#include <linux/auxiliary_bus.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+
+static int meson_gx_hhi_sysctrl_probe(struct platform_device *pdev)
+{
+	struct phy_provider *phy_provider;
+	struct auxiliary_device *auxdev;
+	const char *phy_aux_name;
+	struct device *dev = &pdev->dev;
+
+	phy_aux_name = device_get_match_data(dev);
+	if (!phy_aux_name)
+		return dev_err_probe(dev, -ENODEV, "missing PHY match data\n");
+
+	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+	if (IS_ERR(phy_provider))
+		return dev_err_probe(dev, PTR_ERR(phy_provider),
+				     "failed to register PHY provider\n");
+
+	auxdev = devm_auxiliary_device_create(dev, phy_aux_name, NULL);
+	if (!auxdev)
+		return dev_err_probe(dev, -ENOMEM,
+				     "failed to create %s auxiliary device\n",
+				     phy_aux_name);
+
+	return 0;
+}
+
+static const struct of_device_id meson_gx_hhi_sysctrl_of_match[] = {
+	{ .compatible = "amlogic,meson-gxbb-hhi-sysctrl", .data = "gxbb-hdmi-phy" },
+	{ .compatible = "amlogic,meson-gxl-hhi-sysctrl",  .data = "gxl-hdmi-phy" },
+	{ .compatible = "amlogic,meson-g12a-hhi-sysctrl", .data = "g12a-hdmi-phy" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, meson_gx_hhi_sysctrl_of_match);
+
+static struct platform_driver meson_gx_hhi_sysctrl_driver = {
+	.probe = meson_gx_hhi_sysctrl_probe,
+	.driver = {
+		.name = "meson-gx-hhi-sysctrl",
+		.of_match_table = meson_gx_hhi_sysctrl_of_match,
+	},
+};
+module_platform_driver(meson_gx_hhi_sysctrl_driver);
+
+MODULE_AUTHOR("Ronald Claveau <linux-kernel-dev@aliel.fr>");
+MODULE_DESCRIPTION("Amlogic Meson GX HHI System Controller driver");
+MODULE_LICENSE("GPL");

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 04/13] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (2 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY driver is currently named after the Meson8 family
(Meson8, Meson8b and Meson8m2), but the same IP block is found, with
SoC-specific register programming, on the newer GXBB, GXL, GXM and
G12A SoCs.

In preparation for adding support for these SoCs, make the driver
generic:

 - rename phy-meson8-hdmi-tx.c to phy-meson-hdmi-tx.c
 - rename the Kconfig symbol PHY_MESON8_HDMI_TX to PHY_MESON_HDMI_TX
   and update the Makefile accordingly
 - drop the "(ARCH_MESON && ARM)" dependency in favour of
   "ARCH_MESON", since the driver is no longer ARM32-only, and
   select GENERIC_PHY
 - rename the phy_meson8_hdmi_tx_* symbols to meson_hdmi_phy_*
 - update the platform driver name, the Kconfig help text and the
   module description
 - drop the unused <linux/property.h> include

No functional change intended: the only supported compatible remains
"amlogic,meson8-hdmi-tx-phy".

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/phy/amlogic/Kconfig                        |  9 ++--
 drivers/phy/amlogic/Makefile                       |  2 +-
 .../{phy-meson8-hdmi-tx.c => phy-meson-hdmi-tx.c}  | 54 +++++++++++-----------
 3 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
index ce7ba3eb2a8e..294996869e83 100644
--- a/drivers/phy/amlogic/Kconfig
+++ b/drivers/phy/amlogic/Kconfig
@@ -2,14 +2,15 @@
 #
 # Phy drivers for Amlogic platforms
 #
-config PHY_MESON8_HDMI_TX
-	tristate "Meson8, Meson8b and Meson8m2 HDMI TX PHY driver"
-	depends on (ARCH_MESON && ARM) || COMPILE_TEST
+config PHY_MESON_HDMI_TX
+	tristate "Meson HDMI TX PHY driver"
+	depends on ARCH_MESON || COMPILE_TEST
 	depends on OF
+	select GENERIC_PHY
 	select MFD_SYSCON
 	help
 	  Enable this to support the HDMI TX PHYs found in Meson8,
-	  Meson8b and Meson8m2 SoCs.
+	  Meson8b, Meson8m2, GXBB, GXL, GXM and G12A SoCs.
 	  If unsure, say N.
 
 config PHY_MESON8B_USB2
diff --git a/drivers/phy/amlogic/Makefile b/drivers/phy/amlogic/Makefile
index 91e3b9790c03..2611ec8a056d 100644
--- a/drivers/phy/amlogic/Makefile
+++ b/drivers/phy/amlogic/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_PHY_MESON8_HDMI_TX)		+= phy-meson8-hdmi-tx.o
+obj-$(CONFIG_PHY_MESON_HDMI_TX)			+= phy-meson-hdmi-tx.o
 obj-$(CONFIG_PHY_MESON8B_USB2)			+= phy-meson8b-usb2.o
 obj-$(CONFIG_PHY_MESON_GXL_USB2)		+= phy-meson-gxl-usb2.o
 obj-$(CONFIG_PHY_MESON_G12A_USB2)		+= phy-meson-g12a-usb2.o
diff --git a/drivers/phy/amlogic/phy-meson8-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
similarity index 68%
rename from drivers/phy/amlogic/phy-meson8-hdmi-tx.c
rename to drivers/phy/amlogic/phy-meson-hdmi-tx.c
index f6b5df74a58f..e4e606ab4eef 100644
--- a/drivers/phy/amlogic/phy-meson8-hdmi-tx.c
+++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Meson8, Meson8b and Meson8m2 HDMI TX PHY.
+ * Amlogic Meson HDMI TX PHY driver
+ * (Meson8/8b/8m2)
  *
  * Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  */
@@ -13,7 +14,6 @@
 #include <linux/of.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
-#include <linux/property.h>
 #include <linux/regmap.h>
 
 /*
@@ -32,30 +32,30 @@
 
 #define HHI_HDMI_PHY_CNTL2				0x3a8
 
-struct phy_meson8_hdmi_tx_priv {
+struct meson_hdmi_phy {
 	struct regmap		*hhi;
 	struct clk		*tmds_clk;
 };
 
-static int phy_meson8_hdmi_tx_init(struct phy *phy)
+static int meson_hdmi_phy_init(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
 	return clk_prepare_enable(priv->tmds_clk);
 }
 
-static int phy_meson8_hdmi_tx_exit(struct phy *phy)
+static int meson_hdmi_phy_exit(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
 	clk_disable_unprepare(priv->tmds_clk);
 
 	return 0;
 }
 
-static int phy_meson8_hdmi_tx_power_on(struct phy *phy)
+static int meson_hdmi_phy_power_on(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 	unsigned int i;
 	u16 hdmi_ctl0;
 
@@ -85,9 +85,9 @@ static int phy_meson8_hdmi_tx_power_on(struct phy *phy)
 	return 0;
 }
 
-static int phy_meson8_hdmi_tx_power_off(struct phy *phy)
+static int meson_hdmi_phy_power_off(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
 	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
 		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x0841) |
@@ -96,18 +96,18 @@ static int phy_meson8_hdmi_tx_power_off(struct phy *phy)
 	return 0;
 }
 
-static const struct phy_ops phy_meson8_hdmi_tx_ops = {
-	.init		= phy_meson8_hdmi_tx_init,
-	.exit		= phy_meson8_hdmi_tx_exit,
-	.power_on	= phy_meson8_hdmi_tx_power_on,
-	.power_off	= phy_meson8_hdmi_tx_power_off,
+static const struct phy_ops meson_hdmi_phy_ops = {
+	.init		= meson_hdmi_phy_init,
+	.exit		= meson_hdmi_phy_exit,
+	.power_on	= meson_hdmi_phy_power_on,
+	.power_off	= meson_hdmi_phy_power_off,
 	.owner		= THIS_MODULE,
 };
 
-static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
+static int meson_hdmi_phy_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct phy_meson8_hdmi_tx_priv *priv;
+	struct meson_hdmi_phy *priv;
 	struct phy_provider *phy_provider;
 	struct resource *res;
 	struct phy *phy;
@@ -128,7 +128,7 @@ static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->tmds_clk))
 		return PTR_ERR(priv->tmds_clk);
 
-	phy = devm_phy_create(&pdev->dev, np, &phy_meson8_hdmi_tx_ops);
+	phy = devm_phy_create(&pdev->dev, np, &meson_hdmi_phy_ops);
 	if (IS_ERR(phy))
 		return PTR_ERR(phy);
 
@@ -140,21 +140,21 @@ static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
-static const struct of_device_id phy_meson8_hdmi_tx_of_match[] = {
+static const struct of_device_id meson_hdmi_phy_of_match[] = {
 	{ .compatible = "amlogic,meson8-hdmi-tx-phy" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, phy_meson8_hdmi_tx_of_match);
+MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
 
-static struct platform_driver phy_meson8_hdmi_tx_driver = {
-	.probe	= phy_meson8_hdmi_tx_probe,
+static struct platform_driver meson_hdmi_phy_driver = {
+	.probe	= meson_hdmi_phy_probe,
 	.driver	= {
-		.name		= "phy-meson8-hdmi-tx",
-		.of_match_table	= phy_meson8_hdmi_tx_of_match,
+		.name		= "meson-hdmi-tx-phy",
+		.of_match_table	= meson_hdmi_phy_of_match,
 	},
 };
-module_platform_driver(phy_meson8_hdmi_tx_driver);
+module_platform_driver(meson_hdmi_phy_driver);
 
 MODULE_AUTHOR("Martin Blumenstingl <martin.blumenstingl@googlemail.com>");
-MODULE_DESCRIPTION("Meson8, Meson8b and Meson8m2 HDMI TX PHY driver");
+MODULE_DESCRIPTION("Amlogic Meson HDMI TX PHY driver");
 MODULE_LICENSE("GPL v2");

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (3 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 04/13] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:25   ` sashiko-bot
  2026-12-01 20:12 ` [PATCH v6 06/13] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Extend the Meson8 HDMI TX PHY driver for the HDMI TX PHY found on
Amlogic GXBB, GXL, GXM and G12A SoCs. The PHY is controlled through
the HHI_HDMI_PHY_CNTL0..5 registers of the same HHI system controller,
but differs in the analog settings, in the CNTL1 enable bits
(FIFO enable and FIFO write enable on GXBB and newer) and in the
presence of CNTL3 to CNTL5. On Meson8, the PHY node is a child of the
HHI syscon, so the regmap is still obtained from the parent syscon.
GXBB, GXL, GXM and G12A are instead probed as auxiliary devices
created by the meson-gx-hhi-sysctrl driver.

To support this, move the Meson8 hardcoded values into per-SoC match
data (register init values, rate table and maximum TMDS character
rate). The TMDS clock is now only requested on Meson8, the only SoC
where it is needed.

The driver now implements the generic PHY HDMI configuration options:
.validate() accepts only 8 bpc and a TMDS character rate covered by
the per-SoC table, .configure() programs the analog settings matching
that rate, and .power_on()/.power_off() handle the reset sequence and
the return to the initial state. The Meson8 behaviour is preserved,
except that the analog settings are now programmed from .configure()
instead of .power_on(), and that the reset sequence uses
read-modify-write updates of the CNTL1 enable bits.

The per-SoC register values and rate thresholds for GXBB and newer are
taken from the existing HDMI TX code in meson_dw_hdmi.c, so that the
PHY handling can be moved out of the display driver.

For DTs that do not provide a "phys" property on the HDMI TX node,
export meson_hdmi_phy_create_legacy() so that the display driver can
still create the PHY itself. It is marked as deprecated and will be
removed together with the fallback in meson_dw_hdmi.c.

Kconfig: select AUXILIARY_BUS for the auxiliary driver, and
MESON_GX_HHI_SYSCTRL on ARCH_MESON since it creates the auxiliary
devices. COMMON_CLK is required for the Meson8 TMDS clock.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/phy/amlogic/Kconfig             |   4 +-
 drivers/phy/amlogic/phy-meson-hdmi-tx.c | 410 +++++++++++++++++++++++++++-----
 include/linux/phy/phy-meson-hdmi-tx.h   |  19 ++
 3 files changed, 374 insertions(+), 59 deletions(-)

diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
index 294996869e83..d6f781812b4b 100644
--- a/drivers/phy/amlogic/Kconfig
+++ b/drivers/phy/amlogic/Kconfig
@@ -5,8 +5,10 @@
 config PHY_MESON_HDMI_TX
 	tristate "Meson HDMI TX PHY driver"
 	depends on ARCH_MESON || COMPILE_TEST
-	depends on OF
+	depends on OF && COMMON_CLK
+	select AUXILIARY_BUS
 	select GENERIC_PHY
+	select MESON_GX_HHI_SYSCTRL if ARCH_MESON
 	select MFD_SYSCON
 	help
 	  Enable this to support the HDMI TX PHYs found in Meson8,
diff --git a/drivers/phy/amlogic/phy-meson-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
index e4e606ab4eef..66bf841411fd 100644
--- a/drivers/phy/amlogic/phy-meson-hdmi-tx.c
+++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
@@ -1,18 +1,28 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Amlogic Meson HDMI TX PHY driver
- * (Meson8/8b/8m2)
+ * (Meson8/8b/8m2, GXBB / GXL / GXM / G12A)
  *
  * Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+ * Copyright (C) 2026 Ronald Claveau <linux-kernel-dev@aliel.fr>
+ *
+ * GXBB+ support Based on meson_dw_hdmi.c:
+ * Copyright (C) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ * Copyright (C) 2015 Amlogic, Inc. All rights reserved.
  */
 
+#include <linux/auxiliary_bus.h>
 #include <linux/bitfield.h>
 #include <linux/bits.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/phy/phy.h>
+#include <linux/phy/phy-hdmi.h>
+#include <linux/phy/phy-meson-hdmi-tx.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 
@@ -22,26 +32,167 @@
  * Magic register values in the driver below are taken from the vendor
  * BSP / kernel.
  */
-#define HHI_HDMI_PHY_CNTL0				0x3a0
-	#define HHI_HDMI_PHY_CNTL0_HDMI_CTL1		GENMASK(31, 16)
-	#define HHI_HDMI_PHY_CNTL0_HDMI_CTL0		GENMASK(15, 0)
-
-#define HHI_HDMI_PHY_CNTL1				0x3a4
-	#define HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE		BIT(1)
-	#define HHI_HDMI_PHY_CNTL1_SOFT_RESET		BIT(0)
+#define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
+#define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
+#define  PHY_CNTL1_INIT		0x03900000
+#define  PHY_INVERT		BIT(17)
+#define  PHY_CNTL1_SOFT_RESET	BIT(0)
+#define  PHY_CNTL1_CLOCK_EN	BIT(1)
+#define  PHY_CNTL1_FIFO_EN	BIT(2)	/* GXBB and newer */
+#define  PHY_CNTL1_FIFO_WR_EN	BIT(3)	/* GXBB and newer */
+
+#define HHI_HDMI_PHY_CNTL2	0x3a8 /* 0xea */
+#define HHI_HDMI_PHY_CNTL3	0x3ac /* 0xeb, GXBB and newer */
+#define HHI_HDMI_PHY_CNTL4	0x3b0 /* 0xec */
+#define HHI_HDMI_PHY_CNTL5	0x3b4 /* 0xed, G12A */
+
+/* The code resets the PHY 3 times in a row */
+#define PHY_RESET_COUNT		3
+
+struct meson_hdmi_phy_rate {
+	unsigned int min_rate;	/* TMDS character rate, in Hz */
+	u32 cntl0;
+	u32 cntl3;		/* only used if has_cntl3 */
+	u32 cntl5;		/* only used if has_cntl5 */
+};
 
-#define HHI_HDMI_PHY_CNTL2				0x3a8
+struct meson_hdmi_phy_data {
+	const struct meson_hdmi_phy_rate *rates;
+	unsigned int num_rates;
+	unsigned int max_rate;	/* Hz, TMDS character rate maximum */
+	bool has_tmds_clk;	/* Meson8 only */
+	bool has_cntl3;
+	bool has_cntl5;
+	u32 cntl0_init;
+	u32 cntl1_init;
+	u32 cntl1_en;		/* CNTL1 enable bits (clock, fifo, ...) */
+};
 
 struct meson_hdmi_phy {
-	struct regmap		*hhi;
-	struct clk		*tmds_clk;
+	struct regmap *hhi;
+	struct clk *tmds_clk;	/* optional, Meson8 only */
+	const struct meson_hdmi_phy_data *data;
+};
+
+/* Meson8, Meson8b, Meson8m2 */
+static const struct meson_hdmi_phy_rate meson8_rates[] = {
+	/* 2.97Gbps */
+	{ 297000000, 0x08c31e8b },
+	/* below 2.97Gbps, down to 250Mbps */
+	{ 25000000,  0x08c34d0b },
+};
+
+/* GXBB */
+static const struct meson_hdmi_phy_rate gxbb_rates[] = {
+	/* 5.94Gbps, 3.7125Gbps */
+	{ 371250000, 0x33353245, 0x2100115b },
+	/* 2.97Gbps */
+	{ 297000000, 0x33634283, 0xb000115b },
+	/* 1.485Gbps, down to 159Mbps */
+	{ 15900000,  0x33632122, 0x2000115b },
+};
+
+/* GXL / GXM */
+static const struct meson_hdmi_phy_rate gxl_rates[] = {
+	/* 5.94Gbps, 3.7125Gbps */
+	{ 371250000, 0x333d3282, 0x2136315b },
+	/* 2.97Gbps */
+	{ 297000000, 0x33303382, 0x2036315b },
+	/* 1.485Gbps */
+	{ 148500000, 0x33303362, 0x2016315b },
+	/* 742.5Mbps, down to 159Mbps */
+	{ 15900000,  0x33604142, 0x0016315b },
+};
+
+/* G12A */
+static const struct meson_hdmi_phy_rate g12a_rates[] = {
+	/* 5.94Gbps, 3.7125Gbps */
+	{ 371250000, 0x37eb65c4, 0x2ab0ff3b, 0x0000080b },
+	/* 2.97Gbps */
+	{ 297000000, 0x33eb6262, 0x2ab0ff3b, 0x00000003 },
+	/* 1.485Gbps, down to 159Mbps */
+	{ 15900000,  0x33eb4242, 0x2ab0ff3b, 0x00000003 },
+};
+
+static const struct meson_hdmi_phy_data meson8_data = {
+	.rates = meson8_rates,
+	.num_rates = ARRAY_SIZE(meson8_rates),
+	.max_rate = 297000000, /* HDMI 1.4b limited to 4k@30 */
+	.has_tmds_clk = true,
+	.cntl0_init = 0x08418d00,
+	.cntl1_init = 0x0,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN,
+};
+
+static const struct meson_hdmi_phy_data gxbb_data = {
+	.rates = gxbb_rates,
+	.num_rates = ARRAY_SIZE(gxbb_rates),
+	.max_rate  = 600000000, /* HDMI 2.0 */
+	.has_cntl3 = true,
+	.cntl0_init = 0x0,
+	.cntl1_init = PHY_CNTL1_INIT | PHY_INVERT,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
+		    PHY_CNTL1_FIFO_WR_EN,
+};
+
+static const struct meson_hdmi_phy_data gxl_data = {
+	.rates = gxl_rates,
+	.num_rates = ARRAY_SIZE(gxl_rates),
+	.max_rate  = 600000000, /* HDMI 2.0 */
+	.has_cntl3 = true,
+	.cntl0_init = 0x0,
+	.cntl1_init = PHY_CNTL1_INIT,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
+		    PHY_CNTL1_FIFO_WR_EN,
+};
+
+static const struct meson_hdmi_phy_data g12a_data = {
+	.rates = g12a_rates,
+	.num_rates = ARRAY_SIZE(g12a_rates),
+	.max_rate  = 600000000, /* HDMI 2.0 */
+	.has_cntl3 = true,
+	.has_cntl5 = true,
+	.cntl0_init = 0x000b4242, /* Bandgap */
+	.cntl1_init = PHY_CNTL1_INIT,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
+		    PHY_CNTL1_FIFO_WR_EN,
 };
 
+static const struct meson_hdmi_phy_rate *
+meson_hdmi_phy_find_rate(const struct meson_hdmi_phy_data *data, u64 rate)
+{
+	unsigned int i;
+
+	if (rate > data->max_rate)
+		return NULL;
+
+	for (i = 0; i < data->num_rates; i++)
+		if (rate >= data->rates[i].min_rate)
+			return &data->rates[i];
+
+	return NULL;
+}
+
+/* Fallback to init mode: CNTL1 first, then CNTL0 (order matters) */
+static void meson_hdmi_phy_set_init_state(struct meson_hdmi_phy *priv)
+{
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, priv->data->cntl1_init);
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, priv->data->cntl0_init);
+}
+
 static int meson_hdmi_phy_init(struct phy *phy)
 {
 	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
+	int ret;
 
-	return clk_prepare_enable(priv->tmds_clk);
+	/* No-op if there is no clock (GXBB and newer) */
+	ret = clk_prepare_enable(priv->tmds_clk);
+	if (ret)
+		return ret;
+
+	meson_hdmi_phy_set_init_state(priv);
+
+	return 0;
 }
 
 static int meson_hdmi_phy_exit(struct phy *phy)
@@ -53,33 +204,64 @@ static int meson_hdmi_phy_exit(struct phy *phy)
 	return 0;
 }
 
-static int meson_hdmi_phy_power_on(struct phy *phy)
+static int meson_hdmi_phy_configure(struct phy *phy,
+				    union phy_configure_opts *opts)
 {
 	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
-	unsigned int i;
-	u16 hdmi_ctl0;
+	const struct meson_hdmi_phy_rate *r;
+
+	r = meson_hdmi_phy_find_rate(priv->data, opts->hdmi.tmds_char_rate);
+	if (!r)
+		return -EINVAL;
+
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, r->cntl0);
+	if (priv->data->has_cntl3)
+		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, r->cntl3);
+	if (priv->data->has_cntl5)
+		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, r->cntl5);
+
+	/* Disable clock, (and fifo, fifo_wr where present), release reset */
+	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+			   priv->data->cntl1_en | PHY_CNTL1_SOFT_RESET, 0);
 
-	if (clk_get_rate(priv->tmds_clk) >= 2970UL * 1000 * 1000)
-		hdmi_ctl0 = 0x1e8b;
-	else
-		hdmi_ctl0 = 0x4d0b;
+	return 0;
+}
 
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x08c3) |
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL0, hdmi_ctl0));
+static int meson_hdmi_phy_validate(struct phy *phy, enum phy_mode mode,
+				   int submode, union phy_configure_opts *opts)
+{
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, 0x0);
+	if (mode != PHY_MODE_HDMI || submode != PHY_HDMI_MODE_TMDS)
+		return -EINVAL;
 
-	/* Reset three times, just like the vendor driver does */
-	for (i = 0; i < 3; i++) {
-		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1,
-			     HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE |
-			     HHI_HDMI_PHY_CNTL1_SOFT_RESET);
-		usleep_range(1000, 2000);
+	if (opts->hdmi.bpc != 8)
+		return -EINVAL;
 
-		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1,
-			     HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE);
-		usleep_range(1000, 2000);
+	if (!meson_hdmi_phy_find_rate(priv->data, opts->hdmi.tmds_char_rate))
+		return -EINVAL;
+
+	return 0;
+}
+
+static int meson_hdmi_phy_power_on(struct phy *phy)
+{
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
+	u32 en = priv->data->cntl1_en;
+	u32 mask = en | PHY_CNTL1_SOFT_RESET;
+	int i;
+
+	/* Reset PHY 3 times in a row */
+	for (i = 0; i < PHY_RESET_COUNT; i++) {
+		/* Enable and software reset */
+		regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+				   mask, mask);
+		fsleep(2000);
+
+		/* Enable and unreset */
+		regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+				   mask, en);
+		fsleep(2000);
 	}
 
 	return 0;
@@ -89,9 +271,7 @@ static int meson_hdmi_phy_power_off(struct phy *phy)
 {
 	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x0841) |
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL0, 0x8d00));
+	meson_hdmi_phy_set_init_state(priv);
 
 	return 0;
 }
@@ -99,41 +279,131 @@ static int meson_hdmi_phy_power_off(struct phy *phy)
 static const struct phy_ops meson_hdmi_phy_ops = {
 	.init		= meson_hdmi_phy_init,
 	.exit		= meson_hdmi_phy_exit,
+	.configure	= meson_hdmi_phy_configure,
+	.validate	= meson_hdmi_phy_validate,
 	.power_on	= meson_hdmi_phy_power_on,
 	.power_off	= meson_hdmi_phy_power_off,
 	.owner		= THIS_MODULE,
 };
 
-static int meson_hdmi_phy_probe(struct platform_device *pdev)
+static struct phy *meson_hdmi_phy_alloc(struct device *dev,
+					struct device_node *provider_node,
+					struct regmap *hhi,
+					struct clk *tmds_clk,
+					const struct meson_hdmi_phy_data *data)
 {
-	struct device_node *np = pdev->dev.of_node;
 	struct meson_hdmi_phy *priv;
-	struct phy_provider *phy_provider;
-	struct resource *res;
 	struct phy *phy;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
-	priv = devm_kzalloc_obj(&pdev->dev, *priv);
+	priv = devm_kzalloc_obj(dev, *priv);
 	if (!priv)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 
-	priv->hhi = syscon_node_to_regmap(np->parent);
-	if (IS_ERR(priv->hhi))
-		return PTR_ERR(priv->hhi);
+	priv->hhi = hhi;
+	priv->tmds_clk = tmds_clk;
+	priv->data = data;
 
-	priv->tmds_clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(priv->tmds_clk))
-		return PTR_ERR(priv->tmds_clk);
-
-	phy = devm_phy_create(&pdev->dev, np, &meson_hdmi_phy_ops);
+	phy = devm_phy_create(dev, provider_node, &meson_hdmi_phy_ops);
 	if (IS_ERR(phy))
-		return PTR_ERR(phy);
+		return phy;
 
 	phy_set_drvdata(phy, priv);
 
+	return phy;
+}
+
+/*
+ * DEPRECATED: only for DTs without a "phys" property on the HDMI TX node.
+ * Remove together with the fallback in meson_dw_hdmi.c.
+ */
+struct phy *meson_hdmi_phy_create_legacy(struct device *dev,
+					 struct regmap *hhi,
+					 enum meson_hdmi_phy_soc soc)
+{
+	static const struct meson_hdmi_phy_data *const soc_data[] = {
+		[MESON_HDMI_PHY_GXBB] = &gxbb_data,
+		[MESON_HDMI_PHY_GXL]  = &gxl_data,
+		[MESON_HDMI_PHY_G12A] = &g12a_data,
+	};
+
+	if (soc >= ARRAY_SIZE(soc_data))
+		return ERR_PTR(-EINVAL);
+
+	return meson_hdmi_phy_alloc(dev, NULL, hhi, NULL, soc_data[soc]);
+}
+EXPORT_SYMBOL_GPL(meson_hdmi_phy_create_legacy);
+
+static int meson_hdmi_phy_aux_probe(struct auxiliary_device *auxdev,
+				    const struct auxiliary_device_id *id)
+{
+	const struct meson_hdmi_phy_data *data;
+	struct device *dev = &auxdev->dev;
+	struct device_node *parent_np = dev->parent->of_node;
+	struct regmap *hhi;
+	struct phy *phy;
+
+	data = (const struct meson_hdmi_phy_data *)id->driver_data;
+	if (!data)
+		return -EINVAL;
+
+	hhi = syscon_node_to_regmap(parent_np);
+	if (IS_ERR(hhi))
+		return dev_err_probe(dev, PTR_ERR(hhi),
+				     "failed to get HHI regmap\n");
+
+	phy = meson_hdmi_phy_alloc(dev, parent_np, hhi, NULL, data);
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
+
+	return 0;
+}
+
+static const struct auxiliary_device_id meson_hdmi_phy_aux_id_table[] = {
+	{ .name = "meson_gx_hhi_sysctrl.gxbb-hdmi-phy", .driver_data = (kernel_ulong_t)&gxbb_data },
+	{ .name = "meson_gx_hhi_sysctrl.gxl-hdmi-phy",  .driver_data = (kernel_ulong_t)&gxl_data },
+	{ .name = "meson_gx_hhi_sysctrl.g12a-hdmi-phy", .driver_data = (kernel_ulong_t)&g12a_data },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(auxiliary, meson_hdmi_phy_aux_id_table);
+
+static struct auxiliary_driver meson_hdmi_phy_aux_driver = {
+	.probe = meson_hdmi_phy_aux_probe,
+	.name = "meson-hdmi-tx-phy",
+	.id_table = meson_hdmi_phy_aux_id_table,
+};
+
+static int meson_hdmi_phy_platform_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	const struct meson_hdmi_phy_data *data;
+	struct phy_provider *phy_provider;
+	struct clk *tmds_clk = NULL;
+	struct regmap *hhi;
+	struct phy *phy;
+
+	data = of_device_get_match_data(dev);
+	if (!data)
+		return -EINVAL;
+
+	/* The PHY node is a child of the HHI syscon */
+	hhi = syscon_node_to_regmap(dev->of_node->parent);
+	if (IS_ERR(hhi))
+		return dev_err_probe(dev, PTR_ERR(hhi),
+				     "failed to get HHI regmap\n");
+
+	if (data->has_tmds_clk) {
+		tmds_clk = devm_clk_get(dev, NULL);
+		if (IS_ERR(tmds_clk))
+			return dev_err_probe(dev, PTR_ERR(tmds_clk),
+					     "failed to get TMDS clock\n");
+	}
+
+	phy = meson_hdmi_phy_alloc(dev, NULL, hhi, tmds_clk, data);
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
+
 	phy_provider = devm_of_phy_provider_register(&pdev->dev,
 						     of_phy_simple_xlate);
 
@@ -141,19 +411,43 @@ static int meson_hdmi_phy_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id meson_hdmi_phy_of_match[] = {
-	{ .compatible = "amlogic,meson8-hdmi-tx-phy" },
+	{ .compatible = "amlogic,meson8-hdmi-tx-phy", .data = &meson8_data },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
 
-static struct platform_driver meson_hdmi_phy_driver = {
-	.probe	= meson_hdmi_phy_probe,
+static struct platform_driver meson_hdmi_phy_platform_driver = {
+	.probe	= meson_hdmi_phy_platform_probe,
 	.driver	= {
 		.name		= "meson-hdmi-tx-phy",
 		.of_match_table	= meson_hdmi_phy_of_match,
 	},
 };
-module_platform_driver(meson_hdmi_phy_driver);
+
+static int __init meson_hdmi_phy_register(void)
+{
+	int ret;
+
+	ret = auxiliary_driver_register(&meson_hdmi_phy_aux_driver);
+	if (ret)
+		return ret;
+
+	ret = platform_driver_register(&meson_hdmi_phy_platform_driver);
+	if (ret) {
+		auxiliary_driver_unregister(&meson_hdmi_phy_aux_driver);
+		return ret;
+	}
+
+	return 0;
+}
+module_init(meson_hdmi_phy_register);
+
+static void __exit meson_hdmi_phy_unregister(void)
+{
+	platform_driver_unregister(&meson_hdmi_phy_platform_driver);
+	auxiliary_driver_unregister(&meson_hdmi_phy_aux_driver);
+}
+module_exit(meson_hdmi_phy_unregister);
 
 MODULE_AUTHOR("Martin Blumenstingl <martin.blumenstingl@googlemail.com>");
 MODULE_DESCRIPTION("Amlogic Meson HDMI TX PHY driver");
diff --git a/include/linux/phy/phy-meson-hdmi-tx.h b/include/linux/phy/phy-meson-hdmi-tx.h
new file mode 100644
index 000000000000..fe76a5f7efdb
--- /dev/null
+++ b/include/linux/phy/phy-meson-hdmi-tx.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __PHY_MESON_HDMI_TX_H
+#define __PHY_MESON_HDMI_TX_H
+
+struct device;
+struct regmap;
+
+enum meson_hdmi_phy_soc {
+	MESON_HDMI_PHY_GXBB,
+	MESON_HDMI_PHY_GXL,	/* GXL and GXM */
+	MESON_HDMI_PHY_G12A,
+};
+
+/* DEPRECATED: compat for DTs without "phys" on the HDMI TX node */
+struct phy *meson_hdmi_phy_create_legacy(struct device *dev,
+					 struct regmap *hhi,
+					 enum meson_hdmi_phy_soc soc);
+
+#endif /* __PHY_MESON_HDMI_TX_H */

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 06/13] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (4 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 07/13] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY now has its own binding and driver. Describe the link
between the HDMI TX controller and its PHY with a "phys" property
holding a single phandle, and update the example accordingly.

The property is optional so that existing DT, which do not describe
the PHY, keep validating; the driver falls back to creating the PHY
itself in that case.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml b/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
index 416fe263ac92..7ece4ea262bd 100644
--- a/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
@@ -108,6 +108,9 @@ properties:
 
   sound-name-prefix: true
 
+  phys:
+    maxItems: 1
+
 required:
   - compatible
   - reg
@@ -136,6 +139,7 @@ examples:
         power-domains = <&pd_vpu>;
         #address-cells = <1>;
         #size-cells = <0>;
+        phys = <&hdmi_tx_phy>;
 
         /* VPU VENC Input */
         hdmi_tx_venc_port: port@0 {

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 07/13] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (5 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 06/13] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 08/13] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

When a power domain is found already powered on at probe time (typically
the VPU domain left enabled by the bootloader), the driver registers the
genpd in the ON state with GENPD_FLAG_ALWAYS_ON and never calls
meson_ee_pwrc_on(). As a result, the memory power-down bits of the domain
are not touched.

pwrc_ee_is_powered_off() only checks the top-level sleep bit, so a
bootloader that enabled the VPU without waking every memory block
leaves those memories powered down, and nothing in the genpd framework
will wake them since pm_runtime_resume_and_get() is a no-op for an
always-on domain.

This is a preparatory change: a following patch drops the explicit
HHI_MEM_PD_REG0 write from the meson_dw_hdmi driver, which relies on the
power domain to power the HDMITX memory.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/pmdomain/amlogic/meson-ee-pwrc.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
index 338f70d77bf0..b3ae5cd7bea8 100644
--- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
+++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
@@ -392,11 +392,21 @@ static int meson_ee_pwrc_off(struct generic_pm_domain *domain)
 	return 0;
 }
 
+static void meson_ee_pwrc_mem_power_up(struct meson_ee_pwrc_domain *dom)
+{
+	int i;
+
+	for (i = 0; i < dom->desc.mem_pd_count; i++)
+		regmap_update_bits(dom->pwrc->regmap_hhi,
+				   dom->desc.mem_pd[i].reg,
+				   dom->desc.mem_pd[i].mask, 0);
+}
+
 static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
 {
 	struct meson_ee_pwrc_domain *pwrc_domain =
 		container_of(domain, struct meson_ee_pwrc_domain, base);
-	int i, ret;
+	int ret;
 
 	if (pwrc_domain->desc.top_pd)
 		regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
@@ -404,10 +414,7 @@ static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
 				   pwrc_domain->desc.top_pd->sleep_mask, 0);
 	udelay(20);
 
-	for (i = 0 ; i < pwrc_domain->desc.mem_pd_count ; ++i)
-		regmap_update_bits(pwrc_domain->pwrc->regmap_hhi,
-				   pwrc_domain->desc.mem_pd[i].reg,
-				   pwrc_domain->desc.mem_pd[i].mask, 0);
+	meson_ee_pwrc_mem_power_up(pwrc_domain);
 
 	udelay(20);
 
@@ -478,6 +485,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
          * prepare/enable counters won't be in sync.
          */
 	if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) {
+		meson_ee_pwrc_mem_power_up(dom);
+
 		ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
 		if (ret)
 			return ret;

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 08/13] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (6 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 07/13] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

meson_dw_hdmi_init() programs two HHI registers by hand: the HDMI clock
mux/divider/gate (HHI_HDMI_CLK_CNTL) and the HDMITX memory power-down
bits (HHI_MEM_PD_REG0). Both are already covered by resources described
in the DT:

 - the HDMI clock is selected and rated through assigned-clocks
   (CLKID_HDMI_SEL parented to xtal, CLKID_HDMI at 24 MHz), and gated
   through the "isfr" clock, which the driver already enables at bind
   time;
 - the memory power-down bits are handled by the VPU power domain
   referenced by "power-domains".

Remove the open-coded register writes. Take an explicit runtime PM
reference in probe and release it on removal, so that the domain is
guaranteed to be on for the lifetime of the device.

The driver now relies on runtime PM to power the HDMITX memory, so make
it depend on PM.

Those properties are optional in the binding and were only added to the
in-tree DTs in v6.11, so DTs without them would no longer get the
registers programmed by the kernel. This is not a concern in practice:

 - the DT used by the kernel often comes from U-Boot, which used a DT
   based on Linux v6.2 before v2024.07 and has used the DT synchronized
   with Linux since then, matching the v6.11 DT with the clock changes;
 - U-Boot already sets HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0 when
   probing dw_hdmi, since v2019.04, so both registers are already in the
   expected state when Linux boots, even with an older U-Boot and DT.

The risk of regression is therefore very low.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/gpu/drm/meson/Kconfig         |  1 +
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 31 ++++++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
index 417f79829cf8..6645665f6038 100644
--- a/drivers/gpu/drm/meson/Kconfig
+++ b/drivers/gpu/drm/meson/Kconfig
@@ -17,6 +17,7 @@ config DRM_MESON
 config DRM_MESON_DW_HDMI
 	tristate "HDMI Synopsys Controller support for Amlogic Meson Display"
 	depends on DRM_MESON
+	depends on PM
 	default y if DRM_MESON
 	select DRM_DW_HDMI
 	imply DRM_DW_HDMI_I2S_AUDIO
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index eb33c70f29c3..20a821936b3a 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -12,6 +12,7 @@
 #include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 
@@ -102,8 +103,6 @@
 #define HDMITX_DWC_CTRL_REG	0x18
 
 /* HHI Registers */
-#define HHI_MEM_PD_REG0		0x100 /* 0x40 */
-#define HHI_HDMI_CLK_CNTL	0x1cc /* 0x73 */
 #define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
 #define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
 #define  PHY_CNTL1_INIT		0x03900000
@@ -599,12 +598,6 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 {
 	struct meson_drm *priv = meson_dw_hdmi->priv;
 
-	/* Enable clocks */
-	regmap_update_bits(priv->hhi, HHI_HDMI_CLK_CNTL, 0xffff, 0x100);
-
-	/* Bring HDMITX MEM output of power down */
-	regmap_update_bits(priv->hhi, HHI_MEM_PD_REG0, 0xff << 8, 0);
-
 	/* Reset HDMITX APB & TX & PHY */
 	reset_control_reset(meson_dw_hdmi->hdmitx_apb);
 	reset_control_reset(meson_dw_hdmi->hdmitx_ctrl);
@@ -829,9 +822,29 @@ static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev)
 	return 0;
 }
 
+static void meson_dw_hdmi_pm_put(void *dev)
+{
+	pm_runtime_put_sync(dev);
+}
+
 static int meson_dw_hdmi_probe(struct platform_device *pdev)
 {
-	return component_add(&pdev->dev, &meson_dw_hdmi_ops);
+	struct device *dev = &pdev->dev;
+	int ret;
+
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		return ret;
+
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to power on HDMI TX\n");
+
+	ret = devm_add_action_or_reset(dev, meson_dw_hdmi_pm_put, dev);
+	if (ret)
+		return ret;
+
+	return component_add(dev, &meson_dw_hdmi_ops);
 }
 
 static void meson_dw_hdmi_remove(struct platform_device *pdev)

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (7 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 08/13] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:30   ` sashiko-bot
  2026-12-01 20:12 ` [PATCH v6 10/13] arm64: dts: amlogic: g12: Use the HHI system controller as HDMI PHY provider Ronald Claveau via B4 Relay
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY registers (HHI_HDMI_PHY_CNTL0..5) were programmed
directly from this driver, with per-SoC tables selected by compatible
string. A dedicated PHY driver now exists, so use it through the
generic PHY API instead:

 - phy_init() replaces the initial CNTL0/CNTL1 programming,
 - phy_configure() replaces meson_hdmi_phy_setup_mode(), the TMDS
   character rate being derived from the (possibly 4:2:0 halved) pixel
   clock, with 8 bpc as before,
 - phy_power_on() replaces the three successive PHY resets,
 - phy_power_off() replaces the fallback to the initial state in
   dw_hdmi_phy_disable().

The "hdmi" PHY is looked up through the "phys" property of the HDMI TX
node. Device trees that do not provide it keep working: in that case
the PHY is created by this driver through
meson_hdmi_phy_create_legacy(), using a per-SoC identifier replacing the
former cntl0_init/cntl1_init fields, and a warning is printed. This
fallback is deprecated and will be removed once all device trees have
been converted.

meson_dw_hdmi_init() can now fail, so propagate its return value from
probe and resume. Select PHY_MESON_HDMI_TX in Kconfig since the driver
now depends on it, including for the legacy path.

Add a device link with hdmi-tx as consumer and vpu as supplier to get
the correct order on suspend/resume.

Move the atomic suspend/resume to the .prepare/.complete callbacks. This
guarantees:

  suspend: power_off (prepare) -> phy_exit (suspend)
  resume : venc_init (resume)  -> phy_init (resume) -> power_on (complete)

The constraints are:

 - phy_exit() must come after phy_power_off(), which is done by the
   atomic disable in drm_mode_config_helper_suspend().
 - phy_init() must come after meson_venc_init(), which writes 0 to
   HHI_HDMI_PHY_CNTL0 and would otherwise clobber the value programmed
   by phy_init() (bandgap on G12A).
 - phy_power_on() must come after phy_init(), otherwise the PHY core
   warns that it was called before phy_init.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/gpu/drm/meson/Kconfig         |   1 +
 drivers/gpu/drm/meson/meson_drv.c     |  16 ++-
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 192 +++++++++++++---------------------
 3 files changed, 89 insertions(+), 120 deletions(-)

diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
index 6645665f6038..a91cf851314a 100644
--- a/drivers/gpu/drm/meson/Kconfig
+++ b/drivers/gpu/drm/meson/Kconfig
@@ -20,6 +20,7 @@ config DRM_MESON_DW_HDMI
 	depends on PM
 	default y if DRM_MESON
 	select DRM_DW_HDMI
+	select PHY_MESON_HDMI_TX
 	imply DRM_DW_HDMI_I2S_AUDIO
 
 config DRM_MESON_DW_MIPI_DSI
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 38bf2811d068..5343323f404a 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -422,7 +422,7 @@ static const struct component_master_ops meson_drv_master_ops = {
 	.unbind	= meson_drv_unbind,
 };
 
-static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
+static int meson_drv_pm_prepare(struct device *dev)
 {
 	struct meson_drm *priv = dev_get_drvdata(dev);
 
@@ -432,6 +432,14 @@ static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
 	return drm_mode_config_helper_suspend(priv->drm);
 }
 
+static void meson_drv_pm_complete(struct device *dev)
+{
+	struct meson_drm *priv = dev_get_drvdata(dev);
+
+	if (priv)
+		drm_mode_config_helper_resume(priv->drm);
+}
+
 static int __maybe_unused meson_drv_pm_resume(struct device *dev)
 {
 	struct meson_drm *priv = dev_get_drvdata(dev);
@@ -446,7 +454,7 @@ static int __maybe_unused meson_drv_pm_resume(struct device *dev)
 	if (priv->afbcd.ops)
 		priv->afbcd.ops->init(priv);
 
-	return drm_mode_config_helper_resume(priv->drm);
+	return 0;
 }
 
 static void meson_drv_shutdown(struct platform_device *pdev)
@@ -553,7 +561,9 @@ static const struct of_device_id dt_match[] = {
 MODULE_DEVICE_TABLE(of, dt_match);
 
 static const struct dev_pm_ops meson_drv_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(meson_drv_pm_suspend, meson_drv_pm_resume)
+	.prepare = meson_drv_pm_prepare,
+	.complete  = meson_drv_pm_complete,
+	SET_SYSTEM_SLEEP_PM_OPS(NULL, meson_drv_pm_resume)
 };
 
 static struct platform_driver meson_drm_platform_driver = {
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 20a821936b3a..ec21d13775b7 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -11,6 +11,8 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/phy/phy.h>
+#include <linux/phy/phy-meson-hdmi-tx.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
@@ -102,16 +104,6 @@
 #define HDMITX_DWC_DATA_REG	0x14
 #define HDMITX_DWC_CTRL_REG	0x18
 
-/* HHI Registers */
-#define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
-#define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
-#define  PHY_CNTL1_INIT		0x03900000
-#define  PHY_INVERT		BIT(17)
-#define HHI_HDMI_PHY_CNTL2	0x3a8 /* 0xea */
-#define HHI_HDMI_PHY_CNTL3	0x3ac /* 0xeb */
-#define HHI_HDMI_PHY_CNTL4	0x3b0 /* 0xec */
-#define HHI_HDMI_PHY_CNTL5	0x3b4 /* 0xed */
-
 static DEFINE_SPINLOCK(reg_lock);
 
 enum meson_venc_source {
@@ -131,8 +123,7 @@ struct meson_dw_hdmi_data {
 				    unsigned int addr);
 	void		(*dwc_write)(struct meson_dw_hdmi *dw_hdmi,
 				     unsigned int addr, unsigned int data);
-	u32 cntl0_init;
-	u32 cntl1_init;
+	enum meson_hdmi_phy_soc phy_soc;	/* legacy PHY only */
 };
 
 struct meson_dw_hdmi {
@@ -147,6 +138,8 @@ struct meson_dw_hdmi {
 	u32 irq_stat;
 	struct dw_hdmi *hdmi;
 	struct drm_bridge *bridge;
+	struct phy *phy;
+	bool legacy_phy;
 };
 
 static inline int dw_hdmi_is_compatible(struct meson_dw_hdmi *dw_hdmi,
@@ -273,87 +266,6 @@ static inline void dw_hdmi_g12a_dwc_write(struct meson_dw_hdmi *dw_hdmi,
 
 /* Bridge */
 
-/* Setup PHY bandwidth modes */
-static void meson_hdmi_phy_setup_mode(struct meson_dw_hdmi *dw_hdmi,
-				      const struct drm_display_mode *mode,
-				      bool mode_is_420)
-{
-	struct meson_drm *priv = dw_hdmi->priv;
-	unsigned int pixel_clock = mode->clock;
-
-	/* For 420, pixel clock is half unlike venc clock */
-	if (mode_is_420) pixel_clock /= 2;
-
-	if (dw_hdmi_is_compatible(dw_hdmi, "amlogic,meson-gxl-dw-hdmi") ||
-	    dw_hdmi_is_compatible(dw_hdmi, "amlogic,meson-gxm-dw-hdmi")) {
-		if (pixel_clock >= 371250) {
-			/* 5.94Gbps, 3.7125Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x333d3282);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2136315b);
-		} else if (pixel_clock >= 297000) {
-			/* 2.97Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33303382);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2036315b);
-		} else if (pixel_clock >= 148500) {
-			/* 1.485Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33303362);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2016315b);
-		} else {
-			/* 742.5Mbps, and below */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33604142);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x0016315b);
-		}
-	} else if (dw_hdmi_is_compatible(dw_hdmi,
-					 "amlogic,meson-gxbb-dw-hdmi")) {
-		if (pixel_clock >= 371250) {
-			/* 5.94Gbps, 3.7125Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33353245);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2100115b);
-		} else if (pixel_clock >= 297000) {
-			/* 2.97Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33634283);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0xb000115b);
-		} else {
-			/* 1.485Gbps, and below */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33632122);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2000115b);
-		}
-	} else if (dw_hdmi_is_compatible(dw_hdmi,
-					 "amlogic,meson-g12a-dw-hdmi")) {
-		if (pixel_clock >= 371250) {
-			/* 5.94Gbps, 3.7125Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x37eb65c4);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2ab0ff3b);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, 0x0000080b);
-		} else if (pixel_clock >= 297000) {
-			/* 2.97Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33eb6262);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2ab0ff3b);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, 0x00000003);
-		} else {
-			/* 1.485Gbps, and below */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33eb4242);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2ab0ff3b);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, 0x00000003);
-		}
-	}
-}
-
-static inline void meson_dw_hdmi_phy_reset(struct meson_dw_hdmi *dw_hdmi)
-{
-	struct meson_drm *priv = dw_hdmi->priv;
-
-	/* Enable and software reset */
-	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1, 0xf, 0xf);
-
-	mdelay(2);
-
-	/* Enable and unreset */
-	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1, 0xf, 0xe);
-
-	mdelay(2);
-}
-
 static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
 			    const struct drm_display_info *display,
 			    const struct drm_display_mode *mode)
@@ -364,6 +276,9 @@ static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
 	unsigned int wr_clk =
 		readl_relaxed(priv->io_base + _REG(VPU_HDMI_SETTING));
 	bool mode_is_420 = false;
+	unsigned int pixel_clock = mode->clock;
+	union phy_configure_opts opts = {};
+	int ret;
 
 	DRM_DEBUG_DRIVER("\"%s\" div%d\n", mode->name,
 			 mode->clock > 340000 ? 40 : 10);
@@ -392,19 +307,22 @@ static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
 	dw_hdmi->data->top_write(dw_hdmi, HDMITX_TOP_TMDS_CLK_PTTN_CNTL, 0x2);
 
 	/* Setup PHY parameters */
-	meson_hdmi_phy_setup_mode(dw_hdmi, mode, mode_is_420);
-
-	/* Disable clock, fifo, fifo_wr */
-	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1, 0xf, 0);
+	if (mode_is_420)
+		pixel_clock /= 2;
+	opts.hdmi.tmds_char_rate = (u64)pixel_clock * 1000;
+	opts.hdmi.bpc = 8;
+	ret = phy_configure(dw_hdmi->phy, &opts);
+	if (ret)
+		return ret;
 
 	dw_hdmi_set_high_tmds_clock_ratio(hdmi, display);
 
 	msleep(100);
 
 	/* Reset PHY 3 times in a row */
-	meson_dw_hdmi_phy_reset(dw_hdmi);
-	meson_dw_hdmi_phy_reset(dw_hdmi);
-	meson_dw_hdmi_phy_reset(dw_hdmi);
+	ret = phy_power_on(dw_hdmi->phy);
+	if (ret)
+		return ret;
 
 	/* Temporary Disable VENC video stream */
 	if (priv->venc.hdmi_use_enci)
@@ -443,13 +361,11 @@ static void dw_hdmi_phy_disable(struct dw_hdmi *hdmi,
 				void *data)
 {
 	struct meson_dw_hdmi *dw_hdmi = (struct meson_dw_hdmi *)data;
-	struct meson_drm *priv = dw_hdmi->priv;
 
 	DRM_DEBUG_DRIVER("\n");
 
 	/* Fallback to init mode */
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, dw_hdmi->data->cntl1_init);
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, dw_hdmi->data->cntl0_init);
+	phy_power_off(dw_hdmi->phy);
 }
 
 static enum drm_connector_status dw_hdmi_read_hpd(struct dw_hdmi *hdmi,
@@ -572,8 +488,7 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_gxbb_data = {
 	.top_write = dw_hdmi_top_write,
 	.dwc_read = dw_hdmi_dwc_read,
 	.dwc_write = dw_hdmi_dwc_write,
-	.cntl0_init = 0x0,
-	.cntl1_init = PHY_CNTL1_INIT | PHY_INVERT,
+	.phy_soc = MESON_HDMI_PHY_GXBB,
 };
 
 static const struct meson_dw_hdmi_data meson_dw_hdmi_gxl_data = {
@@ -581,8 +496,7 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_gxl_data = {
 	.top_write = dw_hdmi_top_write,
 	.dwc_read = dw_hdmi_dwc_read,
 	.dwc_write = dw_hdmi_dwc_write,
-	.cntl0_init = 0x0,
-	.cntl1_init = PHY_CNTL1_INIT,
+	.phy_soc = MESON_HDMI_PHY_GXL,
 };
 
 static const struct meson_dw_hdmi_data meson_dw_hdmi_g12a_data = {
@@ -590,13 +504,13 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_g12a_data = {
 	.top_write = dw_hdmi_g12a_top_write,
 	.dwc_read = dw_hdmi_g12a_dwc_read,
 	.dwc_write = dw_hdmi_g12a_dwc_write,
-	.cntl0_init = 0x000b4242, /* Bandgap */
-	.cntl1_init = PHY_CNTL1_INIT,
+	.phy_soc = MESON_HDMI_PHY_G12A,
 };
 
-static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
+static int meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 {
 	struct meson_drm *priv = meson_dw_hdmi->priv;
+	int ret;
 
 	/* Reset HDMITX APB & TX & PHY */
 	reset_control_reset(meson_dw_hdmi->hdmitx_apb);
@@ -624,8 +538,9 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_BIST_CNTL, BIT(12));
 
 	/* Setup PHY */
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, meson_dw_hdmi->data->cntl1_init);
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, meson_dw_hdmi->data->cntl0_init);
+	ret = phy_init(meson_dw_hdmi->phy);
+	if (ret)
+		return ret;
 
 	/* Enable HDMI-TX Interrupt */
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_INTR_STAT_CLR,
@@ -634,6 +549,7 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_INTR_MASKN,
 				       HDMITX_TOP_INTR_CORE);
 
+	return 0;
 }
 
 static void meson_disable_clk(void *data)
@@ -664,10 +580,11 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	const struct meson_dw_hdmi_data *match;
+	struct dw_hdmi_plat_data *dw_plat_data;
 	struct meson_dw_hdmi *meson_dw_hdmi;
+	struct device_link *link;
 	struct drm_device *drm = data;
 	struct meson_drm *priv = drm->dev_private;
-	struct dw_hdmi_plat_data *dw_plat_data;
 	int irq;
 	int ret;
 
@@ -746,7 +663,26 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
-	meson_dw_hdmi_init(meson_dw_hdmi);
+	meson_dw_hdmi->phy = devm_phy_optional_get(dev, NULL);
+	if (IS_ERR(meson_dw_hdmi->phy))
+		return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
+				     "failed to get HDMI PHY\n");
+
+	if (!meson_dw_hdmi->phy) {
+		/* DEPRECATED: DT without "phys" */
+		dev_warn(dev, "missing \"phys\", using legacy HDMI PHY\n");
+		meson_dw_hdmi->phy = meson_hdmi_phy_create_legacy(dev, priv->hhi,
+						meson_dw_hdmi->data->phy_soc);
+		if (IS_ERR(meson_dw_hdmi->phy))
+			return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
+					     "failed to create legacy HDMI PHY\n");
+
+		meson_dw_hdmi->legacy_phy = true;
+	}
+
+	ret = meson_dw_hdmi_init(meson_dw_hdmi);
+	if (ret)
+		return ret;
 
 	/* Bridge / Connector */
 
@@ -767,14 +703,25 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 	platform_set_drvdata(pdev, meson_dw_hdmi);
 
 	meson_dw_hdmi->hdmi = dw_hdmi_probe(pdev, &meson_dw_hdmi->dw_plat_data);
-	if (IS_ERR(meson_dw_hdmi->hdmi))
-		return PTR_ERR(meson_dw_hdmi->hdmi);
+	if (IS_ERR(meson_dw_hdmi->hdmi)) {
+		ret = PTR_ERR(meson_dw_hdmi->hdmi);
+		goto err_hdmi_probe;
+	}
 
 	meson_dw_hdmi->bridge = of_drm_find_and_get_bridge(pdev->dev.of_node);
 
+	link = device_link_add(dev, master, DL_FLAG_STATELESS);
+	if (!link)
+		dev_warn(dev, "failed to link DRM master (supplier) to HDMI (consumer)\n");
+
 	DRM_DEBUG_DRIVER("HDMI controller initialized\n");
 
 	return 0;
+
+err_hdmi_probe:
+	phy_exit(meson_dw_hdmi->phy);
+
+	return ret;
 }
 
 static void meson_dw_hdmi_unbind(struct device *dev, struct device *master,
@@ -784,8 +731,14 @@ static void meson_dw_hdmi_unbind(struct device *dev, struct device *master,
 	struct platform_device *pdev = to_platform_device(dev);
 	int irq = platform_get_irq(pdev, 0);
 
+	device_link_remove(dev, master);	/* (consumer, supplier) */
+
 	devm_free_irq(dev, irq, meson_dw_hdmi);
 	dw_hdmi_unbind(meson_dw_hdmi->hdmi);
+
+	phy_exit(meson_dw_hdmi->phy);
+	if (meson_dw_hdmi->legacy_phy)
+		devm_phy_destroy(dev, meson_dw_hdmi->phy);
 	drm_bridge_put(meson_dw_hdmi->bridge);
 }
 
@@ -801,6 +754,8 @@ static int __maybe_unused meson_dw_hdmi_pm_suspend(struct device *dev)
 	if (!meson_dw_hdmi)
 		return 0;
 
+	phy_exit(meson_dw_hdmi->phy);
+
 	/* Reset TOP */
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi,
 				       HDMITX_TOP_SW_RESET, 0);
@@ -811,11 +766,14 @@ static int __maybe_unused meson_dw_hdmi_pm_suspend(struct device *dev)
 static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev)
 {
 	struct meson_dw_hdmi *meson_dw_hdmi = dev_get_drvdata(dev);
+	int ret;
 
 	if (!meson_dw_hdmi)
 		return 0;
 
-	meson_dw_hdmi_init(meson_dw_hdmi);
+	ret = meson_dw_hdmi_init(meson_dw_hdmi);
+	if (ret)
+		return ret;
 
 	dw_hdmi_resume(meson_dw_hdmi->hdmi);
 

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 10/13] arm64: dts: amlogic: g12: Use the HHI system controller as HDMI PHY provider
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (8 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:12 ` [PATCH v6 11/13] arm64: dts: amlogic: meson-gx: Add #phy-cells to the HHI system controller Ronald Claveau via B4 Relay
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Describe the HDMI TX PHY as an auxiliary device, and reference it from
the HDMI TX node through "phys".

Switch the HHI system controller to the SoC-specific
"amlogic,meson-g12a-hhi-sysctrl" compatible, which selects the G12A PHY
variant, add "#phy-cells" and reference the controller from the HDMI TX
node through "phys".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 3135566df880..f73087f5c8ac 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -210,6 +210,7 @@ hdmi_tx: hdmi-tx@0 {
 					 <&clkc CLKID_HTX_PCLK>,
 					 <&clkc CLKID_VPU_INTR>;
 				clock-names = "isfr", "iahb", "venci";
+				phys = <&hhi>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				#sound-dai-cells = <0>;
@@ -1620,9 +1621,10 @@ hiu: bus@3c000 {
 				ranges = <0x0 0x0 0x0 0x3c000 0x0 0x1400>;
 
 				hhi: system-controller@0 {
-					compatible = "amlogic,meson-gx-hhi-sysctrl",
+					compatible = "amlogic,meson-g12a-hhi-sysctrl",
 						     "simple-mfd", "syscon";
 					reg = <0 0 0 0x400>;
+					#phy-cells = <0>;
 
 					clkc: clock-controller {
 						compatible = "amlogic,g12a-clkc";

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 11/13] arm64: dts: amlogic: meson-gx: Add #phy-cells to the HHI system controller
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (9 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 10/13] arm64: dts: amlogic: g12: Use the HHI system controller as HDMI PHY provider Ronald Claveau via B4 Relay
@ 2026-12-01 20:12 ` Ronald Claveau via B4 Relay
  2026-12-01 20:13 ` [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
  2026-12-01 20:13 ` [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
  12 siblings, 0 replies; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The meson-gx-hhi-sysctrl driver registers the controller as a PHY
provider, so add the "#phy-cells" property to the sysctrl node.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index c1d8e81d95cb..bdea3b914da1 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -589,6 +589,7 @@ hiubus: bus@c883c000 {
 			sysctrl: system-controller@0 {
 				compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
 				reg = <0 0 0 0x400>;
+				#phy-cells = <0>;
 
 				pwrc: power-controller {
 					compatible = "amlogic,meson-gxbb-pwrc";

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (10 preceding siblings ...)
  2026-12-01 20:12 ` [PATCH v6 11/13] arm64: dts: amlogic: meson-gx: Add #phy-cells to the HHI system controller Ronald Claveau via B4 Relay
@ 2026-12-01 20:13 ` Ronald Claveau via B4 Relay
  2026-12-01 20:32   ` sashiko-bot
  2026-12-01 20:13 ` [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
  12 siblings, 1 reply; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:13 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Describe the HDMI TX PHY as a child of the HHI system controller, with
the amlogic,meson-gxbb-hdmi-tx-phy compatible and reference
it from the HDMI TX node through "phys".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 5c2fe9dc4f80..1e724958f4c5 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -316,6 +316,7 @@ &hdmi_tx {
 		 <&clkc CLKID_GCLK_VENCI_INT0>;
 	clock-names = "isfr", "iahb", "venci";
 	power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
+	phys = <&sysctrl>;
 
 	assigned-clocks = <&clkc CLKID_HDMI_SEL>,
 			  <&clkc CLKID_HDMI>;
@@ -324,6 +325,8 @@ &hdmi_tx {
 };
 
 &sysctrl {
+	compatible = "amlogic,meson-gxbb-hhi-sysctrl", "simple-mfd", "syscon";
+
 	clkc: clock-controller {
 		compatible = "amlogic,gxbb-clkc";
 		#clock-cells = <1>;

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL
  2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (11 preceding siblings ...)
  2026-12-01 20:13 ` [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
@ 2026-12-01 20:13 ` Ronald Claveau via B4 Relay
  2026-12-01 20:23   ` sashiko-bot
  12 siblings, 1 reply; 20+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-12-01 20:13 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Describe the HDMI TX PHY as a child of the HHI system controller, with
the amlogic,meson-gxl-hdmi-tx-phy compatible and reference
it from the HDMI TX node through "phys".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index f257fe3860f7..bff4fed29c53 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -328,6 +328,7 @@ &hdmi_tx {
 		 <&clkc CLKID_GCLK_VENCI_INT0>;
 	clock-names = "isfr", "iahb", "venci";
 	power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
+	phys = <&sysctrl>;
 
 	assigned-clocks = <&clkc CLKID_HDMI_SEL>,
 			  <&clkc CLKID_HDMI>;
@@ -336,6 +337,8 @@ &hdmi_tx {
 };
 
 &sysctrl {
+	compatible = "amlogic,meson-gxl-hhi-sysctrl", "simple-mfd", "syscon";
+
 	clkc: clock-controller {
 		compatible = "amlogic,gxl-clkc";
 		#clock-cells = <1>;

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL
  2026-12-01 20:13 ` [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
@ 2026-12-01 20:23   ` sashiko-bot
  0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-12-01 20:23 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] arm64: dts: amlogic: commit message does not match
  meson-gxl.dtsi changes
--

commit 3490bf7a4edff94ae1e24c4db82e69d58e461eaa
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

> arm64: dts: amlogic: Add HDMI TX PHY node for GXL
>
> Describe the HDMI TX PHY as a child of the HHI system controller, with
> the amlogic,meson-gxl-hdmi-tx-phy compatible and reference
> it from the HDMI TX node through "phys".
>
> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>

> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> index f257fe3860f78..bff4fed29c537 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> @@ -328,6 +328,7 @@ &hdmi_tx {
>  		 <&clkc CLKID_GCLK_VENCI_INT0>;
>  	clock-names = "isfr", "iahb", "venci";
>  	power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
> +	phys = <&sysctrl>;
>  
>  	assigned-clocks = <&clkc CLKID_HDMI_SEL>,
>  			  <&clkc CLKID_HDMI>;
> @@ -336,6 +337,8 @@ &hdmi_tx {
>  };
>  
>  &sysctrl {
> +	compatible = "amlogic,meson-gxl-hhi-sysctrl", "simple-mfd", "syscon";
> +
>  	clkc: clock-controller {
>  		compatible = "amlogic,gxl-clkc";
>  		#clock-cells = <1>;

[Severity: Low]
This isn't a bug, but the commit title and message do not match the change.
Rather than adding a child node under &sysctrl with compatible
"amlogic,meson-gxl-hdmi-tx-phy", the patch updates &sysctrl to use
"amlogic,meson-gxl-hhi-sysctrl" and points &hdmi_tx's phys property directly
at &sysctrl.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=13

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver
  2026-12-01 20:12 ` [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver Ronald Claveau via B4 Relay
@ 2026-12-01 20:24   ` sashiko-bot
  0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-12-01 20:24 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] soc: amlogic: meson_gx_hhi_sysctrl_probe() registers PHY
  provider before PHY
- [High] soc: amlogic: meson_gx_hhi_sysctrl_probe() hijacks child PHY
  node lookups
--

commit 5d78a854bc7adf16d895a668b567c24c0ad39b45
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

soc: amlogic: Add Meson GX HHI system controller driver

This commit adds a driver for the Amlogic Meson GX HHI system controller
that registers a PHY provider and creates an auxiliary device for the
HDMI TX PHY driver.

> diff --git a/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c b/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c
> new file mode 100644
> index 0000000000000..d4ef41e422a27
> --- /dev/null
> +++ b/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c

[ ... ]

> +static int meson_gx_hhi_sysctrl_probe(struct platform_device *pdev)
> +{
> +	struct phy_provider *phy_provider;
> +	struct auxiliary_device *auxdev;
> +	const char *phy_aux_name;
> +	struct device *dev = &pdev->dev;
> +
> +	phy_aux_name = device_get_match_data(dev);
> +	if (!phy_aux_name)
> +		return dev_err_probe(dev, -ENODEV, "missing PHY match data\n");
> +
> +	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> +	if (IS_ERR(phy_provider))
> +		return dev_err_probe(dev, PTR_ERR(phy_provider),
> +				     "failed to register PHY provider\n");

[Severity: High]
Does registering the HHI MFD node with devm_of_phy_provider_register()
intercept lookups for child PHY nodes under the HHI node?

devm_of_phy_provider_register() passes NULL for the children node, which
causes __of_phy_provider_register() to set phy_provider->children to
dev->of_node, and of_phy_provider_lookup() matches any direct child of
phy_provider->children:

drivers/phy/phy-core.c:of_phy_provider_lookup() {
	...
		for_each_child_of_node_scoped(phy_provider->children, child)
			if (child == node)
				return phy_provider;
	...
}

On G12A, G12B and SM1 SoCs, the HHI node contains the mipi_analog_dphy
child PHY node (compatible "amlogic,g12a-mipi-dphy-analog").  If
phy_meson_axg_mipi_dphy_probe() calls devm_phy_get(dev, "analog") before
phy_g12a_mipi_dphy_analog_probe() has created that PHY,
of_phy_provider_lookup() returns the HHI phy_provider instead of deferring
and of_phy_simple_xlate() returns -ENODEV, causing the MIPI D-PHY probe to
fail permanently.  Even after the child PHY driver probes,
of_phy_provider_lookup() matches the HHI provider first and pins the wrong
module owner.

> +
> +	auxdev = devm_auxiliary_device_create(dev, phy_aux_name, NULL);

[Severity: High]
Does registering phy_provider before the auxiliary HDMI TX PHY driver binds
break probe deferral for HDMI TX PHY consumers?

_of_phy_get_with_args() only returns -EPROBE_DEFER while
of_phy_provider_lookup() finds no provider for the node.  Once
devm_of_phy_provider_register() succeeds here, any consumer requesting the
PHY before the auxiliary driver has bound and called devm_phy_create()
reaches of_phy_simple_xlate(), which fails class_find_device_by_of_node()
and returns -ENODEV instead of -EPROBE_DEFER.  This happens whenever
CONFIG_MESON_GX_HHI_SYSCTRL=y and the HDMI TX PHY driver is built as a
module or probes later, causing devm_phy_get() callers to fail permanently
and devm_phy_optional_get() callers to treat the PHY as absent.  In
addition, phy_provider->owner is set to this module rather than the PHY
driver module, and devres teardown on unbind destroys auxdev and its struct
phy before unregistering phy_provider.

Since auxiliary_device_create() already copies dev->of_node to
auxdev->dev.of_node, could the auxiliary PHY driver register the PHY
provider itself after calling devm_phy_create()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=3

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
  2026-12-01 20:12 ` [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
@ 2026-12-01 20:25   ` sashiko-bot
  0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-12-01 20:25 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] phy: amlogic: missing PHY provider registration in
  meson_hdmi_phy_aux_probe()
--

commit 9c83a9c8c670c3d3e57ee4e8af9227943e479a17
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support

This commit extends the Meson HDMI TX PHY driver to support GXBB, GXL, GXM,
and G12A SoCs as auxiliary devices, implementing generic PHY HDMI
configuration callbacks and a legacy creation helper.

> diff --git a/drivers/phy/amlogic/phy-meson-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> index e4e606ab4eefa..66bf841411fd2 100644
> --- a/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> +++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
[ ... ]
> +static int meson_hdmi_phy_aux_probe(struct auxiliary_device *auxdev,
> +				    const struct auxiliary_device_id *id)
> +{
> +	const struct meson_hdmi_phy_data *data;
> +	struct device *dev = &auxdev->dev;
> +	struct device_node *parent_np = dev->parent->of_node;
> +	struct regmap *hhi;
> +	struct phy *phy;
> +
> +	data = (const struct meson_hdmi_phy_data *)id->driver_data;
> +	if (!data)
> +		return -EINVAL;
> +
> +	hhi = syscon_node_to_regmap(parent_np);
> +	if (IS_ERR(hhi))
> +		return dev_err_probe(dev, PTR_ERR(hhi),
> +				     "failed to get HHI regmap\n");
> +
> +	phy = meson_hdmi_phy_alloc(dev, parent_np, hhi, NULL, data);
> +	if (IS_ERR(phy))
> +		return dev_err_probe(dev, PTR_ERR(phy),
> +				     "failed to create PHY\n");
> +
> +	return 0;
> +}

[Severity: Medium]
Should meson_hdmi_phy_aux_probe() register the OF PHY provider with
devm_of_phy_provider_register() after meson_hdmi_phy_alloc(), instead of
relying on the parent sysctrl driver registering it before creating the
auxiliary device?

drivers/soc/amlogic/meson-gx-hhi-sysctrl.c:meson_gx_hhi_sysctrl_probe() {
    ...
	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
	if (IS_ERR(phy_provider))
		return dev_err_probe(dev, PTR_ERR(phy_provider),
				     "failed to register PHY provider\n");

	auxdev = devm_auxiliary_device_create(dev, phy_aux_name, NULL);
    ...
}

Because the provider is already live with of_phy_simple_xlate() before the
struct phy exists, any consumer lookup before meson_hdmi_phy_aux_probe()
completes (or when this driver is a not-yet-loaded module, defers, or is
unbound) gets -ENODEV from of_phy_simple_xlate() instead of -EPROBE_DEFER.
In addition, devm_phy_create() inside meson_hdmi_phy_alloc() publishes
phy->dev to phy_class before phy_set_drvdata(phy, priv) runs, leaving a
window where a concurrent consumer can look up the PHY and invoke phy_ops
with a NULL priv pointer.

Since auxiliary_device_create() already copies the parent OF node to
auxdev->dev.of_node, registering the provider here on dev after
meson_hdmi_phy_alloc() (as meson_hdmi_phy_platform_probe() does) avoids
both issues and ties the provider lifetime to the auxiliary driver.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=5

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells
  2026-12-01 20:12 ` [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells Ronald Claveau via B4 Relay
@ 2026-12-01 20:27   ` sashiko-bot
  0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-12-01 20:27 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: soc: amlogic: missing phy constraint for gxbb and
  gxl compatibles
--

commit ea6ad9b4381c3ce81b3b9f7c71af326d4010fd03
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells

This commit adds the #phy-cells property and SoC-specific HHI system
controller compatibles for GXBB, GXL, and G12A so the system controller
can act as the HDMI TX PHY provider.

> diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
> index 285edac4c0821..f277e22a98ffe 100644
> --- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
> +++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml

[ ... ]

> @@ -80,12 +93,14 @@ allOf:
>  
>          power-controller: false
>          phy: false
> +        "#phy-cells": false
>  
>    - if:
>        properties:
>          compatible:
>            contains:
>              enum:
> +              - amlogic,meson-g12a-hhi-sysctrl
>                - amlogic,meson-gx-hhi-sysctrl
>      then:
>        properties:

[Severity: Low]
Should amlogic,meson-gxbb-hhi-sysctrl and amlogic,meson-gxl-hhi-sysctrl
also constrain the phy child node in allOf?

Top-level properties defines phy as a bare type: object, and every other
compatible either constrains it to a PHY schema or sets phy: false.
Leaving the new GXBB and GXL compatibles out of both rules allows
arbitrary unvalidated phy child nodes under those system controllers.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=2

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
  2026-12-01 20:12 ` [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
@ 2026-12-01 20:30   ` sashiko-bot
  0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-12-01 20:30 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/meson: dw-hdmi: devm_phy_optional_get() masks unbound aux
  PHY as legacy
- [Low] drm/meson: dw-hdmi: unmet COMMON_CLK dependency for
  PHY_MESON_HDMI_TX
--

commit 4a5d79bfd8030c336301e39697e95c82dc0bc195
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY

This commit converts the Meson DW-HDMI driver to manage the HDMI TX PHY
through the generic PHY framework, with a legacy fallback for device
trees without a phys property, and adjusts suspend/resume ordering.

> diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
> index 6645665f60380..a91cf851314a6 100644
> --- a/drivers/gpu/drm/meson/Kconfig
> +++ b/drivers/gpu/drm/meson/Kconfig
> @@ -20,6 +20,7 @@ config DRM_MESON_DW_HDMI
>  	depends on PM
>  	default y if DRM_MESON
>  	select DRM_DW_HDMI
> +	select PHY_MESON_HDMI_TX
>  	imply DRM_DW_HDMI_I2S_AUDIO

[Severity: Low]
Can selecting PHY_MESON_HDMI_TX here cause an unmet direct dependency
warning on COMMON_CLK?

drivers/phy/amlogic/Kconfig:
    config PHY_MESON_HDMI_TX
    	tristate "Meson HDMI TX PHY driver"
    	depends on ARCH_MESON || COMPILE_TEST
    	depends on OF && COMMON_CLK

Neither DRM_MESON nor DRM_MESON_DW_HDMI depends on COMMON_CLK, so a
COMPILE_TEST=y build with COMMON_CLK=n and DRM_MESON_DW_HDMI enabled
selects PHY_MESON_HDMI_TX without its COMMON_CLK dependency satisfied.

> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> index 20a821936b3af..ec21d13775b70 100644
> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
[ ... ]
> @@ -746,7 +663,26 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
>  		return ret;
>  	}
>  
> -	meson_dw_hdmi_init(meson_dw_hdmi);
> +	meson_dw_hdmi->phy = devm_phy_optional_get(dev, NULL);
> +	if (IS_ERR(meson_dw_hdmi->phy))
> +		return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
> +				     "failed to get HDMI PHY\n");
> +
> +	if (!meson_dw_hdmi->phy) {
> +		/* DEPRECATED: DT without "phys" */
> +		dev_warn(dev, "missing \"phys\", using legacy HDMI PHY\n");
> +		meson_dw_hdmi->phy = meson_hdmi_phy_create_legacy(dev, priv->hhi,
> +						meson_dw_hdmi->data->phy_soc);
> +		if (IS_ERR(meson_dw_hdmi->phy))
> +			return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
> +					     "failed to create legacy HDMI PHY\n");
> +
> +		meson_dw_hdmi->legacy_phy = true;
> +	}

[Severity: Medium]
Can devm_phy_optional_get() return NULL even when the DT has a "phys"
property, causing meson_dw_hdmi_bind() to fall back to
meson_hdmi_phy_create_legacy() instead of deferring probe?

meson_gx_hhi_sysctrl_probe() registers the OF PHY provider with
of_phy_simple_xlate before creating the auxiliary device:

drivers/soc/amlogic/meson-gx-hhi-sysctrl.c:meson_gx_hhi_sysctrl_probe() {
    ...
	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
	if (IS_ERR(phy_provider))
		return dev_err_probe(dev, PTR_ERR(phy_provider),
				     "failed to register PHY provider\n");

	auxdev = devm_auxiliary_device_create(dev, phy_aux_name, NULL);
    ...
}

If meson_dw_hdmi_bind() runs after the provider is registered on the HHI
node but before meson_hdmi_phy_aux_driver binds to the auxiliary device
and creates the struct phy (for example when phy-meson-hdmi-tx is a
module or with asynchronous probing), of_phy_provider_lookup() succeeds
and calls of_phy_simple_xlate(), which returns -ENODEV because no device
in phy_class matches args->np yet.  devm_phy_optional_get() turns that
-ENODEV into NULL, so meson_dw_hdmi_bind() logs a false missing "phys"
warning and creates a duplicate legacy PHY on the same HHI registers
without a device link to the auxiliary PHY device.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=9

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
  2026-12-01 20:13 ` [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
@ 2026-12-01 20:32   ` sashiko-bot
  0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-12-01 20:32 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: amlogic: commit message does not match actual DT
  changes for GXBB
--

commit fcf18238b263f550f0b3a77c5b8cea3949082c54
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

> arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
>
> Describe the HDMI TX PHY as a child of the HHI system controller, with
> the amlogic,meson-gxbb-hdmi-tx-phy compatible and reference
> it from the HDMI TX node through "phys".
>
> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>

> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
> index 5c2fe9dc4f807..1e724958f4c57 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
> @@ -316,6 +316,7 @@ &hdmi_tx {
>  		 <&clkc CLKID_GCLK_VENCI_INT0>;
>  	clock-names = "isfr", "iahb", "venci";
>  	power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
> +	phys = <&sysctrl>;
>  
>  	assigned-clocks = <&clkc CLKID_HDMI_SEL>,
>  			  <&clkc CLKID_HDMI>;
> @@ -324,6 +325,8 @@ &hdmi_tx {
>  };
>  
>  &sysctrl {
> +	compatible = "amlogic,meson-gxbb-hhi-sysctrl", "simple-mfd", "syscon";
> +
>  	clkc: clock-controller {
>  		compatible = "amlogic,gxbb-clkc";
>  		#clock-cells = <1>;

[Severity: Medium]
Does the commit title and message match the actual changes in the patch?

The patch sets the compatible of &sysctrl to
"amlogic,meson-gxbb-hhi-sysctrl" and points &hdmi_tx's phys property
directly at &sysctrl, rather than adding a child PHY node with the
"amlogic,meson-gxbb-hdmi-tx-phy" compatible.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=12

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-12-01 20:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 01/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells Ronald Claveau via B4 Relay
2026-12-01 20:27   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver Ronald Claveau via B4 Relay
2026-12-01 20:24   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 04/13] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
2026-12-01 20:25   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 06/13] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 07/13] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 08/13] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
2026-12-01 20:30   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 10/13] arm64: dts: amlogic: g12: Use the HHI system controller as HDMI PHY provider Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 11/13] arm64: dts: amlogic: meson-gx: Add #phy-cells to the HHI system controller Ronald Claveau via B4 Relay
2026-12-01 20:13 ` [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
2026-12-01 20:32   ` sashiko-bot
2026-12-01 20:13 ` [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
2026-12-01 20:23   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox