From patchwork Mon Feb 27 11:39: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: 2758 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 86A323F9C2 for ; Mon, 27 Feb 2023 12:41:46 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id 10-20020a63030a000000b004fb64e929f2sf1776655pgd.7 for ; Mon, 27 Feb 2023 03:41:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498105; cv=pass; d=google.com; s=arc-20160816; b=fYwwNRB9ZYVP7q/eBSbpfa6EuVS+7JlFrjByiMju+30WduwfS0RGOVE1ZCZhigD/Og 6iM0zWkjb3KcqjUfO+Npt3kyIsb0HzWDmFukCZaLBca8Er98ZTTVy3UJ4QoT/4nSpBV4 8hIVWkeJEDv389LxpqyAazHw/NgwARYcZqBGqCpAP1XdjFSwS/v5ea9umfvod8aKp4vJ WquvYm/HyoI1MnPyZYTTViNVMK1phsUj7uCPY2jPcbeJUUVL9L6SUMaKzx3Q7XuK3MH/ ycORHshchxaFwf7ZQamALbSfoHpL0BS0t8MA+ChlniKaL/deQ9tdXRelsEVbmJtZ2El9 gExQ== 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=yhvkgkP8cYNwUJBjLyKSulyVvKsmXYvpKfg3FFKupnk=; b=hX7NYpRkElEFO/8aC5Sd9yjQgJbKnPI0Sv/40AzJ0zB3lzLtZrjhE/VFyPEXptFRq3 5ljDjf6LtfiyeWZZoHoXlyCnMmDwET3sAI+EaIlRFfNtVH3hGR5IZNMU1NnRJjIKgSbc qWLQLHuU0/kcqqz1ccFq3/sHSs8wmM3AirGcD2dfCoLUjwrA606MRGVjMZaAW5EU4f3a gSAq9KF1tYceSjA910FYNBXo1PphyU2vFfYZJ+CRByJ+SOSvISqTL1johKFfcCuYQ4sU w+Cpz4X2q4ShRNqDmLLv1N6U0tfJRMnVofj7ND69Dp3SIrjFSBE5LDHroFXIu7kCD1ao YkYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Psp/AAkQ"; 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=yhvkgkP8cYNwUJBjLyKSulyVvKsmXYvpKfg3FFKupnk=; b=XRD5wXLRIo3vWc/llix8/ovAIs+Th7WwOhq/b/0cOtO0R3Kt+vCDqWcRU1GJdx2t6Q j/22TuXnkiLWO93xLCfEab6JfRNi9iEpQdG4i+wGXFNm0hB3T6m5k8Er8XcallOPMh1+ LVcxgf4c2OL1lIeBX9JnrtDnV0pzem8IVMnGA= 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=yhvkgkP8cYNwUJBjLyKSulyVvKsmXYvpKfg3FFKupnk=; b=qsxYhOEx0UCrhObaEGekDp0i73OhJqVwBtTw1/0SCaZxX3vBgkH1rSk9yzipH+9VnN yQXBgZ2uabEEJrFSqyI/ox9Ey7iWihZJO450NBi/+DFBISECbkMnlOMXNZBwcSOjTVeb jGJoBB2w1/bkfuQFVIwNFbKZU9qNX07O5nqby6RbsTQAMkwJZLJcq3hjIc2gEhcVJfGb /jhLTpDTvvIegXDqqTbSBfLnKrRryNLsli70puLlIcTzA9OjoZAmL/c3c5w7H287Nsvw Gr4cN3SBZuJlsgnXGXpuAV1AerK32QBAJDlE05GE+a56+x1I1Z5EuRe1i7pa9WqHdNxb yZVw== X-Gm-Message-State: AO0yUKV0p+OGy0pJsI3hwn7rDtwghFmMLiw7rWXsTDKuwclY4kf2nBC6 6VigDB3Mj8ZWKQho00iqcumtSre9 X-Google-Smtp-Source: AK7set/AOtY1QZwg8neqp4Cl9A14CHcETccbWCzoxvfRNHMcBH8i0IgFN2/FfYItr1Tn4KSwqlNYHw== X-Received: by 2002:a17:902:cecf:b0:19a:850a:d88b with SMTP id d15-20020a170902cecf00b0019a850ad88bmr4613858plg.4.1677498105260; Mon, 27 Feb 2023 03:41:45 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:f595:b0:234:a618:558a with SMTP id ct21-20020a17090af59500b00234a618558als8859275pjb.1.-pod-control-gmail; Mon, 27 Feb 2023 03:41:44 -0800 (PST) X-Received: by 2002:a17:902:d4c8:b0:19b:dbf7:f9ca with SMTP id o8-20020a170902d4c800b0019bdbf7f9camr28437011plg.0.1677498103938; Mon, 27 Feb 2023 03:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498103; cv=none; d=google.com; s=arc-20160816; b=Ybw/dCoJDXObFnVspIMH0wwMG4xZWJpzRzk1cbzWLM49+zci1inTa/6asxjFRv/tbg t06wItqKCBQEd7dvtLdzoeqR1mevnQ8gJr3apQGBp4zKEHWrD2a66MXYYT2D/82fYMOJ R1MELCfetCPSCBaVLR2sidK3narlZi91sWjHsJOdqe5bQcDfNOuwLW+z8M2Ub7OYoGAw rIkCLFO2HrlXKeuZmMyGpVOQAdwXTUvQMl1sphzeJ9E7j2Wir6Fzy5IZRoOmoB1XOfpl 9y5ZvnOU+mMXQ0OFe9b4mD0KyYxXCxdpaLPQuGBNZn2PnGidnX+94bAKqVz9+CHYeqoT ac1g== 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=3AnfktcR9EMxXGBUDl6zPYCDItYIt781znpOZ6IyJMI=; b=v3j8HcfellhMGryDQ8wIxLjoxKlTUqQ3pKTHO9uL2rfqZx402WrJH9jl80QrMY4z4b jq+anB1wTjjkawWUULWyY0NcQPh8W4SFmzl+fTabrOb1whcQZElYpedp49E+N9MQbnut UIWZbm7xq+TnlYLfQh4Ww1JZ0eBGeM4Gz8KFR1RoFUsChqX1WOkDbYc+wrKqAKPaCuYK 88J1EN3lpIwKMYkiavVUrDJezJLgWmw8eqZHk4mkv4yY2SR2sYeObPTfqDCN5oOeDUOo Av03qxVNYROaUqhbCn33a+W5AbBcFAGoOJe7xNbL4NOcy712g2qbkPaeFIwMn0SI8AZN VmYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Psp/AAkQ"; 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 jh22-20020a170903329600b0019a7370c110sor2271368plb.66.2023.02.27.03.41.43 for (Google Transport Security); Mon, 27 Feb 2023 03:41:43 -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:fb90:b0:19c:d97f:5d28 with SMTP id lg16-20020a170902fb9000b0019cd97f5d28mr9388676plb.32.1677498103628; Mon, 27 Feb 2023 03:41:43 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:41:43 -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 , Robert Foss , Jagan Teki Subject: [PATCH v13 18/18] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Mon, 27 Feb 2023 17:09:25 +0530 Message-Id: <20230227113925.875425-19-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="Psp/AAkQ"; 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: , From: Marek Vasut Add extras to support i.MX8M Plus. The main change is the removal of HS/VS/DE signal inversion in the LCDIFv3-DSIM glue logic, otherwise the implementation of this IP in i.MX8M Plus is very much compatible with the i.MX8M Mini/Nano one. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Acked-by: Robert Foss Signed-off-by: Marek Vasut 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: - none Changes for v9: - added im8mp in DSIM_STATE_REINITIALIZED check - drop previous = NULL check drivers/gpu/drm/bridge/samsung-dsim.c | 23 +++++++++++++++++++++++ include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 9c64a71d2ebd..f91f2feb1987 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -479,6 +479,7 @@ samsung_dsim_types[DSIM_TYPE_COUNT] = { [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, [DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, + [DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1452,10 +1453,17 @@ static int samsung_dsim_atomic_check(struct drm_bridge *bridge, * 13.6.2.7.2 RGB interface * both claim "Vsync, Hsync, and VDEN are active high signals.", the * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + * + * The i.MX8M Plus glue logic between LCDIFv3 and DSIM does not + * implement the same behavior, therefore LCDIFv3 must generate + * HS/VS/DE signals active HIGH. */ if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } else if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MP) { + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); } return 0; @@ -1689,6 +1697,10 @@ static const struct samsung_dsim_host_ops generic_dsim_host_ops = { .unregister_host = generic_dsim_unregister_host, }; +static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_high = { + .input_bus_flags = DRM_BUS_FLAG_DE_HIGH, +}; + static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = { .input_bus_flags = DRM_BUS_FLAG_DE_LOW, }; @@ -1778,6 +1790,8 @@ int samsung_dsim_probe(struct platform_device *pdev) /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low; + else + dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high; if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) ret = dsi->plat_data->host_ops->register_host(dsi); @@ -1883,11 +1897,20 @@ static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { .host_ops = &generic_dsim_host_ops, }; +static const struct samsung_dsim_plat_data samsung_dsim_imx8mp_pdata = { + .hw_type = DSIM_TYPE_IMX8MP, + .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, }, + { + .compatible = "fsl,imx8mp-mipi-dsim", + .data = &samsung_dsim_imx8mp_pdata, + }, { /* sentinel. */ } }; MODULE_DEVICE_TABLE(of, samsung_dsim_of_match); diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 4ba387c958ae..fb923caf09e1 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -28,6 +28,7 @@ enum samsung_dsim_type { DSIM_TYPE_EXYNOS5422, DSIM_TYPE_EXYNOS5433, DSIM_TYPE_IMX8MM, + DSIM_TYPE_IMX8MP, DSIM_TYPE_COUNT, };