From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73F2EC433F5 for ; Wed, 12 Jan 2022 07:24:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351201AbiALHYx (ORCPT ); Wed, 12 Jan 2022 02:24:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237408AbiALHYv (ORCPT ); Wed, 12 Jan 2022 02:24:51 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF78CC06173F for ; Tue, 11 Jan 2022 23:24:50 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id u21so6176316edd.5 for ; Tue, 11 Jan 2022 23:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uQCDewLBjewv7c8fs65JsSOFwpm0o6zytmCWic/8nRc=; b=YtT1rtZdyJlrkVd6HjSwLPBzN/Obnfg8cZw8b6eK+XtmeFY1sZUh7KJO7edpY/Bca+ l5xA0bRzwdB4cTfr53JAXJVszzPasxM1kN8VkdVUuz4UysoQA1Y5kLMP4zv5xdcMwQWn vozVhsNd4XlUanJWfsD5hwTjNxP0CS8Sl437w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uQCDewLBjewv7c8fs65JsSOFwpm0o6zytmCWic/8nRc=; b=4tYQhRJ/Pbo/O7mRXXvKFRSrhT5jDqsN9gqPwQFVbXe9B/axKeAK0YsUND/lIaDKGU 9mp9eF4HXY0Q1EUK1Se+00HWjSmlORwTSct1u+ygleKaG0TxJ31O3TTT+7oFd1fhms7C qqfzOgtSoeqSm87eUVGVvcw8BHe7Axexw/67FpyEi0CobbkUoPmQdgmBZTV+i+H1ojma E/7ULXJD1BRlkpRiPjIe5QQdqctsxXXIWagF6SdzpB1dWaeHRfc1e8P6xADh0YZ7ZiOw gd+2TjNesxAVysFumwLE1/t3s9lRgOtJVquTBcpiCGn37/u6ZEgFryLNJaiZBc1QdoNs /K/w== X-Gm-Message-State: AOAM532GSSGDR+Zmt8/nBBpba7TW949/UVIZ7fWVSiGesaMHe1gd36wC QWlioIqR9JznbF7MurRQ09ytWFviTGEObXEaxJq/l4pH8Me3eQ== X-Google-Smtp-Source: ABdhPJyEJlSh0abG118+el5cM/GHTx1HkR0P0GQy2atseVhUAX9rTgXQUM2klaGLOApwsObcgD+MtEKSA9hCfVpqHZE= X-Received: by 2002:a17:907:961d:: with SMTP id gb29mr6450110ejc.123.1641972289289; Tue, 11 Jan 2022 23:24:49 -0800 (PST) MIME-Version: 1.0 References: <20200907081825.1654-1-narmstrong@baylibre.com> <20200907081825.1654-7-narmstrong@baylibre.com> In-Reply-To: <20200907081825.1654-7-narmstrong@baylibre.com> From: Jagan Teki Date: Wed, 12 Jan 2022 12:54:38 +0530 Message-ID: Subject: Re: [PATCH 6/6] drm/meson: add support for MIPI-DSI transceiver To: Neil Armstrong Cc: daniel@ffwll.ch, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Neil, On Mon, Sep 7, 2020 at 1:48 PM Neil Armstrong wrote: > > The Amlogic AXg SoCs embeds a Synopsys DW-MIPI-DSI transceiver (ver 1.21a), with a custom > glue managing the IP resets, clock and data input similar to the DW-HDMI Glue on other > Amlogic SoCs. > > This adds support for the Glue managing the transceiver, mimicing the init flow provided > by Amlogic to setup the ENCl encoder, the glue, the transceiver, the digital D-PHY and the > Analog PHY in the proper way. > > The DW-MIPI-DSI transceiver + D-PHY are directly clocked by the VCLK2 clock, which pixel clock > is derived and feeds the ENCL encoder and the VIU pixel reader. > > An optional "MEAS" clock can be enabled to measure the delay between each vsync feeding the > DW-MIPI-DSI transceiver. > > Signed-off-by: Neil Armstrong > --- > drivers/gpu/drm/meson/Kconfig | 7 + > drivers/gpu/drm/meson/Makefile | 1 + > drivers/gpu/drm/meson/meson_dw_mipi_dsi.c | 562 ++++++++++++++++++++++ > 3 files changed, 570 insertions(+) > create mode 100644 drivers/gpu/drm/meson/meson_dw_mipi_dsi.c > > diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig > index 9f9281dd49f8..385f6f23839b 100644 > --- a/drivers/gpu/drm/meson/Kconfig > +++ b/drivers/gpu/drm/meson/Kconfig > @@ -16,3 +16,10 @@ config DRM_MESON_DW_HDMI > default y if DRM_MESON > select DRM_DW_HDMI > imply DRM_DW_HDMI_I2S_AUDIO > + > +config DRM_MESON_DW_MIPI_DSI > + tristate "MIPI DSI Synopsys Controller support for Amlogic Meson Display" > + depends on DRM_MESON > + default y if DRM_MESON > + select DRM_DW_MIPI_DSI > + select GENERIC_PHY_MIPI_DPHY > diff --git a/drivers/gpu/drm/meson/Makefile b/drivers/gpu/drm/meson/Makefile > index 28a519cdf66b..2cc870e91182 100644 > --- a/drivers/gpu/drm/meson/Makefile > +++ b/drivers/gpu/drm/meson/Makefile > @@ -5,3 +5,4 @@ meson-drm-y += meson_rdma.o meson_osd_afbcd.o > > obj-$(CONFIG_DRM_MESON) += meson-drm.o > obj-$(CONFIG_DRM_MESON_DW_HDMI) += meson_dw_hdmi.o > +obj-$(CONFIG_DRM_MESON_DW_MIPI_DSI) += meson_dw_mipi_dsi.o > diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c > new file mode 100644 > index 000000000000..bbe1294fce7c > --- /dev/null > +++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c > @@ -0,0 +1,562 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Copyright (C) 2016 BayLibre, SAS > + * Author: Neil Armstrong > + * Copyright (C) 2015 Amlogic, Inc. All rights reserved. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include