From nobody Sun Nov 24 10:29:30 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 A88D41DFDB3; Wed, 6 Nov 2024 12:34:46 +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=1730896491; cv=none; b=RQs6as0qemcYj8AxxFCXuRwOTiu776P1m1WW8NDbPN1HKgjrblHON/4wX7YiYBK+9o9Kvicze95vojbkO4b8shHB42Fb/3jQOFlV5l8sm22H/y8osvq9+G/EpcvnEgoXKshLwcREmO+CSyGoQC/7zdgaNJ8QM4JkQk2LG4Hs0Tc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730896491; c=relaxed/simple; bh=n8L7xtvhWJiyWrDaQZfl3Xa6d/4gObpifADLJmqtseQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B7Rp9P3rA75H9DFMToU3Wq7yC8n1t/uhh4p74AsftRpsXrKXYDJC33NnpDCpYjUlA4cqorhipCX/GP2xU9PYz2XwhTMNLeP1D0EwRC9JVsOxmsPLNIp5AuzMqaMcqJt9Z+lPwtwLx4yPP8/Yp/3hIvOXz0l4mOzuK6wafkkHgHs= 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=fyO7NeNG; 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="fyO7NeNG" 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=7/ZEDihFIX308g1CuDZfXMZzFY8GhxEmWOvERKr2jmM=; b=fyO7NeNG3WGSWqFqO6oJtRxoLu fIM3XUWdLsZxUx79QefhPrTgjZ77DG/kHQoVJzkJl/qFxEfmHxu22SI23BPpkcnRuZIj576uF7kmw fPPCrsBv65rn4er54LJx0lZVvKN8BCk0EDgA4JLHnKZ2FRB6P39KV52AdDAVhNTbdaBQlwvDVVUN4 0eI9kMb8aPkpcl6ae9hcuE7Gk4+36eve0XOjyzZChN4NvdTEbJolVVEY3vN4OcUGDLhXpI8Eo/LRC ifI9ar3CvOxQtehiFUncrwLpuSp1a7Y/PVDWtYK/TSaJIjXhjumdnsZRySZJBMLQcxtWdLbgCxA4F 9vzsHHVA==; Received: from i53875b28.versanet.de ([83.135.91.40] 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 1t8fEq-00076s-9k; Wed, 06 Nov 2024 13:34:20 +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 Subject: [PATCH 3/3] drm/rockchip: Add MIPI DSI2 glue driver for RK3588 Date: Wed, 6 Nov 2024 13:33:04 +0100 Message-ID: <20241106123304.422854-4-heiko@sntech.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241106123304.422854-1-heiko@sntech.de> References: <20241106123304.422854-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 This adds the glue code for the MIPI DSI2 bridge on Rockchip SoCs and enables its use on the RK3588. Right now the DSI2 controller is always paired with a DC-phy based on a Samsung IP, so the interface values are set statically for now. This stays true for the upcoming RK3576 as well. Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/Kconfig | 10 + drivers/gpu/drm/rockchip/Makefile | 1 + .../gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 524 ++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + 5 files changed, 538 insertions(+) create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kc= onfig index 448fadd4ba15..99d4b260de85 100644 --- a/drivers/gpu/drm/rockchip/Kconfig +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -10,6 +10,7 @@ config DRM_ROCKCHIP select DRM_DW_HDMI if ROCKCHIP_DW_HDMI select DRM_DW_HDMI_QP if ROCKCHIP_DW_HDMI_QP select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI + select DRM_DW_MIPI_DSI2 if ROCKCHIP_DW_MIPI_DSI2 select GENERIC_PHY if ROCKCHIP_DW_MIPI_DSI select GENERIC_PHY_MIPI_DPHY if ROCKCHIP_DW_MIPI_DSI select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC @@ -81,6 +82,15 @@ config ROCKCHIP_DW_MIPI_DSI enable MIPI DSI on RK3288 or RK3399 based SoC, you should select this option. =20 +config ROCKCHIP_DW_MIPI_DSI2 + bool "Rockchip specific extensions for Synopsys DW MIPI DSI" + select GENERIC_PHY_MIPI_DPHY + help + This selects support for Rockchip SoC specific extensions + for the Synopsys DesignWare dsi driver. If you want to + enable MIPI DSI on RK3288 or RK3399 based SoC, you should + select this option. + config ROCKCHIP_INNO_HDMI bool "Rockchip specific extensions for Innosilicon HDMI" select DRM_DISPLAY_HDMI_HELPER diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/M= akefile index 3eab662a5a1d..2b867cebbc12 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -13,6 +13,7 @@ rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) +=3D cdn-dp-core.o = cdn-dp-reg.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) +=3D dw_hdmi-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI_QP) +=3D dw_hdmi_qp-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) +=3D dw-mipi-dsi-rockchip.o +rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI2) +=3D dw-mipi-dsi2-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) +=3D inno_hdmi.o rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) +=3D rockchip_lvds.o rockchipdrm-$(CONFIG_ROCKCHIP_RGB) +=3D rockchip_rgb.o diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c b/drivers/gpu= /drm/rockchip/dw-mipi-dsi2-rockchip.c new file mode 100644 index 000000000000..42a7a80e2138 --- /dev/null +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c @@ -0,0 +1,524 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2024 Rockchip Electronics Co.Ltd + * Author: + * Guochun Huang + * Heiko Stuebner + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include