Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73022606A31A for ; Wed, 2 Dec 2026 10:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=mBphlR6B; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=GXrlvvx8 Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 34665409ED; Wed, 2 Dec 2026 10:28:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id RtnWUql2bDRN; Wed, 2 Dec 2026 10:28:04 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org 6197740A06 Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796207284; b=lbDYkVtWPaXWQK9BXqMJTYZIkAZy/+mieaYhk+/pfQ4dsNhAnzvx4VemKFQHswx1P/L2 SOW6VteQ43gI/vb8of6GQgne+Xf9qZo2m3vmEjRCagcansCqb1DabDOXSDHtfrGCkp7NC /m7gl8Xj5zW0sVSTLbT5T+nkirP7iAk5iNvbmVfrVuIl3voYb8+6x6+/Hx1WQJG1ni1vv AqsaHE3PiWWn57vN2I2ZKWliMm+FFNFqvAPvw3DugzNz9SLILUzvhMTu8Iy8WOsBrgzS4 rhTQ+TB2iS1EKVNE/zB9U1tat28TfiHyFLmAWurZZeRoSQOjXpuh3n5qj45I94nll7A== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796207284; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg: X-Received:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:X-BeenThere:X-Mailman-Version:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=u0n+YNFcmMyOeqNS629GEoFYUxyDiF7wnnMtBbUZqLM=; b=FF2TYjnfdsPxbH69Zz6G7+pNVT/3HWMBK67XgjjJXcjiYG25UTEgEsuvR6gL+Vj3rcXp nzBYm6vjmQN9J1/1HwYKMuwcT4+FgK4+8sLu/2E0ZI5qeU8qQFmYMoNIvSmZBw0GTHL3K WOuFHVDE97GvHAI7+YSLD3UyK3Xk7OqXq2Hx7tTwDGw+3FappL8VhNoT3wSSi6DrgqWLF JZWUHVKCxfGTxSHIbLtu6M3wS3mH1xld5sVa7BRT+I5MM9LW0aTL2i0HUbxUWSx53tvdv DswfokTW5fx4mpeDwC/AVKiPbBzwhcFjfpGKPodDv2M9MXSA+bZgdtC14a2daIjpKjw== ARC-Authentication-Results: i=1; smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796207284; bh=u0n+YNFcmMyOeqNS629GEoFYUxyDiF7wnnMtBbUZqLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mBphlR6BT+VEwnfDivPntY+/zYTn+jkOuaFYc5YvIumQQvYPepYwRADePRn3CrsAL mZwVde1XynMBSh2F8otcrvc6+OVW/opphx4pbz1HHIb+nG6gQL8mWQsHwtcO4AWNSC hc8FMk8XwwsdQEXEn1C23o3bJJ3O11AZsWwx8qsahk3Y5Gsmjm1pSjzbrcEjn8zBqL cuv12uqqB9whpRwieYY7+BcRXGwzMUVhmBICMMj9K+DDR6aHU2/3xH3p/YPQUHYWBu LZl2bMrmE4lfVhGX5G2UnQFYYU/JZo5be+hAF21hu4H/K6dlxkP37Vh9c+iUMCnYRj ckNntcgk/iLNw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 6197740A06; Wed, 2 Dec 2026 10:28:04 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 81BB64C2 for ; Wed, 2 Dec 2026 10:27:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 66AE360820 for ; Wed, 2 Dec 2026 10:27:56 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id u7q9b2HvV5gj for ; Wed, 2 Dec 2026 10:27:55 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 2F113607D8 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip="2a00:1450:4864:20::329" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::329; helo=mail-wm1-x329.google.com; envelope-from=dario.binacchi@amarulasolutions.com; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=GXrlvvx8 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2F113607D8 for ; Wed, 2 Dec 2026 10:27:53 +0000 (UTC) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4bb55cda775so77874815e9.0 for ; Wed, 02 Dec 2026 02:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1796207272; x=1796812072; darn=lists.u-boot-project.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=u0n+YNFcmMyOeqNS629GEoFYUxyDiF7wnnMtBbUZqLM=; b=GXrlvvx8TdTQlCT2EDpTGBa07kKb1zeaty+jhGOQeEmB53SeMwgijdoc2LgmYA0lVY 0+rsW/idBJF++xHSsDahHZ1Yf+anPTrOGvZMp3+WHk2u0kJw4ctVPVrA9L/IIiKyPxLZ vlFrRs8RQoU2ytQnnVUTv6PbilogDslWdheIw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796207272; x=1796812072; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=u0n+YNFcmMyOeqNS629GEoFYUxyDiF7wnnMtBbUZqLM=; b=rAFkb7DACsiTgMfNUAzqyCf7RLivvFE1MWPBUjdx+9Ew9yPGo6qvSCkC3QpRWRfVXW mfFWA/YJK8q27rqnIq90KitxqkK7UnSwkvz0/8bOD6/3lPIeQmC4pS45JDVPh9FknztV D2F1NAldf9oEkACWureaWiRel8bS30XZNaPi9Mt3Bk48SuAG+bk5kmnyBrK+RLBXgpNg 4PaDtu+6sE8ZN033NhFfaC6c1o6GHAhwqxh3XeHwfxihlEsML7KJaKY5HiLckvIqVOFp ndr3aWqjd5FBo7q9Ra6qPf3S9VABHb2+E9eoxqBbq3zVYWoopdaFXr/9TrWxsuCp3t4c Exag== X-Gm-Message-State: APuU4Z+KI+uajzc81WNf6jkuGrUpfIIn0tqSD9OKtM+KFeBSEOP5rGhB FgSyNTUeHsPDJbnhvzuuV4naxvPI8QMGRXifv3CoDJTPRU4VS1yZTJCmAT+Xbp8Iu25GtkU2ta0 +Mn8y X-Gm-Gg: AZFdTZfQh6H4faI1xGnLH5w8wWnVumhmkGH1Lbi0BbgqvnrJnanCvIC/9ujUlboY9lk feOWTmCggf4q0hUcxvLwMwdHJ8MYoNSNPOi1uA0aJGfufmk77GMPwMYZumGRZsl4eaQr3HUEaVL eqa9Iqm7PjBB0TGP23YPulXO6uZaJ0idE21QBKPDYU5/EuPE8dtsPDO7o33zmS4mA6reVD8p003 IpAMQWjFhO5UlgjudZCbRCN6FUlEYdXTrIeWjmPvBkRKGcThmgM9P3smrVc66OMTIchXZlp4xQ3 eU93d4HtsVFZ7agnBDTl9K8KCsVPHCbIP+imAQkxUQdafCjtDlD6cNr1wWZOfw1HAmFNwppKLwX 12N7o9c2ocVfuFI7TK1+hTJipML2prYvDWyYbxHzGld7tuW8alfPfIiOT0qv8tEsK0kOvtuYdqp YOxvwrpiTowAPDj+zIU5MnFQMy9E/E8SnrN+q9bGYlg72st5kkCXEVSsagmTSGTodyH0vXDSX51 +Ev5t1UTIM7VPqude1MQEc3rdcclD88zZ7f4TsDpaqkgI9ogrZj0QxL844ezFfEIK5yQI/42y9D f5tsvt9A+0HZY7fHYi1FtHNYh2SBSEflUv5U7R7e9EelP8acEIzRoCmNNdvgvn8PE+ePQUclfaz 6mlok+BPGppVW/OzlyTAT X-Received: by 2002:a05:600c:c086:b0:4bb:ab2c:67f7 with SMTP id 5b1f17b1804b1-4bbab2c6d69mr310779525e9.8.1796207272155; Wed, 02 Dec 2026 02:27:52 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:6962:3ebc:7df:e6bf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbbaeb1e4csm366823865e9.13.2026.12.02.02.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 02:27:51 -0800 (PST) From: Dario Binacchi To: u-boot@lists.u-boot-project.org Cc: Heiko Schocher , linux-amarula@amarulasolutions.com, Peng Fan , simon.holesch@bshg.com, Marek Vasut , Valeriy.Yatsenko@bshg.com, Leonhard Hesse , michael@amarulasolutions.com, Miquel Raynal , Liu Ying , Andrzej Hajda , Neil Armstrong , =?UTF-8?q?Guido=20G=C3=BCnther?= , Laurent Pinchart , Vinod Koul , Dario Binacchi , Joe Hershberger , Neil Armstrong , Tom Rini , u-boot-amlogic@groups.io Subject: [PATCH v3 17/26] phy: dphy: Correct clk_pre parameter Date: Wed, 2 Dec 2026 11:26:28 +0100 Message-ID: <20261202102716.572884-18-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261202102716.572884-1-dario.binacchi@amarulasolutions.com> References: <20261202102716.572884-1-dario.binacchi@amarulasolutions.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Michael Trimarchi Upstream linux commit 9a8406ba1a9a29. The D-PHY specification (v1.2) explicitly mentions that the T-CLK-PRE parameter's unit is Unit Interval(UI) and the minimum value is 8. Also, kernel doc of the 'clk_pre' member of struct phy_configure_opts_mipi_dphy mentions that it should be in UI. However, the dphy core driver wrongly sets 'clk_pre' to 8000, which seems to hint that it's in picoseconds. So, let's fix the dphy core driver to correctly reflect the T-CLK-PRE parameter's minimum value according to the D-PHY specification. I'm assuming that all impacted custom drivers shall program values in TxByteClkHS cycles into hardware for the T-CLK-PRE parameter. The D-PHY specification mentions that the frequency of TxByteClkHS is exactly 1/8 the High-Speed(HS) bit rate(each HS bit consumes one UI). So, relevant custom driver code is changed to program those values as DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE), then. Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares. Tested-by: Liu Ying # RM67191 DSI panel on i.MX8mq EVK Reviewed-by: Andrzej Hajda Reviewed-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Guido Günther # Librem 5 (imx8mq) with it's rather picky panel Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220124024007.1465018-1-victor.liu@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/phy/meson-axg-mipi-dphy.c | 2 +- drivers/phy/phy-core-mipi-dphy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/meson-axg-mipi-dphy.c b/drivers/phy/meson-axg-mipi-dphy.c index 3f89de19970b..fb10ccca6ac1 100644 --- a/drivers/phy/meson-axg-mipi-dphy.c +++ b/drivers/phy/meson-axg-mipi-dphy.c @@ -237,7 +237,7 @@ static int phy_meson_axg_mipi_dphy_power_on(struct phy *phy) (DIV_ROUND_UP(priv->config.clk_zero, temp) << 16) | (DIV_ROUND_UP(priv->config.clk_prepare, temp) << 24)); regmap_write(priv->regmap, MIPI_DSI_CLK_TIM1, - DIV_ROUND_UP(priv->config.clk_pre, temp)); + DIV_ROUND_UP(priv->config.clk_pre, BITS_PER_BYTE)); regmap_write(priv->regmap, MIPI_DSI_HS_TIM, DIV_ROUND_UP(priv->config.hs_exit, temp) | diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index 79cab9125002..27cff85709d9 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -36,7 +36,7 @@ static int phy_mipi_dphy_calc_config(unsigned long pixel_clock, cfg->clk_miss = 0; cfg->clk_post = 60000 + 52 * ui; - cfg->clk_pre = 8000; + cfg->clk_pre = 8; cfg->clk_prepare = 38000; cfg->clk_settle = 95000; cfg->clk_term_en = 0; -- 2.43.0