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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15802C43461 for ; Mon, 7 Sep 2020 08:44:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7EAF2145D for ; Mon, 7 Sep 2020 08:44:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="irc0rq2S"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="GVMpUMKA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7EAF2145D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VM47N43z8kPX04Zc/y88D4e41Nd9yEbCfVX6aQodfuw=; b=irc0rq2SJBX6eFEEq6/TVNwiz TK5GV62qWg5PU+Tj6eAulqj/igdnzOzRglOsK8rA6xJE6BHWBYMlormGSWiFrlbN2RawY3J4Wx5Ef kd66bDCDbYB6ik3GbOw7RWX2sl5Yg0etT8QcMDYQfhTXAROweB2LnWAI+1cEAfQUeuNtIWj01f2AB k7NDrxamDINqXEzdZZC0IBISoXs8b32aOdwFGy+tHE1tgYemxY4BVGR57rQLBjNJcTY9spxl7Dxj1 g1YcyBJt9j0OqJeeWAK+jKelIh6evez7c2gJ6IofpkSf3q+GVL+ckhA/+0bEerTzsePimtJXnNpks PnLDrBVSQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFCkn-0006W1-P0; Mon, 07 Sep 2020 08:43:57 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFCkl-0006VT-SS for linux-amlogic@lists.infradead.org; Mon, 07 Sep 2020 08:43:57 +0000 Received: by mail-wr1-x443.google.com with SMTP id m6so14912787wrn.0 for ; Mon, 07 Sep 2020 01:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=6Ns+K/IrmbeQf33Kz+TGEhxWVnGxJIFJa7ddzT+gnFA=; b=GVMpUMKAmmqhhwdBQ2/SoS3lzbX40axkZWLTbMYn48DFoIxZBYPiBLQCUle4Bvl6sz HHgPhYJKp7Vt/lmo7FNM9vphidR64pr0Af1w/EjwxT3LY4jwSOo2V8Cnye26Y627/bQ+ 9FpAWy2JfT+ZDUaMCVZmFseHVNvrCH0cKjuEk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=6Ns+K/IrmbeQf33Kz+TGEhxWVnGxJIFJa7ddzT+gnFA=; b=AzaGTy57p7zNHmMC6PnijpFxBGNky0BQmWNTvGHa2EvBqjSu37ys1gbCQxyeP8wb6u xRoTZtQ9SwdKmZwy+oNOY7z7ieGf+Cv9zfD1DlLYWsmvloCLY2t3zWNGI90w9kWM2wDy zjh8YLkNieDmBb/qgRzNv8cjScgZPujYIryxP0S6T8ursUaxd15IS0DpY8m7CbMZMP1x 8ARczercPE8FT4o6BKz3mwffAC7rdZRwg/qnp85im7PbyLUa4QsFRLbLPWvdhQOQZTUf 83UW2y2Oetz/ma3fxxGc1ZIQIJ1xKo2SCZ00KxuU69u14+DxMHjgVByfvc8tZV7dfuZH 7Ccw== X-Gm-Message-State: AOAM5311M6Xv40KGCUWlogXddvnyNYtwBDRATF8KES6rs5lSUl/qlqIl ReThr5DtN9yuWMsY3VInuS5AMA== X-Google-Smtp-Source: ABdhPJy9Skrftitv27yDEGteIfMEZgMaOJVYldLKfsH1M1PzxYldVrAxfjCk85MLeZ8/Qy5JP0UZ3w== X-Received: by 2002:adf:9027:: with SMTP id h36mr2396875wrh.259.1599468233810; Mon, 07 Sep 2020 01:43:53 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id e18sm31399783wra.36.2020.09.07.01.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 01:43:52 -0700 (PDT) Date: Mon, 7 Sep 2020 10:43:51 +0200 From: Daniel Vetter To: Neil Armstrong Subject: Re: [PATCH 6/6] drm/meson: add support for MIPI-DSI transceiver Message-ID: <20200907084351.GV2352366@phenom.ffwll.local> Mail-Followup-To: Neil Armstrong , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org References: <20200907081825.1654-1-narmstrong@baylibre.com> <20200907081825.1654-7-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200907081825.1654-7-narmstrong@baylibre.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200907_044355_927710_11F959EF X-CRM114-Status: GOOD ( 30.92 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On Mon, Sep 07, 2020 at 10:18:25AM +0200, 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 More dw-hdmi drivers which aren't bridges but components, and the thing is still midlayer-y as heck :-/ Can we try to fix this? There's a ton of this going on, and the more we add the old fashioned way the harder this gets to fix up for real. -Daniel > --- > 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