DESK-MP1-L/Peripherals/LCD

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2023/08/02 DESK-MP1-L-1.0.0 release


Peripheral LCD[edit | edit source]

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the ETRA SOM:

From the kernel device tree stm32mp157a-dcsb5000dd1r.dts where RGB interface has been configured for a LCD panel (800x480 18bit):

/ {
    ...
    ...
    panel-rgb@0 {
		status = "okay";
		power-supply = <&lcd_vdd>;
		backlight = <&panel_backlight>;

		compatible = "panel-dpi", "simple-panel";
		data-mapping = "bgr666";

		width-mm = <154>;
		height-mm = <87>;

		panel-timing {
			clock-frequency = <33000000>;
			hactive = <800>;
			vactive = <480>;

			hsync-len = <1>;
			hfront-porch = <210>;
			hback-porch = <88>;

			vsync-len = <3>;
			vfront-porch = <22>;
			vback-porch = <32>;


			hsync-active = <0>;
			vsync-active = <0>;

			de-active = <1>;
			pixelclk-active = <1>;
		};

		port {
			panel_rgb_in: endpoint {
				remote-endpoint = <&ltdc_out_rgb>;
			};
		};
	};

	panel_backlight: backlight {
		compatible = "pwm-backlight";
		pwms = <&bl_pwm 3 5000000 0>;
		pwm-names = "backlight";
		power-supply = <&lcd_5v>;

		brightness-levels = <0 3 6 8 11 13 16 18 21 23 26 29 31 34 36 39 41 44 46 49 51 54 57 59 62 64 67 69 72 74 77 80 82 85 87 90 92 95 97 100 102 105 108 110 113 115 118 120 123 125 128 131 133 136 138 141 143 146 148 151 153 156 159 161 164 166 169 171 174 176 179 182 184 187 189 192 194 197 199 202 204 207 210 212 215 217 220 222 225 227 230 233 235 238 240 243 245 248 250 253 255>;
		default-brightness-level = <75>;
	};
    ...
    ...
};

...
...
&ltdc{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&ltdc_pins_mx>;
	pinctrl-1 = <&ltdc_sleep_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN ltdc */
	port {
		ltdc_out_rgb: endpoint {
			remote-endpoint = <&panel_rgb_in>;
		};
	};
	/* USER CODE END ltdc */
};
...
...
&pinctrl{
...
...
	ltdc_pins_mx: ltdc_mx-0 {
		pins1 {
			pinmux = <STM32_PINMUX('A', 3, AF14)>, /* LTDC_B5 */
					 <STM32_PINMUX('A', 4, AF14)>, /* LTDC_VSYNC */
					 <STM32_PINMUX('A', 5, AF14)>, /* LTDC_R4 */
					 <STM32_PINMUX('A', 6, AF14)>, /* LTDC_G2 */
					 <STM32_PINMUX('B', 0, AF9)>, /* LTDC_R3 */
					 <STM32_PINMUX('B', 1, AF9)>, /* LTDC_R6 */
					 <STM32_PINMUX('B', 8, AF14)>, /* LTDC_B6 */
					 <STM32_PINMUX('B', 9, AF14)>, /* LTDC_B7 */
					 <STM32_PINMUX('B', 10, AF14)>, /* LTDC_G4 */
					 <STM32_PINMUX('C', 0, AF14)>, /* LTDC_R5 */
					 <STM32_PINMUX('C', 6, AF14)>, /* LTDC_HSYNC */
					 <STM32_PINMUX('C', 7, AF14)>, /* LTDC_G6 */
					 <STM32_PINMUX('C', 10, AF14)>, /* LTDC_R2 */
					 <STM32_PINMUX('D', 3, AF14)>, /* LTDC_G7 */
					 <STM32_PINMUX('D', 10, AF14)>, /* LTDC_B3 */
					 <STM32_PINMUX('E', 11, AF14)>, /* LTDC_G3 */
					 <STM32_PINMUX('E', 12, AF14)>, /* LTDC_B4 */
					 <STM32_PINMUX('E', 13, AF14)>, /* LTDC_DE */
					 <STM32_PINMUX('E', 15, AF14)>, /* LTDC_R7 */
					 <STM32_PINMUX('F', 11, AF14)>, /* LTDC_G5 */
					 <STM32_PINMUX('G', 10, AF14)>; /* LTDC_B2 */
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
		pins2 {
			pinmux = <STM32_PINMUX('G', 7, AF14)>; /* LTDC_CLK */
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};
	};

	ltdc_sleep_pins_mx: ltdc_sleep_mx-0 {
		pins {
			pinmux = <STM32_PINMUX('A', 3, ANALOG)>, /* LTDC_B5 */
					 <STM32_PINMUX('A', 4, ANALOG)>, /* LTDC_VSYNC */
					 <STM32_PINMUX('A', 5, ANALOG)>, /* LTDC_R4 */
					 <STM32_PINMUX('A', 6, ANALOG)>, /* LTDC_G2 */
					 <STM32_PINMUX('B', 0, ANALOG)>, /* LTDC_R3 */
					 <STM32_PINMUX('B', 1, ANALOG)>, /* LTDC_R6 */
					 <STM32_PINMUX('B', 8, ANALOG)>, /* LTDC_B6 */
					 <STM32_PINMUX('B', 9, ANALOG)>, /* LTDC_B7 */
					 <STM32_PINMUX('B', 10, ANALOG)>, /* LTDC_G4 */
					 <STM32_PINMUX('C', 0, ANALOG)>, /* LTDC_R5 */
					 <STM32_PINMUX('C', 6, ANALOG)>, /* LTDC_HSYNC */
					 <STM32_PINMUX('C', 7, ANALOG)>, /* LTDC_G6 */
					 <STM32_PINMUX('C', 10, ANALOG)>, /* LTDC_R2 */
					 <STM32_PINMUX('D', 3, ANALOG)>, /* LTDC_G7 */
					 <STM32_PINMUX('D', 10, ANALOG)>, /* LTDC_B3 */
					 <STM32_PINMUX('E', 11, ANALOG)>, /* LTDC_G3 */
					 <STM32_PINMUX('E', 12, ANALOG)>, /* LTDC_B4 */
					 <STM32_PINMUX('E', 13, ANALOG)>, /* LTDC_DE */
					 <STM32_PINMUX('E', 15, ANALOG)>, /* LTDC_R7 */
					 <STM32_PINMUX('F', 11, ANALOG)>, /* LTDC_G5 */
					 <STM32_PINMUX('G', 7, ANALOG)>, /* LTDC_CLK */
					 <STM32_PINMUX('G', 10, ANALOG)>; /* LTDC_B2 */
		};
	};
...
...
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

root@desk-mp1:~# dmesg | grep display
[    0.087536] platform panel-rgb@0: Fixing up cyclic dependency with 5a001000.display-controller
[    2.919515] [drm] Initialized stm 1.0.0 20170330 for 5a001000.display-controller on minor 0
[    2.989666] stm32-display 5a001000.display-controller: [drm] fb0: stmdrmfb frame buffer device