From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 05 Jun 2025 23:14:56 +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 1uNHvM-0049Tp-1i for lore@lore.pengutronix.de; Thu, 05 Jun 2025 23:14:56 +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 1uNHvE-0006No-UO for lore@pengutronix.de; Thu, 05 Jun 2025 23:14:56 +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=MSru7eEQ/GzEeZ/3Uw49bUdgDgb2i9BjFVLC1/oPRno=; b=VySwHHGpsL8NndmQ79GInjydBq NxnNLebBn8JykX9lkb2NvZ5MuYKC0v8sPiHv9lUf9S4FRxqfIsos1Ct/GpXYORAJCpiH3ertjlt16 wqWyvOotTDQxc1onCE3TE+SK0yMCVRNxQ/AeqhVge7XPL8JgGKd101l0mNOcs/kGS1O9Eo8zqeWXl cmWDMaE/BbJ5/X7KeXe3qq3yJ/iHe10hhHKkBcni3tcpVjwb2cqg6TRS58sawePGMVkOBlZe8TZpW cg+Hl4FYlCq/A/pvU+ZbvzpaIEblYf9ahO56gBA1Nt1SNUNrQnzuo5iQ1LSNVTJ/GUWF+Anm9G91x 6oQX/GZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uNHuK-0000000Gezo-2M3f; Thu, 05 Jun 2025 21:13:52 +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 1uNHoB-0000000GeGt-3i06 for barebox@lists.infradead.org; Thu, 05 Jun 2025 21:07:36 +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 1uNHoA-00079B-JU; Thu, 05 Jun 2025 23:07:30 +0200 From: Ahmad Fatoum To: barebox@lists.infradead.org Cc: Ahmad Fatoum Date: Thu, 5 Jun 2025 23:07:23 +0200 Message-Id: <20250605210726.1916656-14-a.fatoum@barebox.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250605210726.1916656-1-a.fatoum@barebox.org> References: <20250605210726.1916656-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_140732_345431_48B5B2D0 X-CRM114-Status: GOOD ( 26.98 ) 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.9 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 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 | 1042 +++++++++++++++++++++++++++++++++++ include/video/dw_mipi_dsi.h | 81 +++ 4 files changed, 1134 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..5205457512f6 --- /dev/null +++ b/drivers/video/dw_mipi_dsi.c @@ -0,0 +1,1042 @@ +// 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