Hi,
i am trying to connect a TFT display with ili9341 driver to a imx6ull som. the default display for this som is a 800x600 touchscreen.
i want to work with the display in RGB666 mode.
I was able to get the display to work with the following setup:
-The lcd data and control lines and are connected to the som.
-The SPI lines are connected to a small MCU that configures the display.
Now i want to configure the display using the SOM. I`ve connected the SPI lines to ECSPI1. I also connected the DC and Reset pins.
I`ve added the driver from the following patch and enabled it using the menuconfig.
[RFC,1/2] drm/panel: Add Ilitek ILI9341 parallel RGB panel driver - Patchwork
This is the configuration i am using in the device tree:
&lcdif {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lcdif_dat
&pinctrl_lcdif_ctrl>;
display = <&display0>;
backlight = <&backlight_0>;
status = "okay";
display0: display {
bits-per-pixel = <16>;
bus-width = <18>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <6350000>;
hactive = <240>;
vactive = <320>;
hfront-porch = <10>;
hback-porch = <20>;
hsync-len = <10>;
vback-porch = <2>;
vfront-porch = <4>;
vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <0>;
};
};
port@0 {
display_out: endpoint {
remote-endpoint = <&panel_in>;
};
};
};
};
&ecspi1 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio3 26 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
panel@0 {
compatible = "displaytech,dt024ctft", "ilitek,ili9341";
reg = <0>;
spi-max-frequency = <32000000>;
dc-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
//reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
backlight = <&backlight_0>;
port {
panel_in: endpoint {
remote-endpoint = <&display_out>;
};
};
};
};
The SPI is registered:
root@visionsom:/dev# dmesg | grep spi0
[ 1.677264] spi_imx 2008000.spi: registered master spi0
[ 1.677648] spi spi0.0: spi_imx_setup: mode 0, 8 bpw, 32000000 hz
[ 1.677690] spi spi0.0: setup mode 0, 8 bits/w, 32000000 Hz max --> 0
[ 1.678181] spi_imx 2008000.spi: registered child spi0.0
and the display is configured in the right resolution:
root@visionsom:~# fbset
mode "240x320-69"
# D: 6.350 MHz, H: 22.679 kHz, V: 69.142 Hz
geometry 240 320 240 320 16
timings 157480 20 10 2 4 10 2
sync 0x40000000
rgba 5/11,6/5,5/0,0/0
endmode
but i am not seeing any data in the spi lines.
do i need to add anything else to enable the driver?
do i need to do something from the userspace/Uboot?
Thanks,
Dudi.
Hi Dudi
for lcds with ecspi one can look at examples:
How to use SPI slave within U-Boot?
https://community.nxp.com/thread/451152
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Thank you for the quick repsonse.
i just want to clarify that i want to use the parallel mode of the display.
i was able to link the spi to the ili9341 driver and now i am getting the following:
root@visionsom:~# dmesg | grep spi0
[ 1.469158] spi_imx 2008000.spi: registered master spi0
[ 1.469557] spi spi0.0: spi_imx_setup: mode 0, 8 bpw, 32000000 hz
[ 1.469597] spi spi0.0: setup mode 0, 8 bits/w, 32000000 Hz max --> 0
[ 1.470313] panel-ilitek-ili9341 spi0.0: spi_imx_setup: mode 0, 8 bpw, 32000000 hz
[ 1.470351] panel-ilitek-ili9341 spi0.0: setup mode 0, 8 bits/w, 32000000 Hz max --> 0
[ 1.470468] spi_imx 2008000.spi: registered child spi0.0
it seems i need to enable the driver but i cant understand how.
Hi Dudi
for parallel lcd first one can try to enable it in uboot,
refer to function do_enable_parallel_lcd() in:
mx6ullevk.c\mx6ullevk\freescale\board - uboot-imx - i.MX U-Boot
Best regards
igor