From patchwork Mon Aug 29 18:40:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2325 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 EE41340F47 for ; Mon, 29 Aug 2022 20:41:44 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id i74-20020a62874d000000b005381588912bsf1692537pfe.0 for ; Mon, 29 Aug 2022 11:41:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661798503; cv=pass; d=google.com; s=arc-20160816; b=g+KP6Z6owMEHUjYZh+dBNhf8eaCfZFXEku8+LjHgm+2eu6ZUkp06tv7hiOLySF9WgF 1F5bA8K1yuGqhXIvpciR3SZob+MvF+aHM/1+00HLBI1B+FiMqaqxBK98IA8ecPqq6vaw YXQmUmrlve2sfK92mXNQjJ6T04IJWvaOnL/yVi3Qjwcw6aVuoy0TUfNDFSZASS5Diyh3 ehvFNV3LK1G5P3gzuqEkps1iH6wxEfdU/C7Mw7P0UP/6ylY1+k7Ti73TfrYqcmpHiNFI 0msvAjl4dc0bJ9dSIleGY/+H0BnZNhBBaDqioZhkaXZ6+ZxCx3jTYZL8iDfT14OJdpVJ t8gw== 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=X/EtkSvk8BovO+OSCVRx1agen1yd/2av+NRMZdCwQd0=; b=TBxdPkHQRfrffwruFphGo0nZuMYHsh0dbzGw9dVbHVpk9nBNVsi9QOARXJD81NypOa lYLkMaz67InknotmG8iTpNc3p5X0aAAWSUlwqZpE/yiuxuyc748O9WL0ONg2lAKcNM98 hNNcX2NBcH1ImLYPwmwHZJAk0MgkW9HImnGJVNyxrJfyvJ53dpEmuHHKp/ukTG7M8NQK XwNjiTRCAxPDrfddHhfVqlgQm255JBXf/JKl6tWcKhk+Zbi5DxzTcTPong2uIBxWzMLt ILPzqUx5wF/FaJMU9f2RwRNCaX1T+QmyfJnZkTx0lHKeS1MVhTwPDHNe11y0q26hPej+ 4fTQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KLyBqgHk; 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=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc; bh=X/EtkSvk8BovO+OSCVRx1agen1yd/2av+NRMZdCwQd0=; b=ZsNLWIVlDJ9tHmaYgJQaLso5Qj2YRonAW8X+kGhbqwXWHAPF9031o4JGMTV6xWuO6r 2DiFuOtcYzDf0fok4Q2RQ9c+BE2NYTyLZbIpw6GkfJCJzZR3LEAyN7jo1FwEdy7qAY+s rh4/BjWFsx+UXKQU1hVRmvJWBOfdxvUpy5lVE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=X/EtkSvk8BovO+OSCVRx1agen1yd/2av+NRMZdCwQd0=; b=dWZMCMBAKqqUlyy49tW5juO+DHaAx4m5pqyv35hZXlG2F+SytCNO2rXWI5gbAGjpt9 R4y7qXHGzCT6HPIm3dM5T2fHeqh+ZZ0NSCIHz4z27CfMo8PiTNr7Wq0bwwXlNFBjHggB 2PvSOEo/z1CRDl2sqqI1BGsID0yXGjF4S9pXTuhK07xoqDMhg92RYi/QxoNMxNtCHBSC o54mlyGSdl2u8DR8diG/V2xmEaGm9+hLHV6KmpDbd/F7U7MPUUQkYTOuKjuepILDPVNG +K3Y9v/nM4cTg++Ktgww9oJTFaUcW3yE0fF6d5TJTZq2Q0vioFCeHmICWp1A3MvYui6a fKMw== X-Gm-Message-State: ACgBeo0Bt0ZB5CfcRIvB6vysmrSwqywr0tQKUDcg2QNd30++ER4/93+a 84N3yxYWTo2IXH4r0ZdkEYcRRDgq X-Google-Smtp-Source: AA6agR5imGpDAOAdiLSbkXi7yweSBfFWJ2Z1D7BAn8pTRsuh+Bdwri1peehouq9bmrOyOJX/LKPrfw== X-Received: by 2002:a17:902:f60f:b0:172:86f6:241b with SMTP id n15-20020a170902f60f00b0017286f6241bmr17822125plg.162.1661798503789; Mon, 29 Aug 2022 11:41:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b108:b0:174:be81:7114 with SMTP id q8-20020a170902b10800b00174be817114ls2301436plr.11.-pod-prod-gmail; Mon, 29 Aug 2022 11:41:43 -0700 (PDT) X-Received: by 2002:a17:903:41c6:b0:16f:3d1:f63 with SMTP id u6-20020a17090341c600b0016f03d10f63mr17477633ple.50.1661798502903; Mon, 29 Aug 2022 11:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661798502; cv=none; d=google.com; s=arc-20160816; b=IxvqQ+5prGccQ0qPfe6vBUQegf1GQzW5gWun6FlNcieCSyD/Ze0wKGFq/daN6yStAQ VBndwCiGRZYqciT6dhiUdvfETRYNa4iIau8x+kQzm3UXycrxVcNVGQG2CHID/fwhPG4j 9XfpSiXtZ0lF4JPh7uv6DGh50exXwR59R9evVfn1Ry8piI9b2824zZHKhLm+qZzZJpAP qwctJRFyM5J5Qf3XE3kJswg70MDnu0HH53uPyptgC/o64+nJLE2jQhTsTVg0YwYstoWP 46vFbKx+8d4aeZh1jCkbT9S9NGeKIszqXSrmt104csfD0iBdLsGJolCOoi99RPPGAcYP j1uA== 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=xMi0yFur/nA6QX+prP8Y5QXRtVTqBYGjaNwK4RB7jg8=; b=Itt3Ue80SZshJSx1UBSqxdZMeyWI+UUWWjchJAITfV5npDKfnrh99Fr25yYZHnXCry nFIVFnX7N4M33ViOMsut2l7fmjI/ONWEWZewjaJTWE9jaNJHU7SGUHiigtE0fn5SoQrX ttXbKgJ/iLvaRXQIb9rftin57uMU/I8eN3h7KPqoSU52P+ZyOsY4aH2bjdpJjSMULFGj 5GoD/Cza20TrgB2Qp/LU7ZIhnQwr7vQ6jr58A4J8jtApB1JBKw/I3KQJS5iQLjfjGthw yO/c3SMhxdDnrP2RLNJBChdDHagPHWPG7olG2uwvOyPwJrNFwBOg0OC9KjwIqQzLVuc+ k0KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KLyBqgHk; 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 u10-20020a170903124a00b00174aa1ef0bdsor1855686plh.73.2022.08.29.11.41.42 for (Google Transport Security); Mon, 29 Aug 2022 11:41:42 -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:a17:902:dac8:b0:174:cf17:6e87 with SMTP id q8-20020a170902dac800b00174cf176e87mr5795736plx.129.1661798502540; Mon, 29 Aug 2022 11:41:42 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:42 -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 , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v4 07/12] drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset Date: Tue, 30 Aug 2022 00:10:26 +0530 Message-Id: <20220829184031.1863663-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-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=KLyBqgHk; 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 v4, v3, v2: * none 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 b6883a6d4681..b6d17c0c9e58 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -168,7 +168,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) @@ -368,6 +368,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -381,6 +382,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -392,6 +394,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -404,6 +407,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -416,6 +420,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -563,7 +568,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 e15fbfd49efe..95d3f89aec4f 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -47,6 +47,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; enum samsung_dsim_quirks quirks; };