From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 06 Jun 2025 07:59:13 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uNQ6j-004HMm-2u for lore@lore.pengutronix.de; Fri, 06 Jun 2025 07:59:13 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1uNQ6c-00057D-EV for lore@pengutronix.de; Fri, 06 Jun 2025 07:59:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=3T66bc2c+otO5UNu3vrSc6pigqUoyRnScSuj+K4Ok/s=; b=fTifMEYZi7WnpDxsFqse0E9zjt 4RAddd2Z1/jqf/lFvjK0ICcT4964nE5CSMxF46e4jDiSxUT4Zwt21fJbBWilKtfHrt3UxdT1RTfFp 7l9zD23Q3yPAMGy6T/0KaubjH2aDCvLMQjgoDvZAsiCgJZLZiGPr02K49BxfyhNe/3/ED1Y9OY9g7 0RMknWHiz4wEgSe4X9D8Cd1cV1Bciy4pkK9zxHGUgtmPIQU+51iXPSXFrcCNzdaHuKfOBnnJu7ILx JRc/h4OysYicI6D2hjyDM/qYr6pHNSdRorDqhdzZjxQtxyr7acHpcHxJuWE3m2yadqJ5rCPpNCkuE ej0dPnmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uNQ5g-0000000H9RY-0Hfz; Fri, 06 Jun 2025 05:58:08 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uNQ5S-0000000H9Fm-2LP6 for barebox@lists.infradead.org; Fri, 06 Jun 2025 05:57:58 +0000 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=geraet.fritz.box) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1uNQ5R-0003r4-9U; Fri, 06 Jun 2025 07:57:53 +0200 From: Ahmad Fatoum To: barebox@lists.infradead.org Cc: Ahmad Fatoum Date: Fri, 6 Jun 2025 07:57:45 +0200 Message-Id: <20250606055748.1990383-14-a.fatoum@barebox.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250606055748.1990383-1-a.fatoum@barebox.org> References: <20250606055748.1990383-1-a.fatoum@barebox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250605_225754_935091_BFD84D9B X-CRM114-Status: GOOD ( 26.92 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-5.8 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH v2 13/16] video: add Designware MIPI-DSI support X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) The Designware MIPI-DSI controller is used on both STM32MP1 and Rockchip RK35x both of which already have a display controller supported in barebox. Port the Linux driver in preparation for enabling MIPI-DSI on the STM32MP1. Signed-off-by: Ahmad Fatoum --- drivers/video/Kconfig | 10 + drivers/video/Makefile | 1 + drivers/video/dw_mipi_dsi.c | 1043 +++++++++++++++++++++++++++++++++++ include/video/dw_mipi_dsi.h | 81 +++ 4 files changed, 1135 insertions(+) create mode 100644 drivers/video/dw_mipi_dsi.c create mode 100644 include/video/dw_mipi_dsi.h diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 4ad7cd6b25d4..818ff4a0f1c8 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -215,4 +215,14 @@ config DRIVER_VIDEO_DW_HDMI controller. To make use of this driver you need platform specific glue code to be selected as well. +config DRIVER_VIDEO_DW_MIPI_DSI + tristate "Designware MIPI-DSI support" + select DRIVER_VIDEO_MIPI_DSI + select VIDEO_VPL + select OFTREE + help + Say Y here if you want to enable support for the Designware MIPI-DSI + controller. To make use of this driver you need platform specific + glue code to be selected as well. + endif diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 9a222fb370aa..73d135776102 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -33,5 +33,6 @@ obj-$(CONFIG_DRIVER_VIDEO_EFI_GOP) += efi_gop.o obj-$(CONFIG_DRIVER_VIDEO_FB_SSD1307) += ssd1307fb.o obj-$(CONFIG_BACKLIGHT_RAVE_SP) += rave-sp-backlight.o obj-$(CONFIG_DRIVER_VIDEO_DW_HDMI) += dw-hdmi.o +obj-$(CONFIG_DRIVER_VIDEO_DW_MIPI_DSI) += dw_mipi_dsi.o obj-$(CONFIG_DRIVER_VIDEO_BOCHS) += bochs/ obj-$(CONFIG_DRIVER_VIDEO_ROCKCHIP) += rockchip/ diff --git a/drivers/video/dw_mipi_dsi.c b/drivers/video/dw_mipi_dsi.c new file mode 100644 index 000000000000..0371806fe893 --- /dev/null +++ b/drivers/video/dw_mipi_dsi.c @@ -0,0 +1,1043 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016, Fuzhou Rockchip Electronics Co., Ltd + * Copyright (C) 2019, STMicroelectronics - All Rights Reserved + * Author(s): Philippe Cornu for STMicroelectronics. + * Yannick Fertre for STMicroelectronics. + * + * This generic Synopsys DesignWare MIPI DSI host driver is inspired from + * the Linux Kernel driver drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include