From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=203.205.221.149 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795247924; b=lQ0/UDsXhb4+932lCvhtQQOZxDT4ekhj/vdmPFipllosdlEgJExo488MR9eV9ErPgcY5 0PnKwVahtOrTP6vYFxe5dv2UCYf2GjeAUbh46vnnZb6kmIgNPTuiJnqBF2nBuLGC8EnaR t4gCedRTtUJgj5Mu2ckGR/WyXSuS3f8DNTmdYksPMmXajnP1ucjgbsXWDZNqqJI1C22vy xeKIT9SnKse8nEC85x7WiAG6sv13RLmJZwtlexw23O8L44oV5e2RdX89rQPTNwWzo3wWB 0A7vVx5Fa6ig8vBol2OmGn2qhWx4Jh3eNUMxYlElC3KA4ef7dQZDOa204O5RzRaJs9A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795247924; h=DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:Message-ID: X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Cc:Subject:Date:X-OQ-MSGID: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=Xmt8jo7oKKzTvhYcY6f1b8Zs3I9/GqGJBF3qAGH80D4=; b=xvwzic5fCdNNEAdot3nii+Qz4mwXt/qjolGw8UzHSr6J28+B/eSv40VpYkb7JF6yWfXG F4HYPF3Nsz6Cl0xdlb3WsU18IIOqO4B0Qh7qwzoNHD0weYmUjdsfCcGdPW9ssacnWIfA3 dqcjudAXcHPL6DnW+hOHU0hqYHtft3hKa2zRRrUjaJty8+PFFJy7c2po6BJkE5XO+Pcjq XrN+isCBJNs8aJdkewHN3xRn9TztLc+1wS5QOE15gn0rOJNRfkEnnGIKz+Y2V0IFF+8ME /Phr5o9d+80bKN/fOK0z5ROtBzsDJsXZIvD4640HvIKefMkw+/Ss3kyGnWauH0bbrgg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=Ispycg+a; arc=none smtp.remote-ip=203.205.221.149 Received: from out203-205-221-149.mail.qq.com (out203-205-221-149.mail.qq.com [203.205.221.149]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9397D606A320 for ; Sat, 21 Nov 2026 07:58:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9397D606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=Ispycg+a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1795247921; bh=Xmt8jo7oKKzTvhYcY6f1b8Zs3I9/GqGJBF3qAGH80D4=; h=From:To:Cc:Subject:Date; b=Ispycg+a3sAa1WU5PXGrZMh41is5LNCwzCByGkiY+g934KrMoGXybO5ibYIyrQ/dh Q0o4F/c9CiyI4TSnKEd/AkTk8QCld7LgW/yGhuvAp78eYPz3X8bL4SL5ONFKJHCdj9 954UKaKLVuD07iljE3JER49pDrXVSMpM5fT6IaUM= Received: from jerry-PC.lan ([2408:8249:5f:7101:71a:8713:56b4:5043]) by newxmesmtplogicsvrszb51-1.qq.com (NewEsmtp) with SMTP id EA517A94; Sat, 21 Nov 2026 15:58:37 +0800 X-QQ-mid: xmsmtpt1795247917t4zunjgeo Message-ID: X-QQ-XMAILINFO: OKquegeHeYmF6WbOtyTZ71BnVYmwKY+O+h3/k7lMB2BxYQi7WXNhMgPMUkX+yU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YxzOr/MBAlMfoBE7X7DrhUJ2n+JLp+q9tAWMLuZPVPiqGYdgD1 X-QQ-XMRINFO: OWPUhxQsoeAVwkVaQIEGSKwwgKCxK/fD5g== From: ZhuXiangyu <1194781887@qq.com> To: Vinod Koul , Neil Armstrong , Heiko Stuebner , Sandy Huang Cc: Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Manivannan Sadhasivam , linux-phy@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, ZhuXiangyu <1194781887@qq.com> Subject: [PATCH] drm/phy: rockchip: fix RK3506 DSI low-power command handling Date: Sat, 21 Nov 2026 15:58:35 +0800 X-OQ-MSGID: <20261121075835.1283525-1-1194781887@qq.com> X-Mailer: git-send-email 2.47.3 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Two bugs keep the RK3506 MIPI-DSI link from initialising a panel: the DPHY programs the wrong high-speed timing entry, and the PHY data lanes are never enabled in the GRF. 1. phy-rockchip-inno-dsidphy picks the wrong HS timing entry The 1.5 GHz inno DSI PHY timing table stores its rates in Mbps while the other tables and the lookup use Hz. The mode enable code compares inno->pll.rate in Hz (e.g. 372000000) against timings[].rate in Mbps (e.g. 400), so the comparison never matches. The loop runs to the end and the last, fastest entry is used, which programs a TLPX/LPX counter that is far too large. The panel then cannot decode the low-power DCS commands and stays in sleep mode, so the display stays black even though the LP packets are visible on the data lane. Convert the 1.5 GHz timing table rates to Hz so that the lookup selects the correct entry. 2. The RK3506 DSI GRF lane enable bits are never written rk3506_chip_data only clears the turnaround / force-stop fields, so the PHY data lanes stay disabled unless the boot loader happens to enable them. Program RK3506_DSI_PHY_ENABLE_LANE0/1 as well. Tested on the RK3506B JerryTech board: the panel now receives the init sequence over LP and the framebuffer console is visible. Signed-off-by: ZhuXiangyu <1194781887@qq.com> --- .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 6 +++- .../phy/rockchip/phy-rockchip-inno-dsidphy.c | 28 +++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 30d6f83c..116cc140 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -199,6 +199,8 @@ #define RK3506_SYS_GRF_SOC_CON6 0x0018 #define RK3506_DSI_FORCETXSTOPMODE (0xf << 4) +#define RK3506_DSI_PHY_ENABLE_LANE1 BIT(9) +#define RK3506_DSI_PHY_ENABLE_LANE0 BIT(8) #define RK3506_DSI_TURNDISABLE BIT(2) #define RK3506_DSI_FORCERXMODE BIT(0) @@ -1727,7 +1729,9 @@ static const struct rockchip_dw_dsi_chip_data rk3506_chip_data[] = { .lanecfg1_grf_reg = RK3506_SYS_GRF_SOC_CON6, .lanecfg1 = (FIELD_PREP_WM16_CONST(RK3506_DSI_TURNDISABLE, 0) | FIELD_PREP_WM16_CONST(RK3506_DSI_FORCERXMODE, 0) | - FIELD_PREP_WM16_CONST(RK3506_DSI_FORCETXSTOPMODE, 0)), + FIELD_PREP_WM16_CONST(RK3506_DSI_FORCETXSTOPMODE, 0) | + FIELD_PREP_WM16_CONST(RK3506_DSI_PHY_ENABLE_LANE0, 1) | + FIELD_PREP_WM16_CONST(RK3506_DSI_PHY_ENABLE_LANE1, 1)), .max_data_lanes = 2, .max_bit_rate_per_lane = 1500000000UL, .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing, diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c index 6ad04b0c..fcf7aa17 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c @@ -282,20 +282,20 @@ struct inno_mipi_dphy_timing inno_mipi_dphy_timing_table_max_1ghz[] = { static const struct inno_mipi_dphy_timing inno_mipi_dphy_timing_table_max_1_5ghz[] = { - { 110, 0x02, 0x7f, 0x16, 0x02, 0x02}, - { 150, 0x02, 0x7f, 0x16, 0x03, 0x02}, - { 200, 0x02, 0x7f, 0x17, 0x04, 0x02}, - { 250, 0x02, 0x7f, 0x17, 0x05, 0x04}, - { 300, 0x02, 0x7f, 0x18, 0x06, 0x04}, - { 400, 0x03, 0x7e, 0x19, 0x07, 0x04}, - { 500, 0x03, 0x7c, 0x1b, 0x07, 0x08}, - { 600, 0x03, 0x70, 0x1d, 0x08, 0x10}, - { 700, 0x05, 0x40, 0x1e, 0x08, 0x30}, - { 800, 0x05, 0x02, 0x1f, 0x09, 0x30}, - {1000, 0x05, 0x08, 0x20, 0x09, 0x30}, - {1200, 0x06, 0x03, 0x32, 0x14, 0x0f}, - {1400, 0x09, 0x03, 0x32, 0x14, 0x0f}, - {1500, 0x0d, 0x42, 0x36, 0x0e, 0x0f}, + { 110000000, 0x02, 0x7f, 0x16, 0x02, 0x02}, + { 150000000, 0x02, 0x7f, 0x16, 0x03, 0x02}, + { 200000000, 0x02, 0x7f, 0x17, 0x04, 0x02}, + { 250000000, 0x02, 0x7f, 0x17, 0x05, 0x04}, + { 300000000, 0x02, 0x7f, 0x18, 0x06, 0x04}, + { 400000000, 0x03, 0x7e, 0x19, 0x07, 0x04}, + { 500000000, 0x03, 0x7c, 0x1b, 0x07, 0x08}, + { 600000000, 0x03, 0x70, 0x1d, 0x08, 0x10}, + { 700000000, 0x05, 0x40, 0x1e, 0x08, 0x30}, + { 800000000, 0x05, 0x02, 0x1f, 0x09, 0x30}, + {1000000000, 0x05, 0x08, 0x20, 0x09, 0x30}, + {1200000000, 0x06, 0x03, 0x32, 0x14, 0x0f}, + {1400000000, 0x09, 0x03, 0x32, 0x14, 0x0f}, + {1500000000, 0x0d, 0x42, 0x36, 0x0e, 0x0f}, }; static const -- 2.47.3