From patchwork Wed Mar 8 16:39:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2794 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 71817414B5 for ; Wed, 8 Mar 2023 17:41:40 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id ju20-20020a170903429400b0019ea5ea044asf8018363plb.21 for ; Wed, 08 Mar 2023 08:41:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293699; cv=pass; d=google.com; s=arc-20160816; b=lbCm5LmU22nARS6ZA75rcBfPNIiajUmnsOZTeYujBbQ+evf15tK7hm6aAk9AuQNNoM fkpP3F256FYXg/g49Mo/YHQfuGJ0lLiwie48q4BjkFvS7nLBoFOE6204dyBCByf8C6pK LqrlSsrBytBAgsa1APgDXs3p85VzE3f4Ty2eKTfnVPXX3vseeJmXjEUzRRjhpaqhT3zO +lctU0kkhzI3kZE5QxjtKn5NtflkLN1PlvAiBP4k5o1UiPL8LVcgKTiuDDWaNJVeNEfe hkR8zgak+GYoq6PBbwVTfDYtOkx7vYLUTCog/W+nxzjw33ARsN830LZGOBAyZ8nkw2TE QKLg== 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=onOwJRegslnHr2NW9vU617TdUQHffGFojJnmwNqq5RA=; b=Z1vs7UgeysK/208stsnJyKqdjXcLiH/I43dV2blro/XYnb6k6Cf5RnlAXeq+laconI mBSlaaPq0PNHveCgFzwcfNvmXl8ktJMtkB/OcY67aMr3yMby2iz8VfYBG10J7pY+Dc5K nhVQMjDqQDwiyeovAet1IzhHDu9+BYpGI58ECCb15Ei7QVtKB9PTReBpwrIMhKC0tqIc dURZbOMdWouHlUnK4EhkpRhTIWB74C2f1GPfXNUokgvCLvxIw2O/VNSfu28S2tYjLUCe 08z2w6g/f+YaFYfk4hQgqjN9mtkCVnagMK/+nAMwil5ruMatMcULDJK3hqnjHAFikP2W pllQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=b7NHNFND; 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; t=1678293699; 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=onOwJRegslnHr2NW9vU617TdUQHffGFojJnmwNqq5RA=; b=CAv1HRB1SZxHWUaMBbw8b8sr8iubQCBa8QiIWp08rh0j2AFBDJOoHI6ePzea/HWqY4 29MXSZrkJjLbU9zrZBRvOW8h0P4mgunPZoxoqLNarjIfmwN8BES4zaOy00h3Bb9h+hOJ OxIm02WCdVdQqzsXmCtVoqidl6dxYggEUd668= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293699; 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=onOwJRegslnHr2NW9vU617TdUQHffGFojJnmwNqq5RA=; b=aZK6zANeXPXnx9V++qwsXYYtept6rJ7+lDl42VNolMfkthg82XilEyyXwIJki3eEdb YN+0WZMiGTreEtODDR7/gYb156jAzzGHUvyGHSgfxqV92QECEZHB4I7iU8D71FD+JnZx Eb4V6gT3ITMdoY+CVzuPJJox26aO8A9N36+LUW03iYl+fcXQG4essiYZ6mS/O2numFFj IWPMg3GoAWkFUTaBUUZTWd3lTQFSthFe17ztV4U3vr+sh1jnrxQdJ2mf6wRBf5GfT91p y/xobZPmeV8tRE1FiWuQvoMRemqP+kM4soNOVv3WEBpiBdQCTThDSJQ0BWgAZA29nOPK e7Zw== X-Gm-Message-State: AO0yUKWpneTk2BOReDkgOvZrpNDtyHdaUmVuDc309IFZKtE4gNY0p6mC QaD6TxV1haWojA6J5k7rnJCsRGQP X-Google-Smtp-Source: AK7set9Abq8QKfczBRa1MO86tg3LV8kKAGBr4/e+vCtSa4KgROuN/it0xKCZq9GjNTvvH1CDshky6Q== X-Received: by 2002:a17:90a:d785:b0:237:622f:cf22 with SMTP id z5-20020a17090ad78500b00237622fcf22mr7145829pju.7.1678293699283; Wed, 08 Mar 2023 08:41:39 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:a69:b0:237:18be:2595 with SMTP id o96-20020a17090a0a6900b0023718be2595ls1995351pjo.3.-pod-control-gmail; Wed, 08 Mar 2023 08:41:38 -0800 (PST) X-Received: by 2002:a17:902:eccd:b0:19c:f232:21ca with SMTP id a13-20020a170902eccd00b0019cf23221camr24210843plh.3.1678293698375; Wed, 08 Mar 2023 08:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293698; cv=none; d=google.com; s=arc-20160816; b=r9w1J0prK5QZ3Fji2tykRbMl2WWqXnp+RZZlkfxjFW7URxmv4rJhzObVTK+6c9jnYj GvXr3ofZTUgh1QbBXO3B6tY+XuMKn93Zij+2BkdL6FBBoSLdDnhmu7kkemqnvC4wsdx/ 1XEO0m45ltduDLIu8fraI4UAJs48LKDNv7Un4vQkAv8WIkCzgzjr603pWQbcxRqONlml vgs+axEirO2AASXanjgRLPLlGCj0VHgqVVaeIeJ98yxWp0cWJAcXxsRVGFRInyklbXoj L+ktEy5HUELz9MyaME6ze8OsHpuByeVBNmz1ivkaDl95PNbbCzdfhuRWo6VJmyPuFJgR g4eQ== 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=+SkrMCjMvODH/U8ovHeqiBImyTBUYYRDFhy5XeZ7taU=; b=sjtK2JiVvWo9qEeMuxQ0RdA5/2vm5Di3YSe3zfnz28LNWJWABRVQzkM+QH1EBzDJDH jC4TS2wFfb8m8AbCj68OlN7yC8Vy6DlaZvc0GCMcdmAMdbE+NyUi9I9zb6okXo2Kzpm/ SfjX6IJtglXU0xD9CW3+Ppp5+6kt1VwzD0u/yq2G4Y3ZQ4IH+uzWFQQem1eTV1k3ya82 qHw6uI/JENpsxwdCWYiOZOflRKFAnYIS2Zfq+xmYS2HDn4STSbxiEFvbQ0eKqC31QleD qzSUX7akqQXWiik9RoTEh0X8+xTRF2eN72aIi91S5WiUb27Z+SP4AVqgnNQqRZEBX5vc AniQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=b7NHNFND; 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 w15-20020a1709026f0f00b0019ea6406ddbsor5361565plk.196.2023.03.08.08.41.38 for (Google Transport Security); Wed, 08 Mar 2023 08:41:38 -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:902:bf42:b0:19a:ad2f:2df9 with SMTP id u2-20020a170902bf4200b0019aad2f2df9mr17080553pls.55.1678293698050; Wed, 08 Mar 2023 08:41:38 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:37 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki , Robert Foss , Laurent Pinchart Subject: [PATCH v16 14/16] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Wed, 8 Mar 2023 22:09:51 +0530 Message-Id: <20230308163953.28506-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=b7NHNFND; 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. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Acked-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki Tested-by: Adam Ford #imx8mm-beacon --- Changes for v16, v15, v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder - collect ACK from Robert Changes for v10, v9: - none Changed for v8: - fix and update the comment Changes for v7, v6: - none Changes for v3: - enable DSIM_QUIRK_FIXUP_SYNC_POL quirk Changes for v5: - [mszyprow] rebased and adjusted to the new driver initialization - drop quirk Changes for v4: - none Changes for v3: - enable DSIM_QUIRK_FIXUP_SYNC_POL quirk Changes for v2: - collect Laurent r-b Changes for v1: - none 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 f9a5e69a0fcd..f3bd06489a39 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -376,6 +376,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, @@ -437,6 +455,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[DSIM_TYPE_COUNT] = { [DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, @@ -444,6 +478,7 @@ samsung_dsim_types[DSIM_TYPE_COUNT] = { [DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, + [DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1877,7 +1912,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 = DSIM_TYPE_IMX8MM, + .host_ops = &generic_dsim_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);