From patchwork Mon Jan 23 12:23:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2651 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4EBBD3F039 for ; Mon, 23 Jan 2023 13:25:37 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id 69-20020a630148000000b00478118684c4sf5400976pgb.20 for ; Mon, 23 Jan 2023 04:25:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476736; cv=pass; d=google.com; s=arc-20160816; b=MQq8S8EAKFU8uvqzHnMwDVGprosBvE9Kg2ciINWz0QxAlmPaPv6d1LXk7AQ2rxG1oF H7y+G5qb7/L6zcv540+SUuyBkhDyzvfcyH3GlIy3gVcXoU63827H8lURdEL7V2Cd2FsQ zBDemsPok18AnAsf9flW9bcV+h5GYc7BnBSClKtIn97H1Vh2g+peXgQ26u2C1GvwcnDP R88jedA8K3Uw0VqwvdHPtinKCYlhS8slCAC2DByfnmXa/FUxWXxL4tayd8RmpT3rgOBB mZqW/HXq1+cJEXy+he4IO3Xyy2Eh+oULzyL9PKik6K8NYSjC2AFjXMgXB4jI2BAklIRZ LY+w== 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=ki+ymlUkiv3rWsecJtzXYcofuAqfv7Cj34AArlO7dB4=; b=JtJAFU9wnBxgsi/ycR2K/xIQpKQmo5RjyBAVfbAv6BIAMBWKFdJCD0GQRPbk975yxl 48iJInqywcrmbWcEwMAC5gWHC8tgp4/nrHn1KDtS2Kg+fOZnDKJVVhwhHLsYStX8ufNX xTQ/mS0Fb1xLqAyYRn3r7AmIxN8TgdY9OGXewZyn075n61jRg4K8aMrIKMO8otxThUHp hUhTxp6LWtV7IdQCZOy+1E3jRkbM9xm4DIyQ/116MdoUeDexfRxQza0dnHKIVSBjXFdt SXrdlHI9h1NU2Obl1D2IUysIit6WiJvF51iIHL6N+Uh9u/UIuj5oqweNEyH7/13LS3Wh a5IA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fGRJHEcW; 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=ki+ymlUkiv3rWsecJtzXYcofuAqfv7Cj34AArlO7dB4=; b=rMHlnwwkCxjFQj5zR9vpLPQXiLUutW9sPSx8rPf4Lb6Ze2kMwniLkBkRB2c9VAtmQi gfrbk6aKP4oiVE7sw8yo8a4weXYHdXu6mKs2tJ2yNKIsJI/ain+Hw+CSGJaYphlq8d8O KCPcEU1cmlJdUS9JqlLq27ErvjTIo4Yc1+KbA= 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=ki+ymlUkiv3rWsecJtzXYcofuAqfv7Cj34AArlO7dB4=; b=eabqKWyQhcA0KzF02ttpiXeoq4QhZJcTf/RDPhwQN0/gTjaQWbdED6TGSBTD3PRJb1 dDAGnCkT0R9X3uD0udqjpJKCZuF6PESkJYE+yfyZU5E/9M5M/oZxTN7FJr4LxORouGcW JPi96PA4O9wyCKKaRzczMCMXfg7yKdM9K2dCdwzuQtlFvffErJfCubZxB3ztJSPeEP2q qKcGDRNKuLIdwhGxvXkpdcmzw0wDS3m1KSoEAtGRlHm46+Kw+BXPr0l/U8zIlbWaBFz8 iY20tMasFoxIUgjbOKAhE0Tneacd66xzzf+BP00lSnNx83fA+JymFW9FDGXQDsQj6Cl9 mbdw== X-Gm-Message-State: AFqh2kq6MvyRTQ/4U227ZfFlsqYCuZIyLg99Zf+QQQJWoMk7OkjxFbhr 91xjM1gWnBKfBR74Vra1cc2/OHEa X-Google-Smtp-Source: AMrXdXtyvyKqBWPLeEpd0rD3ql6plVxJ3sdtalLTPPJN29k44AEZ20aOBpaz/q3BUJfyY2S5wKfiEw== X-Received: by 2002:a65:4d0f:0:b0:4a2:d7ef:2b9b with SMTP id i15-20020a654d0f000000b004a2d7ef2b9bmr2626398pgt.167.1674476736116; Mon, 23 Jan 2023 04:25:36 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8c06:b0:210:6f33:e22d with SMTP id a6-20020a17090a8c0600b002106f33e22dls12919067pjo.2.-pod-control-gmail; Mon, 23 Jan 2023 04:25:35 -0800 (PST) X-Received: by 2002:a17:902:e205:b0:189:c8d9:ed30 with SMTP id u5-20020a170902e20500b00189c8d9ed30mr20186452plb.24.1674476735299; Mon, 23 Jan 2023 04:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476735; cv=none; d=google.com; s=arc-20160816; b=GhUZm7xjc7X/s5+MjIPA5x5+1PeegTk1KSTJ4QsiV0o8HaxsRCcfIpbq3L9QRJMNZm KUy/jvyWlxB4dkW1tATB4dSiEbmTjo+vcwgtGHkNNlJJrqTLikk4qyumPNnV6wxxq8cu Kb2Z9wf21xizDDbTbWlmJwSH9o1MUevLKffWRsaymYRWNyg7TrTjppsS4D2jNiqvOOLs /cT8E79QXis7z4zfWOWgwmabk+Mek6hTscvZTlpxpEm6MY2bYUyXt1cnmH/BL8jMsPTy aEAgFbqz2q0YbD/d6mgXZMH+e5hbxGxDREy4JlF+cK2WzB4wSUFGVPWKSYbfDuSCyPfx TEJQ== 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=ajKvhWNKzqFT7LDd16sT+3C5isIu7jIMPTIpzFlW67I=; b=M2XBgkP0q9zfLoGuugcci5Q2uq6Z3BqXiJfO9yJSCuOhZbkrriqqWbidEz/lyp/AO5 iWULEKlbvZz0sb+D5Aq9QUH2xbSwRWfV2+rA9yW1mQ4gmeKrvAMriLAPjCI9r8DxtFGA Ir525emCmcHFAgMqsMNnlXiKs4ro8g0jl1Te5AjNhXLsq4ei7mGxP2O7C/YtTk0c9jkQ evo7rNZNfd+a5K0xI1uGSpgTjN+GVgWuo2qwxbu68VTzv+JoGwR0pyk+zol/jZkKO74N Y3tmoIAfGHiuXXAUmfbDB1EFYSg0Q9A4XLHwlddKTAnONTfj5eqRD1vHxo7eTiBCchnB NDsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fGRJHEcW; 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 l13-20020a170902f68d00b001897548534bsor629753plg.119.2023.01.23.04.25.35 for (Google Transport Security); Mon, 23 Jan 2023 04:25:35 -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:903:28f:b0:194:3f27:6fa8 with SMTP id j15-20020a170903028f00b001943f276fa8mr30031389plr.11.1674476735034; Mon, 23 Jan 2023 04:25:35 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:25:34 -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 v11 16/18] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Mon, 23 Jan 2023 17:53:17 +0530 Message-Id: <20230123122319.261341-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=fGRJHEcW; 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: Frieder Schrempf Acked-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- 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 645071745760..18645c8eaba1 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) @@ -1794,7 +1829,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);