From: Michael Riesch <michael.riesch@collabora.com>
To: Gerald Loacker <gerald.loacker@wolfvision.net>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Heiko Stuebner <heiko@sntech.de>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v4 3/3] phy: rockchip: phy-rockchip-inno-csidphy: add clock lane phase tuning
Date: Mon, 3 Aug 2026 13:04:07 +0200 [thread overview]
Message-ID: <e4a4eef8-3c42-407b-a6b7-e2f9a32da29e@collabora.com> (raw)
In-Reply-To: <20260725-feature-mipi-csi-dphy-4k60-v4-3-5b2c4626d31e@wolfvision.net>
Hi Gerald,
On 7/25/26 18:56, Gerald Loacker wrote:
> At high data rates like 4K60 (2500 Mbps), such as when using an
> LT6911GXD bridge chip on an RK3588 board, fixed default timing parameters
> can cause signal integrity issues and clock-data recovery failures.
> The driver currently lacks a mechanism to adjust the clock lane sampling
> phase to compensate for board-specific trace variations.
>
> Resolve this by parsing and applying the optional 'rockchip,clk-lane-phase'
> device tree property. This enables board-specific tuning of the clock
> lane sampling phase in ~40 ps steps (range 0-7) to optimize link
> stability. If the property is absent, the driver falls back to the
> hardware default.
>
> Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Reviewed-by: Michael Riesch <michael.riesch@collabora.com>
Thanks and best regards,
Michael
> ---
> drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 25 ++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> index 5281f8dea0ad3..d989f1649b0e4 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> @@ -69,6 +69,10 @@
> #define RK1808_CSIDPHY_CLK_CALIB_EN 0x168
> #define RK3568_CSIDPHY_CLK_CALIB_EN 0x168
>
> +#define CSIDPHY_LANE_CLK_3_PHASE 0x38
> +#define CSIDPHY_CLK_PHASE_MASK GENMASK(6, 4)
> +#define CSIDPHY_CLK_PHASE_DEFAULT 3
> +
> #define RESETS_MAX 2
>
> /*
> @@ -151,6 +155,7 @@ struct rockchip_inno_csidphy {
> const struct dphy_drv_data *drv_data;
> struct phy_configure_opts_mipi_dphy config;
> u8 hsfreq;
> + int clk_phase;
> };
>
> static inline void write_grf_reg(struct rockchip_inno_csidphy *priv,
> @@ -304,6 +309,13 @@ static int rockchip_inno_csidphy_power_on(struct phy *phy)
> rockchip_inno_csidphy_ths_settle(priv, priv->hsfreq,
> CSIDPHY_LANE_THS_SETTLE(i));
>
> + if (priv->clk_phase >= 0) {
> + val = readl(priv->phy_base + CSIDPHY_LANE_CLK_3_PHASE);
> + val &= ~CSIDPHY_CLK_PHASE_MASK;
> + val |= FIELD_PREP(CSIDPHY_CLK_PHASE_MASK, priv->clk_phase);
> + writel(val, priv->phy_base + CSIDPHY_LANE_CLK_3_PHASE);
> + }
> +
> write_grf_reg(priv, GRF_DPHY_CSIPHY_CLKLANE_EN, 0x1);
> write_grf_reg(priv, GRF_DPHY_CSIPHY_DATALANE_EN,
> GENMASK(priv->config.lanes - 1, 0));
> @@ -449,6 +461,7 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct phy_provider *phy_provider;
> struct phy *phy;
> + u32 phase;
> int ret;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> @@ -464,6 +477,18 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> + priv->clk_phase = -1;
> + if (device_property_read_u32(dev, "rockchip,clk-lane-phase",
> + &phase) == 0) {
> + if (phase > 7) {
> + dev_warn(dev,
> + "invalid rockchip,clk-lane-phase %u, using default %u\n",
> + phase, CSIDPHY_CLK_PHASE_DEFAULT);
> + phase = CSIDPHY_CLK_PHASE_DEFAULT;
> + }
> + priv->clk_phase = phase;
> + }
> +
> priv->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
> "rockchip,grf");
> if (IS_ERR(priv->grf)) {
>
_______________________________________________
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: Michael Riesch <michael.riesch@collabora.com>
To: Gerald Loacker <gerald.loacker@wolfvision.net>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Heiko Stuebner <heiko@sntech.de>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v4 3/3] phy: rockchip: phy-rockchip-inno-csidphy: add clock lane phase tuning
Date: Mon, 3 Aug 2026 13:04:07 +0200 [thread overview]
Message-ID: <e4a4eef8-3c42-407b-a6b7-e2f9a32da29e@collabora.com> (raw)
In-Reply-To: <20260725-feature-mipi-csi-dphy-4k60-v4-3-5b2c4626d31e@wolfvision.net>
Hi Gerald,
On 7/25/26 18:56, Gerald Loacker wrote:
> At high data rates like 4K60 (2500 Mbps), such as when using an
> LT6911GXD bridge chip on an RK3588 board, fixed default timing parameters
> can cause signal integrity issues and clock-data recovery failures.
> The driver currently lacks a mechanism to adjust the clock lane sampling
> phase to compensate for board-specific trace variations.
>
> Resolve this by parsing and applying the optional 'rockchip,clk-lane-phase'
> device tree property. This enables board-specific tuning of the clock
> lane sampling phase in ~40 ps steps (range 0-7) to optimize link
> stability. If the property is absent, the driver falls back to the
> hardware default.
>
> Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Reviewed-by: Michael Riesch <michael.riesch@collabora.com>
Thanks and best regards,
Michael
> ---
> drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 25 ++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> index 5281f8dea0ad3..d989f1649b0e4 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> @@ -69,6 +69,10 @@
> #define RK1808_CSIDPHY_CLK_CALIB_EN 0x168
> #define RK3568_CSIDPHY_CLK_CALIB_EN 0x168
>
> +#define CSIDPHY_LANE_CLK_3_PHASE 0x38
> +#define CSIDPHY_CLK_PHASE_MASK GENMASK(6, 4)
> +#define CSIDPHY_CLK_PHASE_DEFAULT 3
> +
> #define RESETS_MAX 2
>
> /*
> @@ -151,6 +155,7 @@ struct rockchip_inno_csidphy {
> const struct dphy_drv_data *drv_data;
> struct phy_configure_opts_mipi_dphy config;
> u8 hsfreq;
> + int clk_phase;
> };
>
> static inline void write_grf_reg(struct rockchip_inno_csidphy *priv,
> @@ -304,6 +309,13 @@ static int rockchip_inno_csidphy_power_on(struct phy *phy)
> rockchip_inno_csidphy_ths_settle(priv, priv->hsfreq,
> CSIDPHY_LANE_THS_SETTLE(i));
>
> + if (priv->clk_phase >= 0) {
> + val = readl(priv->phy_base + CSIDPHY_LANE_CLK_3_PHASE);
> + val &= ~CSIDPHY_CLK_PHASE_MASK;
> + val |= FIELD_PREP(CSIDPHY_CLK_PHASE_MASK, priv->clk_phase);
> + writel(val, priv->phy_base + CSIDPHY_LANE_CLK_3_PHASE);
> + }
> +
> write_grf_reg(priv, GRF_DPHY_CSIPHY_CLKLANE_EN, 0x1);
> write_grf_reg(priv, GRF_DPHY_CSIPHY_DATALANE_EN,
> GENMASK(priv->config.lanes - 1, 0));
> @@ -449,6 +461,7 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct phy_provider *phy_provider;
> struct phy *phy;
> + u32 phase;
> int ret;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> @@ -464,6 +477,18 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> + priv->clk_phase = -1;
> + if (device_property_read_u32(dev, "rockchip,clk-lane-phase",
> + &phase) == 0) {
> + if (phase > 7) {
> + dev_warn(dev,
> + "invalid rockchip,clk-lane-phase %u, using default %u\n",
> + phase, CSIDPHY_CLK_PHASE_DEFAULT);
> + phase = CSIDPHY_CLK_PHASE_DEFAULT;
> + }
> + priv->clk_phase = phase;
> + }
> +
> priv->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
> "rockchip,grf");
> if (IS_ERR(priv->grf)) {
>
--
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: Michael Riesch <michael.riesch@collabora.com>
To: Gerald Loacker <gerald.loacker@wolfvision.net>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Heiko Stuebner <heiko@sntech.de>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v4 3/3] phy: rockchip: phy-rockchip-inno-csidphy: add clock lane phase tuning
Date: Mon, 3 Aug 2026 13:04:07 +0200 [thread overview]
Message-ID: <e4a4eef8-3c42-407b-a6b7-e2f9a32da29e@collabora.com> (raw)
In-Reply-To: <20260725-feature-mipi-csi-dphy-4k60-v4-3-5b2c4626d31e@wolfvision.net>
Hi Gerald,
On 7/25/26 18:56, Gerald Loacker wrote:
> At high data rates like 4K60 (2500 Mbps), such as when using an
> LT6911GXD bridge chip on an RK3588 board, fixed default timing parameters
> can cause signal integrity issues and clock-data recovery failures.
> The driver currently lacks a mechanism to adjust the clock lane sampling
> phase to compensate for board-specific trace variations.
>
> Resolve this by parsing and applying the optional 'rockchip,clk-lane-phase'
> device tree property. This enables board-specific tuning of the clock
> lane sampling phase in ~40 ps steps (range 0-7) to optimize link
> stability. If the property is absent, the driver falls back to the
> hardware default.
>
> Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Reviewed-by: Michael Riesch <michael.riesch@collabora.com>
Thanks and best regards,
Michael
> ---
> drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 25 ++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> index 5281f8dea0ad3..d989f1649b0e4 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
> @@ -69,6 +69,10 @@
> #define RK1808_CSIDPHY_CLK_CALIB_EN 0x168
> #define RK3568_CSIDPHY_CLK_CALIB_EN 0x168
>
> +#define CSIDPHY_LANE_CLK_3_PHASE 0x38
> +#define CSIDPHY_CLK_PHASE_MASK GENMASK(6, 4)
> +#define CSIDPHY_CLK_PHASE_DEFAULT 3
> +
> #define RESETS_MAX 2
>
> /*
> @@ -151,6 +155,7 @@ struct rockchip_inno_csidphy {
> const struct dphy_drv_data *drv_data;
> struct phy_configure_opts_mipi_dphy config;
> u8 hsfreq;
> + int clk_phase;
> };
>
> static inline void write_grf_reg(struct rockchip_inno_csidphy *priv,
> @@ -304,6 +309,13 @@ static int rockchip_inno_csidphy_power_on(struct phy *phy)
> rockchip_inno_csidphy_ths_settle(priv, priv->hsfreq,
> CSIDPHY_LANE_THS_SETTLE(i));
>
> + if (priv->clk_phase >= 0) {
> + val = readl(priv->phy_base + CSIDPHY_LANE_CLK_3_PHASE);
> + val &= ~CSIDPHY_CLK_PHASE_MASK;
> + val |= FIELD_PREP(CSIDPHY_CLK_PHASE_MASK, priv->clk_phase);
> + writel(val, priv->phy_base + CSIDPHY_LANE_CLK_3_PHASE);
> + }
> +
> write_grf_reg(priv, GRF_DPHY_CSIPHY_CLKLANE_EN, 0x1);
> write_grf_reg(priv, GRF_DPHY_CSIPHY_DATALANE_EN,
> GENMASK(priv->config.lanes - 1, 0));
> @@ -449,6 +461,7 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct phy_provider *phy_provider;
> struct phy *phy;
> + u32 phase;
> int ret;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> @@ -464,6 +477,18 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> + priv->clk_phase = -1;
> + if (device_property_read_u32(dev, "rockchip,clk-lane-phase",
> + &phase) == 0) {
> + if (phase > 7) {
> + dev_warn(dev,
> + "invalid rockchip,clk-lane-phase %u, using default %u\n",
> + phase, CSIDPHY_CLK_PHASE_DEFAULT);
> + phase = CSIDPHY_CLK_PHASE_DEFAULT;
> + }
> + priv->clk_phase = phase;
> + }
> +
> priv->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
> "rockchip,grf");
> if (IS_ERR(priv->grf)) {
>
next prev parent reply other threads:[~2026-08-03 11:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 16:56 [PATCH v4 0/3] phy: rockchip: inno-csidphy: fix 2500 Mbps support and add clock lane phase tuning Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 16:56 ` [PATCH v4 1/3] phy: rockchip: phy-rockchip-inno-csidphy: fix rk1808 hsfreq table Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 17:04 ` sashiko-bot
2026-07-25 17:04 ` sashiko-bot
2026-07-25 16:56 ` [PATCH v4 2/3] dt-bindings: phy: rockchip-inno-csi-dphy: add rockchip,clk-lane-phase property Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 16:56 ` [PATCH v4 3/3] phy: rockchip: phy-rockchip-inno-csidphy: add clock lane phase tuning Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-07-25 16:56 ` Gerald Loacker
2026-08-03 11:04 ` Michael Riesch [this message]
2026-08-03 11:04 ` Michael Riesch
2026-08-03 11:04 ` Michael Riesch
2026-08-06 16:26 ` [PATCH v4 0/3] phy: rockchip: inno-csidphy: fix 2500 Mbps support and " Vinod Koul
2026-08-06 16:26 ` Vinod Koul
2026-08-06 16:26 ` Vinod Koul
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=e4a4eef8-3c42-407b-a6b7-e2f9a32da29e@collabora.com \
--to=michael.riesch@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gerald.loacker@wolfvision.net \
--cc=heiko@sntech.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--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 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.