From 4b611523c556150f0040bf999c4dc337879122c2 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Tue, 30 Apr 2024 22:30:26 +0000 Subject: [PATCH 1/2] boards: nxp: mimxrt1040_evk: add display support Add display support for the RT1040 EVK, using the RK043* series panels defined as shields in Zephyr. Signed-off-by: Daniel DeGrasse --- boards/nxp/mimxrt1040_evk/CMakeLists.txt | 5 +++ boards/nxp/mimxrt1040_evk/doc/index.rst | 4 +++ .../mimxrt1040_evk-pinctrl.dtsi | 30 ++++++++++++++++ boards/nxp/mimxrt1040_evk/mimxrt1040_evk.dts | 34 +++++++++++++++++++ 4 files changed, 73 insertions(+) diff --git a/boards/nxp/mimxrt1040_evk/CMakeLists.txt b/boards/nxp/mimxrt1040_evk/CMakeLists.txt index 9fc000a98ab3b..e5e2d4d414091 100644 --- a/boards/nxp/mimxrt1040_evk/CMakeLists.txt +++ b/boards/nxp/mimxrt1040_evk/CMakeLists.txt @@ -4,6 +4,11 @@ # SPDX-License-Identifier: Apache-2.0 # +if (CONFIG_DISPLAY) +message(WARNING " +CONFIG_DISPLAY: Running this firmware on a board without a display may damage the board +") +endif() if(CONFIG_NXP_IMXRT_BOOT_HEADER) zephyr_library() diff --git a/boards/nxp/mimxrt1040_evk/doc/index.rst b/boards/nxp/mimxrt1040_evk/doc/index.rst index a73b6a05b4d0e..67d3578189295 100644 --- a/boards/nxp/mimxrt1040_evk/doc/index.rst +++ b/boards/nxp/mimxrt1040_evk/doc/index.rst @@ -118,6 +118,10 @@ already supported, which can also be re-used on this mimxrt1040_evk board: +-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | +-----------+------------+-------------------------------------+ +| DISPLAY | on-chip | eLCDIF. Tested with | +| | | :ref:`rk043fn02h_ct`, and | +| | | :ref:`rk043fn66hs_ctg` shields | ++-----------+------------+-------------------------------------+ The default configuration can be found in :zephyr_file:`boards/nxp/mimxrt1040_evk/mimxrt1040_evk_defconfig` diff --git a/boards/nxp/mimxrt1040_evk/mimxrt1040_evk-pinctrl.dtsi b/boards/nxp/mimxrt1040_evk/mimxrt1040_evk-pinctrl.dtsi index ad26eeecc3fdc..b9542c2362a56 100644 --- a/boards/nxp/mimxrt1040_evk/mimxrt1040_evk-pinctrl.dtsi +++ b/boards/nxp/mimxrt1040_evk/mimxrt1040_evk-pinctrl.dtsi @@ -94,5 +94,35 @@ }; }; + pinmux_lcdif: pinmux_lcdif { + group0 { + pinmux = <&iomuxc_gpio_b0_00_lcdif_clk>, + <&iomuxc_gpio_b0_01_lcdif_enable>, + <&iomuxc_gpio_b0_02_lcdif_hsync>, + <&iomuxc_gpio_b0_03_lcdif_vsync>, + <&iomuxc_gpio_b0_04_lcdif_data00>, + <&iomuxc_gpio_b0_05_lcdif_data01>, + <&iomuxc_gpio_b0_06_lcdif_data02>, + <&iomuxc_gpio_b0_07_lcdif_data03>, + <&iomuxc_gpio_b0_08_lcdif_data04>, + <&iomuxc_gpio_b0_09_lcdif_data05>, + <&iomuxc_gpio_b0_10_lcdif_data06>, + <&iomuxc_gpio_b0_11_lcdif_data07>, + <&iomuxc_gpio_b0_12_lcdif_data08>, + <&iomuxc_gpio_b0_13_lcdif_data09>, + <&iomuxc_gpio_b0_14_lcdif_data10>, + <&iomuxc_gpio_b0_15_lcdif_data11>, + <&iomuxc_gpio_b1_00_lcdif_data12>, + <&iomuxc_gpio_b1_01_lcdif_data13>, + <&iomuxc_gpio_b1_02_lcdif_data14>, + <&iomuxc_gpio_b1_03_lcdif_data15>; + drive-strength = "r0-6"; + input-schmitt-enable; + bias-pull-up; + bias-pull-up-value = "100k"; + slew-rate = "slow"; + nxp,speed = "100-mhz"; + }; + }; }; diff --git a/boards/nxp/mimxrt1040_evk/mimxrt1040_evk.dts b/boards/nxp/mimxrt1040_evk/mimxrt1040_evk.dts index fe10790977c1c..a81167a17202b 100644 --- a/boards/nxp/mimxrt1040_evk/mimxrt1040_evk.dts +++ b/boards/nxp/mimxrt1040_evk/mimxrt1040_evk.dts @@ -37,6 +37,33 @@ reg = <0x80000000 DT_SIZE_M(32)>; }; + /* + * This node describes the GPIO pins of the parallel FPC interface, + * This interface is standard to several NXP EVKs, and is used with + * several parallel LCD displays (available as zephyr shields) + */ + nxp_parallel_lcd_connector: parallel-connector { + compatible = "nxp,parallel-lcd-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio2 31 0>; /* Pin 1, BL+ */ + }; + + /* + * This node describes the GPIO pins of the I2C display FPC interface, + * This interface is standard to several NXP EVKs, and is used with + * several parallel LCD displays (available as zephyr shields) + */ + nxp_i2c_touch_fpc: i2c-touch-connector { + compatible = "nxp,i2c-tsc-fpc"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <1 0 &gpio1 19 0>, /* Pin 2, LCD touch RST */ + <2 0 &gpio1 11 0>; /* Pin 3, LCD touch INT */ + }; + leds { compatible = "gpio-leds"; green_led: led_0 { @@ -163,6 +190,13 @@ pinctrl-names = "default"; }; +nxp_touch_i2c: &lpi2c1 {}; + +zephyr_lcdif: &lcdif { + pinctrl-0 = <&pinmux_lcdif>; + pinctrl-names = "default"; +}; + /* Leave LPI2C3 disabled by default, since it conflicts with LPSPI1 pins */ &lpi2c3 { pinctrl-0 = <&pinmux_lpi2c3>; From ccef5bf5519eaa5fb584e36f6cab052df248d150 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Tue, 30 Apr 2024 20:57:10 +0000 Subject: [PATCH 2/2] samples: add rt1040 to display samples with shield Add RT1040 EVK to platform-allow list for display sample tests with RK043* based shields. Signed-off-by: Daniel DeGrasse --- samples/drivers/display/sample.yaml | 2 ++ samples/subsys/display/lvgl/sample.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/samples/drivers/display/sample.yaml b/samples/drivers/display/sample.yaml index 03bca4a8617fe..17630bf73532c 100644 --- a/samples/drivers/display/sample.yaml +++ b/samples/drivers/display/sample.yaml @@ -173,6 +173,7 @@ tests: platform_allow: - mimxrt1060_evk - mimxrt1050_evk + - mimxrt1040_evk tags: display harness: console extra_args: SHIELD=rk043fn66hs_ctg @@ -182,6 +183,7 @@ tests: platform_allow: - mimxrt1060_evk - mimxrt1050_evk + - mimxrt1040_evk tags: display harness: console extra_args: SHIELD=rk043fn02h_ct diff --git a/samples/subsys/display/lvgl/sample.yaml b/samples/subsys/display/lvgl/sample.yaml index 00ba4a5ddcbfa..59be45e5b6832 100644 --- a/samples/subsys/display/lvgl/sample.yaml +++ b/samples/subsys/display/lvgl/sample.yaml @@ -74,6 +74,7 @@ tests: platform_allow: - mimxrt1060_evk - mimxrt1050_evk + - mimxrt1040_evk tags: display harness: console extra_args: SHIELD=rk043fn66hs_ctg @@ -83,6 +84,7 @@ tests: platform_allow: - mimxrt1060_evk - mimxrt1050_evk + - mimxrt1040_evk tags: display harness: console extra_args: SHIELD=rk043fn02h_ct