From patchwork Mon Feb 27 11:39:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2756 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EC8C33F9C2 for ; Mon, 27 Feb 2023 12:41:31 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id gf1-20020a17090ac7c100b002369bf87b7asf1528364pjb.8 for ; Mon, 27 Feb 2023 03:41:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498090; cv=pass; d=google.com; s=arc-20160816; b=Isn7bl4cD4M4O+n55J9GXJX3u2q7aN6+AbHeDFLWfKoKtd18zVHuS/5tjvdgi2FAPW 5/AOpG65NZ2/J/IBvC4g3bXygFXDKKS6cFqlPm2gpGYC8lwwmw/Xe66R66cFlz7a8d7l d4LQekptvKIrVscdDIt6Dawa+7W89vDzuP96N6if15OtLf3JqNKYpTl8Q0GxnqKoKVpa /cHGok7A6qrVLdC9cdmR2/uKk4e7UlkO+4O1lldPXYYhEW1qju5uNJ6ZkwTZa7jgdKJb AW5B+j13YqIvfz2lZ1RS+fMv4Hd6+hazy7sn5B40/mjpg2hRuFlxmCHLTBBtSeoN4D81 4Lzw== 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=XvAjs3lKDZeTzZT8yvJ/bVQSf+76c07B60tPr+VxZ84=; b=G+Yn2y/CGbD6OKohyUg9JCIrT9vQwbkc04BK/qGFkQ6pqrt75MP5hTzp21qU3p5QEa xkB+enl0JZy6fWosUMqZAx3RK6pRUkc7GzG6zyXQiyJCOGoesCDwjm91z1mMLMDLeauS 00trJtpf0mbXVI1P1eWcQrE0QqQqCjoI1QxV+t6WTdYkEsKEhbtnWRgq7eQvZUO4wCmZ A4qBeU3yQLZJkPgy9LiHxPGUSVgZaV+q8Qui1+iVRi1NY94WBcdpbbu6b7yX6b3Y+msR urQ2Ffwgh+/x1jXt/5ZMIyGwbYIe8Y9brtzQoUhiccdCIR9w8lu8d1RP4akdK1zzWlZv Qxlw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GBF68+E7; 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=XvAjs3lKDZeTzZT8yvJ/bVQSf+76c07B60tPr+VxZ84=; b=qENIdPNYV+v0LyihCeR2PJsNnYSo35u8miwUie2siGEfQYOxxKiqbE50sG0aep/heh nHCA9ye4MG4rkWWR4oSvwDeR2Bt1Ja56Ps7rEoLbq2HMNe47ofQxssmrWeJuTmzEwLRL V543Ga1FV6cZptwTzdHa1FJydNq7fWbQeEsd8= 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=XvAjs3lKDZeTzZT8yvJ/bVQSf+76c07B60tPr+VxZ84=; b=ci7XFkMz7/ueng4845b6wdvq23EI+ep+/P5bKAt3jTxd/bo4DY7f6pD9kZh1pBNtlE NPZ241ZZtqhV+xccvJSGfGqf0wPvAYsw/LCqsjVEJ20x+7+JdDNEtwS8GAGALQSVqOsj w3mkwKovTCrP6hTfREZzvwoJ5WgD6f4NHY5JBe42R85BQYdrTJ1vFXJOYrm+7WsEFHoM uTw0LNIpQz7a8BUrh+WpZM4O1ApzJfFAQXlESl9ZfY9xPm18oHeqiLOfLj90pVed7+Az NU0dY6LvsxlelVyXTDJR3mYLuouXEdYcy9fz9741pr+3D+AjcrHhPxH/tDMUB40LT+IM wc/A== X-Gm-Message-State: AO0yUKVm2xHSktrfxa7zo58CNhZkg1yFR2qIrCtaou2W7cEWkDiAdNQ9 q3ytH+xjYmGpX9uNQ/ZoI5hIiyrm X-Google-Smtp-Source: AK7set+O/s63q1LIEUzm4u8JjP/4BhnbTGhGiy5EgLoJDdFRNSkLO0+0zqETsLp4Qv3TIdXboBm8CA== X-Received: by 2002:a17:90a:f692:b0:234:b29d:3319 with SMTP id cl18-20020a17090af69200b00234b29d3319mr4704759pjb.8.1677498090721; Mon, 27 Feb 2023 03:41:30 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:451:b0:19c:b3c9:49d5 with SMTP id iw17-20020a170903045100b0019cb3c949d5ls10502102plb.6.-pod-prod-gmail; Mon, 27 Feb 2023 03:41:30 -0800 (PST) X-Received: by 2002:a17:903:1390:b0:19c:bae2:681a with SMTP id jx16-20020a170903139000b0019cbae2681amr12198116plb.66.1677498089884; Mon, 27 Feb 2023 03:41:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498089; cv=none; d=google.com; s=arc-20160816; b=a/OU3p2dDI65iDO08Ij7/uRKyo8NPsXeVzv4vcHm9nTedHO/RBs+80kncZXzRmfeci gFAP3N/h7XiaRbMb4hmlyKyo//RiBSiz+AYaIcWYYFLuS16QgYgvA8E1MKpq87phZ1Gf wV/LHa+06dO82sPMunZOdClL9VYXsyiidJRSrXDRKDvwXkEy+FIIEURA4h/hh/h6OXjg P+lhsfgArqqbYtid4zuF8tBWbjJkaBp8Aq3Jesiq3LWVvSkWSJC3TubcKgzBtx6KWI0b tkiI9dJgEryNgSGoWdUylQkXXSZtLtUWwfyp97oq1r7zixdQboDS41vEOYD6nNxxZxp+ G2/w== 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=UvZwD67eFCMqJHDIBTDsxpjzh+agmIoxVCrI5gJq49Y=; b=HIOY44X1JEEsyKPZtyRQ7QN9+rWLI8GW7i10+RQuBvM0g6cdCILcSCdCCH3avgX18N Fn6EyfKHb6Qf3CodOGq4wqS+PNZTHTvuR3/xHhQ3+qJW5T1KSYWLOY0svUC6NXGZIkRq t6nl2HUosqIqpwvfaAV4J1Tl7DAwxTfJBGFQ4PnAvCa1DocxHL+xUT/xjFGnMOI6Q+Cu G6/rranQp9GuD6Hd4QE90PSbYVj0uCFjEczlwGdiVQ9Y4CKFvIiid3HBFafcZlDI2nfl e1V4CDOF+R5sLZHaMuGtnbBgEGVl4ExDEQJdA9U42ZmMZ8NmE+0yUcS0WjwldYZdidsy 3LvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GBF68+E7; 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 a11-20020a1709027e4b00b001990714101esor2342370pln.13.2023.02.27.03.41.29 for (Google Transport Security); Mon, 27 Feb 2023 03:41: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:a17:902:ec81:b0:19a:a80e:a6d5 with SMTP id x1-20020a170902ec8100b0019aa80ea6d5mr29294753plg.23.1677498089563; Mon, 27 Feb 2023 03:41:29 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:41:29 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , 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 , Robert Foss , Laurent Pinchart Subject: [PATCH v13 16/18] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Mon, 27 Feb 2023 17:09:23 +0530 Message-Id: <20230227113925.875425-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=GBF68+E7; 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 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 e0dac7aeab37..9c64a71d2ebd 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) @@ -1843,7 +1878,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);