From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 05 Jun 2025 23:14:46 +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 1uNHvC-0049Sr-2h for lore@lore.pengutronix.de; Thu, 05 Jun 2025 23:14:46 +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 1uNHv6-0006C4-9I for lore@pengutronix.de; Thu, 05 Jun 2025 23:14:46 +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: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fh2ckDpQMVQQn/fG7ZSWM0xSU3f7GTOwzl3VllHIZlk=; b=XtSA/9Ebn053gMULmpwkpUrhEE 8ZO+qkUk/xCH8KFsX8uRGraInXK/rfuE+eBJvuyvbGSOOgiaOYXdFibW9etY5kYEVlbFRIsuXrHz+ H4+unwqPvNQGWZoaRDVthS9V+ADwh4VfguxOo/lrdw80fkIvKXLGXu9pNFAVvCAv8DRfwYoAio4gf Mx7Xwlzrw1BG/tGWkFzNcz+im8x9NSUSpAPFkYTkLVI5vd4ra1NyQ9zFdJRVvXB/ILiYI+6ZSPZij 4o8ZupUfg1xrBfOjKvqsLDJR2LuwZObf4wwPA57Tr+TSwxIegPGc5KnJ5+inS588vWl5H5K4reOKt a69mmGDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uNHuI-0000000Gex9-2XW7; Thu, 05 Jun 2025 21:13:50 +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 1uNHoC-0000000GeHB-0Vgn for barebox@lists.infradead.org; Thu, 05 Jun 2025 21:07:34 +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-R8; 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:24 +0200 Message-Id: <20250605210726.1916656-15-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-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250605_140732_539235_11122678 X-CRM114-Status: GOOD ( 31.87 ) 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 14/16] video: add STM32 MIPI DSI video driver 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) Now with the common Designware MIPI DSI support added, let's add STM32 glue driver to make use of it. Signed-off-by: Ahmad Fatoum --- drivers/video/Kconfig | 9 + drivers/video/Makefile | 1 + drivers/video/stm32_dsi.c | 457 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 467 insertions(+) create mode 100644 drivers/video/stm32_dsi.c diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 818ff4a0f1c8..c4b244fa5a98 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -68,6 +68,15 @@ config DRIVER_VIDEO_STM32_LTDC Say 'Y' here to enable framebuffer and splash screen support for STM32 and STM32MP1. +config DRIVER_VIDEO_STM32_DSI + bool "Enable STM32 DSI video support" + select VIDEO_VPL + select DRIVER_VIDEO_DW_MIPI_DSI + depends on ARCH_STM32 || COMPILE_TEST + help + This option enables support DSI internal bridge which can be used on + devices which have DSI devices connected. + config DRIVER_VIDEO_SDL bool "SDL framebuffer driver" depends on HAVE_LIBSDL2 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 73d135776102..f6c309ead23b 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_DRIVER_VIDEO_ATMEL) += atmel_lcdfb.o atmel_lcdfb_core.o obj-$(CONFIG_DRIVER_VIDEO_ATMEL_HLCD) += atmel_hlcdfb.o atmel_lcdfb_core.o obj-$(CONFIG_DRIVER_VIDEO_STM) += stm.o obj-$(CONFIG_DRIVER_VIDEO_STM32_LTDC) += stm32_ltdc.o +obj-$(CONFIG_DRIVER_VIDEO_STM32_DSI) += stm32_dsi.o obj-$(CONFIG_DRIVER_VIDEO_IMX) += imx.o obj-$(CONFIG_DRIVER_VIDEO_IMX_IPU) += imx-ipu-fb.o obj-$(CONFIG_DRIVER_VIDEO_PXA) += pxa.o diff --git a/drivers/video/stm32_dsi.c b/drivers/video/stm32_dsi.c new file mode 100644 index 000000000000..757e0a7081ed --- /dev/null +++ b/drivers/video/stm32_dsi.c @@ -0,0 +1,457 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 STMicroelectronics - All Rights Reserved + * Author(s): Philippe Cornu for STMicroelectronics. + * Yannick Fertre for STMicroelectronics. + * + * This MIPI DSI controller driver is based on the Linux Kernel driver from + * drivers/gpu/drm/stm/dw_mipi_dsi-stm.c. + */ + +#define pr_fmt(fmt) "stm32_dsi: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include + +#include