From: Vinod Koul <vkoul@kernel.org>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Andy Yan" <andy.yan@rock-chips.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Emil Renner Berthing" <kernel@esmil.dk>,
"Hal Feng" <hal.feng@starfivetech.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Dominique Belhachemi" <db@domibel.de>,
"Brian Masney" <bmasney+clk@redhat.com>,
"Jerome Brunet" <jbrunet+clk@baylibre.com>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-riscv@lists.infradead.org,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Maud Spierings" <maud_spierings@murena.io>,
"Graham Markall" <hello@big-grey.co.uk>,
"Icenowy Zheng" <zhengxingda@iscas.ac.cn>,
"Chaoyi Chen" <chaoyi.chen@rock-chips.com>,
"Joshua Peisach" <jpeisach@ubuntu.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: Re: [PATCH v5 19/21] phy: starfive: Add jh7110-inno-hdmi-phy driver
Date: Sat, 3 Oct 2026 16:25:01 +0200 [thread overview]
Message-ID: <asEQPf-oKbt_DSp3@parshuram> (raw)
In-Reply-To: <20260929-jh7110-clean-send-v5-19-82b4d8e3c6c7@samsung.com>
On 29-09-26, 12:31, Michal Wilczynski wrote:
> Add the HDMI PHY driver for the StarFive JH7110.
>
> This driver binds to the starfive,jh7110-inno-hdmi-phy node and
> gets its regmap from the parent. It has no dependencies on voutcrg, only
> on its reference oscillator (xin24m), which breaks the probe-time
> circular dependency.
>
> This driver provides two main functions:
> - Clock Provider: It registers clk_ops to provide the variable pixel
> clock. The .set_rate operation configures the Pre-PLL registers
> (0x1a0+) based on the requested rate.
>
> - PHY Provider: It registers phy_ops for the controller. The .power_on
> op configures and enables the Post-PLL and other analog blocks (BIAS,
> LDO, Serializer, etc.).
>
> The clock ops reach registers in the window shared with the HDMI
> controller, and access to that window is gated by the controller's
> system clock, which only the sibling controller driver holds. The clock
> framework walks every registered clock regardless of which drivers have
> bound, so deliberately do not implement .is_prepared, which lets the
> framework fall back to the software prepare count, and return the cached
> rate from .recalc_rate whenever the clock is not prepared. Without this,
> clk_disable_unused() reads a PHY register with that clock gated and the
> resulting stalled bus transaction wedges the CPU hard enough that it
> stops responding to NMIs. It is reproducible by building the bridge
> driver as a module so that the controller has not bound by then.
>
> The JH7110 instantiates the same Innosilicon IP as the Rockchip RK3328,
> with the PHY register block shifted by 0x100 because it sits behind the
> HDMI controller in the shared register space. The pre-PLL programming
> therefore comes from the common Innosilicon helpers; this driver adds
> the JH7110 pixel clock table, the post-PLL and the analog configuration.
>
> Co-developed-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
> drivers/phy/starfive/Kconfig | 20 +
> drivers/phy/starfive/Makefile | 1 +
> drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 582 ++++++++++++++++++++++++++++
> 3 files changed, 603 insertions(+)
>
> diff --git a/drivers/phy/starfive/Kconfig b/drivers/phy/starfive/Kconfig
> index d0cdd7cb4a13de22ff643c89a79d99cce57284d7..1da417ffbf224c13224e42a3ce322e3d0c272824 100644
> --- a/drivers/phy/starfive/Kconfig
> +++ b/drivers/phy/starfive/Kconfig
> @@ -25,6 +25,26 @@ config PHY_STARFIVE_JH7110_DPHY_TX
> system. If M is selected, the module will be called
> phy-jh7110-dphy-tx.ko.
>
> +config PHY_STARFIVE_JH7110_INNO_HDMI
> + tristate "Starfive JH7110 INNO HDMI PHY"
> + select PHY_INNO_HDMI
> + depends on COMMON_CLK
> + select GENERIC_PHY
> + help
> + This option enables the driver for the analog HDMI PHY (Physical
> + Layer) on the StarFive JH7110 SoC.
> +
> + This driver binds to a child node of the 'starfive,jh7110-hdmi-subsystem'
> + parent driver and gets its register map from that parent.
> +
> + It is responsible for two main functions:
> + 1. PHY Provider: It provides standard PHY operations (.power_on,
> + .power_off) for the HDMI controller (bridge) driver. This
> + involves configuring the Post-PLL and analog TMDS blocks.
> + 2. Clock Provider: It registers as a clock provider to supply the
> + variable pixel clock (hdmi_pclk) to the HDMI controller and
> + the VOUT subsystem, which it generates using the Pre-PLL.
> +
> config PHY_STARFIVE_JH7110_PCIE
> tristate "Starfive JH7110 PCIE 2.0/USB 3.0 PHY support"
> depends on HAS_IOMEM
> diff --git a/drivers/phy/starfive/Makefile b/drivers/phy/starfive/Makefile
> index eedc4a6fec156320c99ac0a0da609083b6a6a695..e7b13f00880b500f933f21b6037384d5c6884e3e 100644
> --- a/drivers/phy/starfive/Makefile
> +++ b/drivers/phy/starfive/Makefile
> @@ -1,5 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_RX) += phy-jh7110-dphy-rx.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_TX) += phy-jh7110-dphy-tx.o
> +obj-$(CONFIG_PHY_STARFIVE_JH7110_INNO_HDMI) += phy-jh7110-inno-hdmi.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_PCIE) += phy-jh7110-pcie.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_USB) += phy-jh7110-usb.o
> diff --git a/drivers/phy/starfive/phy-jh7110-inno-hdmi.c b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..cba6f3c3dae40bd982c062c8504438f51f3b30be
> --- /dev/null
> +++ b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> @@ -0,0 +1,582 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2017 Rockchip Electronics Co. Ltd.
> + * Copyright (c) 2025 Samsung Electronics Co., Ltd.
> + *
> + * Author: Zheng Yang <zhengyang@rock-chips.com>
> + * Author: Michal Wilczynski <m.wilczynski@samsung.com>
> + *
> + * The register layout and programming sequence derive from
> + * drivers/phy/rockchip/phy-rockchip-inno-hdmi.c; the JH7110 places the
> + * same Innosilicon PHY block at a 0x100 register offset.
> + *
> + * This driver handles the PHY portion of the StarFive Innosilicon HDMI IP,
> + * which is part of a monolithic HDMI block. It provides the variable pixel
> + * clock (from the Pre-PLL) and the PHY operations (for the Post-PLL/analog).
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/iopoll.h>
> +#include <linux/math64.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/phy/inno-hdmi-phy.h>
> +#include <linux/phy/phy.h>
> +#include <linux/slab.h>
> +
> +/*
> + * StarFive (JH7110) Innosilicon HDMI PHY Register Definitions
> + */
> +
> +/* REG: 0x1aa */
> +#define STF_INNO_POST_PLL_DIV_1 0x1aa
> +#define STF_INNO_POST_PLL_POST_DIV_ENABLE GENMASK(3, 2)
> +#define STF_INNO_POST_PLL_REFCLK_SEL_TMDS BIT(1)
> +#define STF_INNO_POST_PLL_POWER_DOWN BIT(0)
> +
> +/* REG: 0x1ab */
> +#define STF_INNO_POST_PLL_DIV_2 0x1ab
> +#define STF_INNO_POST_PLL_PRE_DIV(x) FIELD_PREP(GENMASK(5, 0), x)
> +#define STF_INNO_POST_PLL_FB_DIV_8(x) FIELD_PREP(BIT(7), (x) >> 8)
> +
> +/* REG: 0x1ac */
> +#define STF_INNO_POST_PLL_DIV_3 0x1ac
> +#define STF_INNO_POST_PLL_FB_DIV_7_0(x) FIELD_PREP(GENMASK(7, 0), x)
> +
> +/* REG: 0x1ad */
> +#define STF_INNO_POST_PLL_DIV_4 0x1ad
> +#define STF_INNO_POST_PLL_POST_DIV_MASK GENMASK(1, 0)
> +
> +/* REG: 0x1af */
> +#define STF_INNO_POST_PLL_LOCK_STATUS 0x1af
> +#define STF_INNO_POST_PLL_LOCK BIT(0)
> +
> +/* REG: 0x1b0 */
> +#define STF_INNO_BIAS_CONTROL 0x1b0
> +#define STF_INNO_BIAS_ENABLE BIT(2)
> +
> +/* REG: 0x1b2 */
> +#define STF_INNO_TMDS_CONTROL 0x1b2
> +#define STF_INNO_TMDS_CLK_DRIVER_EN BIT(3)
> +#define STF_INNO_TMDS_D2_DRIVER_EN BIT(2)
> +#define STF_INNO_TMDS_D1_DRIVER_EN BIT(1)
> +#define STF_INNO_TMDS_D0_DRIVER_EN BIT(0)
> +#define STF_INNO_TMDS_DRIVER_ENABLE (STF_INNO_TMDS_CLK_DRIVER_EN | \
> + STF_INNO_TMDS_D2_DRIVER_EN | \
> + STF_INNO_TMDS_D1_DRIVER_EN | \
> + STF_INNO_TMDS_D0_DRIVER_EN)
> +
> +/* REG: 0x1b4 */
> +#define STF_INNO_LDO_CONTROL 0x1b4
> +#define STF_INNO_LDO_ENABLE (BIT(2) | BIT(1) | BIT(0))
> +
> +/* REG: 0x1be */
> +#define STF_INNO_SERIALIER_CONTROL 0x1be
> +#define STF_INNO_SERIALIER_ENABLE (BIT(6) | BIT(5) | BIT(4) | BIT(0))
> +
> +/* REG: 0x1cc */
> +#define STF_INNO_RX_CONTROL 0x1cc
> +#define STF_INNO_RX_ENABLE (BIT(3) | BIT(2) | BIT(1) | BIT(0))
> +
> +/*
> + * These tables are copied from the monolithic driver.
> + * They match the Rockchip PHY driver tables.
> + */
> +
> +struct post_pll_config {
> + unsigned long tmdsclock;
> + u8 prediv;
> + u16 fbdiv;
> + u8 postdiv;
> + u8 post_div_en;
> +};
> +
> +static const struct inno_hdmi_phy_pre_pll_config pre_pll_cfg_table[] = {
> + { 25175000, 25175000, 1, 100, 2, 3, 3, 12, 3, 3, 4, 0, 0xF55555 },
lower case hex values, here and everywhere else please
--
~Vinod
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Andy Yan" <andy.yan@rock-chips.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Emil Renner Berthing" <kernel@esmil.dk>,
"Hal Feng" <hal.feng@starfivetech.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Dominique Belhachemi" <db@domibel.de>,
"Brian Masney" <bmasney+clk@redhat.com>,
"Jerome Brunet" <jbrunet+clk@baylibre.com>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-riscv@lists.infradead.org,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Maud Spierings" <maud_spierings@murena.io>,
"Graham Markall" <hello@big-grey.co.uk>,
"Icenowy Zheng" <zhengxingda@iscas.ac.cn>,
"Chaoyi Chen" <chaoyi.chen@rock-chips.com>,
"Joshua Peisach" <jpeisach@ubuntu.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: Re: [PATCH v5 19/21] phy: starfive: Add jh7110-inno-hdmi-phy driver
Date: Sat, 3 Oct 2026 16:25:01 +0200 [thread overview]
Message-ID: <asEQPf-oKbt_DSp3@parshuram> (raw)
In-Reply-To: <20260929-jh7110-clean-send-v5-19-82b4d8e3c6c7@samsung.com>
On 29-09-26, 12:31, Michal Wilczynski wrote:
> Add the HDMI PHY driver for the StarFive JH7110.
>
> This driver binds to the starfive,jh7110-inno-hdmi-phy node and
> gets its regmap from the parent. It has no dependencies on voutcrg, only
> on its reference oscillator (xin24m), which breaks the probe-time
> circular dependency.
>
> This driver provides two main functions:
> - Clock Provider: It registers clk_ops to provide the variable pixel
> clock. The .set_rate operation configures the Pre-PLL registers
> (0x1a0+) based on the requested rate.
>
> - PHY Provider: It registers phy_ops for the controller. The .power_on
> op configures and enables the Post-PLL and other analog blocks (BIAS,
> LDO, Serializer, etc.).
>
> The clock ops reach registers in the window shared with the HDMI
> controller, and access to that window is gated by the controller's
> system clock, which only the sibling controller driver holds. The clock
> framework walks every registered clock regardless of which drivers have
> bound, so deliberately do not implement .is_prepared, which lets the
> framework fall back to the software prepare count, and return the cached
> rate from .recalc_rate whenever the clock is not prepared. Without this,
> clk_disable_unused() reads a PHY register with that clock gated and the
> resulting stalled bus transaction wedges the CPU hard enough that it
> stops responding to NMIs. It is reproducible by building the bridge
> driver as a module so that the controller has not bound by then.
>
> The JH7110 instantiates the same Innosilicon IP as the Rockchip RK3328,
> with the PHY register block shifted by 0x100 because it sits behind the
> HDMI controller in the shared register space. The pre-PLL programming
> therefore comes from the common Innosilicon helpers; this driver adds
> the JH7110 pixel clock table, the post-PLL and the analog configuration.
>
> Co-developed-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
> drivers/phy/starfive/Kconfig | 20 +
> drivers/phy/starfive/Makefile | 1 +
> drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 582 ++++++++++++++++++++++++++++
> 3 files changed, 603 insertions(+)
>
> diff --git a/drivers/phy/starfive/Kconfig b/drivers/phy/starfive/Kconfig
> index d0cdd7cb4a13de22ff643c89a79d99cce57284d7..1da417ffbf224c13224e42a3ce322e3d0c272824 100644
> --- a/drivers/phy/starfive/Kconfig
> +++ b/drivers/phy/starfive/Kconfig
> @@ -25,6 +25,26 @@ config PHY_STARFIVE_JH7110_DPHY_TX
> system. If M is selected, the module will be called
> phy-jh7110-dphy-tx.ko.
>
> +config PHY_STARFIVE_JH7110_INNO_HDMI
> + tristate "Starfive JH7110 INNO HDMI PHY"
> + select PHY_INNO_HDMI
> + depends on COMMON_CLK
> + select GENERIC_PHY
> + help
> + This option enables the driver for the analog HDMI PHY (Physical
> + Layer) on the StarFive JH7110 SoC.
> +
> + This driver binds to a child node of the 'starfive,jh7110-hdmi-subsystem'
> + parent driver and gets its register map from that parent.
> +
> + It is responsible for two main functions:
> + 1. PHY Provider: It provides standard PHY operations (.power_on,
> + .power_off) for the HDMI controller (bridge) driver. This
> + involves configuring the Post-PLL and analog TMDS blocks.
> + 2. Clock Provider: It registers as a clock provider to supply the
> + variable pixel clock (hdmi_pclk) to the HDMI controller and
> + the VOUT subsystem, which it generates using the Pre-PLL.
> +
> config PHY_STARFIVE_JH7110_PCIE
> tristate "Starfive JH7110 PCIE 2.0/USB 3.0 PHY support"
> depends on HAS_IOMEM
> diff --git a/drivers/phy/starfive/Makefile b/drivers/phy/starfive/Makefile
> index eedc4a6fec156320c99ac0a0da609083b6a6a695..e7b13f00880b500f933f21b6037384d5c6884e3e 100644
> --- a/drivers/phy/starfive/Makefile
> +++ b/drivers/phy/starfive/Makefile
> @@ -1,5 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_RX) += phy-jh7110-dphy-rx.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_TX) += phy-jh7110-dphy-tx.o
> +obj-$(CONFIG_PHY_STARFIVE_JH7110_INNO_HDMI) += phy-jh7110-inno-hdmi.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_PCIE) += phy-jh7110-pcie.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_USB) += phy-jh7110-usb.o
> diff --git a/drivers/phy/starfive/phy-jh7110-inno-hdmi.c b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..cba6f3c3dae40bd982c062c8504438f51f3b30be
> --- /dev/null
> +++ b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> @@ -0,0 +1,582 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2017 Rockchip Electronics Co. Ltd.
> + * Copyright (c) 2025 Samsung Electronics Co., Ltd.
> + *
> + * Author: Zheng Yang <zhengyang@rock-chips.com>
> + * Author: Michal Wilczynski <m.wilczynski@samsung.com>
> + *
> + * The register layout and programming sequence derive from
> + * drivers/phy/rockchip/phy-rockchip-inno-hdmi.c; the JH7110 places the
> + * same Innosilicon PHY block at a 0x100 register offset.
> + *
> + * This driver handles the PHY portion of the StarFive Innosilicon HDMI IP,
> + * which is part of a monolithic HDMI block. It provides the variable pixel
> + * clock (from the Pre-PLL) and the PHY operations (for the Post-PLL/analog).
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/iopoll.h>
> +#include <linux/math64.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/phy/inno-hdmi-phy.h>
> +#include <linux/phy/phy.h>
> +#include <linux/slab.h>
> +
> +/*
> + * StarFive (JH7110) Innosilicon HDMI PHY Register Definitions
> + */
> +
> +/* REG: 0x1aa */
> +#define STF_INNO_POST_PLL_DIV_1 0x1aa
> +#define STF_INNO_POST_PLL_POST_DIV_ENABLE GENMASK(3, 2)
> +#define STF_INNO_POST_PLL_REFCLK_SEL_TMDS BIT(1)
> +#define STF_INNO_POST_PLL_POWER_DOWN BIT(0)
> +
> +/* REG: 0x1ab */
> +#define STF_INNO_POST_PLL_DIV_2 0x1ab
> +#define STF_INNO_POST_PLL_PRE_DIV(x) FIELD_PREP(GENMASK(5, 0), x)
> +#define STF_INNO_POST_PLL_FB_DIV_8(x) FIELD_PREP(BIT(7), (x) >> 8)
> +
> +/* REG: 0x1ac */
> +#define STF_INNO_POST_PLL_DIV_3 0x1ac
> +#define STF_INNO_POST_PLL_FB_DIV_7_0(x) FIELD_PREP(GENMASK(7, 0), x)
> +
> +/* REG: 0x1ad */
> +#define STF_INNO_POST_PLL_DIV_4 0x1ad
> +#define STF_INNO_POST_PLL_POST_DIV_MASK GENMASK(1, 0)
> +
> +/* REG: 0x1af */
> +#define STF_INNO_POST_PLL_LOCK_STATUS 0x1af
> +#define STF_INNO_POST_PLL_LOCK BIT(0)
> +
> +/* REG: 0x1b0 */
> +#define STF_INNO_BIAS_CONTROL 0x1b0
> +#define STF_INNO_BIAS_ENABLE BIT(2)
> +
> +/* REG: 0x1b2 */
> +#define STF_INNO_TMDS_CONTROL 0x1b2
> +#define STF_INNO_TMDS_CLK_DRIVER_EN BIT(3)
> +#define STF_INNO_TMDS_D2_DRIVER_EN BIT(2)
> +#define STF_INNO_TMDS_D1_DRIVER_EN BIT(1)
> +#define STF_INNO_TMDS_D0_DRIVER_EN BIT(0)
> +#define STF_INNO_TMDS_DRIVER_ENABLE (STF_INNO_TMDS_CLK_DRIVER_EN | \
> + STF_INNO_TMDS_D2_DRIVER_EN | \
> + STF_INNO_TMDS_D1_DRIVER_EN | \
> + STF_INNO_TMDS_D0_DRIVER_EN)
> +
> +/* REG: 0x1b4 */
> +#define STF_INNO_LDO_CONTROL 0x1b4
> +#define STF_INNO_LDO_ENABLE (BIT(2) | BIT(1) | BIT(0))
> +
> +/* REG: 0x1be */
> +#define STF_INNO_SERIALIER_CONTROL 0x1be
> +#define STF_INNO_SERIALIER_ENABLE (BIT(6) | BIT(5) | BIT(4) | BIT(0))
> +
> +/* REG: 0x1cc */
> +#define STF_INNO_RX_CONTROL 0x1cc
> +#define STF_INNO_RX_ENABLE (BIT(3) | BIT(2) | BIT(1) | BIT(0))
> +
> +/*
> + * These tables are copied from the monolithic driver.
> + * They match the Rockchip PHY driver tables.
> + */
> +
> +struct post_pll_config {
> + unsigned long tmdsclock;
> + u8 prediv;
> + u16 fbdiv;
> + u8 postdiv;
> + u8 post_div_en;
> +};
> +
> +static const struct inno_hdmi_phy_pre_pll_config pre_pll_cfg_table[] = {
> + { 25175000, 25175000, 1, 100, 2, 3, 3, 12, 3, 3, 4, 0, 0xF55555 },
lower case hex values, here and everywhere else please
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Andy Yan" <andy.yan@rock-chips.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Emil Renner Berthing" <kernel@esmil.dk>,
"Hal Feng" <hal.feng@starfivetech.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Dominique Belhachemi" <db@domibel.de>,
"Brian Masney" <bmasney+clk@redhat.com>,
"Jerome Brunet" <jbrunet+clk@baylibre.com>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-riscv@lists.infradead.org,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Maud Spierings" <maud_spierings@murena.io>,
"Graham Markall" <hello@big-grey.co.uk>,
"Icenowy Zheng" <zhengxingda@iscas.ac.cn>,
"Chaoyi Chen" <chaoyi.chen@rock-chips.com>,
"Joshua Peisach" <jpeisach@ubuntu.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: Re: [PATCH v5 19/21] phy: starfive: Add jh7110-inno-hdmi-phy driver
Date: Sat, 3 Oct 2026 16:25:01 +0200 [thread overview]
Message-ID: <asEQPf-oKbt_DSp3@parshuram> (raw)
In-Reply-To: <20260929-jh7110-clean-send-v5-19-82b4d8e3c6c7@samsung.com>
On 29-09-26, 12:31, Michal Wilczynski wrote:
> Add the HDMI PHY driver for the StarFive JH7110.
>
> This driver binds to the starfive,jh7110-inno-hdmi-phy node and
> gets its regmap from the parent. It has no dependencies on voutcrg, only
> on its reference oscillator (xin24m), which breaks the probe-time
> circular dependency.
>
> This driver provides two main functions:
> - Clock Provider: It registers clk_ops to provide the variable pixel
> clock. The .set_rate operation configures the Pre-PLL registers
> (0x1a0+) based on the requested rate.
>
> - PHY Provider: It registers phy_ops for the controller. The .power_on
> op configures and enables the Post-PLL and other analog blocks (BIAS,
> LDO, Serializer, etc.).
>
> The clock ops reach registers in the window shared with the HDMI
> controller, and access to that window is gated by the controller's
> system clock, which only the sibling controller driver holds. The clock
> framework walks every registered clock regardless of which drivers have
> bound, so deliberately do not implement .is_prepared, which lets the
> framework fall back to the software prepare count, and return the cached
> rate from .recalc_rate whenever the clock is not prepared. Without this,
> clk_disable_unused() reads a PHY register with that clock gated and the
> resulting stalled bus transaction wedges the CPU hard enough that it
> stops responding to NMIs. It is reproducible by building the bridge
> driver as a module so that the controller has not bound by then.
>
> The JH7110 instantiates the same Innosilicon IP as the Rockchip RK3328,
> with the PHY register block shifted by 0x100 because it sits behind the
> HDMI controller in the shared register space. The pre-PLL programming
> therefore comes from the common Innosilicon helpers; this driver adds
> the JH7110 pixel clock table, the post-PLL and the analog configuration.
>
> Co-developed-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
> drivers/phy/starfive/Kconfig | 20 +
> drivers/phy/starfive/Makefile | 1 +
> drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 582 ++++++++++++++++++++++++++++
> 3 files changed, 603 insertions(+)
>
> diff --git a/drivers/phy/starfive/Kconfig b/drivers/phy/starfive/Kconfig
> index d0cdd7cb4a13de22ff643c89a79d99cce57284d7..1da417ffbf224c13224e42a3ce322e3d0c272824 100644
> --- a/drivers/phy/starfive/Kconfig
> +++ b/drivers/phy/starfive/Kconfig
> @@ -25,6 +25,26 @@ config PHY_STARFIVE_JH7110_DPHY_TX
> system. If M is selected, the module will be called
> phy-jh7110-dphy-tx.ko.
>
> +config PHY_STARFIVE_JH7110_INNO_HDMI
> + tristate "Starfive JH7110 INNO HDMI PHY"
> + select PHY_INNO_HDMI
> + depends on COMMON_CLK
> + select GENERIC_PHY
> + help
> + This option enables the driver for the analog HDMI PHY (Physical
> + Layer) on the StarFive JH7110 SoC.
> +
> + This driver binds to a child node of the 'starfive,jh7110-hdmi-subsystem'
> + parent driver and gets its register map from that parent.
> +
> + It is responsible for two main functions:
> + 1. PHY Provider: It provides standard PHY operations (.power_on,
> + .power_off) for the HDMI controller (bridge) driver. This
> + involves configuring the Post-PLL and analog TMDS blocks.
> + 2. Clock Provider: It registers as a clock provider to supply the
> + variable pixel clock (hdmi_pclk) to the HDMI controller and
> + the VOUT subsystem, which it generates using the Pre-PLL.
> +
> config PHY_STARFIVE_JH7110_PCIE
> tristate "Starfive JH7110 PCIE 2.0/USB 3.0 PHY support"
> depends on HAS_IOMEM
> diff --git a/drivers/phy/starfive/Makefile b/drivers/phy/starfive/Makefile
> index eedc4a6fec156320c99ac0a0da609083b6a6a695..e7b13f00880b500f933f21b6037384d5c6884e3e 100644
> --- a/drivers/phy/starfive/Makefile
> +++ b/drivers/phy/starfive/Makefile
> @@ -1,5 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_RX) += phy-jh7110-dphy-rx.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_TX) += phy-jh7110-dphy-tx.o
> +obj-$(CONFIG_PHY_STARFIVE_JH7110_INNO_HDMI) += phy-jh7110-inno-hdmi.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_PCIE) += phy-jh7110-pcie.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_USB) += phy-jh7110-usb.o
> diff --git a/drivers/phy/starfive/phy-jh7110-inno-hdmi.c b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..cba6f3c3dae40bd982c062c8504438f51f3b30be
> --- /dev/null
> +++ b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> @@ -0,0 +1,582 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2017 Rockchip Electronics Co. Ltd.
> + * Copyright (c) 2025 Samsung Electronics Co., Ltd.
> + *
> + * Author: Zheng Yang <zhengyang@rock-chips.com>
> + * Author: Michal Wilczynski <m.wilczynski@samsung.com>
> + *
> + * The register layout and programming sequence derive from
> + * drivers/phy/rockchip/phy-rockchip-inno-hdmi.c; the JH7110 places the
> + * same Innosilicon PHY block at a 0x100 register offset.
> + *
> + * This driver handles the PHY portion of the StarFive Innosilicon HDMI IP,
> + * which is part of a monolithic HDMI block. It provides the variable pixel
> + * clock (from the Pre-PLL) and the PHY operations (for the Post-PLL/analog).
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/iopoll.h>
> +#include <linux/math64.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/phy/inno-hdmi-phy.h>
> +#include <linux/phy/phy.h>
> +#include <linux/slab.h>
> +
> +/*
> + * StarFive (JH7110) Innosilicon HDMI PHY Register Definitions
> + */
> +
> +/* REG: 0x1aa */
> +#define STF_INNO_POST_PLL_DIV_1 0x1aa
> +#define STF_INNO_POST_PLL_POST_DIV_ENABLE GENMASK(3, 2)
> +#define STF_INNO_POST_PLL_REFCLK_SEL_TMDS BIT(1)
> +#define STF_INNO_POST_PLL_POWER_DOWN BIT(0)
> +
> +/* REG: 0x1ab */
> +#define STF_INNO_POST_PLL_DIV_2 0x1ab
> +#define STF_INNO_POST_PLL_PRE_DIV(x) FIELD_PREP(GENMASK(5, 0), x)
> +#define STF_INNO_POST_PLL_FB_DIV_8(x) FIELD_PREP(BIT(7), (x) >> 8)
> +
> +/* REG: 0x1ac */
> +#define STF_INNO_POST_PLL_DIV_3 0x1ac
> +#define STF_INNO_POST_PLL_FB_DIV_7_0(x) FIELD_PREP(GENMASK(7, 0), x)
> +
> +/* REG: 0x1ad */
> +#define STF_INNO_POST_PLL_DIV_4 0x1ad
> +#define STF_INNO_POST_PLL_POST_DIV_MASK GENMASK(1, 0)
> +
> +/* REG: 0x1af */
> +#define STF_INNO_POST_PLL_LOCK_STATUS 0x1af
> +#define STF_INNO_POST_PLL_LOCK BIT(0)
> +
> +/* REG: 0x1b0 */
> +#define STF_INNO_BIAS_CONTROL 0x1b0
> +#define STF_INNO_BIAS_ENABLE BIT(2)
> +
> +/* REG: 0x1b2 */
> +#define STF_INNO_TMDS_CONTROL 0x1b2
> +#define STF_INNO_TMDS_CLK_DRIVER_EN BIT(3)
> +#define STF_INNO_TMDS_D2_DRIVER_EN BIT(2)
> +#define STF_INNO_TMDS_D1_DRIVER_EN BIT(1)
> +#define STF_INNO_TMDS_D0_DRIVER_EN BIT(0)
> +#define STF_INNO_TMDS_DRIVER_ENABLE (STF_INNO_TMDS_CLK_DRIVER_EN | \
> + STF_INNO_TMDS_D2_DRIVER_EN | \
> + STF_INNO_TMDS_D1_DRIVER_EN | \
> + STF_INNO_TMDS_D0_DRIVER_EN)
> +
> +/* REG: 0x1b4 */
> +#define STF_INNO_LDO_CONTROL 0x1b4
> +#define STF_INNO_LDO_ENABLE (BIT(2) | BIT(1) | BIT(0))
> +
> +/* REG: 0x1be */
> +#define STF_INNO_SERIALIER_CONTROL 0x1be
> +#define STF_INNO_SERIALIER_ENABLE (BIT(6) | BIT(5) | BIT(4) | BIT(0))
> +
> +/* REG: 0x1cc */
> +#define STF_INNO_RX_CONTROL 0x1cc
> +#define STF_INNO_RX_ENABLE (BIT(3) | BIT(2) | BIT(1) | BIT(0))
> +
> +/*
> + * These tables are copied from the monolithic driver.
> + * They match the Rockchip PHY driver tables.
> + */
> +
> +struct post_pll_config {
> + unsigned long tmdsclock;
> + u8 prediv;
> + u16 fbdiv;
> + u8 postdiv;
> + u8 post_div_en;
> +};
> +
> +static const struct inno_hdmi_phy_pre_pll_config pre_pll_cfg_table[] = {
> + { 25175000, 25175000, 1, 100, 2, 3, 3, 12, 3, 3, 4, 0, 0xF55555 },
lower case hex values, here and everywhere else please
--
~Vinod
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Andy Yan" <andy.yan@rock-chips.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Emil Renner Berthing" <kernel@esmil.dk>,
"Hal Feng" <hal.feng@starfivetech.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Dominique Belhachemi" <db@domibel.de>,
"Brian Masney" <bmasney+clk@redhat.com>,
"Jerome Brunet" <jbrunet+clk@baylibre.com>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-riscv@lists.infradead.org,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Maud Spierings" <maud_spierings@murena.io>,
"Graham Markall" <hello@big-grey.co.uk>,
"Icenowy Zheng" <zhengxingda@iscas.ac.cn>,
"Chaoyi Chen" <chaoyi.chen@rock-chips.com>,
"Joshua Peisach" <jpeisach@ubuntu.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: Re: [PATCH v5 19/21] phy: starfive: Add jh7110-inno-hdmi-phy driver
Date: Sat, 3 Oct 2026 16:25:01 +0200 [thread overview]
Message-ID: <asEQPf-oKbt_DSp3@parshuram> (raw)
In-Reply-To: <20260929-jh7110-clean-send-v5-19-82b4d8e3c6c7@samsung.com>
On 29-09-26, 12:31, Michal Wilczynski wrote:
> Add the HDMI PHY driver for the StarFive JH7110.
>
> This driver binds to the starfive,jh7110-inno-hdmi-phy node and
> gets its regmap from the parent. It has no dependencies on voutcrg, only
> on its reference oscillator (xin24m), which breaks the probe-time
> circular dependency.
>
> This driver provides two main functions:
> - Clock Provider: It registers clk_ops to provide the variable pixel
> clock. The .set_rate operation configures the Pre-PLL registers
> (0x1a0+) based on the requested rate.
>
> - PHY Provider: It registers phy_ops for the controller. The .power_on
> op configures and enables the Post-PLL and other analog blocks (BIAS,
> LDO, Serializer, etc.).
>
> The clock ops reach registers in the window shared with the HDMI
> controller, and access to that window is gated by the controller's
> system clock, which only the sibling controller driver holds. The clock
> framework walks every registered clock regardless of which drivers have
> bound, so deliberately do not implement .is_prepared, which lets the
> framework fall back to the software prepare count, and return the cached
> rate from .recalc_rate whenever the clock is not prepared. Without this,
> clk_disable_unused() reads a PHY register with that clock gated and the
> resulting stalled bus transaction wedges the CPU hard enough that it
> stops responding to NMIs. It is reproducible by building the bridge
> driver as a module so that the controller has not bound by then.
>
> The JH7110 instantiates the same Innosilicon IP as the Rockchip RK3328,
> with the PHY register block shifted by 0x100 because it sits behind the
> HDMI controller in the shared register space. The pre-PLL programming
> therefore comes from the common Innosilicon helpers; this driver adds
> the JH7110 pixel clock table, the post-PLL and the analog configuration.
>
> Co-developed-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Dominique Belhachemi <db@domibel.de>
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
> drivers/phy/starfive/Kconfig | 20 +
> drivers/phy/starfive/Makefile | 1 +
> drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 582 ++++++++++++++++++++++++++++
> 3 files changed, 603 insertions(+)
>
> diff --git a/drivers/phy/starfive/Kconfig b/drivers/phy/starfive/Kconfig
> index d0cdd7cb4a13de22ff643c89a79d99cce57284d7..1da417ffbf224c13224e42a3ce322e3d0c272824 100644
> --- a/drivers/phy/starfive/Kconfig
> +++ b/drivers/phy/starfive/Kconfig
> @@ -25,6 +25,26 @@ config PHY_STARFIVE_JH7110_DPHY_TX
> system. If M is selected, the module will be called
> phy-jh7110-dphy-tx.ko.
>
> +config PHY_STARFIVE_JH7110_INNO_HDMI
> + tristate "Starfive JH7110 INNO HDMI PHY"
> + select PHY_INNO_HDMI
> + depends on COMMON_CLK
> + select GENERIC_PHY
> + help
> + This option enables the driver for the analog HDMI PHY (Physical
> + Layer) on the StarFive JH7110 SoC.
> +
> + This driver binds to a child node of the 'starfive,jh7110-hdmi-subsystem'
> + parent driver and gets its register map from that parent.
> +
> + It is responsible for two main functions:
> + 1. PHY Provider: It provides standard PHY operations (.power_on,
> + .power_off) for the HDMI controller (bridge) driver. This
> + involves configuring the Post-PLL and analog TMDS blocks.
> + 2. Clock Provider: It registers as a clock provider to supply the
> + variable pixel clock (hdmi_pclk) to the HDMI controller and
> + the VOUT subsystem, which it generates using the Pre-PLL.
> +
> config PHY_STARFIVE_JH7110_PCIE
> tristate "Starfive JH7110 PCIE 2.0/USB 3.0 PHY support"
> depends on HAS_IOMEM
> diff --git a/drivers/phy/starfive/Makefile b/drivers/phy/starfive/Makefile
> index eedc4a6fec156320c99ac0a0da609083b6a6a695..e7b13f00880b500f933f21b6037384d5c6884e3e 100644
> --- a/drivers/phy/starfive/Makefile
> +++ b/drivers/phy/starfive/Makefile
> @@ -1,5 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_RX) += phy-jh7110-dphy-rx.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_TX) += phy-jh7110-dphy-tx.o
> +obj-$(CONFIG_PHY_STARFIVE_JH7110_INNO_HDMI) += phy-jh7110-inno-hdmi.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_PCIE) += phy-jh7110-pcie.o
> obj-$(CONFIG_PHY_STARFIVE_JH7110_USB) += phy-jh7110-usb.o
> diff --git a/drivers/phy/starfive/phy-jh7110-inno-hdmi.c b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..cba6f3c3dae40bd982c062c8504438f51f3b30be
> --- /dev/null
> +++ b/drivers/phy/starfive/phy-jh7110-inno-hdmi.c
> @@ -0,0 +1,582 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2017 Rockchip Electronics Co. Ltd.
> + * Copyright (c) 2025 Samsung Electronics Co., Ltd.
> + *
> + * Author: Zheng Yang <zhengyang@rock-chips.com>
> + * Author: Michal Wilczynski <m.wilczynski@samsung.com>
> + *
> + * The register layout and programming sequence derive from
> + * drivers/phy/rockchip/phy-rockchip-inno-hdmi.c; the JH7110 places the
> + * same Innosilicon PHY block at a 0x100 register offset.
> + *
> + * This driver handles the PHY portion of the StarFive Innosilicon HDMI IP,
> + * which is part of a monolithic HDMI block. It provides the variable pixel
> + * clock (from the Pre-PLL) and the PHY operations (for the Post-PLL/analog).
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/iopoll.h>
> +#include <linux/math64.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/phy/inno-hdmi-phy.h>
> +#include <linux/phy/phy.h>
> +#include <linux/slab.h>
> +
> +/*
> + * StarFive (JH7110) Innosilicon HDMI PHY Register Definitions
> + */
> +
> +/* REG: 0x1aa */
> +#define STF_INNO_POST_PLL_DIV_1 0x1aa
> +#define STF_INNO_POST_PLL_POST_DIV_ENABLE GENMASK(3, 2)
> +#define STF_INNO_POST_PLL_REFCLK_SEL_TMDS BIT(1)
> +#define STF_INNO_POST_PLL_POWER_DOWN BIT(0)
> +
> +/* REG: 0x1ab */
> +#define STF_INNO_POST_PLL_DIV_2 0x1ab
> +#define STF_INNO_POST_PLL_PRE_DIV(x) FIELD_PREP(GENMASK(5, 0), x)
> +#define STF_INNO_POST_PLL_FB_DIV_8(x) FIELD_PREP(BIT(7), (x) >> 8)
> +
> +/* REG: 0x1ac */
> +#define STF_INNO_POST_PLL_DIV_3 0x1ac
> +#define STF_INNO_POST_PLL_FB_DIV_7_0(x) FIELD_PREP(GENMASK(7, 0), x)
> +
> +/* REG: 0x1ad */
> +#define STF_INNO_POST_PLL_DIV_4 0x1ad
> +#define STF_INNO_POST_PLL_POST_DIV_MASK GENMASK(1, 0)
> +
> +/* REG: 0x1af */
> +#define STF_INNO_POST_PLL_LOCK_STATUS 0x1af
> +#define STF_INNO_POST_PLL_LOCK BIT(0)
> +
> +/* REG: 0x1b0 */
> +#define STF_INNO_BIAS_CONTROL 0x1b0
> +#define STF_INNO_BIAS_ENABLE BIT(2)
> +
> +/* REG: 0x1b2 */
> +#define STF_INNO_TMDS_CONTROL 0x1b2
> +#define STF_INNO_TMDS_CLK_DRIVER_EN BIT(3)
> +#define STF_INNO_TMDS_D2_DRIVER_EN BIT(2)
> +#define STF_INNO_TMDS_D1_DRIVER_EN BIT(1)
> +#define STF_INNO_TMDS_D0_DRIVER_EN BIT(0)
> +#define STF_INNO_TMDS_DRIVER_ENABLE (STF_INNO_TMDS_CLK_DRIVER_EN | \
> + STF_INNO_TMDS_D2_DRIVER_EN | \
> + STF_INNO_TMDS_D1_DRIVER_EN | \
> + STF_INNO_TMDS_D0_DRIVER_EN)
> +
> +/* REG: 0x1b4 */
> +#define STF_INNO_LDO_CONTROL 0x1b4
> +#define STF_INNO_LDO_ENABLE (BIT(2) | BIT(1) | BIT(0))
> +
> +/* REG: 0x1be */
> +#define STF_INNO_SERIALIER_CONTROL 0x1be
> +#define STF_INNO_SERIALIER_ENABLE (BIT(6) | BIT(5) | BIT(4) | BIT(0))
> +
> +/* REG: 0x1cc */
> +#define STF_INNO_RX_CONTROL 0x1cc
> +#define STF_INNO_RX_ENABLE (BIT(3) | BIT(2) | BIT(1) | BIT(0))
> +
> +/*
> + * These tables are copied from the monolithic driver.
> + * They match the Rockchip PHY driver tables.
> + */
> +
> +struct post_pll_config {
> + unsigned long tmdsclock;
> + u8 prediv;
> + u16 fbdiv;
> + u8 postdiv;
> + u8 post_div_en;
> +};
> +
> +static const struct inno_hdmi_phy_pre_pll_config pre_pll_cfg_table[] = {
> + { 25175000, 25175000, 1, 100, 2, 3, 3, 12, 3, 3, 4, 0, 0xF55555 },
lower case hex values, here and everywhere else please
--
~Vinod
next prev parent reply other threads:[~2026-10-03 14:25 UTC|newest]
Thread overview: 156+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260929103200eucas1p17af134cc3b93c242227964f574f13aa5@eucas1p1.samsung.com>
2026-09-29 10:30 ` [PATCH v5 00/21] drm: starfive: jh7110: Enable display subsystem Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` [PATCH v5 01/21] drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-10-01 15:40 ` Maud Spierings
2026-10-01 15:40 ` Maud Spierings
2026-10-01 15:40 ` Maud Spierings
2026-10-01 15:40 ` Maud Spierings
2026-09-29 10:30 ` [PATCH v5 02/21] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 10:30 ` Michal Wilczynski
2026-09-29 20:52 ` Rob Herring (Arm)
2026-09-29 20:52 ` Rob Herring (Arm)
2026-09-29 20:52 ` Rob Herring (Arm)
2026-09-29 20:52 ` Rob Herring (Arm)
2026-09-29 10:31 ` [PATCH v5 03/21] dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 21:00 ` Rob Herring (Arm)
2026-09-29 21:00 ` Rob Herring (Arm)
2026-09-29 21:00 ` Rob Herring (Arm)
2026-09-29 21:00 ` Rob Herring (Arm)
2026-09-29 10:31 ` [PATCH v5 04/21] dt-bindings: soc: starfive: Add starfive,jh7110-hdmi-subsystem Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 21:31 ` Rob Herring
2026-09-29 21:31 ` Rob Herring
2026-09-29 21:31 ` Rob Herring
2026-09-29 21:31 ` Rob Herring
2026-09-29 10:31 ` [PATCH v5 05/21] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 06/21] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200 Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 21:33 ` Rob Herring
2026-09-29 21:33 ` Rob Herring
2026-09-29 21:33 ` Rob Herring
2026-09-29 21:33 ` Rob Herring
2026-09-29 10:31 ` [PATCH v5 07/21] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 08/21] drm/bridge: inno-hdmi: Split probe out of bind Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-30 10:02 ` Heiko Stübner
2026-09-30 10:02 ` Heiko Stübner
2026-09-30 10:02 ` Heiko Stübner
2026-09-30 10:02 ` Heiko Stübner
2026-10-03 16:19 ` Michal Wilczynski
2026-10-03 16:19 ` Michal Wilczynski
2026-10-03 16:19 ` Michal Wilczynski
2026-10-03 16:19 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 09/21] drm/bridge: inno-hdmi: Allow the register map to come from a parent Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 10/21] drm/bridge: inno-hdmi: Add .disable platform operation Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-30 10:07 ` Heiko Stübner
2026-09-30 10:07 ` Heiko Stübner
2026-09-30 10:07 ` Heiko Stübner
2026-09-30 10:07 ` Heiko Stübner
2026-09-29 10:31 ` [PATCH v5 11/21] drm/bridge: inno-hdmi: Add .mode_valid " Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-30 10:19 ` Heiko Stübner
2026-09-30 10:19 ` Heiko Stübner
2026-09-30 10:19 ` Heiko Stübner
2026-09-30 10:19 ` Heiko Stübner
2026-09-29 10:31 ` [PATCH v5 12/21] drm/bridge: inno-hdmi: Make the PHY configuration table optional Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 13/21] drm/bridge: inno-hdmi: Make the register clock source selectable Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-10-01 15:38 ` Maud Spierings
2026-10-01 15:38 ` Maud Spierings
2026-10-01 15:38 ` Maud Spierings
2026-10-01 15:38 ` Maud Spierings
2026-09-29 10:31 ` [PATCH v5 14/21] soc: starfive: Add jh7110-hdmi-subsystem driver Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 15/21] soc: starfive: Add jh7110-vout-subsystem driver Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 16/21] drm/bridge: starfive: Add JH7110 HDMI controller driver Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 17/21] phy: Add common Innosilicon HDMI PHY helpers Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-30 10:11 ` Heiko Stübner
2026-09-30 10:11 ` Heiko Stübner
2026-09-30 10:11 ` Heiko Stübner
2026-09-30 10:11 ` Heiko Stübner
2026-09-29 10:31 ` [PATCH v5 18/21] phy: rockchip: inno-hdmi: Use the common Innosilicon " Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-30 10:14 ` Heiko Stübner
2026-09-30 10:14 ` Heiko Stübner
2026-09-30 10:14 ` Heiko Stübner
2026-09-30 10:14 ` Heiko Stübner
2026-09-29 10:31 ` [PATCH v5 19/21] phy: starfive: Add jh7110-inno-hdmi-phy driver Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-10-03 14:25 ` Vinod Koul [this message]
2026-10-03 14:25 ` Vinod Koul
2026-10-03 14:25 ` Vinod Koul
2026-10-03 14:25 ` Vinod Koul
2026-09-29 10:31 ` [PATCH v5 20/21] riscv: dts: starfive: jh7110: Update DT for display subsystem Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` [PATCH v5 21/21] MAINTAINERS: Add StarFive JH7110 display subsystem entry Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 10:31 ` Michal Wilczynski
2026-09-29 14:54 ` [PATCH v5 00/21] drm: starfive: jh7110: Enable display subsystem Icenowy Zheng
2026-09-29 14:54 ` Icenowy Zheng
2026-09-29 14:54 ` Icenowy Zheng
2026-09-29 14:54 ` Icenowy Zheng
2026-09-29 15:02 ` Icenowy Zheng
2026-09-29 15:02 ` Icenowy Zheng
2026-09-29 15:02 ` Icenowy Zheng
2026-09-29 15:02 ` Icenowy Zheng
2026-09-30 0:20 ` Byron Stanoszek
2026-09-30 0:20 ` Byron Stanoszek
2026-09-30 0:20 ` Byron Stanoszek
2026-09-30 0:20 ` Byron Stanoszek
2026-10-12 17:59 ` OOHehir
2026-10-12 17:59 ` OOHehir
2026-10-12 17:59 ` OOHehir
2026-10-12 17:59 ` OOHehir
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=asEQPf-oKbt_DSp3@parshuram \
--to=vkoul@kernel.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=alex@ghiti.fr \
--cc=andrzej.hajda@intel.com \
--cc=andy.yan@rock-chips.com \
--cc=aou@eecs.berkeley.edu \
--cc=bmasney+clk@redhat.com \
--cc=chaoyi.chen@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=db@domibel.de \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hal.feng@starfivetech.com \
--cc=heiko@sntech.de \
--cc=hello@big-grey.co.uk \
--cc=jbrunet+clk@baylibre.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=jpeisach@ubuntu.com \
--cc=kernel@esmil.dk \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=luca.ceresoli@bootlin.com \
--cc=m.szyprowski@samsung.com \
--cc=m.wilczynski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mani@kernel.org \
--cc=maud_spierings@murena.io \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tzimmermann@suse.de \
--cc=u.kleine-koenig@baylibre.com \
--cc=zhengxingda@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.