Devicetree
 help / color / mirror / Atom feed
From: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
To: sashiko-bot@kernel.org
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, gianfranco.mariotti94@gmail.com,
	robh@kernel.org, sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH 2/2] drm/bridge: Add Rockchip RK628 HDMI to LVDS bridge driver
Date: Thu,  3 Dec 2026 03:07:39 +0100	[thread overview]
Message-ID: <20261203020739.34050-1-gianfranco.mariotti94@gmail.com> (raw)
In-Reply-To: <sashiko-outbox-246905@kernel.org>

On Thu, Dec 03, 2026 at 01:47:28AM +0000, sashiko-bot@kernel.org wrote:
> [Severity: High]
> Does rk628_cru_set_cpll_rate() need to set CLK_CPLL_MODE_MASK (bit 0) in
> CRU_MODE_CON00 to switch CPLL from slow mode to normal mode?
>
> On RK628F, rk628_cru_init() returns early after setting bit 4 in
> CRU_MODE_CON00 without setting CLK_CPLL_MODE_MASK.  When
> rk628_hdmirx_enable() calls rk628_cru_set_cpll_rate(), CPLL locks but its
> mode bit in CRU_MODE_CON00 remains 0, so CPLL stays in 24 MHz reference
> clock bypass and rk628_cru_get_pll_rate() returns 24 MHz instead of the
> configured CPLL rate when rk628_cru_set_frac_clk() programs the
> CRU_CLKSEL_CON13 and CRU_CLKSEL_CON14 fractional dividers.

No, this matches the RK628F CRU hardware reset defaults and Rockchip's
reference driver (rk628_cru.c). Unlike RK628D (which resets with CPLL
and GPLL in 24 MHz slow mode and requires the software mode-switch
sequence), RK628F resets with CLK_CPLL_MODE (bit 0) and CLK_GPLL_MODE
(bit 2) already set to normal PLL mode (1), while only the newly added
APLL (bit 4) defaults to slow mode (0).

RK628_HIWORD_UPDATE(1, 4, 4) in rk628_cru_init() uses the high-word
write-enable mask (BIT(20)) to switch bit 4 (APLL) to normal mode
without clearing bits 0 and 2, so CPLL and GPLL remain in normal mode
and rk628_cru_get_pll_rate() reads back the locked PLL rate. (Note that
hardware testing for this series was done on RK628D; the RK628F paths
follow Rockchip's BSP sequence verbatim.)

I will add a comment in rk628_cru_init() in v2 to document this.

> [Severity: High]
> Should rate_khz be halved in dual-link LVDS mode?
>
> In dual-link LVDS mode, odd and even pixels are split across module A and
> module B so each link runs at dst_mode.clock / 2.  Computing rate_khz from
> the full dst_mode.clock doubles the per-link serial bit rate for modes at
> or above 71429 kHz (such as 1920x1080p60 at 148.5 MHz), selecting half the
> required rate_div in COMBTXPHY_CON5.

No, rate_khz intentionally uses the unhalved pixel clock in both single-
and dual-link LVDS modes (tested on RK628D hardware and matching
Rockchip's rk628_lvds.c / rk628_combtxphy.c reference).

In rk628_post_process_enable(), the COMBTXPHY reference clock (sclk_vop,
selected via SW_TXPHY_REFCLK_SEL(1)) is programmed to the full
dst_mode.clock, and COMBTXPHY_CON5 uses fixed SW_REF_DIV(0) (ref_div = 1)
and SW_PLL_FB_DIV(14) (fb_div = 14). Because the COMBTXPHY PLL VCO locks
against the unhalved sclk_vop input before the PHY splits odd/even
pixels across Module A and Module B (SW_LVDS_CON_CHASEL(1)), rate_div
must be selected against dst_mode.clock * 7; halving rate_khz while
sclk_vop is unhalved would double rate_div and push the VCO out of
range.

I will add a clarifying comment in rk628_lvds_enable() in v2 as well.

Best regards,
Gianfranco

      reply	other threads:[~2026-12-03  2:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  1:33 [PATCH 0/2] drm/bridge: Add Rockchip RK628 video interface bridge support Gianfranco Mariotti
2026-12-03  1:33 ` [PATCH 1/2] dt-bindings: display: bridge: Add Rockchip RK628 video interface bridge Gianfranco Mariotti
2026-12-03  1:33 ` [PATCH 2/2] drm/bridge: Add Rockchip RK628 HDMI to LVDS bridge driver Gianfranco Mariotti
2026-12-03  1:47   ` sashiko-bot
2026-12-03  2:07     ` Gianfranco Mariotti [this message]

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=20261203020739.34050-1-gianfranco.mariotti94@gmail.com \
    --to=gianfranco.mariotti94@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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