linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Icenowy Zheng <zhengxingda@iscas.ac.cn>
To: Michal Wilczynski <m.wilczynski@samsung.com>,
	Vinod Koul <vkoul@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>,
	Lee Jones <lee@kernel.org>, 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>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	mfd@lists.linux.dev, 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>,
	"Chaoyi Chen" <chaoyi.chen@rock-chips.com>,
	"Joshua Peisach" <jpeisach@ubuntu.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: Re: [PATCH v4 13/20] soc: starfive: Add jh7110-vout-subsystem driver
Date: Tue, 29 Sep 2026 23:04:46 +0800	[thread overview]
Message-ID: <dca5684318e5e54a8c21ef800067c2bd20b40d07.camel@iscas.ac.cn> (raw)
In-Reply-To: <20260915-jh7110-clean-send-v4-13-f0e4fd6f2cc8@samsung.com>

在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
> Nothing in the video output subsystem can reach its own registers
> until
> the NoC display bus clock and reset are up and PD_VOUT is powered,
> and
> those are shared by every device in the region. Leaving them to
> whichever
> consumer probes first works by accident and stops working as soon as
> the
> probe order changes.
> 
> Add a driver for the subsystem node that takes the bus clock and
> reset,
> holds a runtime PM reference so genpd keeps PD_VOUT powered, and then
> populates its children. All three are released only once the last
> child
> is gone.
> 
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>

```
Tested-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
```

Thanks,
Icenowy

> ---
>  drivers/soc/starfive/Kconfig                 | 15 +++++
>  drivers/soc/starfive/Makefile                |  1 +
>  drivers/soc/starfive/jh7110-vout-subsystem.c | 82
> ++++++++++++++++++++++++++++
>  3 files changed, 98 insertions(+)
> 
> diff --git a/drivers/soc/starfive/Kconfig
> b/drivers/soc/starfive/Kconfig
> index
> e738638ab0f755fbbabca259264abb56f3b6101f..cf5e626b8a39a75768917eee188
> a79256b36f1aa 100644
> --- a/drivers/soc/starfive/Kconfig
> +++ b/drivers/soc/starfive/Kconfig
> @@ -6,6 +6,21 @@
>  if ARCH_STARFIVE || COMPILE_TEST
>  menu "Starfive SoC drivers"
>  
> +config SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM
> +	tristate "StarFive JH7110 video output subsystem driver"
> +	depends on OF
> +	select PM
> +	help
> +	  This option enables the parent driver for the StarFive
> JH7110
> +	  video output subsystem, which the documentation calls
> dom_vout_top.
> +
> +	  The subsystem covers the DC8200 display controller, the
> HDMI
> +	  transmitter, the video output clock generator and the
> video output
> +	  system controller. They share one NoC port whose clock and
> reset
> +	  gate access to the whole register region, and the region
> sits in
> +	  the PD_VOUT power domain. This driver owns those resources
> and
> +	  holds them for as long as any of its children exist.
> +
>  config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM
>  	tristate "StarFive JH7110 HDMI subsystem driver"
>  	depends on OF
> diff --git a/drivers/soc/starfive/Makefile
> b/drivers/soc/starfive/Makefile
> index
> be89d8119212b7a7038817c2f0e8eac1984ada88..6c229020c1e563b37df43f6ac16
> 65465a11333cc 100644
> --- a/drivers/soc/starfive/Makefile
> +++ b/drivers/soc/starfive/Makefile
> @@ -1,2 +1,3 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  obj-$(CONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM) += jh7110-hdmi-
> subsystem.o
> +obj-$(CONFIG_SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM) += jh7110-vout-
> subsystem.o
> diff --git a/drivers/soc/starfive/jh7110-vout-subsystem.c
> b/drivers/soc/starfive/jh7110-vout-subsystem.c
> new file mode 100644
> index
> 0000000000000000000000000000000000000000..af632692e2139d9d07edd478a29
> 9b170ad1b7104
> --- /dev/null
> +++ b/drivers/soc/starfive/jh7110-vout-subsystem.c
> @@ -0,0 +1,82 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for the StarFive JH7110 video output subsystem
> + *
> + * Copyright (c) 2025 Samsung Electronics Co., Ltd.
> + * Author: Michal Wilczynski <m.wilczynski@samsung.com>
> + *
> + * The display hardware sits behind a single NoC port whose clock
> and reset
> + * gate access to every register in the region, inside the PD_VOUT
> power
> + * domain. Nothing below this node can reach its own registers until
> all three
> + * are up, so bring them up here and hold them for as long as any
> child device
> + * exists, rather than leaving them to whichever consumer happens to
> probe
> + * first.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/reset.h>
> +
> +static void jh7110_vout_subsys_pm_put(void *data)
> +{
> +	pm_runtime_put_sync(data);
> +}
> +
> +static int jh7110_vout_subsys_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct reset_control *bus_rst;
> +	struct clk *bus_clk;
> +	int ret;
> +
> +	/*
> +	 * Take a runtime PM reference for the lifetime of this
> device. genpd
> +	 * only keeps PD_VOUT powered while something actually holds
> it, and
> +	 * an unclocked or unpowered access to this region wedges
> the bus.
> +	 */
> +	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
> PD_VOUT\n");
> +
> +	ret = devm_add_action_or_reset(dev,
> jh7110_vout_subsys_pm_put, dev);
> +	if (ret)
> +		return ret;
> +
> +	bus_clk = devm_clk_get_enabled(dev, NULL);
> +	if (IS_ERR(bus_clk))
> +		return dev_err_probe(dev, PTR_ERR(bus_clk),
> +				     "Failed to enable NoC bus
> clock\n");
> +
> +	bus_rst = devm_reset_control_get_exclusive_deasserted(dev,
> NULL);
> +	if (IS_ERR(bus_rst))
> +		return dev_err_probe(dev, PTR_ERR(bus_rst),
> +				     "Failed to deassert NoC bus
> reset\n");
> +
> +	return devm_of_platform_populate(dev);
> +}
> +
> +static const struct of_device_id jh7110_vout_subsys_of_match[] = {
> +	{ .compatible = "starfive,jh7110-vout-subsystem", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, jh7110_vout_subsys_of_match);
> +
> +static struct platform_driver jh7110_vout_subsys_driver = {
> +	.probe = jh7110_vout_subsys_probe,
> +	.driver = {
> +		.name = "jh7110-vout-subsystem",
> +		.of_match_table = jh7110_vout_subsys_of_match,
> +	},
> +};
> +module_platform_driver(jh7110_vout_subsys_driver);
> +
> +MODULE_AUTHOR("Michal Wilczynski <m.wilczynski@samsung.com>");
> +MODULE_DESCRIPTION("StarFive JH7110 video output subsystem driver");
> +MODULE_LICENSE("GPL");



  reply	other threads:[~2026-09-29 15:05 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260915153213eucas1p148f013af239a334fc78cdc249c0f8a61@eucas1p1.samsung.com>
2026-09-15 15:32 ` [PATCH v4 00/20] drm: starfive: jh7110: Enable display subsystem Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy Michal Wilczynski
2026-09-17  6:51     ` Krzysztof Kozlowski
2026-09-18  0:34       ` Joshua Peisach
2026-09-18  6:16         ` Krzysztof Kozlowski
2026-09-18  6:21           ` Icenowy Zheng
2026-09-18  6:41             ` Krzysztof Kozlowski
2026-09-25 21:27           ` Michal Wilczynski
2026-09-25 21:05       ` Michal Wilczynski
2026-09-30 11:01         ` Krzysztof Kozlowski
2026-10-03 15:36           ` Michal Wilczynski
2026-10-03 20:45             ` Krzysztof Kozlowski
2026-10-03 22:35               ` Michal Wilczynski
2026-10-04  7:15                 ` Krzysztof Kozlowski
2026-10-05  7:27                 ` Icenowy Zheng
2026-09-15 15:32   ` [PATCH v4 02/20] dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 03/20] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem Michal Wilczynski
2026-09-17  6:54     ` Krzysztof Kozlowski
2026-09-28 18:34       ` Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 04/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon Michal Wilczynski
2026-09-17  6:55     ` Krzysztof Kozlowski
2026-09-15 15:32   ` [PATCH v4 05/20] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200 Michal Wilczynski
2026-09-18  5:58     ` Icenowy Zheng
2026-09-27 15:26       ` Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 06/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem Michal Wilczynski
2026-09-24 15:30     ` Rob Herring (Arm)
2026-09-15 15:32   ` [PATCH v4 07/20] drm/bridge: inno-hdmi: Split probe out of bind Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 08/20] drm/bridge: inno-hdmi: Allow the register map to come from a parent Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 09/20] drm/bridge: inno-hdmi: Add .disable platform operation Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 10/20] drm/bridge: inno-hdmi: Add .mode_valid " Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 11/20] drm/bridge: inno-hdmi: Make the PHY configuration table optional Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 12/20] soc: starfive: Add jh7110-hdmi-subsystem driver Michal Wilczynski
2026-09-29 15:04     ` Icenowy Zheng
2026-09-15 15:32   ` [PATCH v4 13/20] soc: starfive: Add jh7110-vout-subsystem driver Michal Wilczynski
2026-09-29 15:04     ` Icenowy Zheng [this message]
2026-09-15 15:32   ` [PATCH v4 14/20] clk: starfive: jh7110-vout: Allow pixel clock rate propagation Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 15/20] drm/bridge: starfive: Add JH7110 HDMI controller driver Michal Wilczynski
2026-09-29 15:03     ` Icenowy Zheng
2026-09-15 15:32   ` [PATCH v4 16/20] phy: Add common Innosilicon HDMI PHY helpers Michal Wilczynski
2026-10-03 14:22     ` Vinod Koul
2026-09-15 15:32   ` [PATCH v4 17/20] phy: rockchip: inno-hdmi: Use the common Innosilicon " Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 18/20] phy: starfive: Add jh7110-inno-hdmi-phy driver Michal Wilczynski
2026-09-26  3:31     ` Dominique Belhachemi
2026-09-27 12:05       ` Michal Wilczynski
2026-09-15 15:32   ` [PATCH v4 19/20] riscv: dts: starfive: jh7110: Update DT for display subsystem Michal Wilczynski
2026-09-29 15:06     ` Icenowy Zheng
2026-09-15 15:32   ` [PATCH v4 20/20] MAINTAINERS: Add StarFive JH7110 display subsystem entry Michal Wilczynski
2026-09-16  0:45   ` [PATCH v4 00/20] drm: starfive: jh7110: Enable display subsystem Joshua Peisach
2026-09-17 17:22     ` Michal Wilczynski
2026-09-18 15:32       ` Joshua Peisach
2026-09-27 12:24         ` Michal Wilczynski
2026-09-20  6:09   ` Byron Stanoszek
2026-09-20  7:35     ` Icenowy Zheng
2026-09-25 20:09       ` Michal Wilczynski
2026-09-25 13:55   ` (subset) " Brian Masney

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=dca5684318e5e54a8c21ef800067c2bd20b40d07.camel@iscas.ac.cn \
    --to=zhengxingda@iscas.ac.cn \
    --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=lee@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=maud_spierings@murena.io \
    --cc=mfd@lists.linux.dev \
    --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=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).