From patchwork Thu Jan 26 14:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2689 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 829C93F046 for ; Thu, 26 Jan 2023 15:48:02 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id 69-20020a630148000000b00478118684c4sf854394pgb.20 for ; Thu, 26 Jan 2023 06:48:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744481; cv=pass; d=google.com; s=arc-20160816; b=zisG3e2yJLLyspvswyXnYOz72U719K+x9ZOll98iJAal1W1s9JwHHdNMrC7MWGFTkZ jSNVoNmhma+F2DY2h5i7M6HL50ACGYB7cNviUiJjCssnyX0lLX7kk3a37ue480zAKDpj fjycBcjSTYzMn1aOMCueeUloZrtbN/RpM92UN3dfYFIwKGTfT8QazafU7rGXosBrxbD6 JvErbaO4Ua5qpowHnvvTS36Z6t4T6qaHX26AgxSnjlXXruAOOWM3t543iGZ9qVDGTJpt 93eZfPd6L/hC6Ad70QODv76lRPcUFGOcp2V/2zrfcsu4V7ygfdQ6/HiUYil1cJh3W2xx SCeA== 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=rVC0+CZM9+zLjY4x3tj4bc1wy3jbJWvbDJTjMwu0mHQ=; b=a/3ozuyFHYNfipfgOmrRoOSmYBtfWDLvQaHNbY7ac5cvIUS8fpE8M/6b8q0dqwENK4 4mikxUm8Gx8QOSM9JKjMCsFbK3v+Q5O5Iv1TS33IKB8bzwPqjCVkooJUI5ZbXFlIb/t+ oRAsotu8U4An2sMpdgPKkk+VTpPVeCRgNTyN4jigbQ83ZoykAlx8U7d9A1COArufy5wu phXP3XIlChKlqIOPhENqZD8Ms9AJOEsBhvwaJtr/tgPnJRDyhlN+SwEPfm8hlgwW454B fZ3mDj1ybbjXxw1wAhbpa7a7wr1EnIqAFUzLe+StJciwtx6txMLSB+woVs3fj9xNYtbM O4Cw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nwRbCdV+; 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=rVC0+CZM9+zLjY4x3tj4bc1wy3jbJWvbDJTjMwu0mHQ=; b=S+DgT8VqL9l4j34KWf4mpXZ5HAID6OzgS+xe6ixdO2lr6wNGc0AJvxZ8frBUmPbe7j GltPNDNhSzxDiaQOn4gspZAUpAvAM1zkBbzUZ5qkO5nC/vbVlD1DFer1QolNlvylAbDK EkORUFOGK1/CxbF+p0NCQ/6CT17CEIRP8NbmE= 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=rVC0+CZM9+zLjY4x3tj4bc1wy3jbJWvbDJTjMwu0mHQ=; b=WdC4UmLe2VsitWhRLCUY+h0GIwtY2ZqlwTMt44PPjbPVn7hXT+lL8Wl5sWn6lt1Ir2 zzrbAPI53rGbdbSjrr3Ntq7vTGdLot/SsznvefkyscUZKw/fpO3Zcd0NEqKmb+KSOdE5 srZRyZpG/h0iNfS+G+h8uoCsKjKLrViKCpQZRHNsY+pnlycw6VVsEAXju8hP4/K3BOg+ 1YYsTlu5RdnpYiQblmbhmeSmqM84yPVB4qB1w8pDgoICBZyOUugl6D11IHGBjx51szpN xsuTNS9k/v4flOuYDM0mR8WicczmmNSKgI2XJ3pzymKSaXtEiA/PxYDw1wPMgoFFfikK Wbzw== X-Gm-Message-State: AFqh2ko43Ic/mGnBhE9g2+1E1BkMXWuXPdJH1SnFFUXQQgqRU0XXMJDO Pv2kEnxApfvSDP+mguiYXxYhqgcA X-Google-Smtp-Source: AMrXdXt7K7uqFePs0N9DDLuwZJERQZE5peYIkJvCsFOA9lHTjnnhdsZrs1AUgit6IMRGbQHB7I+EPA== X-Received: by 2002:a63:1a15:0:b0:4cf:5317:8401 with SMTP id a21-20020a631a15000000b004cf53178401mr3439681pga.120.1674744481200; Thu, 26 Jan 2023 06:48:01 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7c88:b0:189:b2b2:56d5 with SMTP id y8-20020a1709027c8800b00189b2b256d5ls2412410pll.0.-pod-prod-gmail; Thu, 26 Jan 2023 06:48:00 -0800 (PST) X-Received: by 2002:a17:903:11c5:b0:196:fd8:a95e with SMTP id q5-20020a17090311c500b001960fd8a95emr12812302plh.68.1674744480299; Thu, 26 Jan 2023 06:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744480; cv=none; d=google.com; s=arc-20160816; b=mKXkadJtbjY/q3xR8/4pswTB7FQ0Kb65UHw0+TLu3tnUM4xv8N9JRCcLvgE9Hz104J CoEftkmpyoqgITqg2f7s0PTiwE1XVAEQkAfaDIG91GaDVACyQY+EWv1sXh4NZWggEEn6 7nE11KQgpMnhap2YWVJY1OrtVlDdOUC1yiqiJqwbXd1RoqzgzbU4TgV7Ff5V6mlNI5DA IDal+gIeHp96lZlpnh96KI+SzSYUGwNTa4bvbUtl8TiUc7jqxh2KD66vMtIOorYnFSvd 5X0xukAw+5aXJJL2zn/m8Pf61/RaFi38Y28ngOUFWn/F0VKgplQlzzThkOJ/zc9g3fFy J50Q== 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=RVt6cqLgzh0ZQuUHgJ1jTOMS/S45HwG4L9ZBObbs1DA=; b=BaCxkEAM7tcnCEih7ik/zOOVbbQREQA3WkKAiAeFUdG5mzG2ucASEbmUEgXDNQASoL qcMw1JGJmL9Hr53hBK7PODWLiOHKMzDAngZzp0GMuMC2qYRuSdFnl7Eb3YxAOzKK+iPN bBchCVtWckz03SsZT7IQCVL9WG8i+iM77c03CmaKtubNQdGptVqobzGlAw/SVY+hEz5E iuq+7VtvNKZwtQb+jJL6nTuTN5Io4KGHDava+Ipf94GewYowz9E2nGxoak1Avv12GWjW Z85Tm72Hy3AbDcVUHwfgzA5qHnzfiBuJJiFL9qz5JxDIxPpDal45I0nsnc+6024KDUes PZBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nwRbCdV+; 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 b19-20020a170902d41300b00196064bf2cesor731881ple.74.2023.01.26.06.48.00 for (Google Transport Security); Thu, 26 Jan 2023 06:48:00 -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:a05:6a20:9f8e:b0:bb:b903:d836 with SMTP id mm14-20020a056a209f8e00b000bbb903d836mr7232205pzb.54.1674744479974; Thu, 26 Jan 2023 06:47:59 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:47:59 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , Laurent Pinchart , 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 v12 16/18] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Thu, 26 Jan 2023 20:14:25 +0530 Message-Id: <20230126144427.607098-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=nwRbCdV+; 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 --- 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 c90314c4d205..fd042dbcd8d6 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) @@ -1832,7 +1867,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);