* [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
@ 2026-11-17 19:33 Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 01/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
` (10 more replies)
0 siblings, 11 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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" and
"phy-names" 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-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
"hdmi-phy" child node under the HHI syscon.
- Patch 4: Add the new Meson HDMI TX PHY driver implementing the HDMI
PHY configuration ops, along with the temporary legacy creation
helper.
- Patch 5: Document the optional "phys" and "phy-names" properties in
the amlogic,meson-dw-hdmi binding.
- Patches 6-7: 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 8-10: Add the "hdmi-phy" child 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>
---
Ronald Claveau (10):
dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding
dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node
phy: amlogic: Add Meson HDMI TX PHY driver
dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names
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: Add HDMI TX PHY node for G12
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 | 8 +
.../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml | 33 +++
.../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml | 43 ++-
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 7 +
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +
drivers/gpu/drm/meson/Kconfig | 1 +
drivers/gpu/drm/meson/meson_dw_hdmi.c | 203 ++++++--------
drivers/phy/amlogic/Kconfig | 11 +
drivers/phy/amlogic/Makefile | 1 +
drivers/phy/amlogic/phy-meson-hdmi-tx.c | 309 +++++++++++++++++++++
include/linux/phy/phy-meson-hdmi-tx.h | 19 ++
12 files changed, 513 insertions(+), 136 deletions(-)
---
base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
Best regards,
--
Ronald Claveau <linux-kernel-dev@aliel.fr>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 01/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 02/10] dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding Ronald Claveau via B4 Relay
` (9 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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.
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.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 02/10] dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 01/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 03/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
` (8 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
Add a YAML binding for the HDMI TX PHY found on Amlogic Meson SoCs.
It covers the GXBB, GXL and G12A variants, which are described by
their own compatible strings:
- amlogic,meson-gxbb-hdmi-tx-phy
- amlogic,meson-gxl-hdmi-tx-phy
- amlogic,meson-g12a-hdmi-tx-phy
The PHY is a child of the HHI system controller.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
.../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/amlogic,meson-hdmi-tx-phy.yaml b/Documentation/devicetree/bindings/phy/amlogic,meson-hdmi-tx-phy.yaml
new file mode 100644
index 000000000000..c5dd1036c375
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/amlogic,meson-hdmi-tx-phy.yaml
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/amlogic,meson-hdmi-tx-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic HDMI TX PHY
+
+maintainers:
+ - Ronald Claveau <linux-kernel-dev@aliel.fr>
+
+properties:
+ compatible:
+ enum:
+ - amlogic,meson-gxbb-hdmi-tx-phy
+ - amlogic,meson-gxl-hdmi-tx-phy
+ - amlogic,meson-g12a-hdmi-tx-phy
+
+ "#phy-cells":
+ const: 0
+
+required:
+ - compatible
+ - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ hdmi-phy {
+ compatible = "amlogic,meson-gxbb-hdmi-tx-phy";
+ #phy-cells = <0>;
+ };
--
2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 03/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 01/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 02/10] dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 04/10] phy: amlogic: Add Meson HDMI TX PHY driver Ronald Claveau via B4 Relay
` (7 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
The HDMI TX PHY found on Amlogic Meson SoCs is a child of the HHI
system controller.
Add an optional "hdmi-phy" child node referencing the
amlogic,meson-hdmi-tx-phy binding, and add it to the example.
The node is forbidden for the other system controller variants.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
.../bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml | 11 +++++++++++
1 file changed, 11 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..97e47592aff2 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
@@ -36,6 +36,9 @@ properties:
phy:
type: object
+ hdmi-phy:
+ $ref: /schemas/phy/amlogic,meson-hdmi-tx-phy.yaml
+
allOf:
- if:
properties:
@@ -50,6 +53,7 @@ allOf:
pinctrl: false
phy: false
+ hdmi-phy: false
- if:
properties:
@@ -80,6 +84,7 @@ allOf:
power-controller: false
phy: false
+ hdmi-phy: false
- if:
properties:
@@ -104,6 +109,7 @@ allOf:
oneOf:
- $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
- $ref: /schemas/phy/amlogic,meson-axg-mipi-pcie-analog.yaml
+ hdmi-phy: false
required:
- compatible
@@ -155,6 +161,11 @@ examples:
clocks = <&clk_vpu>, <&clk_vapb>;
clock-names = "vpu", "vapb";
};
+
+ hdmi-phy {
+ compatible = "amlogic,meson-g12a-hdmi-tx-phy";
+ #phy-cells = <0>;
+ };
};
};
--
2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 04/10] phy: amlogic: Add Meson HDMI TX PHY driver
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (2 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 03/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names Ronald Claveau via B4 Relay
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
Add a 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 HHI system controller, of which the PHY node is a
child, so the regmap is obtained from the parent syscon.
The driver implements the generic PHY API with the 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 per-SoC register values and rate thresholds are taken from the
existing HDMI TX code, 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.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
drivers/phy/amlogic/Kconfig | 11 ++
drivers/phy/amlogic/Makefile | 1 +
drivers/phy/amlogic/phy-meson-hdmi-tx.c | 309 ++++++++++++++++++++++++++++++++
include/linux/phy/phy-meson-hdmi-tx.h | 19 ++
4 files changed, 340 insertions(+)
diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
index ce7ba3eb2a8e..14fcde8d88bc 100644
--- a/drivers/phy/amlogic/Kconfig
+++ b/drivers/phy/amlogic/Kconfig
@@ -105,3 +105,14 @@ config PHY_MESON_AXG_MIPI_DPHY
Enable this to support the Meson MIPI DPHY found in Meson AXG
SoCs.
If unsure, say N.
+
+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 PHY found on Amlogic
+ GXBB, GXL, GXM and G12A SoCs.
+ If unsure, say N.
diff --git a/drivers/phy/amlogic/Makefile b/drivers/phy/amlogic/Makefile
index 91e3b9790c03..fa7165700a93 100644
--- a/drivers/phy/amlogic/Makefile
+++ b/drivers/phy/amlogic/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_PHY_MESON_G12A_MIPI_DPHY_ANALOG) += phy-meson-g12a-mipi-dphy-analog
obj-$(CONFIG_PHY_MESON_AXG_PCIE) += phy-meson-axg-pcie.o
obj-$(CONFIG_PHY_MESON_AXG_MIPI_PCIE_ANALOG) += phy-meson-axg-mipi-pcie-analog.o
obj-$(CONFIG_PHY_MESON_AXG_MIPI_DPHY) += phy-meson-axg-mipi-dphy.o
+obj-$(CONFIG_PHY_MESON_HDMI_TX) += phy-meson-hdmi-tx.o
diff --git a/drivers/phy/amlogic/phy-meson-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
new file mode 100644
index 000000000000..69833a080dc3
--- /dev/null
+++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
@@ -0,0 +1,309 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Amlogic Meson HDMI TX PHY driver (GXBB / GXL / GXM / G12A)
+ *
+ * Copyright (C) 2026 Ronald Claveau <linux-kernel-dev@aliel.fr>
+ *
+ * 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/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>
+
+#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_CTRL_MASK GENMASK(3, 0)
+#define PHY_CNTL1_RESET 0xf /* enable + software reset */
+#define PHY_CNTL1_UNRESET 0xe /* enable + unreset */
+#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 */
+
+/* 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;
+ u32 cntl5; /* only used if has_cntl5 */
+};
+
+struct meson_hdmi_phy_data {
+ const struct meson_hdmi_phy_rate *rates;
+ unsigned int num_rates;
+ bool has_cntl5;
+ u32 cntl0_init;
+ u32 cntl1_init;
+};
+
+struct meson_hdmi_phy {
+ struct regmap *hhi;
+ const struct meson_hdmi_phy_data *data;
+};
+
+/* GXBB */
+static const struct meson_hdmi_phy_rate gxbb_rates[] = {
+ /* 5.94Gbps, 3.7125Gbps */
+ { 371250000, 0x33353245, 0x2100115b },
+ /* 2.97Gbps */
+ { 297000000, 0x33634283, 0xb000115b },
+ /* 1.485Gbps, and below */
+ { 0, 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, and below */
+ { 0, 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, and below */
+ { 0, 0x33eb4242, 0x2ab0ff3b, 0x00000003 },
+};
+
+static const struct meson_hdmi_phy_data gxbb_data = {
+ .rates = gxbb_rates,
+ .num_rates = ARRAY_SIZE(gxbb_rates),
+ .cntl0_init = 0x0,
+ .cntl1_init = PHY_CNTL1_INIT | PHY_INVERT,
+};
+
+static const struct meson_hdmi_phy_data gxl_data = {
+ .rates = gxl_rates,
+ .num_rates = ARRAY_SIZE(gxl_rates),
+ .cntl0_init = 0x0,
+ .cntl1_init = PHY_CNTL1_INIT,
+};
+
+static const struct meson_hdmi_phy_data g12a_data = {
+ .rates = g12a_rates,
+ .num_rates = ARRAY_SIZE(g12a_rates),
+ .has_cntl5 = true,
+ .cntl0_init = 0x000b4242, /* Bandgap */
+ .cntl1_init = PHY_CNTL1_INIT,
+};
+
+static const struct meson_hdmi_phy_rate *
+meson_hdmi_phy_find_rate(const struct meson_hdmi_phy_data *data, u64 rate)
+{
+ unsigned int i;
+
+ 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);
+
+ meson_hdmi_phy_set_init_state(priv);
+
+ return 0;
+}
+
+static int meson_hdmi_phy_configure(struct phy *phy,
+ union phy_configure_opts *opts)
+{
+ struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
+ 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);
+ 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, fifo, fifo_wr */
+ regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+ PHY_CNTL1_CTRL_MASK, 0);
+
+ return 0;
+}
+
+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);
+
+ if (mode != PHY_MODE_HDMI)
+ return -EINVAL;
+
+ if (opts->hdmi.bpc != 8)
+ return -EINVAL;
+
+ 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);
+ 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,
+ PHY_CNTL1_CTRL_MASK, PHY_CNTL1_RESET);
+ fsleep(2000);
+
+ /* Enable and unreset */
+ regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+ PHY_CNTL1_CTRL_MASK, PHY_CNTL1_UNRESET);
+ fsleep(2000);
+ }
+
+ return 0;
+}
+
+static int meson_hdmi_phy_power_off(struct phy *phy)
+{
+ struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
+
+ meson_hdmi_phy_set_init_state(priv);
+
+ return 0;
+}
+
+static const struct phy_ops meson_hdmi_phy_ops = {
+ .init = meson_hdmi_phy_init,
+ .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 struct phy *meson_hdmi_phy_alloc(struct device *dev,
+ struct regmap *hhi,
+ const struct meson_hdmi_phy_data *data)
+{
+ struct meson_hdmi_phy *priv;
+ struct phy *phy;
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return ERR_PTR(-ENOMEM);
+
+ priv->hhi = hhi;
+ priv->data = data;
+
+ phy = devm_phy_create(dev, NULL, &meson_hdmi_phy_ops);
+ if (IS_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, hhi, soc_data[soc]);
+}
+EXPORT_SYMBOL_GPL(meson_hdmi_phy_create_legacy);
+
+static int meson_hdmi_phy_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct phy_provider *provider;
+ struct regmap *hhi;
+ struct phy *phy;
+ const struct meson_hdmi_phy_data *data;
+
+ 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");
+
+ phy = meson_hdmi_phy_alloc(dev, hhi, data);
+ if (IS_ERR(phy))
+ return dev_err_probe(dev, PTR_ERR(phy),
+ "failed to create PHY\n");
+
+ provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+
+ return PTR_ERR_OR_ZERO(provider);
+}
+
+static const struct of_device_id meson_hdmi_phy_of_match[] = {
+ { .compatible = "amlogic,meson-gxbb-hdmi-tx-phy", .data = &gxbb_data },
+ { .compatible = "amlogic,meson-gxl-hdmi-tx-phy", .data = &gxl_data },
+ { .compatible = "amlogic,meson-g12a-hdmi-tx-phy", .data = &g12a_data },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
+
+static struct platform_driver meson_hdmi_phy_driver = {
+ .probe = meson_hdmi_phy_probe,
+ .driver = {
+ .name = "meson-hdmi-tx-phy",
+ .of_match_table = meson_hdmi_phy_of_match,
+ },
+};
+module_platform_driver(meson_hdmi_phy_driver);
+
+MODULE_AUTHOR("Ronald Claveau <linux-kernel-dev@aliel.fr>");
+MODULE_DESCRIPTION("Amlogic Meson HDMI TX PHY driver");
+MODULE_LICENSE("GPL");
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.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (3 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 04/10] phy: amlogic: Add Meson HDMI TX PHY driver Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-18 12:34 ` Neil Armstrong
2026-11-17 19:33 ` [PATCH 06/10] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
` (5 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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, named "hdmi" through "phy-names", and update
the example accordingly.
The properties are 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>
---
.../devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml | 8 ++++++++
1 file changed, 8 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..5a033fec21b0 100644
--- a/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
@@ -108,6 +108,12 @@ properties:
sound-name-prefix: true
+ phys:
+ maxItems: 1
+
+ phy-names:
+ const: hdmi
+
required:
- compatible
- reg
@@ -136,6 +142,8 @@ examples:
power-domains = <&pd_vpu>;
#address-cells = <1>;
#size-cells = <0>;
+ phys = <&hdmi_tx_phy>;
+ phy-names = "hdmi";
/* VPU VENC Input */
hdmi_tx_venc_port: port@0 {
--
2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 06/10] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (4 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 07/10] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
drivers/gpu/drm/meson/meson_dw_hdmi.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
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.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 07/10] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (5 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 06/10] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 08/10] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
drivers/gpu/drm/meson/Kconfig | 1 +
drivers/gpu/drm/meson/meson_dw_hdmi.c | 172 ++++++++++++----------------------
2 files changed, 59 insertions(+), 114 deletions(-)
diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
index 417f79829cf8..60bdbddaf5d0 100644
--- a/drivers/gpu/drm/meson/Kconfig
+++ b/drivers/gpu/drm/meson/Kconfig
@@ -19,6 +19,7 @@ config DRM_MESON_DW_HDMI
depends on DRM_MESON
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_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 20a821936b3a..f28cc1e6ee1d 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)
@@ -746,7 +662,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, "hdmi");
+ 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 */
@@ -784,6 +719,10 @@ 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);
+ phy_exit(meson_dw_hdmi->phy);
+ if (meson_dw_hdmi->legacy_phy)
+ devm_phy_destroy(dev, meson_dw_hdmi->phy);
+
devm_free_irq(dev, irq, meson_dw_hdmi);
dw_hdmi_unbind(meson_dw_hdmi->hdmi);
drm_bridge_put(meson_dw_hdmi->bridge);
@@ -801,6 +740,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 +752,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.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 08/10] arm64: dts: amlogic: Add HDMI TX PHY node for G12
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (6 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 07/10] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 09/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
` (2 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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-g12a-hdmi-tx-phy compatible and reference
it from the HDMI TX node through "phys" and "phy-names".
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 3135566df880..17d80b8139d6 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -210,6 +210,8 @@ hdmi_tx: hdmi-tx@0 {
<&clkc CLKID_HTX_PCLK>,
<&clkc CLKID_VPU_INTR>;
clock-names = "isfr", "iahb", "venci";
+ phys = <&hdmi_tx_phy>;
+ phy-names = "hdmi";
#address-cells = <1>;
#size-cells = <0>;
#sound-dai-cells = <0>;
@@ -1683,6 +1685,11 @@ mipi_analog_dphy: phy {
#phy-cells = <0>;
status = "disabled";
};
+
+ hdmi_tx_phy: hdmi-phy {
+ compatible = "amlogic,meson-g12a-hdmi-tx-phy";
+ #phy-cells = <0>;
+ };
};
};
--
2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 09/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (7 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 08/10] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 10/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
2026-11-18 12:38 ` [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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" and "phy-names".
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 5c2fe9dc4f80..1dfd5f6d0f68 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -316,6 +316,8 @@ &hdmi_tx {
<&clkc CLKID_GCLK_VENCI_INT0>;
clock-names = "isfr", "iahb", "venci";
power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
+ phys = <&hdmi_tx_phy>;
+ phy-names = "hdmi";
assigned-clocks = <&clkc CLKID_HDMI_SEL>,
<&clkc CLKID_HDMI>;
@@ -330,6 +332,11 @@ clkc: clock-controller {
clocks = <&xtal>;
clock-names = "xtal";
};
+
+ hdmi_tx_phy: hdmi-phy {
+ compatible = "amlogic,meson-gxbb-hdmi-tx-phy";
+ #phy-cells = <0>;
+ };
};
&hwrng {
--
2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 10/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXL
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (8 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 09/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
@ 2026-11-17 19:33 ` Ronald Claveau via B4 Relay
2026-11-18 12:38 ` [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
10 siblings, 0 replies; 17+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-17 19:33 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
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Ronald Claveau
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" and "phy-names".
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index f257fe3860f7..77d4e6b5b850 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -328,6 +328,8 @@ &hdmi_tx {
<&clkc CLKID_GCLK_VENCI_INT0>;
clock-names = "isfr", "iahb", "venci";
power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
+ phys = <&hdmi_tx_phy>;
+ phy-names = "hdmi";
assigned-clocks = <&clkc CLKID_HDMI_SEL>,
<&clkc CLKID_HDMI>;
@@ -342,6 +344,11 @@ clkc: clock-controller {
clocks = <&xtal>;
clock-names = "xtal";
};
+
+ hdmi_tx_phy: hdmi-phy {
+ compatible = "amlogic,meson-gxl-hdmi-tx-phy";
+ #phy-cells = <0>;
+ };
};
&hwrng {
--
2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names
2026-11-17 19:33 ` [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names Ronald Claveau via B4 Relay
@ 2026-11-18 12:34 ` Neil Armstrong
2026-11-18 19:10 ` linux-kernel-dev
0 siblings, 1 reply; 17+ messages in thread
From: Neil Armstrong @ 2026-11-18 12:34 UTC (permalink / raw)
To: linux-kernel-dev, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel
On 11/17/26 20:33, Ronald Claveau via B4 Relay wrote:
> 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, named "hdmi" through "phy-names", and update
> the example accordingly.
>
> The properties are 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>
> ---
> .../devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml | 8 ++++++++
> 1 file changed, 8 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..5a033fec21b0 100644
> --- a/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
> +++ b/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
> @@ -108,6 +108,12 @@ properties:
>
> sound-name-prefix: true
>
> + phys:
> + maxItems: 1
> +
> + phy-names:
> + const: hdmi
I don't think phys-name is necessary here.
Neil
> +
> required:
> - compatible
> - reg
> @@ -136,6 +142,8 @@ examples:
> power-domains = <&pd_vpu>;
> #address-cells = <1>;
> #size-cells = <0>;
> + phys = <&hdmi_tx_phy>;
> + phy-names = "hdmi";
>
> /* VPU VENC Input */
> hdmi_tx_venc_port: port@0 {
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
` (9 preceding siblings ...)
2026-11-17 19:33 ` [PATCH 10/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
@ 2026-11-18 12:38 ` Neil Armstrong
2026-11-18 19:35 ` linux-kernel-dev
10 siblings, 1 reply; 17+ messages in thread
From: Neil Armstrong @ 2026-11-18 12:38 UTC (permalink / raw)
To: linux-kernel-dev, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel
Hi,
On 11/17/26 20:33, Ronald Claveau via B4 Relay wrote:
> 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" and
> "phy-names" 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-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
> add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
> "hdmi-phy" child node under the HHI syscon.
> - Patch 4: Add the new Meson HDMI TX PHY driver implementing the HDMI
> PHY configuration ops, along with the temporary legacy creation
> helper.
> - Patch 5: Document the optional "phys" and "phy-names" properties in
> the amlogic,meson-dw-hdmi binding.
> - Patches 6-7: 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 8-10: Add the "hdmi-phy" child 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>
> ---
> Ronald Claveau (10):
> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
> dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding
> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node
> phy: amlogic: Add Meson HDMI TX PHY driver
> dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names
> 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: Add HDMI TX PHY node for G12
> 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 | 8 +
> .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml | 33 +++
> .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml | 43 ++-
> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 7 +
> arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +
> arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +
> drivers/gpu/drm/meson/Kconfig | 1 +
> drivers/gpu/drm/meson/meson_dw_hdmi.c | 203 ++++++--------
> drivers/phy/amlogic/Kconfig | 11 +
> drivers/phy/amlogic/Makefile | 1 +
> drivers/phy/amlogic/phy-meson-hdmi-tx.c | 309 +++++++++++++++++++++
> include/linux/phy/phy-meson-hdmi-tx.h | 19 ++
> 12 files changed, 513 insertions(+), 136 deletions(-)
> ---
> base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
> change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
>
> Best regards,
> --
> Ronald Claveau <linux-kernel-dev@aliel.fr>
Overall it's very good, but I would've prefered a more sequencial move
to the PHY driver, with an exact copy of the code and simplification
towards the current PHY code.
Anyway, the sashiko review comments are good, especially the one on
patch 6 to keep the driver working on old DTs, sorry my bad...
Neil
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names
2026-11-18 12:34 ` Neil Armstrong
@ 2026-11-18 19:10 ` linux-kernel-dev
0 siblings, 0 replies; 17+ messages in thread
From: linux-kernel-dev @ 2026-11-18 19:10 UTC (permalink / raw)
To: Neil Armstrong
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Vinod Koul, Manivannan Sadhasivam, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
On 11/18/26 13:34, Neil Armstrong wrote:
> On 11/17/26 20:33, Ronald Claveau via B4 Relay wrote:
>> 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, named "hdmi" through "phy-names", and update
>> the example accordingly.
>>
>> The properties are 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>
>> ---
>> .../devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml |
>> 8 ++++++++
>> 1 file changed, 8 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..5a033fec21b0 100644
>> --- a/Documentation/devicetree/bindings/display/amlogic,meson-dw-
>> hdmi.yaml
>> +++ b/Documentation/devicetree/bindings/display/amlogic,meson-dw-
>> hdmi.yaml
>> @@ -108,6 +108,12 @@ properties:
>> sound-name-prefix: true
>> + phys:
>> + maxItems: 1
>> +
>> + phy-names:
>> + const: hdmi
>
> I don't think phys-name is necessary here.
Ok, I will drop phy-names and use NULL as name in the driver instead.
>
>> +
>> required:
>> - compatible
>> - reg
>> @@ -136,6 +142,8 @@ examples:
>> power-domains = <&pd_vpu>;
>> #address-cells = <1>;
>> #size-cells = <0>;
>> + phys = <&hdmi_tx_phy>;
>> + phy-names = "hdmi";
>> /* VPU VENC Input */
>> hdmi_tx_venc_port: port@0 {
>>
>
--
Best regards,
Ronald
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
2026-11-18 12:38 ` [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
@ 2026-11-18 19:35 ` linux-kernel-dev
2026-11-19 7:58 ` Neil Armstrong
0 siblings, 1 reply; 17+ messages in thread
From: linux-kernel-dev @ 2026-11-18 19:35 UTC (permalink / raw)
To: Neil Armstrong
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Vinod Koul, Manivannan Sadhasivam, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
On 11/18/26 13:38, Neil Armstrong wrote:
> Hi,
>
> On 11/17/26 20:33, Ronald Claveau via B4 Relay wrote:
>> 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" and
>> "phy-names" 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-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
>> add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
>> "hdmi-phy" child node under the HHI syscon.
>> - Patch 4: Add the new Meson HDMI TX PHY driver implementing the HDMI
>> PHY configuration ops, along with the temporary legacy creation
>> helper.
>> - Patch 5: Document the optional "phys" and "phy-names" properties in
>> the amlogic,meson-dw-hdmi binding.
>> - Patches 6-7: 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 8-10: Add the "hdmi-phy" child 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>
>> ---
>> Ronald Claveau (10):
>> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible
>> matching in conditionals
>> dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding
>> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy
>> child node
>> phy: amlogic: Add Meson HDMI TX PHY driver
>> dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-
>> names
>> 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: Add HDMI TX PHY node for G12
>> 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 | 8 +
>> .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml | 33 +++
>> .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml | 43 ++-
>> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 7 +
>> arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +
>> arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +
>> drivers/gpu/drm/meson/Kconfig | 1 +
>> drivers/gpu/drm/meson/meson_dw_hdmi.c | 203 ++++++--------
>> drivers/phy/amlogic/Kconfig | 11 +
>> drivers/phy/amlogic/Makefile | 1 +
>> drivers/phy/amlogic/phy-meson-hdmi-tx.c | 309 +++++++++++
>> ++++++++++
>> include/linux/phy/phy-meson-hdmi-tx.h | 19 ++
>> 12 files changed, 513 insertions(+), 136 deletions(-)
>> ---
>> base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
>> change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
>>
>> Best regards,
>> --
>> Ronald Claveau <linux-kernel-dev@aliel.fr>
>
> Overall it's very good, but I would've prefered a more sequencial move
> to the PHY driver, with an exact copy of the code and simplification
> towards the current PHY code.
>
> Anyway, the sashiko review comments are good, especially the one on
> patch 6 to keep the driver working on old DTs, sorry my bad...
>
> Neil
Thanks for your feedback, I am analyzing/testing sashiko feedback.
About the suspend/resume unbind/bind, I do not have any issue on my
side, but I can change the orders.
About patch 6 and the old DTs, I will reintroduce them with the legacy
check. Do you know what would be a good timeline to add a require on
those elements and drop the fallback code ?
--
Best regards,
Ronald
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
2026-11-18 19:35 ` linux-kernel-dev
@ 2026-11-19 7:58 ` Neil Armstrong
2026-11-19 15:33 ` linux-kernel-dev
0 siblings, 1 reply; 17+ messages in thread
From: Neil Armstrong @ 2026-11-19 7:58 UTC (permalink / raw)
To: linux-kernel-dev
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Vinod Koul, Manivannan Sadhasivam, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
On 11/18/26 20:35, linux-kernel-dev@aliel.fr wrote:
> On 11/18/26 13:38, Neil Armstrong wrote:
>> Hi,
>>
>> On 11/17/26 20:33, Ronald Claveau via B4 Relay wrote:
>>> 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" and
>>> "phy-names" 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-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
>>> add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
>>> "hdmi-phy" child node under the HHI syscon.
>>> - Patch 4: Add the new Meson HDMI TX PHY driver implementing the HDMI
>>> PHY configuration ops, along with the temporary legacy creation
>>> helper.
>>> - Patch 5: Document the optional "phys" and "phy-names" properties in
>>> the amlogic,meson-dw-hdmi binding.
>>> - Patches 6-7: 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 8-10: Add the "hdmi-phy" child 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>
>>> ---
>>> Ronald Claveau (10):
>>> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible
>>> matching in conditionals
>>> dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding
>>> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy
>>> child node
>>> phy: amlogic: Add Meson HDMI TX PHY driver
>>> dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-
>>> names
>>> 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: Add HDMI TX PHY node for G12
>>> 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 | 8 +
>>> .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml | 33 +++
>>> .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml | 43 ++-
>>> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 7 +
>>> arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +
>>> arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +
>>> drivers/gpu/drm/meson/Kconfig | 1 +
>>> drivers/gpu/drm/meson/meson_dw_hdmi.c | 203 ++++++--------
>>> drivers/phy/amlogic/Kconfig | 11 +
>>> drivers/phy/amlogic/Makefile | 1 +
>>> drivers/phy/amlogic/phy-meson-hdmi-tx.c | 309 +++++++++++
>>> ++++++++++
>>> include/linux/phy/phy-meson-hdmi-tx.h | 19 ++
>>> 12 files changed, 513 insertions(+), 136 deletions(-)
>>> ---
>>> base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
>>> change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
>>>
>>> Best regards,
>>> --
>>> Ronald Claveau <linux-kernel-dev@aliel.fr>
>>
>> Overall it's very good, but I would've prefered a more sequencial move
>> to the PHY driver, with an exact copy of the code and simplification
>> towards the current PHY code.
>>
>> Anyway, the sashiko review comments are good, especially the one on
>> patch 6 to keep the driver working on old DTs, sorry my bad...
>>
>> Neil
>
> Thanks for your feedback, I am analyzing/testing sashiko feedback.
>
> About the suspend/resume unbind/bind, I do not have any issue on my
> side, but I can change the orders.
>
> About patch 6 and the old DTs, I will reintroduce them with the legacy
> check. Do you know what would be a good timeline to add a require on
> those elements and drop the fallback code ?
>
The problem is not necessarily the kernel DT but the U-Boot DT which
could be used by the kernel.
The U-Boot DT was using v6.2 before v2024.07 and after it uses the synchronized
DT from Linux, which coincides with the v6.11 DT which contains the DT clocks
changes.
It seems most of the SBCs distro uses recent U-Boot versions, and some nice distro
ships older U-Boot version, so it could break on those if a new kernel was deployed.
But, U-Boot already set HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0 when probing dw_hdmi
since 2019.04 so considering that I thing the risk is super low.
Add this to your commit message and send a v2.
Neil
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
2026-11-19 7:58 ` Neil Armstrong
@ 2026-11-19 15:33 ` linux-kernel-dev
0 siblings, 0 replies; 17+ messages in thread
From: linux-kernel-dev @ 2026-11-19 15:33 UTC (permalink / raw)
To: Neil Armstrong
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
linux-phy, dri-devel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Vinod Koul, Manivannan Sadhasivam, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
On 11/19/26 08:58, Neil Armstrong wrote:
> On 11/18/26 20:35, linux-kernel-dev@aliel.fr wrote:
>> On 11/18/26 13:38, Neil Armstrong wrote:
>>> Hi,
>>>
>>> On 11/17/26 20:33, Ronald Claveau via B4 Relay wrote:
>>>> 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"
>>>> and
>>>> "phy-names" 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-3: Fix compatible matching in meson-gx-hhi-sysctrl
>>>> bindings,
>>>> add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
>>>> "hdmi-phy" child node under the HHI syscon.
>>>> - Patch 4: Add the new Meson HDMI TX PHY driver implementing the HDMI
>>>> PHY configuration ops, along with the temporary legacy creation
>>>> helper.
>>>> - Patch 5: Document the optional "phys" and "phy-names" properties in
>>>> the amlogic,meson-dw-hdmi binding.
>>>> - Patches 6-7: 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 8-10: Add the "hdmi-phy" child 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>
>>>> ---
>>>> Ronald Claveau (10):
>>>> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible
>>>> matching in conditionals
>>>> dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding
>>>> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy
>>>> child node
>>>> phy: amlogic: Add Meson HDMI TX PHY driver
>>>> dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-
>>>> names
>>>> 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: Add HDMI TX PHY node for G12
>>>> 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 | 8 +
>>>> .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml | 33 +++
>>>> .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml | 43 ++-
>>>> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 7 +
>>>> arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +
>>>> arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +
>>>> drivers/gpu/drm/meson/Kconfig | 1 +
>>>> drivers/gpu/drm/meson/meson_dw_hdmi.c | 203 +++++
>>>> +--------
>>>> drivers/phy/amlogic/Kconfig | 11 +
>>>> drivers/phy/amlogic/Makefile | 1 +
>>>> drivers/phy/amlogic/phy-meson-hdmi-tx.c | 309 +++++++++++
>>>> ++++++++++
>>>> include/linux/phy/phy-meson-hdmi-tx.h | 19 ++
>>>> 12 files changed, 513 insertions(+), 136 deletions(-)
>>>> ---
>>>> base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
>>>> change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
>>>>
>>>> Best regards,
>>>> --
>>>> Ronald Claveau <linux-kernel-dev@aliel.fr>
>>>
>>> Overall it's very good, but I would've prefered a more sequencial move
>>> to the PHY driver, with an exact copy of the code and simplification
>>> towards the current PHY code.
>>>
>>> Anyway, the sashiko review comments are good, especially the one on
>>> patch 6 to keep the driver working on old DTs, sorry my bad...
>>>
>>> Neil
>>
>> Thanks for your feedback, I am analyzing/testing sashiko feedback.
>>
>> About the suspend/resume unbind/bind, I do not have any issue on my
>> side, but I can change the orders.
>>
>> About patch 6 and the old DTs, I will reintroduce them with the legacy
>> check. Do you know what would be a good timeline to add a require on
>> those elements and drop the fallback code ?
>>
>
> The problem is not necessarily the kernel DT but the U-Boot DT which
> could be used by the kernel.
>
> The U-Boot DT was using v6.2 before v2024.07 and after it uses the
> synchronized
> DT from Linux, which coincides with the v6.11 DT which contains the DT
> clocks
> changes.
>
> It seems most of the SBCs distro uses recent U-Boot versions, and some
> nice distro
> ships older U-Boot version, so it could break on those if a new kernel
> was deployed.
>
> But, U-Boot already set HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0 when
> probing dw_hdmi
> since 2019.04 so considering that I thing the risk is super low.
>
> Add this to your commit message and send a v2.
Crystal clear, will add that in v2.
--
Best regards,
Ronald
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-11-19 15:33 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 19:33 [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 01/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 02/10] dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 03/10] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 04/10] phy: amlogic: Add Meson HDMI TX PHY driver Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 05/10] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys and phy-names Ronald Claveau via B4 Relay
2026-11-18 12:34 ` Neil Armstrong
2026-11-18 19:10 ` linux-kernel-dev
2026-11-17 19:33 ` [PATCH 06/10] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 07/10] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 08/10] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 09/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
2026-11-17 19:33 ` [PATCH 10/10] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
2026-11-18 12:38 ` [PATCH 00/10] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
2026-11-18 19:35 ` linux-kernel-dev
2026-11-19 7:58 ` Neil Armstrong
2026-11-19 15:33 ` linux-kernel-dev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®