Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/nxp/frdm_imx93/frdm_imx93_mimx9352_a55.dts
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,5 @@
&wdog4 {
status = "okay";
};

display_i2c: &lpi2c1 {};
33 changes: 33 additions & 0 deletions boards/shields/waveshare_dsi_lcd/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright 2025 NXP
#
# SPDX-License-Identifier: Apache-2.0
#

if SHIELD_WAVESHARE_7INCH_DSI_LCD_C

if DISPLAY

if LVGL

config LV_Z_VDB_SIZE
default 100

config LV_Z_DOUBLE_VDB
default y

config LV_Z_BITS_PER_PIXEL
default 32

config LV_Z_FULL_REFRESH
default y

choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_32
endchoice

endif # LVGL

endif # DISPLAY

endif # SHIELD_7INCH_DSI_LCD_C
8 changes: 8 additions & 0 deletions boards/shields/waveshare_dsi_lcd/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright 2025 NXP
#
# SPDX-License-Identifier: Apache-2.0
#

config SHIELD_WAVESHARE_7INCH_DSI_LCD_C
def_bool $(shields_list_contains,waveshare_7inch_dsi_lcd_c)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/mipi_dsi/mipi_dsi.h>

/ {
chosen {
zephyr,display = &lcdif;
};

dram: memory@d0000000 {
reg = <0xd0000000 DT_SIZE_M(64)>;
};
};

&media_blk_ctrl {
status = "okay";
};

&lcdif {
width = <1024>;
height = <600>;
pixel-format = "argb-8888";
media-axi-clk-rate = <400000000>;
media-apb-clk-rate = <133333334>;
status = "okay";

display-timings {
compatible = "zephyr,panel-timing";
hsync-len = <100>;
hfront-porch = <100>;
hback-porch = <100>;
vsync-len = <10>;
vfront-porch = <10>;
vback-porch = <10>;
de-active= <0>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
de-active= <0>;
de-active = <0>;

pixelclk-active = <0>;
hsync-active = <1>;
vsync-active = <1>;
clock-frequency = <50000000>;
};
};

&mipi_dsi {
dpi-color-coding = "24-bit";
dpi-video-mode = "non-burst-sync-pulse";
dphy-ref-frequency = <24000000>;
data-rate-clock = <600000000>;
status = "okay";
};

&display_i2c {
status = "okay";
};

&dsi_panel {
mipi-dsi = <&mipi_dsi>;
};
53 changes: 53 additions & 0 deletions boards/shields/waveshare_dsi_lcd/doc/index.rst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add shield.yml file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartben The shield.yml file has been added, thanks for the comments

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.. _waveshare_dsi_lcd:

WAVESHARE DSI LCD Panel
########################

Overview
********

The WAVESHARE DSI LCD Panel Shield is a universal driver shield.
The shield can be used to drive various DSI LCD panel.

More information about the shield can be found
-at the `WAVESHARE DSI LCD Panel website`_.

Current supported displays
==========================

+--------------+------------------------------+
| Display | Shield Designation |
| | |
+==============+==============================+
| 7inch DSI | waveshare_7inch_dsi_lcd_c |
| LCD(C) | |
+--------------+------------------------------+


Requirements
************

This shield can only be used with a board that provides a configuration
for MIPI DSI and defines node aliases for I2C interfaces
(see :ref:`shields` for more details).

Programming
***********

Correct shield designation (see the table above) for your display must
be entered when you invoke ``west build``.
For example:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/display/lvgl
:board: frdm_imx93/mimx9352/a55
:shield: waveshare_7inch_dsi_lcd_c
:goals: build

References
**********

.. target-notes::

.. _WAVESHARE DSI LCD Panel website:
https://www.waveshare.com/product/displays/lcd-oled/7inch-dsi-lcd-c.htm
7 changes: 7 additions & 0 deletions boards/shields/waveshare_dsi_lcd/shield.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
shield:
name: waveshare_7inch_dsi_lcd_c
full_name: Waveshare 7inch DSI LCD (C)
vendor: waveshare
supported_features:
- display
- input
17 changes: 17 additions & 0 deletions boards/shields/waveshare_dsi_lcd/waveshare_7inch_dsi_lcd_c.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/mipi_dsi/mipi_dsi.h>

&display_i2c {
dsi_panel: waveshare_panel@45 {
compatible = "waveshare,7inch-dsi-lcd-c";
reg = <0x45>;
data-lanes = <2>;
pixel-format = <MIPI_DSI_PIXFMT_RGB888>;
status = "okay";
};
};
33 changes: 33 additions & 0 deletions drivers/clock_control/clock_control_mcux_ccm_rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <zephyr/drivers/clock_control.h>
#include <zephyr/dt-bindings/clock/imx_ccm_rev2.h>
#include <fsl_clock.h>
#if defined(CONFIG_SOC_MIMX9352)
#include <soc.h>
#endif

#define LOG_LEVEL CONFIG_CLOCK_CONTROL_LOG_LEVEL
#include <zephyr/logging/log.h>
Expand Down Expand Up @@ -182,6 +185,27 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
break;
#endif

#if defined(CONFIG_SOC_MIMX9352)
case IMX_CCM_MEDIA_AXI_CLK:
clock_root = kCLOCK_Root_MediaAxi;
break;
case IMX_CCM_MEDIA_APB_CLK:
clock_root = kCLOCK_Root_MediaApb;
break;
case IMX_CCM_MEDIA_DISP_PIX_CLK:
clock_root = kCLOCK_Root_MediaDispPix;
break;
case IMX_CCM_MEDIA_LDB_CLK:
clock_root = kCLOCK_Root_MediaLdb;
break;
case IMX_CCM_MIPI_PHY_CFG_CLK:
clock_root = kCLOCK_Root_MipiPhyCfg;
break;
case IMX_CCM_CAM_PIX_CLK:
clock_root = kCLOCK_Root_CamPix;
break;
#endif

#if defined(CONFIG_SOC_MIMX9352) && defined(CONFIG_DAI_NXP_SAI)
case IMX_CCM_SAI1_CLK:
case IMX_CCM_SAI2_CLK:
Expand Down Expand Up @@ -372,6 +396,15 @@ static int CCM_SET_FUNC_ATTR mcux_ccm_set_subsys_rate(const struct device *dev,
return mipi_csi2rx_clock_set_freq(kCLOCK_Root_Csi2_Esc, clock_rate);
#endif

#if defined(CONFIG_SOC_MIMX9352)
case IMX_CCM_MEDIA_AXI_CLK:
case IMX_CCM_MEDIA_APB_CLK:
case IMX_CCM_MEDIA_DISP_PIX_CLK:
case IMX_CCM_MEDIA_LDB_CLK:
case IMX_CCM_MIPI_PHY_CFG_CLK:
case IMX_CCM_CAM_PIX_CLK:
return common_clock_set_freq(clock_name, (uint32_t)clock_rate);
#endif
default:
/* Silence unused variable warning */
ARG_UNUSED(clock_rate);
Expand Down
2 changes: 2 additions & 0 deletions drivers/display/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

zephyr_library()
zephyr_library_sources_ifdef(CONFIG_DISPLAY_MCUX_ELCDIF display_mcux_elcdif.c)
zephyr_library_sources_ifdef(CONFIG_DISPLAY_MCUX_LCDIFV3 display_mcux_lcdifv3.c)
zephyr_library_sources_ifdef(CONFIG_DISPLAY_NRF_LED_MATRIX display_nrf_led_matrix.c)
zephyr_library_sources_ifdef(CONFIG_DUMMY_DISPLAY display_dummy.c)
zephyr_library_sources_ifdef(CONFIG_INTEL_MULTIBOOTFB_DISPLAY display_intel_multibootfb.c)
Expand Down Expand Up @@ -32,6 +33,7 @@ zephyr_library_sources_ifdef(CONFIG_ST7789V display_st7789v.c)
zephyr_library_sources_ifdef(CONFIG_ST7735R display_st7735r.c)
zephyr_library_sources_ifdef(CONFIG_ST7796S display_st7796s.c)
zephyr_library_sources_ifdef(CONFIG_STM32_LTDC display_stm32_ltdc.c)
zephyr_library_sources_ifdef(CONFIG_WAVESHARE_7INCH_DSI_LCD_C display_waveshare_dsi_lcd.c)
zephyr_library_sources_ifdef(CONFIG_RM68200 display_rm68200.c)
zephyr_library_sources_ifdef(CONFIG_RM67162 display_rm67162.c)
zephyr_library_sources_ifdef(CONFIG_HX8394 display_hx8394.c)
Expand Down
2 changes: 2 additions & 0 deletions drivers/display/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module-str = display
source "subsys/logging/Kconfig.template.log_config"

source "drivers/display/Kconfig.mcux_elcdif"
source "drivers/display/Kconfig.mcux_lcdifv3"
source "drivers/display/Kconfig.microbit"
source "drivers/display/Kconfig.nrf_led_matrix"
source "drivers/display/Kconfig.ili9xxx"
Expand Down Expand Up @@ -59,6 +60,7 @@ source "drivers/display/Kconfig.nt35510"
source "drivers/display/Kconfig.renesas_ra"
source "drivers/display/Kconfig.ili9806e_dsi"
source "drivers/display/Kconfig.st7701"
source "drivers/display/Kconfig.waveshare_dsi_lcd"
source "drivers/display/Kconfig.lpm013m126"

endif # DISPLAY
24 changes: 24 additions & 0 deletions drivers/display/Kconfig.mcux_lcdifv3
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0


menuconfig DISPLAY_MCUX_LCDIFV3
bool "MCUX LCDIFV3 driver"
default y
depends on DT_HAS_NXP_IMX_LCDIFV3_ENABLED
depends on CLOCK_CONTROL
select INIT_VIDEO_PLL
help
Enable support for mcux LCDIFV3 driver.

if DISPLAY_MCUX_LCDIFV3

config MCUX_LCDIFV3_FB_NUM
int "Framebuffers to be allocated in driver"
default 2
range 0 2
help
Number of framebuffers to be allocated in LCDIFV3 driver. Driver allocates
framebuffers in order to support partial display update.

endif # DISPLAY_MCUX_LCDIFV3
12 changes: 12 additions & 0 deletions drivers/display/Kconfig.waveshare_dsi_lcd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2025 NXP
#
# SPDX-License-Identifier: Apache-2.0

config WAVESHARE_7INCH_DSI_LCD_C
bool "waveshare 7inch DSI LCD(C) driver"
default y
select MIPI_DSI
select I2C
depends on DT_HAS_WAVESHARE_7INCH_DSI_LCD_C_ENABLED
help
Enable driver for waveshare 7inch DSI LCD(C).
Loading