From patchwork Thu Nov 10 18:38:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2477 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 911DF3F039 for ; Thu, 10 Nov 2022 19:41:42 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id i8-20020a170902c94800b0018712ccd6bbsf1899811pla.1 for ; Thu, 10 Nov 2022 10:41:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668105701; cv=pass; d=google.com; s=arc-20160816; b=w2TxS9DyaTjM+LdXBd6Q+0uEfd5tRazeloZ+5rO+tGumAeTVJQzWla1xdk+aItudey C0ssRknXkhzA4RtnxsgwRmznglabYvrGsev6vVrh9J6/o6Zzn2AYY6hltIMbSG0XjobQ ZgT/mINWSj95zuYTIPuMYy6l59tSgOQjtfCRLz1Tjf6LF+TpszPYeTe4wiF37I+9tuBE LHvm6sbML3YSw0PaAMwzWTwoBd+FoMr/D08k5HQeI7rtb+wJz0UZJwdhLnN9lY+yMDmv 0UvOlvT6uuWGdvsZ3Z5/rMqlDt91fs6w3NtC/mtppq5U9IirtkVpO5x5vh8GA0W/MLJM PuOQ== 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=sELxU93EMoFuFtsCPX1JBq6bq7DUUG0CGJP6UOj+IS4=; b=nhtLYLeRfK9CeHBnTrQ2RY5cwnuEcMrDhTn3P2Wur2uL5fZ9k8eL/7eSGCprS4sGag FxL3mGFp27yZoJv2Ms8kwVVl0Ge8Xb0BFhNX5OwOFudpqpmq8Vg+brCXbNiy/Ar5x5CU g0mvYhAnhpbNmf6TFm/AtN/Iz+c/EpxhW1W+3kMFSzpqo1gLrm/GXRl4XAZ692ZqXOgQ mm9JL4hUyZEceaAG9NTJWC0AV22BCq6xsZGblVwNLrdFU8Dbc6Vs9rGBbV4Uq86MweX7 wMhav1rD5zwlGesVZP6+0yhs53G4dXKBZI8z1U/+kZf+JqmxrK4ljfjndWnlcxblF7Gc p9qw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Ga//SO59"; 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:subject:date:message-id:reply-to; bh=sELxU93EMoFuFtsCPX1JBq6bq7DUUG0CGJP6UOj+IS4=; b=NEU/ZdiQpo+sqTLunwnd30M65zcgN/uc2NrVrm4jMbzEyHfdrES0dsGJq8ElbP79BR oN0Br6gpUgy+eT0zYnSTXmV5tMv0PM5rvF3pI1QvQH8dxUbOFPRJJeEAuc/fxfh/aU8Y v+x9UQxvCVkl5Bfsu3htncXI4e2VI70w87c5E= 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:subject:date:message-id:reply-to; bh=sELxU93EMoFuFtsCPX1JBq6bq7DUUG0CGJP6UOj+IS4=; b=l1MMSWtSoCqgEzzKmotu/nUVNgbZRh5vPWR+aeK2OSI4gFYyZgqpeFh8Y1JUPyufcU 3Lq7+tNbRVMtObav0zUoP97+KeyJpNfz3lWEwhpf4XmsJL8K0DV7xHulvLLN7b1dbEsh m87sj7XsHecIFNQGtDFY6lYb7pR1veMBtbGePAzjwdYlHq3ZfGVWZZd2yhbsdEbRV9Nq iKfloqA2lgc0IekvLLxiSnZTKwDglqHHZ83CC/GMKoM4mZZVnR4SZxQm+3lUCQUYj4QD noJJapROFZ481zT57C9SZv/RCpBcW+KYa/kdp+VLJK/LXasCLKzROoe/UBLndnHgvbze 9Rug== X-Gm-Message-State: ACrzQf20kBlRfYCHwidPKgJ38SFbC+Gy/oexlIE41XRQf+GLID2QvJFU MY1PwESwDLj3i4i3Kh3B0DTAvpJh X-Google-Smtp-Source: AMsMyM7p7z+aS+LlN6AxuhyiLQ+Pw45pZDOBq22vSlshDhIPQ//tLTfo19zWXeoBSI/LXSgjPljUJA== X-Received: by 2002:a62:6502:0:b0:56c:12c0:aaf1 with SMTP id z2-20020a626502000000b0056c12c0aaf1mr3189745pfb.50.1668105701274; Thu, 10 Nov 2022 10:41:41 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8f81:b0:187:3028:5d29 with SMTP id z1-20020a1709028f8100b0018730285d29ls1644217plo.8.-pod-prod-gmail; Thu, 10 Nov 2022 10:41:40 -0800 (PST) X-Received: by 2002:a17:902:ebc7:b0:17e:7378:1da8 with SMTP id p7-20020a170902ebc700b0017e73781da8mr65983338plg.152.1668105700428; Thu, 10 Nov 2022 10:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668105700; cv=none; d=google.com; s=arc-20160816; b=vxbZznLq/akV7GpMVzFo2a10TL27LjDXgL/YyZ14/ouAmuGtUbId2g+Pql0mlX0DwW GdChhKIM7RgXkdqG/QU2BeRGX10WEJGyzfF4JrADGDeUlKYugvt1nw+xSvL/BYdfF+zf rkKGeeF1tldl02oMdziIucpTr0o/sIpMnggEQLJsY2srdC4dm8s4OLReQeWHMDkqfoUX 9easFYosmJ1SC6u5r891eCsH7qmCC6bcXihovK9RnL3HQ2E/dzAElelfOgXDSxfLb0dP YLrx/LWF42SlEqS8W6KQ2EQfxs6nEwnbq1hTaqP7GwGreXKLEnl1D/wj/hFEmhuEvNv2 JZcg== 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=hjviMJMFquemukmCld7+bjQzuHQnVpJu8jaKcC7GpZI=; b=Rp8CMsHQf/nXHJH9ej5juXvxV+uqDLSyEv1F/Q69I5NFaCdr0yxzUEB3kDU3BaKTNv 9m5FSZRXaiJ8VY5Ii1dyaY/DqUszOc+xJEYG9scHth0k0qV5bYQKVgHI72NW+vcshDVf jzIqRvaBuOuRKOHE9aSfOdSr3pPPfJ30RVOxtTe67MHTxWdiSTiqKcJiWPAY5uE5ZnbM BQnY4oZNcJuXwVw6NtSFAGUctXUf3wbtGo9vssHVp5tqXJFYNcbPbK27bA6230RiYNeF PdL1WCNiHQL+mK82u7vfWu2LsLgsqwRWK7X07fN3ZaNFWm+lx7367/Vo7E4R8YrU15Mj ArJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Ga//SO59"; 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 j11-20020a17090a734b00b001fded8896a7sor186803pjs.15.2022.11.10.10.41.40 for (Google Transport Security); Thu, 10 Nov 2022 10:41:40 -0800 (PST) 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:90a:8c7:b0:214:e1:cad0 with SMTP id 7-20020a17090a08c700b0021400e1cad0mr52876577pjn.3.1668105700141; Thu, 10 Nov 2022 10:41:40 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:b5a4:486a:f07:f67e]) by smtp.gmail.com with ESMTPSA id c2-20020a170903234200b001869efb722csm11635627plh.215.2022.11.10.10.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 10:41:39 -0800 (PST) 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 , Laurent Pinchart Subject: [PATCH v8 12/14] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Fri, 11 Nov 2022 00:08:51 +0530 Message-Id: <20221110183853.3678209-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110183853.3678209-1-jagan@amarulasolutions.com> References: <20221110183853.3678209-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="Ga//SO59"; 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: , Samsung MIPI DSIM master can also be found in i.MX8M Mini/Nano SoC. Add compatible and associated driver_data for it. v8: * fix and update the comment v7, v6: * none v3: * enable DSIM_QUIRK_FIXUP_SYNC_POL quirk v5: * [mszyprow] rebased and adjusted to the new driver initialization * drop quirk v4: * none v3: * enable DSIM_QUIRK_FIXUP_SYNC_POL quirk v2: * collect Laurent r-b v1: * none Reviewed-by: Laurent Pinchart Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 65f7d8522bc1..41aa998f5bc4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -360,6 +360,24 @@ static const unsigned int exynos5433_reg_values[] = { [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0c), }; +static const unsigned int imx8mm_dsim_reg_values[] = { + [RESET_TYPE] = DSIM_SWRST, + [PLL_TIMER] = 500, + [STOP_STATE_CNT] = 0xf, + [PHYCTRL_ULPS_EXIT] = 0, + [PHYCTRL_VREG_LP] = 0, + [PHYCTRL_SLEW_UP] = 0, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x26), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x08), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b), +}; + static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .reg_ofs = exynos_reg_ofs, .plltmr_reg = 0x50, @@ -421,6 +439,22 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .reg_values = exynos5422_reg_values, }; +static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = { + .reg_ofs = exynos5433_reg_ofs, + .plltmr_reg = 0xa0, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 2100, + .wait_for_reset = 0, + .num_bits_resol = 12, + /* + * Unlike Exynos, PLL_P(PMS_P) offset 14 is used in i.MX8M Mini/Nano/Plus + * downstream driver - drivers/gpu/drm/bridge/sec-dsim.c + */ + .pll_p_offset = 14, + .reg_values = imx8mm_dsim_reg_values, +}; + static const struct samsung_dsim_driver_data * samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, @@ -428,6 +462,7 @@ samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, + [SAMSUNG_DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1817,7 +1852,16 @@ const struct dev_pm_ops samsung_dsim_pm_ops = { }; EXPORT_SYMBOL_GPL(samsung_dsim_pm_ops); +static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { + .hw_type = SAMSUNG_DSIM_TYPE_IMX8MM, + .host_ops = &samsung_dsim_generic_host_ops, +}; + static const struct of_device_id samsung_dsim_of_match[] = { + { + .compatible = "fsl,imx8mm-mipi-dsim", + .data = &samsung_dsim_imx8mm_pdata, + }, { /* sentinel. */ } }; MODULE_DEVICE_TABLE(of, samsung_dsim_of_match);