From 001710799f849fd4f7c5f06f6483b826ae308206 Mon Sep 17 00:00:00 2001 From: Abderrahmane Jarmouni Date: Wed, 3 Jul 2024 17:43:27 +0200 Subject: [PATCH] boards: shields: st_b_lcd40_dsi1_mb1166: refactoring Minimize code duplication chances when multiple boards will be added eventually as supporting this shield. Signed-off-by: Abderrahmane Jarmouni --- .../stm32h747i_disco_stm32h747xx_m7.overlay | 21 --------- .../stm32h747i_disco_stm32h747xx_m7.overlay | 30 ------------- .../stm32h747i_disco_stm32h747xx_m7.overlay | 18 -------- .../st_b_lcd40_dsi1_mb1166.overlay | 41 ++++++++++++++++- .../st_b_lcd40_dsi1_mb1166_a09.overlay | 44 ++++++++++++++++++- .../stm32h747i_disco_stm32h747xx_m7.dts | 6 +++ 6 files changed, 89 insertions(+), 71 deletions(-) delete mode 100644 boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.overlay delete mode 100644 boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.overlay 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 deleted file mode 100644 index 554e9777f1cb0e4..000000000000000 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32h747i_disco_stm32h747xx_m7.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.overlay deleted file mode 100644 index 90ddb549d7ab68c..000000000000000 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166_a09/stm32h747i_disco_stm32h747xx_m7.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32h747i_disco_stm32h747xx_m7.overlay index 7a80559b8c99274..6a03dfae5edb723 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 @@ -6,18 +6,6 @@ #include -/ { - lvgl_pointer { - compatible = "zephyr,lvgl-pointer-input"; - input = <&ft5336>; - invert-y; - }; - - chosen { - zephyr,display = <dc; - }; -}; - &sdram2 { /* Frame buffer memory cache will cause screen flickering. */ zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>; @@ -26,12 +14,6 @@ <dc { status = "okay"; ext-sdram = <&sdram2>; - width = <800>; - height = <480>; - def-back-color-red = <0>; - def-back-color-green = <0>; - def-back-color-blue = <0>; - pixel-format = ; }; /* ltdc uses pll3_r as pixel clock */ 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 f351cae9cdbf376..aee8e566a13340d 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 @@ -4,7 +4,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -&mipi_dsi { +#include + +/ { + lvgl_pointer { + compatible = "zephyr,lvgl-pointer-input"; + input = <&ft5336>; + invert-y; + }; + + chosen { + zephyr,display = <dc; + }; +}; + +&zephyr_mipi_dsi { + status = "okay"; otm8009a: otm8009a@0 { status = "okay"; compatible = "orisetech,otm8009a"; @@ -18,3 +33,27 @@ rotation = <90>; }; }; + +&zephyr_ltdc { + status = "okay"; + width = <800>; + height = <480>; + def-back-color-red = <0>; + def-back-color-green = <0>; + def-back-color-blue = <0>; + pixel-format = ; + /* 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/st_b_lcd40_dsi1_mb1166_a09.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/st_b_lcd40_dsi1_mb1166_a09.overlay index 0201678d4d00353..85a9950e129f3f4 100644 --- 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 @@ -4,7 +4,25 @@ * SPDX-License-Identifier: Apache-2.0 */ -&mipi_dsi { +#include + +/ { + lvgl_pointer { + compatible = "zephyr,lvgl-pointer-input"; + input = <&ft5336>; + invert-y; + }; + + chosen { + zephyr,display = <dc; + }; +}; + +&zephyr_mipi_dsi { + status = "okay"; + loosely-packed; + largest-packet-size = <64>; + bta-ack-disable; nt35510: nt35510@0 { status = "okay"; compatible = "frida,nt35510"; @@ -18,3 +36,27 @@ rotation = <90>; }; }; + +&zephyr_ltdc { + status = "okay"; + width = <800>; + height = <480>; + def-back-color-red = <0>; + def-back-color-green = <0>; + def-back-color-blue = <0>; + pixel-format = ; + /* 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/st/stm32h747i_disco/stm32h747i_disco_stm32h747xx_m7.dts b/boards/st/stm32h747i_disco/stm32h747i_disco_stm32h747xx_m7.dts index 9feb49e09877bf7..c7b60fdb9bfbd27 100644 --- a/boards/st/stm32h747i_disco/stm32h747i_disco_stm32h747xx_m7.dts +++ b/boards/st/stm32h747i_disco/stm32h747i_disco_stm32h747xx_m7.dts @@ -278,3 +278,9 @@ zephyr_udc0: &usbotg_hs { }; arduino_spi: &spi5 {}; + +/* alias used by display shields */ +zephyr_mipi_dsi: &mipi_dsi {}; + +/* alias used by display shields */ +zephyr_ltdc: <dc {};