From 3baf23ef065f70e9326a28976be52b34c0c116f9 Mon Sep 17 00:00:00 2001 From: Nate Drude Date: Thu, 7 Nov 2024 22:30:24 +0000 Subject: [PATCH 2/5] imx8mp_var_dart: Add support for LVDS Requires first the following patch from: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Add-i-MX8MP-LVDS-driver-in-uboot/ta-p/1434826 $ wget https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors%40tkb/5689/11/0001-L6.6.23-Add-i.MX8MP-LVDS-support-in-uboot.patch $ sha256sum 0001-L6.6.23-Add-i.MX8MP-LVDS-support-in-uboot.patch 0fc4a7b1d54a2a909078c5ac8fc276d617a519cd137706cac91eebe1bfa5a7c4 0001-L6.6.23-Add-i.MX8MP-LVDS-support-in-uboot.patch $ git am --3way --whitespace=fix 0001-L6.6.23-Add-i.MX8MP-LVDS-support-in-uboot.patch Signed-off-by: Nate Drude --- .../dts/imx8mp-var-dart-dt8mcustomboard.dts | 71 +++++++++++++++++++ arch/arm/dts/imx8mp-var-som-symphony.dts | 71 +++++++++++++++++++ board/variscite/imx8mp_var_dart/Makefile | 1 + .../imx8mp_var_dart/imx8mp_var_dart.c | 2 + configs/imx8mp_var_dart_defconfig | 15 ++++ include/configs/imx8mp_var_dart.h | 5 ++ 6 files changed, 165 insertions(+) diff --git a/arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts b/arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts index f7526850f30..4e41fbad008 100644 --- a/arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts +++ b/arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts @@ -14,6 +14,13 @@ gpio6 = &pca6408_2; }; + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + status = "okay"; + default-on; + }; + chosen { stdout-path = &uart1; }; @@ -36,6 +43,37 @@ startup-delay-us = <100>; off-on-delay-us = <12000>; }; + + panel_lvds: panel-lvds { + bootph-pre-ram; + compatible = "simple-panel"; + status= "okay"; + backlight = <&backlight>; + width-mm = <153>; + height-mm = <86>; + data-mapping = "jeida-24"; + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + bootph-pre-ram; + clock-frequency = <74250000>; + hactive = <800>; + vactive = <480>; + hback-porch = <40>; + hfront-porch = <40>; + vback-porch = <29>; + vfront-porch = <13>; + hsync-len = <48>; + vsync-len = <3>; + de-active = <1>; + }; + }; + port@0 { + lvds_in: endpoint { + remote-endpoint = <&lvds_out>; + }; + }; + }; }; &uart1 { @@ -177,6 +215,12 @@ }; &iomuxc { + pinctrl_pwm1: pwm1grp { + fsl,pins = < + MX8MP_IOMUXC_GPIO1_IO01__GPIO1_IO01 0x116 + >; + }; + pinctrl_uart1: uart1grp { fsl,pins = < MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x40 @@ -291,3 +335,30 @@ >; }; }; + +/* LVDS */ +&lcdif2 { + status = "okay"; +}; + +&ldb { + status = "okay"; + + lvds-channel@0 { + fsl,data-mapping = "jeida"; + fsl,data-width = <24>; + status = "okay"; + + port@1 { + reg = <1>; + + lvds_out: endpoint { + remote-endpoint = <&lvds_in>; + }; + }; + }; +}; + +&ldb_phy { + status = "okay"; +}; diff --git a/arch/arm/dts/imx8mp-var-som-symphony.dts b/arch/arm/dts/imx8mp-var-som-symphony.dts index 668004cbddb..b7f893d6897 100644 --- a/arch/arm/dts/imx8mp-var-som-symphony.dts +++ b/arch/arm/dts/imx8mp-var-som-symphony.dts @@ -9,6 +9,13 @@ / { model = "Variscite VAR-SOM-MX8M-PLUS on Symphony-Board"; + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>; + status = "okay"; + default-on; + }; + chosen { stdout-path = &uart2; }; @@ -47,6 +54,37 @@ states = <3300000 0 1800000 1>; }; + + panel_lvds: panel-lvds { + bootph-pre-ram; + compatible = "simple-panel"; + status= "okay"; + backlight = <&backlight>; + width-mm = <153>; + height-mm = <86>; + data-mapping = "jeida-24"; + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + bootph-pre-ram; + clock-frequency = <74250000>; + hactive = <800>; + vactive = <480>; + hback-porch = <40>; + hfront-porch = <40>; + vback-porch = <29>; + vfront-porch = <13>; + hsync-len = <48>; + vsync-len = <3>; + de-active = <1>; + }; + }; + port@0 { + lvds_in: endpoint { + remote-endpoint = <&lvds_out>; + }; + }; + }; }; &uart2 { @@ -199,6 +237,12 @@ &iomuxc { + pinctrl_pwm1: pwm1grp { + fsl,pins = < + MX8MP_IOMUXC_SPDIF_EXT_CLK__GPIO5_IO05 0x116 + >; + }; + pinctrl_uart2: uart2grp { fsl,pins = < MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX 0x40 @@ -302,3 +346,30 @@ >; }; }; + +/* LVDS */ +&lcdif2 { + status = "okay"; +}; + +&ldb { + status = "okay"; + + lvds-channel@0 { + fsl,data-mapping = "jeida"; + fsl,data-width = <24>; + status = "okay"; + + port@1 { + reg = <1>; + + lvds_out: endpoint { + remote-endpoint = <&lvds_in>; + }; + }; + }; +}; + +&ldb_phy { + status = "okay"; +}; diff --git a/board/variscite/imx8mp_var_dart/Makefile b/board/variscite/imx8mp_var_dart/Makefile index a1601f6b1e3..b526bc411a6 100644 --- a/board/variscite/imx8mp_var_dart/Makefile +++ b/board/variscite/imx8mp_var_dart/Makefile @@ -15,4 +15,5 @@ obj-y += ../common/mmc.o obj-$(CONFIG_FEC_MXC) += ../common/eth.o obj-$(CONFIG_EXTCON_PTN5150) += ../common/extcon-ptn5150.o obj-$(CONFIG_IMX8M_BOARD_INIT_DRAM) += ../common/imx8_dram.o +obj-$(CONFIG_VIDEO) += ../common/video.o endif diff --git a/board/variscite/imx8mp_var_dart/imx8mp_var_dart.c b/board/variscite/imx8mp_var_dart/imx8mp_var_dart.c index 930eb306ff4..d59391750e5 100644 --- a/board/variscite/imx8mp_var_dart/imx8mp_var_dart.c +++ b/board/variscite/imx8mp_var_dart/imx8mp_var_dart.c @@ -446,11 +446,13 @@ int board_late_init(void) var_carrier_eeprom_read(CARRIER_EEPROM_BUS_SOM, CARRIER_EEPROM_ADDR, &carrier_eeprom); + env_set("backlight_gpio", "GPIO5_5"); } else if (board_id == BOARD_ID_DART) { env_set("board_name", "DART-MX8M-PLUS"); var_carrier_eeprom_read(CARRIER_EEPROM_BUS_DART, CARRIER_EEPROM_ADDR, &carrier_eeprom); + env_set("backlight_gpio", "GPIO1_1"); } var_carrier_eeprom_get_revision(&carrier_eeprom, carrier_rev, sizeof(carrier_rev)); diff --git a/configs/imx8mp_var_dart_defconfig b/configs/imx8mp_var_dart_defconfig index a3d7f568a91..44036652e8b 100644 --- a/configs/imx8mp_var_dart_defconfig +++ b/configs/imx8mp_var_dart_defconfig @@ -81,7 +81,9 @@ CONFIG_CMD_USB_SDP=y CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_BOOTP_PREFER_SERVERIP=y CONFIG_CMD_SNTP=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y +# CONFIG_CMD_CLS is not set CONFIG_CMD_EFIDEBUG=y CONFIG_CMD_RTC=y CONFIG_CMD_TIME=y @@ -173,6 +175,19 @@ CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="Variscite" CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 +CONFIG_VIDEO=y +CONFIG_BACKLIGHT_GPIO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_VIDEO_IMX8MP_LVDS=y +CONFIG_VIDEO_IMX_LCDIFV3=y +CONFIG_SPLASH_SCREEN=y +CONFIG_SPLASH_SCREEN_ALIGN=y +CONFIG_HIDE_LOGO_VERSION=y +CONFIG_SPLASH_SOURCE=y +CONFIG_VIDEO_BMP_RLE8=y +CONFIG_BMP_16BPP=y +CONFIG_BMP_24BPP=y +CONFIG_BMP_32BPP=y CONFIG_SPL_RSA=y CONFIG_SHA384=y CONFIG_LZO=y diff --git a/include/configs/imx8mp_var_dart.h b/include/configs/imx8mp_var_dart.h index 89e31832662..7a6f0d81baa 100644 --- a/include/configs/imx8mp_var_dart.h +++ b/include/configs/imx8mp_var_dart.h @@ -60,6 +60,10 @@ "image=Image.gz\0" \ "img_addr=0x42000000\0" \ "splashimage=0x4F600000\0" \ + "splashfile=/boot/splash.bmp\0" \ + "splashsourceauto=yes\0" \ + "backlight_disable=gpio clear $backlight_gpio\0" \ + "backlight_enable=gpio set $backlight_gpio\0" \ "console=ttymxc0,115200\0" \ "fdt_addr_r=0x43000000\0" \ "fdt_addr=0x43000000\0" \ @@ -138,6 +142,7 @@ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "run optargs; " \ + "run backlight_disable; " \ "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \ "bootm ${loadaddr}; " \ "else " \ -- 2.43.0