From nobody Sat Dec 28 02:40:00 2024 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D0C819F103; Mon, 9 Dec 2024 23:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733785876; cv=none; b=oggHbtAY9uHNTuZr8qxQYuTyAnveIVRB5sksrHNlKxHyGe6mUYSMmU84FLVNs4PeS5mtwNxwoUyOJ6a51JExSeMdLE+GPdmT3jXJLVGf6glHsWMrtktSIwZr6lyYAEoHPvN7OGcbJu1dxA9Hk7wyOUMALFUJsFAoQMvhq6Ebe+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733785876; c=relaxed/simple; bh=5wNcgXT3urGUHqeyyVd5voKWMaBaYIAd0xTyih6sSBA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s777+30brq9UqDBsmmSa5PCu54PktF7I97DNMSX11r479i5VNrgPg6FImBu7VWBUsxPLra9390/QWPtDdJ+RKsk1p2tLQ/HyvSEdysNcO7J4KLtacD4Q2EVonKPxyPUntlBuSfhgWlLkTc9kI/RlyTft/WJ7wp/IZRDr2qJepoI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=sPVzmbBx; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="sPVzmbBx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1Y7nRbLozFQZmTpWpztwPA7u087w03er8oFQ/McseRc=; b=sPVzmbBx0bcwIwKWUY5Z15E/I4 yXBnsPIdAQvs2VAC2WwVg76xw+e3Ja3m78JPGB0frtsjpZWYngg6WzbE/3Z2Ag6qHVyR//0Hnrj8z wHbloy4PYaZXmunf+8oDFbf7euUJ27hcshReRner4i4JUGe+nXqr9YZ0r+pIiwBuw7gO2xxcxl8WA 2pkYRH8KlQFcyPWA3m2FukS4bwp4dwoIuIJiF9Uw7YVy3fTozE6mlf9MkNhXm+a8As55WanaU6rI9 NgxXUpTLL5mIifNtjnPsdoTNBXDr6bFsbJlzM1QYLEkqMDnD09TY/iK6R6Zy8IsjgGW7U5YN6YVff vuWlwwFw==; Received: from i53875bc4.versanet.de ([83.135.91.196] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKmtc-0005Ev-US; Tue, 10 Dec 2024 00:10:33 +0100 From: Heiko Stuebner To: heiko@sntech.de Cc: andy.yan@rock-chips.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, quentin.schulz@cherry.de, Heiko Stuebner , Daniel Semkowicz , Dmitry Yashin Subject: [PATCH v4 1/3] drm/bridge/synopsys: Add MIPI DSI2 host controller bridge Date: Tue, 10 Dec 2024 00:10:19 +0100 Message-ID: <20241209231021.2180582-2-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241209231021.2180582-1-heiko@sntech.de> References: <20241209231021.2180582-1-heiko@sntech.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Heiko Stuebner Add a Synopsys Designware MIPI DSI host DRM bridge driver for their DSI2 host controller, based on the Rockchip version from the driver rockchip/dw-mipi-dsi2.c in their vendor-kernel with phy & bridge APIs. While the driver is heavily modelled after the previous IP, the register set of this DSI2 controller is completely different and there are also additional properties like the variable-width phy interface. Tested-by: Daniel Semkowicz Tested-by: Dmitry Yashin Reviewed-by: Neil Armstrong Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/bridge/synopsys/Kconfig | 6 + drivers/gpu/drm/bridge/synopsys/Makefile | 1 + .../gpu/drm/bridge/synopsys/dw-mipi-dsi2.c | 1030 +++++++++++++++++ include/drm/bridge/dw_mipi_dsi2.h | 95 ++ 4 files changed, 1132 insertions(+) create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c create mode 100644 include/drm/bridge/dw_mipi_dsi2.h diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig b/drivers/gpu/drm/brid= ge/synopsys/Kconfig index ca416dab156d..f3ab2f985f8c 100644 --- a/drivers/gpu/drm/bridge/synopsys/Kconfig +++ b/drivers/gpu/drm/bridge/synopsys/Kconfig @@ -59,3 +59,9 @@ config DRM_DW_MIPI_DSI select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL_BRIDGE + +config DRM_DW_MIPI_DSI2 + tristate + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE diff --git a/drivers/gpu/drm/bridge/synopsys/Makefile b/drivers/gpu/drm/bri= dge/synopsys/Makefile index 9869d9651ed1..9dc376d220ad 100644 --- a/drivers/gpu/drm/bridge/synopsys/Makefile +++ b/drivers/gpu/drm/bridge/synopsys/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_DRM_DW_HDMI_CEC) +=3D dw-hdmi-cec.o obj-$(CONFIG_DRM_DW_HDMI_QP) +=3D dw-hdmi-qp.o =20 obj-$(CONFIG_DRM_DW_MIPI_DSI) +=3D dw-mipi-dsi.o +obj-$(CONFIG_DRM_DW_MIPI_DSI2) +=3D dw-mipi-dsi2.o diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c b/drivers/gpu/d= rm/bridge/synopsys/dw-mipi-dsi2.c new file mode 100644 index 000000000000..054ad39c451b --- /dev/null +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c @@ -0,0 +1,1030 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2024, Fuzhou Rockchip Electronics Co., Ltd + * + * Modified by Heiko Stuebner + * This generic Synopsys DesignWare MIPI DSI2 host driver is based on the + * Rockchip version from rockchip/dw-mipi-dsi2.c converted to use bridge A= PIs. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include