Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1512433ybb; Thu, 9 Apr 2020 03:43:44 -0700 (PDT) X-Google-Smtp-Source: APiQypJbsDUPKl8v6EXfkKSa+mKDPPuQvul5XCQFfHyR1c6xj6zLUTmth7y8N4Wrw2rvPeQlZ0gP X-Received: by 2002:aca:47c8:: with SMTP id u191mr5968304oia.170.1586429024441; Thu, 09 Apr 2020 03:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586429024; cv=none; d=google.com; s=arc-20160816; b=pcWsKzTFXpFUi6EQ0MgWLRjfO6ldpoIUyurzORDuuNK2+THlNSm6rwB1sOdYD8SnYA TUb9B/3K0Nf2X+/aSMHdD7MDQpxv2gm0Ltr31eJBqQ2enX5W7vU6lkvgkSGWtPmJb+1F QtDus2SO/hQRAgcYWYnyadxcWpKO7s489xq0JeCaAkGVAl6aUzC6ixwPBEM0Q1do7k5j NP7Xicl3k3DUtNYKsY+4S+Vl4DSjHipwdVghkYepn/I0U7xTroDbzl2R5SdmdhuOOWKg PfJhCo4e6NLNha9AMMdiWZZDGTFSS811IVsojX2CDeErpvyAzULjq7LENaa3UI6xWcdf jKlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=RZX4f2mqsBBkICw9s1wPNbY8uBCpQgHToa+zvCfvKuA=; b=PHJY6yzP/lw2wTT9p6yc33EUkk4+UGtUnVldng5w/mfTtAGPTu8bQAPcZg9/iBKnQP 3uoNCgt7lvQjj7GWoQLepnCw4t/cloj1Odr6Kr5XLDlmCi1/KJdMuDZjWFEIWVzgWrGb WCnLJA0GsnUs6GwLurrhvKLiRRlhe5Jazp2Y/EJ8Uq7AJp+rnk/XnM/u2HqpDhkkl1tA WyPDtrGt6k/s2J3VXyqCNzw6tYiu9LpzTq+E8Acc8D7Sh9vl0paMQMCYRF1FgAQ4t684 5t4ZNLwynGvv0rg1gP1QJWizBoLaAtyleojzmzdMiMbTIrQJoDJbjtcoajX5faz5bpaW 932Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26si4310414otj.109.2020.04.09.03.43.30; Thu, 09 Apr 2020 03:43:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbgDIKmQ (ORCPT + 99 others); Thu, 9 Apr 2020 06:42:16 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:43060 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgDIKmP (ORCPT ); Thu, 9 Apr 2020 06:42:15 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 9EF2BFB02; Thu, 9 Apr 2020 12:42:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hp5LJLoQxV9F; Thu, 9 Apr 2020 12:42:06 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id E7BDA400EE; Thu, 9 Apr 2020 12:42:02 +0200 (CEST) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Lee Jones , =?UTF-8?q?Guido=20G=C3=BCnther?= , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Chiras , Sam Ravnborg , Arnd Bergmann Subject: [PATCH v11 2/2] drm/bridge: Add NWL MIPI DSI host controller support Date: Thu, 9 Apr 2020 12:42:02 +0200 Message-Id: <1cf5750f734e33d005564cd89c576eaf3c1c192b.1586427783.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds initial support for the NWL MIPI DSI Host controller found on i.MX8 SoCs. It adds support for the i.MX8MQ but the same IP can be found on e.g. the i.MX8QXP. It has been tested on the Librem 5 devkit using mxsfb. Signed-off-by: Guido Günther Co-developed-by: Robert Chiras Signed-off-by: Robert Chiras Tested-by: Robert Chiras Tested-by: Martin Kepplinger Reviewed-by: Fabio Estevam --- drivers/gpu/drm/bridge/Kconfig | 16 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/nwl-dsi.c | 1213 ++++++++++++++++++++++++++++++ drivers/gpu/drm/bridge/nwl-dsi.h | 144 ++++ 4 files changed, 1374 insertions(+) create mode 100644 drivers/gpu/drm/bridge/nwl-dsi.c create mode 100644 drivers/gpu/drm/bridge/nwl-dsi.h diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index aaed2347ace9..6ec945f837b8 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -58,6 +58,22 @@ config DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW to DP++. This is used with the i.MX6 imx-ldb driver. You are likely to say N here. +config DRM_NWL_MIPI_DSI + tristate "Northwest Logic MIPI DSI Host controller" + depends on DRM + depends on COMMON_CLK + depends on OF && HAS_IOMEM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + select GENERIC_PHY_MIPI_DPHY + select MFD_SYSCON + select MULTIPLEXER + select REGMAP_MMIO + help + This enables the Northwest Logic MIPI DSI Host controller as + for example found on NXP's i.MX8 Processors. + config DRM_NXP_PTN3460 tristate "NXP PTN3460 DP/LVDS bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 6fb062b5b0f0..b04ac2dfa22c 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -18,6 +18,7 @@ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o obj-$(CONFIG_DRM_TI_TPD12S015) += ti-tpd12s015.o +obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.o obj-y += analogix/ obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c new file mode 100644 index 000000000000..b14d725bf609 --- /dev/null +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -0,0 +1,1213 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * i.MX8 NWL MIPI DSI host driver + * + * Copyright (C) 2017 NXP + * Copyright (C) 2020 Purism SPC + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include