From patchwork Tue Dec 3 16:54:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 13892723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B541E74AC3 for ; Tue, 3 Dec 2024 17:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OFYWnVcAm0x3ntfRtLVMm1BFFI70+fP8FVj1WrQ6QV8=; b=jmymLgDdA4LGRN 2CyopEJ9cyCV45TlthxscPewkcvsKdnptRes7hSDL/vqH+80SFzE84Dbw/aMuIuJ8g9qw4pdCu/cB QD/JL3WEsEkIdxmgEjRdoulKO99QBVCIZ+m9eP3L3Rr7NvmOH8COp2LhRS7QPUkTzjekvBye1/yVi 1t1rjo6DqeKo7NpnYvQI1oN/XHmta0/RWJHAFxx39u1sPOpfgMYtc+2Qyor4aptjsOd2VMpLxjFIB jU2uwco6w21wY2DpwmAgRgdYY0vMiHFh3xUyRnI0hvGRP5z9rXUMS7pXfc3KG0IGX3a9NU6j/0ell 2DClE+SPqYZIERq0kxww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIWGi-0000000ABvY-1JAr; Tue, 03 Dec 2024 17:01:00 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIWBL-0000000AArU-1c78; Tue, 03 Dec 2024 16:55:29 +0000 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=LXZLyv/TaK4M9yV1RGTBskl5YofJDTPk8fsXzH33vy8=; b=NqbcZl3jdHAlwg7tUmlCs0Adlz kWNwO/6vdT1CtAfAYzoNwg1c+k2f/eGHB0RwqC/onGXrIK6FtJZ/sT3OweWhoJQLBSq0dUFMXPrEd 9NLAwSieWxXK7AvTCj8DrqPNNec5ZZtSys9KGLFSqj9PUeq1yzMsDKGX4TGICRQPJ2LSr8kCMh8Mv cV/H1yJ+ead9lmARK9P0DBPYpQSahs+fk/3X7WpLbWaHtUtKqdum46/j5NpHGqZPYRhlaEdR4IouT ZlOXN4u9Bv91KH1L3fEBETdfoJZGJibYUB4BGs23Abn0s8H2j2IHfh2Esthsmm661cjRZ8mgz7R1s d37DlC+g==; 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 1tIWAu-0003jl-9w; Tue, 03 Dec 2024 17:55:00 +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 Subject: [PATCH v3 1/3] drm/bridge/synopsys: Add MIPI DSI2 host controller bridge Date: Tue, 3 Dec 2024 17:54:47 +0100 Message-ID: <20241203165450.1501219-2-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241203165450.1501219-1-heiko@sntech.de> References: <20241203165450.1501219-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_085527_865159_D0F12E1E X-CRM114-Status: GOOD ( 25.45 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 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/bridge/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/bridge/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) += dw-hdmi-cec.o obj-$(CONFIG_DRM_DW_HDMI_QP) += dw-hdmi-qp.o obj-$(CONFIG_DRM_DW_MIPI_DSI) += dw-mipi-dsi.o +obj-$(CONFIG_DRM_DW_MIPI_DSI2) += dw-mipi-dsi2.o diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c new file mode 100644 index 000000000000..e143a083f423 --- /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 APIs. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include