From patchwork Fri Apr 8 16:21:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1906 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 454533F066 for ; Fri, 8 Apr 2022 18:22:51 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id h131-20020a628389000000b005056723a9dcsf3170049pfe.8 for ; Fri, 08 Apr 2022 09:22:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649434970; cv=pass; d=google.com; s=arc-20160816; b=FM8D8lAzZpcHP35HCyDu5zWDh6ChcT+8Yl31lz7UoyCYFhiBJ0jfdjVzB697N+Xk/D S7GNC1SKb6P+8r3p9xbX8t+/GIhY0k8LemsN12c8ag3ISctega/Y6kN0EcEsKFAJ9P1x EcAwBmKrY+cuHcYccZjIqN6+qFz5vxh5+SLV8lG2N+GsjVbyAhLc5y6kDHYhRLPKX8ri U+f/MvSRbnSMJctE5pnGSPpPwyzyhbBuxyYpYyB4+90dV82ht5CAmATo4Wx0mE8NZDzP q9lqxXHx5kRYW+tM5LrTl7QwuPq7TDFCyUQZ5CtBcjKKxurHhkv+iknTVTiLzUbp7GTP aPCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=RFIv6t6uU6/28kHtc1+PyuYkIslPcgmBDtw7hOdcXhI=; b=SaPMTYloU4999uUw/0L71GeUxiy2TwhMBgxw/JCOftgjCHL1hZ41U93k4LBRfg1RiE SrC8DcUXg0FgOTqx+AOQVqJh5p4pAJjr9snJtN7op5tO5R7wdt7hT2frdPwI9fa8yQK6 5w5JyBizjd17Q9UHNxvnzoXlNg41Fa6X9EClAsw0j75sdmsgU4tblZMGeL8ev3OlIFUK pyNpKwcRAiXBp3btWrsfnKF8SZObhK5JWh5W4sYl0500iTwZblJzMQHxY8t/dZQrD+CO PmBvKghkbu4utByrOAq4h47QllKtBu7mmoUl9dJ3Td8Y0RdWApbcf9UnUmNa0nqI29ER G9JA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VjoSi9WU; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=RFIv6t6uU6/28kHtc1+PyuYkIslPcgmBDtw7hOdcXhI=; b=F3TZKnirDl9dDCRihBg8P5ov3307vwdQUQSec7Q8Wc04osZba+CpuhyuLjqSUjBxNN 9MyqvGaxTB4Eovkl0Qzv5y7sZcvMhcQujdhMtvurbiuugT0RyoxT1qFL0l6osN7yiICu jeJMYl5JCBv5jzdkvNgNX6aw3y2zwd+QECVMQ= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=RFIv6t6uU6/28kHtc1+PyuYkIslPcgmBDtw7hOdcXhI=; b=L/qnanqf1Rt93iFh5xNr8djKvdJMntAE+NkT4QlrCnNJmkLAmqSy8whFKHbBIvKKYj AeBN2UUfgBegkypGMqeNbTm1E+C4zAIJXZhab4pMaLf0bmIT6Cqc3ZS17OmnjNdYPOi5 4g5F6ualpfErnUwVy4NDzlUc3JJ6+ceUV6cUXOabt0sODuR6P9e0ilVzjin1ef7ElfU4 a2GS7mLkuKVOYyMQHCxAwZ+lltxuE+7FxapCY4KlNQ2h3n7vqVIz/U6b3GSfuEDYQHKF PLnnwIAJ+IqwXMDXnqFPeirpqeFNd7fK/+eoWyxcaQsRXbRvgm2dN8VHleum+VtfovHc KWXw== X-Gm-Message-State: AOAM531NUkS7DP8t9/XSPiqjaGEeDmAcpNB+h9l2RwFKHCBdJgIoopgA YxCPVcZMnIp/cwpOhBEu+KqunJCR X-Google-Smtp-Source: ABdhPJy6jPwyj8YU1bZ2maF7w3vIozfQ0JAs3g4CJuoF51J37KCRzTFqA0V0zzO8QtQ0feCb5diAPg== X-Received: by 2002:aa7:88d6:0:b0:4fa:ba98:4f5d with SMTP id k22-20020aa788d6000000b004faba984f5dmr20330440pff.5.1649434970018; Fri, 08 Apr 2022 09:22:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:13aa:b0:4fa:9dfd:68ee with SMTP id t42-20020a056a0013aa00b004fa9dfd68eels1433356pfg.10.gmail; Fri, 08 Apr 2022 09:22:49 -0700 (PDT) X-Received: by 2002:a05:6a00:1908:b0:4f7:8813:b2cb with SMTP id y8-20020a056a00190800b004f78813b2cbmr20343967pfi.54.1649434969238; Fri, 08 Apr 2022 09:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649434969; cv=none; d=google.com; s=arc-20160816; b=XPrmAp0JU+HlFq6qPnXLunr70jI0lijWGPrIyybUhjM6V8zoyhOHB8RbaDRkmCCCmq yVbHatgWjjC9nSXLpLVWX89sSuDRHJfoZFNYcNwMZYBu9HEu5x44n131JoD4heptZlfm BpKwcYeAB+Kd3pA3/u9h7lZm8rH1c2GSrspUmIJchgonv3bdBm7Siy8VY6Zqm9ScHMSc ZmY0o6R8thv3PnAgO4TwqRvDVigjpDBHJMTfLrBGgjJfNfTMniloFiXk94H8q28JrxLD CtxZNds7VC7TT/V+M4EKF5u7SbijCqzdca9BqUyo01nP0vbRTqiU/ACYsxM6IvFABs+1 meaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=h67+xEaF679u3X7yXL9S0kYbWc8Rb5WkxAfTc72OsWE=; b=McRZJhfOQg/e0ZKOu6GevB1VegU0clGsvRsu5qpQi6xTqkl/zsJOPYfqTTh2dSESId lYs09skQycavfXgxdYcZPTAMWVjUkhApRKe/EI1NvAWdzeHYCMYpKtnpiAI/k54UlcIL ZyYoLpJE7DzIoqc8tUXBJCSM7RxI39lawXoQ1yGqIvJ0u5oct1GhisuY5fGODWQvHfxt TA2Y3FrzeUhAyF4VzR0euEHhjwrdB79D7POedihTJ6z4kCLb905yB5D1i46GCOcqQkbm VaSJ3fJeblIVW4OFrFJYaCQlU09dgeT+wbJ6PitKlqnuEvDzhYbInrenaJy5LH1tKWhm DzIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VjoSi9WU; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id t71-20020a63814a000000b003746edc71e0sor1020413pgd.2.2022.04.08.09.22.49 for (Google Transport Security); Fri, 08 Apr 2022 09:22:49 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a63:ec46:0:b0:381:81c4:ebbd with SMTP id r6-20020a63ec46000000b0038181c4ebbdmr16197865pgj.534.1649434968925; Fri, 08 Apr 2022 09:22:48 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22:48 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 05/11] drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset Date: Fri, 8 Apr 2022 21:51:02 +0530 Message-Id: <20220408162108.184583-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VjoSi9WU; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 with 13.7.10.1 Master PLL PMS Value setting Register mentioned PMS_P offset range from BIT[18-13] and the upstream driver is using the same offset. However, offset 13 is not working on i.MX8M Mini platforms but downstream NXP driver is using 14 [1] and it is working with i.MX8M Mini SoC. Not sure about whether it is reference manual documentation or something else but this patch trusts the downstream code and fixes the PLL_P offset. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n211 v1: * updated commit message * add downstream driver link Signed-off-by: Frieder Schrempf Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 10 ++++++++-- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 3e12b469dfa8..423d654e8ffd 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -169,7 +169,7 @@ /* DSIM_PLLCTRL */ #define DSIM_FREQ_BAND(x) ((x) << 24) #define DSIM_PLL_EN (1 << 23) -#define DSIM_PLL_P(x) ((x) << 13) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) #define DSIM_PLL_M(x) ((x) << 4) #define DSIM_PLL_S(x) ((x) << 1) @@ -369,6 +369,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, .platform_init = true, }; @@ -382,6 +383,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, .platform_init = true, }; @@ -393,6 +395,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, .platform_init = true, }; @@ -405,6 +408,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 0, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5433_reg_values, .platform_init = true, }; @@ -417,6 +421,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 1, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5422_reg_values, .platform_init = true, }; @@ -564,7 +569,8 @@ static unsigned long samsung_dsim_set_pll(struct samsung_dsim *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index eca7eacb5910..4eb48ec6543f 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -38,6 +38,7 @@ struct samsung_dsim_driver_data { unsigned int max_freq; unsigned int wait_for_reset; unsigned int num_bits_resol; + unsigned int pll_p_offset; const unsigned int *reg_values; bool platform_init; };