diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig b/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig index b192ce223f0..2fe69bcea06 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig @@ -1,7 +1,8 @@ # Copyright (c) 2023 BrainCo Inc. +# Copyright (c) 2024 Erik Andersson # SPDX-License-Identifier: Apache-2.0 -if SHIELD_ST_B_LCD40_DSI1_MB1166 +if SHIELD_ST_B_LCD40_DSI1_MB1166 || SHIELD_ST_B_LCD40_DSI1_MB1166_A09 # Double frame buffer maintained by lvgl. if LVGL @@ -39,4 +40,4 @@ endchoice endif # LVGL -endif # SHIELD_ST_B_LCD40_DSI1_MB1166 +endif # SHIELD_ST_B_LCD40_DSI1_MB1166 || SHIELD_ST_B_LCD40_DSI1_MB1166_A09 diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.shield b/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.shield index c46fa19b33c..4cf58d14923 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.shield +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.shield @@ -1,5 +1,10 @@ # Copyright (c) 2023 bytes at work AG +# Copyright (c) 2024 Erik Andersson + # SPDX-License-Identifier: Apache-2.0 config SHIELD_ST_B_LCD40_DSI1_MB1166 def_bool $(shields_list_contains,st_b_lcd40_dsi1_mb1166) + +config SHIELD_ST_B_LCD40_DSI1_MB1166_A09 + def_bool $(shields_list_contains,st_b_lcd40_dsi1_mb1166_a09) diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.conf b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.conf new file mode 100644 index 00000000000..b8b9c9b7ee3 --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.conf @@ -0,0 +1,6 @@ +# Copyright (c) 2023 bytes at work AG +# Copyright (c) 2024 Erik Andersson +# SPDX-License-Identifier: Apache-2.0 + +# Initialize after LTDC and MIPI-DSI +CONFIG_DISPLAY_OTM8009A_INIT_PRIORITY=87 diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.overlay new file mode 100644 index 00000000000..554e9777f1c --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 bytes at work AG + * + * SPDX-License-Identifier: Apache-2.0 + */ +<dc { + /* orisetech, otm8009a */ + display-timings { + compatible = "zephyr,panel-timing"; + hsync-active = <0>; + vsync-active = <0>; + de-active = <0>; + pixelclk-active = <0>; + hsync-len = <2>; + vsync-len = <1>; + hback-porch = <34>; + vback-porch = <15>; + hfront-porch = <34>; + vfront-porch = <16>; + }; +}; diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.conf b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.conf new file mode 100644 index 00000000000..8a9071c9579 --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.conf @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Erik Andersson +# SPDX-License-Identifier: Apache-2.0 + +# Initialize after LTDC and MIPI-DSI +CONFIG_DISPLAY_NT35510_INIT_PRIORITY=87 diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.overlay new file mode 100644 index 00000000000..90ddb549d7a --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Erik Andersson + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&mipi_dsi { + loosely-packed; + largest-packet-size = <64>; + bta-ack-disable; +}; + +<dc { + /* frida, nt35510 */ + display-timings { + compatible = "zephyr,panel-timing"; + hsync-active = <0>; + vsync-active = <0>; + de-active = <0>; + pixelclk-active = <0>; + hsync-len = <2>; + vsync-len = <120>; + hback-porch = <34>; + vback-porch = <150>; + hfront-porch = <34>; + vfront-porch = <150>; + }; +}; diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.conf b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.conf index d3881d7e2ed..6b946eca8f1 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.conf +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.conf @@ -4,5 +4,3 @@ CONFIG_MEMC=y CONFIG_STM32_LTDC_RGB888=y CONFIG_HEAP_MEM_POOL_SIZE=65536 -# Initialize after LTDC and MIPI-DSI -CONFIG_DISPLAY_OTM8009A_INIT_PRIORITY=87 diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.overlay index bbaba0718b9..7a80559b8c9 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.overlay +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.overlay @@ -26,24 +26,8 @@ <dc { status = "okay"; ext-sdram = <&sdram2>; - - /* orisetech, otm8009a */ width = <800>; height = <480>; - display-timings { - compatible = "zephyr,panel-timing"; - hsync-active = <0>; - vsync-active = <0>; - de-active = <0>; - pixelclk-active = <0>; - hsync-len = <2>; - vsync-len = <1>; - hback-porch = <34>; - vback-porch = <15>; - hfront-porch = <34>; - vfront-porch = <16>; - }; - def-back-color-red = <0>; def-back-color-green = <0>; def-back-color-blue = <0>; @@ -78,12 +62,6 @@ de-active-high; }; -&otm8009a { - data-lanes = <2>; - pixel-format = ; - rotation = <90>; -}; - &i2c4 { pinctrl-0 = <&i2c4_scl_pd12 &i2c4_sda_pd13>; pinctrl-names = "default"; diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/doc/index.rst b/boards/shields/st_b_lcd40_dsi1_mb1166/doc/index.rst index 4e71b025ee3..4bc150e0c0f 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/doc/index.rst +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/doc/index.rst @@ -10,8 +10,11 @@ The B-LCD40-DSI1 shield provides a 4-inch WVGA TFT LCD with MIPI DSI interface and capacitive touch screen. .. note:: - Currently only the older version MB1166-A03 is supported by Zephyr. - The newer version MB1166-A09 does not get initialized correctly (see :github:`60888`). + The shield comes in different hardware revisions, the MB1166-A09 + is utilizing a NT35510 panel controller and shall specifically + use ``st_b_lcd40_dsi1_mb1166_a09`` as SHIELD when building + Prior versions are utilizing an OTM8009a controller and shall + use shield name without postfix, that is: ``st_b_lcd40_dsi1_mb1166`` .. figure:: image.jpg :alt: B-LCD40-DSI1 MB1166 Image @@ -101,7 +104,8 @@ Usage ***** The shield can be used in any application by setting ``SHIELD`` to -``st_b_lcd40_dsi1_mb1166`` and adding the necessary device tree properties. +``st_b_lcd40_dsi1_mb1166`` or ``st_b_lcd40_dsi1_mb1166_a09`` and adding +the necessary device tree properties. Set ``-DSHIELD="st_b_lcd40_dsi1_mb1166"`` when you invoke ``west build``. For example: diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166.overlay index 96469ab58de..f351cae9cdb 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166.overlay +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166.overlay @@ -13,5 +13,8 @@ width = <480>; reset-gpios = <&dsi_lcd_qsh_030 57 GPIO_ACTIVE_HIGH>; bl-gpios = <&dsi_lcd_qsh_030 53 GPIO_ACTIVE_HIGH>; + data-lanes = <2>; + pixel-format = ; + rotation = <90>; }; }; diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166_a09.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166_a09.overlay new file mode 100644 index 00000000000..0201678d4d0 --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166_a09.overlay @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Erik Andersson + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mipi_dsi { + nt35510: nt35510@0 { + status = "okay"; + compatible = "frida,nt35510"; + reg = <0x0>; + height = <800>; + width = <480>; + reset-gpios = <&dsi_lcd_qsh_030 57 GPIO_ACTIVE_HIGH>; + bl-gpios = <&dsi_lcd_qsh_030 53 GPIO_ACTIVE_HIGH>; + data-lanes = <2>; + pixel-format = ; + rotation = <90>; + }; +};