From patchwork Thu Feb 17 00:08:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 543322 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp38327imn; Wed, 16 Feb 2022 16:08:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0xQl4Hzwrqe1BRT58avRjkvFE4b+mrl4fC2kc6xBVrGSN6hoalQMBgMtauDFOfmGArXlG X-Received: by 2002:a17:902:654b:b0:14d:964d:7578 with SMTP id d11-20020a170902654b00b0014d964d7578mr351892pln.166.1645056526559; Wed, 16 Feb 2022 16:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645056526; cv=none; d=google.com; s=arc-20160816; b=jm7W9kO2QeKNFx05qfNc8Ku0DamzFFTThc6mdUTFLbFG4rALHsgp9BTdd0FcE4o7Ev NRlmdhjsNG1ijK/ALiFh34ZnNBsaPsZ989I+F2bNfn1NAfjrmCUOJSRBSSReOnK04/fp jiHR38mAFODynwwZVFDbh3Rhs8ztkCCLu8gahQWXwnMHBT83kU4BuwRfcHouTlDaUvv8 LmE8kz4ONXKUkjcwag08rGJcq83v1m2YT/XCsiLwUO+H7Y/0uiAeIbbY0x7w13/PK+z7 +W3Y3crSuqcap1S7bgAXJuTf2v/pYkwcjmvmWfp1ePRRSsdTb0ugw/UQDej5IH80e/Lu TMjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :delivered-to; bh=cJ+5mbwD/7lPCQPyt9Z7JoknhxYPPxgDVRd9pXODZ5o=; b=kjkw2Yix6p/VQvXXs3+BIs3e0GmUvIMNgIqTKpiB3ULHGlvqM1yimDZku44iUQYh3B WTDwXOmZ1Uieqh5pZhuPAV4CXLs5uUKyxQ/b1DjaXcWN5OlmOYZuKKMeudrRa5Y+oRHy HkR0gupuDGlq7FGnU7aBZVje3oApSgacRgzdY7UMSqM/58HqiWSudQJuP3yICEQo9+T8 jS9L6rLVt8qpnyq6X2SAxEnWCu5ZnXv4vtQlnw/me5gf9WoL9JvaCdsxzC7GoF8xP9nT HnJdaRzcgdzZfYmQoKwp2KIAxNysmXLoNCTgpW2EVGnT2fWmg9cZCKtPChrGUCQo+Oy9 gZbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="vC3CA/0Y"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id k20si403309pjq.95.2022.02.16.16.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 16:08:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="vC3CA/0Y"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBADD10E1F8; Thu, 17 Feb 2022 00:08:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 080CE10E1F8 for ; Thu, 17 Feb 2022 00:08:40 +0000 (UTC) Received: by mail-lj1-x230.google.com with SMTP id r20so5837545ljj.1 for ; Wed, 16 Feb 2022 16:08:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cJ+5mbwD/7lPCQPyt9Z7JoknhxYPPxgDVRd9pXODZ5o=; b=vC3CA/0YHRFW4zBqC0DeMPM5gDVicSFaSDXd1UK11xJBi8q+szSDcaAv33hiWrgkj4 EL26NvtOIjV1cQWedrxXJuGCDYKAYK14sVCzugaPkkdrCHWzDJDITQ1aVWcReqPd0R8j E5Iy5vHe2r8W+Fi6hP/VgoGwjKCO17p0Ma3win19afh4VMLQN7RvgbVe+Sui+M/q0Ukc q/R3yQ8MCJfox1DA4wXjPJxHlcknj3AllFDXIHC6/ySzK0bhmoNhbewwQ68tuwIO1MvZ 7n9idR0HtuLK6VNP8/OKunOf4lAA8XWw/zeTlq3jT28tT675wPvlX3yl+N6gSgTaDDlO pyIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cJ+5mbwD/7lPCQPyt9Z7JoknhxYPPxgDVRd9pXODZ5o=; b=edWhan/Xj5kj3H10Wedrf8e23yH6U4vwxeEmCz1ERgAnbMwjjyg7YtMsFNON+ZRCEV QAlE7qu/+WFPom7kpg9nuswcC789SAIp5aALlv5Rk2rCEU+seyRnoEkkSJS7WViMNWlQ jqijSapthpPkwpNIcgShh2AQDQcTKpNkFerWITC1BY/t/x5D5q7MeNEsvzrG5NyM46sH pLoJNYMt+rXiVTGoUskfCF+JrUvJKv6Sl+jpgzaN345JFVHlwKjWu03nlvwmkpJ+DcCT wh63c2t80EIBQsxdKAIElPSSBMgALHMFMpICZQwTpXcP6RuTozWyv/U+RtQYbkd9WoQN P+sw== X-Gm-Message-State: AOAM533xxudfilFdmDPFstLa1AcopnxKhJtRYLK+fLsogTD1UArzwUe0 Jzn/2nA3JQblBfSds/kKW37Thw== X-Received: by 2002:a05:651c:307:b0:244:dc4c:c2f2 with SMTP id a7-20020a05651c030700b00244dc4cc2f2mr331058ljp.531.1645056519081; Wed, 16 Feb 2022 16:08:39 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id x3sm740845lfr.283.2022.02.16.16.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 16:08:38 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH] drm/msm/dsi/phy: fix 7nm v4.0 settings for C-PHY mode Date: Thu, 17 Feb 2022 03:08:37 +0300 Message-Id: <20220217000837.435340-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The dsi_7nm_phy_enable() disagrees with downstream for glbl_str_swi_cal_sel_ctrl and glbl_hstx_str_ctrl_0 values. Update programmed settings to match downstream driver. To remove the possibility for such errors in future drop less_than_1500_mhz assignment and specify settings explicitly. Fixes: 5ac178381d26 ("drm/msm/dsi: support CPHY mode for 7nm pll/phy") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c index 36eb6109cb88..6e506feb111f 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c @@ -864,20 +864,26 @@ static int dsi_7nm_phy_enable(struct msm_dsi_phy *phy, /* Alter PHY configurations if data rate less than 1.5GHZ*/ less_than_1500_mhz = (clk_req->bitclk_rate <= 1500000000); - /* For C-PHY, no low power settings for lower clk rate */ - if (phy->cphy_mode) - less_than_1500_mhz = false; - if (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V4_1) { vreg_ctrl_0 = less_than_1500_mhz ? 0x53 : 0x52; - glbl_rescode_top_ctrl = less_than_1500_mhz ? 0x3d : 0x00; - glbl_rescode_bot_ctrl = less_than_1500_mhz ? 0x39 : 0x3c; + if (phy->cphy_mode) { + glbl_rescode_top_ctrl = 0x00; + glbl_rescode_bot_ctrl = 0x3c; + } else { + glbl_rescode_top_ctrl = less_than_1500_mhz ? 0x3d : 0x00; + glbl_rescode_bot_ctrl = less_than_1500_mhz ? 0x39 : 0x3c; + } glbl_str_swi_cal_sel_ctrl = 0x00; glbl_hstx_str_ctrl_0 = 0x88; } else { vreg_ctrl_0 = less_than_1500_mhz ? 0x5B : 0x59; - glbl_str_swi_cal_sel_ctrl = less_than_1500_mhz ? 0x03 : 0x00; - glbl_hstx_str_ctrl_0 = less_than_1500_mhz ? 0x66 : 0x88; + if (phy->cphy_mode) { + glbl_str_swi_cal_sel_ctrl = 0x03; + glbl_hstx_str_ctrl_0 = 0x66; + } else { + glbl_str_swi_cal_sel_ctrl = less_than_1500_mhz ? 0x03 : 0x00; + glbl_hstx_str_ctrl_0 = less_than_1500_mhz ? 0x66 : 0x88; + } glbl_rescode_top_ctrl = 0x03; glbl_rescode_bot_ctrl = 0x3c; }