Skip to contentSkip to conversation

ARM: dts: i.mxrt1050: add lcdif node

PATCH Superseded Giulio Benetti 1 participant 6 messages Mar 22, 2020

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 15/19 ARM: dts: i.mxrt1050: add lcdif node

Add lcdif node to SoC.

---
 arch/arm/dts/imxrt1050.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/imxrt1050.dtsi +10 -0
index b1d98e6feb..0123f4788c 100644
@@ -13,6 +13,7 @@
 
 / {
 	aliases {
+		display0 = &lcdif;
 		gpio0 = &gpio1;
 		gpio1 = &gpio2;
 		gpio2 = &gpio3;
@@ -142,5 +143,14 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;
 		};
+
+		lcdif: lcdif at 402b8000 {
+		    compatible = "fsl,imxrt-lcdif";
+		    reg = <0x402b8000 0x10000>;
+		    interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+		    clocks = <&clks IMXRT1050_CLK_LCDIF>;
+		    clock-names = "per";
+		    status = "disabled";
+		};
 	};
 };
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 15/19 ARM: dts: i.mxrt1050: add lcdif node

Sorry I've sent this patch twice.

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 35 lines · Giulio Benetti

Add lcdif node to SoC.

---
  arch/arm/dts/imxrt1050.dtsi | 10 ++++++++++
  1 file changed, 10 insertions(+)
arch/arm/dts/imxrt1050.dtsi +10 -0
index b1d98e6feb..0123f4788c 100644
@@ -13,6 +13,7 @@
 
  / {
  	aliases {
+		display0 = &lcdif;
  		gpio0 = &gpio1;
  		gpio1 = &gpio2;
  		gpio2 = &gpio3;
@@ -142,5 +143,14 @@
  			interrupt-controller;
  			#interrupt-cells = <2>;
  		};
+
+		lcdif: lcdif at 402b8000 {
+		    compatible = "fsl,imxrt-lcdif";
+		    reg = <0x402b8000 0x10000>;
+		    interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+		    clocks = <&clks IMXRT1050_CLK_LCDIF>;
+		    clock-names = "per";
+		    status = "disabled";
+		};
  	};
  };
#2 lore raw

PATCH v2 16/19 ARM: dts: imxrt1050: allow this dtsi file to be compiled in Linux

In reply to Giulio Benetti

Linux doesn't provide skeleton.dtsi file so let's remove its include and provide #address-cells/size-cells = <1> that were defined in skeleton.dtsi before.

---
 arch/arm/dts/imxrt1050.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/dts/imxrt1050.dtsi +3 -1
index 0123f4788c..7cfe5f5c95 100644
@@ -4,7 +4,6 @@
  * Author(s): Giulio Benetti <[email protected]>
  */
 
-#include "skeleton.dtsi"
 #include "armv7-m.dtsi"
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/imxrt1050-clock.h>
@@ -12,6 +11,9 @@
 #include <dt-bindings/memory/imxrt-sdram.h>
 
 / {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
 	aliases {
 		display0 = &lcdif;
 		gpio0 = &gpio1;
Signature · 1 line
2.20.1
#3 lore raw

PATCH v2 17/19 arch: arm: dts: imxrt1050-evk: add lcdif node

In reply to Giulio Benetti

Add lcdif node and its pinctrl.

---
 arch/arm/dts/imxrt1050-evk.dts | 60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
arch/arm/dts/imxrt1050-evk.dts +60 -0
index 56b75986e2..b5e781275e 100644
@@ -185,6 +185,33 @@
 					0x17061
 			>;
 		};
+
+		pinctrl_lcdif: lcdifgrp {
+			u-boot,dm-spl;
+			fsl,pins = <
+				MXRT1050_IOMUXC_GPIO_B0_00_LCD_CLK		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_01_LCD_ENABLE		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_02_LCD_HSYNC		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_03_LCD_VSYNC		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_04_LCD_DATA00		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_05_LCD_DATA01		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_06_LCD_DATA02		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_07_LCD_DATA03		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_08_LCD_DATA04		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_09_LCD_DATA05		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_10_LCD_DATA06		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_11_LCD_DATA07		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_12_LCD_DATA08		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_13_LCD_DATA09		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_14_LCD_DATA10		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B0_15_LCD_DATA11		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B1_01_LCD_DATA13		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B1_02_LCD_DATA14		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B1_03_LCD_DATA15		0x1b0b1
+				MXRT1050_IOMUXC_GPIO_B1_15_GPIO2_IO31		0x0b069
+				MXRT1050_IOMUXC_GPIO_AD_B0_02_GPIO1_IO02	0x0b069
+			>;
+		};
 	};
 };
 
@@ -198,3 +225,36 @@
 
 	cd-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
 };
+
+&lcdif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_lcdif>;
+	display = <&display0>;
+	status = "okay";
+
+	assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>;
+	assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>;
+
+	display0: display0 {
+		bits-per-pixel = <16>;
+		bus-width = <16>;
+
+		display-timings {
+			timing0: timing0 {
+				clock-frequency = <9300000>;
+				hactive = <480>;
+				vactive = <272>;
+				hback-porch = <4>;
+				hfront-porch = <8>;
+				vback-porch = <4>;
+				vfront-porch = <8>;
+				hsync-len = <41>;
+				vsync-len = <10>;
+				de-active = <1>;
+				pixelclk-active = <0>;
+				hsync-active = <0>;
+				vsync-active = <0>;
+			};
+		};
+	};
+};
Signature · 1 line
2.20.1
#4 lore raw

PATCH v2 18/19 configs: imxrt1050-evk: enable video support/console

In reply to Giulio Benetti

Enable DM_VIDEO subsystem and its BACKLIGHT_GPIO. Then enable SYS_WHITE_ON_BLACK to have classic black background on display. Need also to enable CONFIG_SYS_CONSOLE_ENV_OVERWRITE to retrieve stdin/stdout/stderr from CONFIG_EXTRA_ENV_SETTINGS.

---
 configs/imxrt1050-evk_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/imxrt1050-evk_defconfig +4 -0
index 71970552c0..810f391fdc 100644
@@ -17,6 +17,7 @@ CONFIG_SPL_TEXT_BASE=0x20209000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SD_BOOT=y
 # CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
@@ -62,6 +63,9 @@ CONFIG_IMXRT_SDRAM=y
 CONFIG_FSL_LPUART=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
+CONFIG_DM_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SHA1=y
 CONFIG_SHA256=y
 CONFIG_HEXDUMP=y
Signature · 1 line
2.20.1
#5 lore raw

PATCH v2 19/19 configs: imxrt1050-evk: temporary disable DCACHE

In reply to Giulio Benetti

mxsfb needs a dcache function not implemented in cortex-M7, so for the moment let's keep dcache not enabled.

---
 configs/imxrt1050-evk_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/imxrt1050-evk_defconfig +2 -0
index 810f391fdc..25d0ba191c 100644
@@ -1,4 +1,6 @@
 CONFIG_ARM=y
+CONFIG_SYS_DCACHE_OFF=y
+# CONFIG_SPL_SYS_DCACHE_OFF is not set
 CONFIG_ARCH_IMXRT=y
 CONFIG_SYS_TEXT_BASE=0x80002000
 CONFIG_SPL_GPIO_SUPPORT=y
Signature · 1 line
2.20.1