From patchwork Thu Mar 7 10:30:52 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: 10842645 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 A88C317E4 for ; Thu, 7 Mar 2019 10:31:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9626B2E5A1 for ; Thu, 7 Mar 2019 10:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A7F22E5A4; Thu, 7 Mar 2019 10:31:09 +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 36D2F2E5A1 for ; Thu, 7 Mar 2019 10:31:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA7C46E285; Thu, 7 Mar 2019 10:31:00 +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 BC8E26E27F for ; Thu, 7 Mar 2019 10:30:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 5918BFB04; Thu, 7 Mar 2019 11:30:58 +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 trvznWadBgyJ; Thu, 7 Mar 2019 11:30:56 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id BC6B5414C8; 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 1/2] dt-bindings: imx: Add binding for IMX NWL mipi dsi host controller Date: Thu, 7 Mar 2019 11:30:52 +0100 Message-Id: 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 The Northwest Logic MIPI DSI IP core can be found in NXPs i.MX8 Socs. Signed-off-by: Guido Günther --- .../bindings/display/imx/imx-nwl-dsi.txt | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/imx/imx-nwl-dsi.txt diff --git a/Documentation/devicetree/bindings/display/imx/imx-nwl-dsi.txt b/Documentation/devicetree/bindings/display/imx/imx-nwl-dsi.txt new file mode 100644 index 000000000000..d74b9e303417 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/imx-nwl-dsi.txt @@ -0,0 +1,72 @@ +Northwest Logic MIPI-DSI on imx SoCs +===================================== + +NWL MIPI-DSI host controller found in i.MX8 platforms. This is an +encoder/connector for the for the NWL MIPI-DSI host. + +Required properties: +- compatible: "fsl,-mipi-dsi" + The following strings are expected: + "fsl,imx8mq-mipi-dsi_drm" +- reg: the register range of the MIPI-DSI controller +- interrupts: the interrupt number for this module +- clock, clock-names: phandles to the MIPI-DSI clocks + The following clocks are expected on all platforms: + "core" - DSI core clock + "tx_esc" - TX_ESC clock (used in escape mode) + "rx_esc" - RX_ESC clock (used in escape mode) + "phy_ref" - PHY_REF clock. Clock is managed by the phy. Only + used to read the clock rate. + The following clocks are expected on i.MX8mq: + "cosre" - DSI core clock +- assigned-clocks: phandles to clocks that requires initial configuration +- assigned-clock-rates: rates of the clocks that requires initial configuration + The following clocks needs to have an initial configuration: + "tx_esc" (20 MHz) and "rx_esc" (80 Mhz). +- phys: phandle to the phy module representing the DPHY + inside the MIPI-DSI IP block +- phy-names: should be "dphy" + +Optional properties: +- power-domains phandle to the power domain +- src phandle to the system reset controller (required on + i.MX8mq) +- mux-sel phandle to the MUX register set (required on i.MX8mq) +- assigned-clock-parents phandles to parent clocks that needs to be assigned as + parents to clocks defined in assigned-clocks + +Example: + mipi_dsi: mipi_dsi@30A00000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx8mq-nwl-dsi"; + reg = <0x0 0x30A00000 0x0 0x300>; + clocks = <&clk IMX8MQ_CLK_DSI_CORE_DIV>, + <&clk IMX8MQ_CLK_DSI_AHB_DIV>, + <&clk IMX8MQ_CLK_DSI_IPG_DIV>, + <&clk IMX8MQ_CLK_DSI_PHY_REF_DIV>; + clock-names = "core", "rx_esc", "tx_esc", "phy_ref"; + assigned-clocks = <&clk IMX8MQ_CLK_DSI_AHB_SRC>, + <&clk IMX8MQ_CLK_DSI_CORE_SRC>, + <&clk IMX8MQ_VIDEO_PLL1_REF_SEL>, + <&clk IMX8MQ_VIDEO_PLL1>, + <&clk IMX8MQ_CLK_DSI_IPG_DIV>, + <&clk IMX8MQ_CLK_DSI_AHB_DIV>; + assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_80M>, + <&clk IMX8MQ_SYS1_PLL_266M>, + <&clk IMX8MQ_CLK_25M>, + <&clk IMX8MQ_CLK_DSI_AHB_DIV>; + assigned-clock-rates = <80000000>, + <266000000>, + <0>, + <599999999>, + <20000000>, + <80000000>; + interrupts = ; + power-domains = <&mipi_pd>; + src = <&src>; + mux-sel = <&gpr>; + phys = <&mipi_dsi_phy>; + phy-names = "dphy"; + status = "okay"; + }; 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