From patchwork Fri Mar 3 14:51:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2777 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 42CC644AA6 for ; Fri, 3 Mar 2023 15:53:32 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id la3-20020a170902fa0300b0019ca5ddecedsf1517091plb.1 for ; Fri, 03 Mar 2023 06:53:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855211; cv=pass; d=google.com; s=arc-20160816; b=OKoUR+skYsRbu1YaKpZ887pL96aIWTgplRPiD31lFmeDtoduX9sobciYVQFswjc6Hb 4+ApRhDZCGCq6Fwvcrh/4oNcUkLP7aM+d4N0wp6lenBf0Er7+yaGSsLXvp6XRbNhZZAa 6eIzKbH2UQWPccTQyip6PwjuumfWO35kCwb4zVvuczvAOs55Wg/Nx1/Fi8NGKY1CZrrs pxBaF0cCIx+Cvo/ZED7wtqlc4dqAjs8EOYq5PTw5C4OMNK5z178PVO2DWfNs+0UaueTe gXJSMtnnqHlWpJzR/tItRnOJVvXQQFJn4OQQGRyZmkutrAxsfujMB8mZjn9Qcxfh9s9E Lymg== 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=qXtxyKKpaIBeUT6+ofHf9c3mgeVkwVN0lORxm+ElweI=; b=b6B/6jmz2motdOH2XLV1XsWu0opu5sUpVamXCb1+sRPfxnMLF5hntnOpoZY6vWg1+9 KGgtVbBHROl+lwrwbmZopuq9i20WxA5ONoSmjTqMZxVY4p9E7p0VyVD+oEn7rbJc/yIZ a46aneQxevaBxQtyjop4smfEukJdKtQZ5+VvrUja+56T69VO96X0DKYgxli+2zGbTzIu lcsjI+IlJ0GyE7QLHQzEqxKCvNZgj5B+qJ5RqFk7l4uKE/ORxmxpIvP1i4ojloeqmYKB p04G26YvykmPZCfK0c/PiyenIU595DYqRmnmB+hfY2lfg7w8yjVfYRnyCLNu1eRW4WFE YfhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aGXkDLxU; 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=1677855211; 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=qXtxyKKpaIBeUT6+ofHf9c3mgeVkwVN0lORxm+ElweI=; b=QxXK/2bUjbAWFqgMKtkbd87FgggcwMBjHj2PWqJx35hByTn7gz/nhNkOc9/6/0TPUP e47uDVcD3sezUba4sR91mTO6nwPzC41fPj9UVi0nic3gr0Rb+Y4MoNgB4KT4fYhI9yNs 0W+H2DNFTgQsjXEKnBF8usxVkKCTV0MbQTXAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855211; 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=qXtxyKKpaIBeUT6+ofHf9c3mgeVkwVN0lORxm+ElweI=; b=t6aFivRnBwYNMzLaeJqNAkv8oP0cxdUbmt/X91cPOUx2wdg29Fwj+a3X9DYWyNuywL MH8sBiJkPkcA/nW3YQ1v2I74Bij+l2QdHqfaldUxJ3O2GsOKYzc4lmy7aMuHfWj4Re3X ONzt7IbBqlTUU2OjJk7im4P42kjZzNvMvcXzHUz8mGdzECKlnw8P8fSObRurNzycAGwJ RI1l7pDuF4J4Fh6URCX3348LSluhBgEAqyd8gEfP5VYQm5eY6G4sbzas0K2piTnXhQIn zy8TcHAhUMLU90yvs5PvOUougFPd7a4yv4Hp4NkeeCj8S0FQb9kBIHAeTd3gFzcxZL/5 PzQQ== X-Gm-Message-State: AO0yUKWCJTWQ/1Ty92X6aEiHWvjWpt17dMLpiB142PVxhqML5kL4IvL4 RPz84Xcuw57rTGE8hXVRtV3va6A7 X-Google-Smtp-Source: AK7set8n4tk4h48alHX9uOTP6qEUc//Xrov6ZhXXrPOCPXksf9B+qXL6FBeXk0v20zKnDJrTggS6Lw== X-Received: by 2002:a17:902:6805:b0:19c:9035:7864 with SMTP id h5-20020a170902680500b0019c90357864mr819181plk.5.1677855210972; Fri, 03 Mar 2023 06:53:30 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3850:b0:210:6f33:e22d with SMTP id nl16-20020a17090b385000b002106f33e22dls3090654pjb.2.-pod-control-gmail; Fri, 03 Mar 2023 06:53:30 -0800 (PST) X-Received: by 2002:a17:903:2290:b0:19e:25b4:7740 with SMTP id b16-20020a170903229000b0019e25b47740mr2594049plh.28.1677855210014; Fri, 03 Mar 2023 06:53:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855209; cv=none; d=google.com; s=arc-20160816; b=GJXRJD0B6Z+Xe74B5UfOKI8aS/fNXWWPWF204e0SsILthPTCgTf6E7T/RUZOa68e2n qkXMu1jsA2HVlAyJi+70Oii5u5rBYF+7ffpoFoLc4CTlJQMPBUrnZf8Ip2xX/mrJVwum QZDZ4XbP9GyFJJS09LTpHRnv6ceT8l+kWIc5LZDvwIo9YdW0Zpp1XkmLOCz5kYSytqeY AE2WAyaeKYO3EeVXmjZNtFFS5VUsDlxTGyv60YpIbCdkohPQ10Jw3C4spt0IAMewMZDW QefyKo+5lSELIcXJAjelfKvBx5fwMqa1jGcLOa6srviebp1ZcqRdMXuB3gbQwmCUg0zt 4jNQ== 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=LJit/9jx4Jh9SnqcRqHqL0SMNt+O+dxValiE0RggnWc=; b=a98zV0wJ4kmwTYGcyNpiAi3kIxESeiN68hA4RL2IXa6a+EhZezIax21RiR+1utc6Fc 4tOXbK/rbpT+4vdUMTgCE1zWybCct2uGK/QEC0k5+YwIWpuUrIRIyEoBod4Xh1AMvN42 hxQ1Vni2DWSLA2TjGLTmg0mfJIMVBLpW/dpv1E/XVORq00BT1zy3V0GqX4GlCx0Ptdtz GXLR9Eku8Yoh4F/h13X72+CxKTZWJtcotgTRnkzaUxi+30TsWl0U6MEEzofcFRV55eKz emE3RbHxF/pckS2TJI+uNjF46+sT65twO5d7gq580S+itOSAd6UpFRU2YtHdGL+PDAAw Q0XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aGXkDLxU; 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 z8-20020a1709027e8800b0019c35405636sor1019526pla.178.2023.03.03.06.53.29 for (Google Transport Security); Fri, 03 Mar 2023 06:53:29 -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:29a9:b0:c7:6c26:48b7 with SMTP id f41-20020a056a2029a900b000c76c2648b7mr2027617pzh.15.1677855209626; Fri, 03 Mar 2023 06:53:29 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:29 -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 v15 14/16] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Fri, 3 Mar 2023 20:21:36 +0530 Message-Id: <20230303145138.29233-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-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=aGXkDLxU; 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 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 42e3536cb2fc..3ffdaedaa261 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) @@ -1875,7 +1910,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);