From patchwork Thu Mar 7 10:30:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 10842647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1002317E4 for ; Thu, 7 Mar 2019 10:31:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE45C2E5A1 for ; Thu, 7 Mar 2019 10:31:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E23DB2E5A4; Thu, 7 Mar 2019 10:31:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B32D32E5A1 for ; Thu, 7 Mar 2019 10:31:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7C996E287; Thu, 7 Mar 2019 10:31:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E42B6E286 for ; Thu, 7 Mar 2019 10:31:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id F1B23FB05; Thu, 7 Mar 2019 11:31:05 +0100 (CET) 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 01aIlqdu5pH7; Thu, 7 Mar 2019 11:30:57 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id C2A8747356; Thu, 7 Mar 2019 11:30:53 +0100 (CET) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Philipp Zabel , David Airlie , Daniel Vetter , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , dri-devel@lists.freedesktop.org, Robert Chiras Subject: [PATCH 2/2] drm/imx: Add NWL MIPI DSI host controller support Date: Thu, 7 Mar 2019 11:30:53 +0100 Message-Id: <7c181a69ee64fa3dcc2f08d1e60f7f03c1dacb59.1551954425.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 i.MX8QXP. It has been tested on the Librem 5 devkit using DCSS. Co-authored-by: Robert Chiras Signed-off-by: Guido Günther --- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/nwl/Kconfig | 12 + drivers/gpu/drm/nwl/Makefile | 2 + drivers/gpu/drm/nwl/nwl-drv.c | 594 +++++++++++++++++++++++++++ drivers/gpu/drm/nwl/nwl-drv.h | 68 +++ drivers/gpu/drm/nwl/nwl-dsi.c | 752 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/nwl/nwl-dsi.h | 105 +++++ 8 files changed, 1536 insertions(+) create mode 100644 drivers/gpu/drm/nwl/Kconfig create mode 100644 drivers/gpu/drm/nwl/Makefile create mode 100644 drivers/gpu/drm/nwl/nwl-drv.c create mode 100644 drivers/gpu/drm/nwl/nwl-drv.h create mode 100644 drivers/gpu/drm/nwl/nwl-dsi.c create mode 100644 drivers/gpu/drm/nwl/nwl-dsi.h diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index bd943a71756c..0c9ee3ef55c6 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -303,6 +303,8 @@ source "drivers/gpu/drm/sti/Kconfig" source "drivers/gpu/drm/imx/Kconfig" +source "drivers/gpu/drm/nwl/Kconfig" + source "drivers/gpu/drm/v3d/Kconfig" source "drivers/gpu/drm/vc4/Kconfig" diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index f0c1f8731a27..169dd8062964 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -96,6 +96,7 @@ obj-$(CONFIG_DRM_STI) += sti/ obj-$(CONFIG_DRM_IMX) += imx/ obj-$(CONFIG_DRM_MEDIATEK) += mediatek/ obj-$(CONFIG_DRM_MESON) += meson/ +obj-$(CONFIG_DRM_IMX_NWL_DSI) += nwl/ obj-y += i2c/ obj-y += panel/ obj-y += bridge/ diff --git a/drivers/gpu/drm/nwl/Kconfig b/drivers/gpu/drm/nwl/Kconfig new file mode 100644 index 000000000000..9a6d275c8119 --- /dev/null +++ b/drivers/gpu/drm/nwl/Kconfig @@ -0,0 +1,12 @@ +config DRM_IMX_NWL_DSI + tristate "Support for Northwest Logic MIPI DSI Host controller" + depends on DRM && (ARCH_MXC || ARCH_MULTIPLATFORM || COMPILE_TEST) + depends on COMMON_CLK + depends on MFD_SYSCON + depends on OF + select DRM_PANEL + select GENERIC_PHY + help + This enables the Northwest Logic MIPI DSI Host controller as + found on NXP's i.MX8 Processors. + diff --git a/drivers/gpu/drm/nwl/Makefile b/drivers/gpu/drm/nwl/Makefile new file mode 100644 index 000000000000..9fa63483da5b --- /dev/null +++ b/drivers/gpu/drm/nwl/Makefile @@ -0,0 +1,2 @@ +imx-nwl-objs := nwl-drv.o nwl-dsi.o +obj-$(CONFIG_DRM_IMX_NWL_DSI) += imx-nwl.o diff --git a/drivers/gpu/drm/nwl/nwl-drv.c b/drivers/gpu/drm/nwl/nwl-drv.c new file mode 100644 index 000000000000..d1f0eb6fdbb1 --- /dev/null +++ b/drivers/gpu/drm/nwl/nwl-drv.c @@ -0,0 +1,594 @@ +// 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