Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2040305ybg; Sat, 19 Oct 2019 07:15:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC/7PabxZ+d1cwuxaP4Wsvvv+k54GDbP22V7qOwDl+q1p1/ZLSgmr9HsYIp6tf3/teEbRN X-Received: by 2002:a17:906:792:: with SMTP id l18mr13314905ejc.170.1571494544494; Sat, 19 Oct 2019 07:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571494544; cv=none; d=google.com; s=arc-20160816; b=toarS41NAlKpxezTJ8AL/kxxV2LcIPwbdOvabEs287yTxGDA1W/QtivsVA843iO6yT JpKwZ5Bp3dXvw3s1CKX8ZEtDitjnPmKJXwazhL1QR6pF7APBbgNUohmtOqenUIpqRfpf Q7u/ET970/QP7UOQiuYqBTs8bC5mDkz814A1gV+w5Na0TlRUxRoN+Fti9Jm8IkdPXjY0 Yey23SAofsGNpQMQbE07ktoYbs9bFxdTNDOh0irn/zYZaZoTph75BhFZJdfd3Gr/mrhd Wu6LNtybGGz/y8XMCXTbANInPJEopwo7KDfHX2wgUPO/UOE+aVnmBstQOCLvgtYiz2iC B0Ug== 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=k4epYCtm4oYxH/XN9JhqgGI0c7/QpdtBdVlw8GMt1Xc=; b=ooiBkoAOvryTf50vpXw21ddr7Aykzr70mIdoOhOr6mwt8TEPcGgFiByUTkYDdLQPFt jYHdYp+mXCtFaxnGc8XeS8O5j19HZz1aiH3IPqhEplh2dpyR2afYuI12gVTfReV8suXd whOTyS/F57aFsl6j+RkZWCQQy/g5t56qgu/XVs0YJKKQcRrZc9HfYBg1CNiMzhN+brob wuSz+ANL1sjzEE96J9Nj5JR9Od+XuiKNT9ca9eFdl4j59GbCaoV9areUsAwGhkK/TArP aNISufWUTbfBEmZDuLXZBC85Sdz4dp3mxA9doo7RG3aHdFATvdYqbyLoxsTurboW+OIg 6GbQ== 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 f1si5405734ejw.217.2019.10.19.07.15.19; Sat, 19 Oct 2019 07:15: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 S1726144AbfJSOMi (ORCPT + 99 others); Sat, 19 Oct 2019 10:12:38 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:50900 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbfJSOMf (ORCPT ); Sat, 19 Oct 2019 10:12:35 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 58807FB02; Sat, 19 Oct 2019 16:12:33 +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 PEIZ6setv_h1; Sat, 19 Oct 2019 16:12:28 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 099D049B0E; Sat, 19 Oct 2019 16:12:26 +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 v7 2/2] drm/bridge: Add NWL MIPI DSI host controller support Date: Sat, 19 Oct 2019 16:12:25 +0200 Message-Id: X-Mailer: git-send-email 2.23.0.rc1 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 --- drivers/gpu/drm/bridge/Kconfig | 16 + drivers/gpu/drm/bridge/Makefile | 3 + drivers/gpu/drm/bridge/nwl-dsi.c | 1235 ++++++++++++++++++++++++++++++ drivers/gpu/drm/bridge/nwl-dsi.h | 144 ++++ 4 files changed, 1398 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 34362976cd6f..6fb534f55d22 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -65,6 +65,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 4934fcf5a6f8..c3f3a43e9b8f 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -16,4 +16,7 @@ obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ 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_NWL_MIPI_DSI) += nwl-dsi.o obj-y += synopsys/ + +header-test-y += nwl-dsi.h diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c new file mode 100644 index 000000000000..56096aed9c7b --- /dev/null +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -0,0 +1,1235 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * i.MX8 NWL MIPI DSI host driver + * + * Copyright (C) 2017 NXP + * Copyright (C) 2019 Purism SPC + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include