LCD issues

Hello,
I have been trying to get an LCD panel going connected to my BBB.
Building the kernel with my own device tree file I can get the kernel and rootfs up and fbv an image to the display.

The kernel is based on the 4.4.38 and patches as identified on RobertCNelson’s wiki, all seems to be OK.

All boots fine and when connecting HDMI I can blit bmp’s to the frame buffer. I then decided to connect the LCD panel (5" 480x800) and I could also send a bitmap to the frame buffer although I was getting an issue sometimes about a timeout waiting for the lcd.

The dts has the following in:

/{

panel {
compatible = “ti,tilcdc,panel”;
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lcd_pins_default>;
panel-info {
ac-bias = <255>;
ac-bias-intrpt = <0>;
dma-burst-sz = <16>;
bpp = <32>;
fdd = <0x80>;
sync-edge = <0>;
sync-ctrl = <1>;
raster-order = <0>;
fifo-th = <0>;
};

display-timings {
800x480p62 {
clock-frequency = <30000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <39>;
hback-porch = <39>;
hsync-len = <47>;
vback-porch = <29>;
vfront-porch = <13>;
vsync-len = <2>;
hsync-active = <1>;
vsync-active = <1>;
};
};
};
};

&am33xx_pinmux {
pinctrl-names = “default”;

lcd_pins_default: lcd_pins_default {
pinctrl-single,pins = <
0xa0 0x00 /* lcd_data0.lcd_data0, OUTPUT | MODE0 /
0xa4 0x00 /
lcd_data1.lcd_data1, OUTPUT | MODE0 /
0xa8 0x00 /
lcd_data2.lcd_data2, OUTPUT | MODE0 /
0xac 0x00 /
lcd_data3.lcd_data3, OUTPUT | MODE0 /
0xb0 0x00 /
lcd_data4.lcd_data4, OUTPUT | MODE0 /
0xb4 0x00 /
lcd_data5.lcd_data5, OUTPUT | MODE0 /
0xb8 0x00 /
lcd_data6.lcd_data6, OUTPUT | MODE0 /
0xbc 0x00 /
lcd_data7.lcd_data7, OUTPUT | MODE0 /
0xc0 0x00 /
lcd_data8.lcd_data8, OUTPUT | MODE0 /
0xc4 0x00 /
lcd_data9.lcd_data9, OUTPUT | MODE0 /
0xc8 0x00 /
lcd_data10.lcd_data10, OUTPUT | MODE0 /
0xcc 0x00 /
lcd_data11.lcd_data11, OUTPUT | MODE0 /
0xd0 0x00 /
lcd_data12.lcd_data12, OUTPUT | MODE0 /
0xd4 0x00 /
lcd_data13.lcd_data13, OUTPUT | MODE0 /
0xd8 0x00 /
lcd_data14.lcd_data14, OUTPUT | MODE0 /
0xdc 0x00 /
lcd_data15.lcd_data15, OUTPUT | MODE0 /
0xe0 0x00 /
lcd_vsync.lcd_vsync, OUTPUT | MODE0 /
0xe4 0x00 /
lcd_hsync.lcd_hsync, OUTPUT | MODE0 /
0xe8 0x00 /
lcd_pclk.lcd_pclk, OUTPUT | MODE0 /
0xec 0x00 /
lcd_ac_bias_en.lcd_ac_bias_en, OUTPUT | MODE0 */

;
};

};

&lcdc {
pinctrl-names = “default”;
pinctrl-0 = <&lcd_pins_default>;
status = “okay”;
display-timings {
800x480p62 {
clock-frequency = <30000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <39>;
hback-porch = <39>;
hsync-len = <47>;
vback-porch = <29>;
vfront-porch = <13>;
vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
bpp = <16>;
};
};
};

&tscadc {
status = “okay”;
tsc {
ti,wires = <4>;
ti,x-plate-resistance = <200>;
ti,coordinate-readouts = <5>;
ti,wire-config = <0x00 0x11 0x22 0x33>;
};

adc {
ti,adc-channels = <4 5 6 7>;
};
};

A bit of digging seemed to show that I needed to define the fb, which I have done.

fb {
compatible = “ti,am33xx-tilcdc”;
reg = <0x4830e000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <36>;
ti,hwmods = “lcdc”;
};

Since updating the dts file I now get a warning at boot:

[ 7.403547] ------------[ cut here ]------------
[ 7.408226] WARNING: CPU: 0 PID: 100 at arch/arm/mach-omap2/omap_hwmod.c:2107 _enable+0x201/0x210()
[ 7.417307] omap_hwmod: lcdc: enabled state can only be entered from initialized, idle, or disabled state
[ 7.426910] Modules linked in: ti_am335x_tsc(+) omap_rng(+) rng_core btusb btrtl btintel btbcm snd_soc_davinci_mcasp(+) snd_soc_edma snd_soc_omap snd_soc_core snd_pcm_dmaengine bluetooth snd_pcm snd_timer snd soundcore spi_omap2_mcspi(+) st_pressure_i2c st_pressure inv_mpu6050_i2c st_sensors inv_mpu6050 evdev st_sensors_i2c industrialio_triggered_buffer kfifo_buf industrialio ti_am335x_tscadc leds_gpio tilcdc(+) uio_pdrv_genirq uio pwm_bl
[ 7.466139] CPU: 0 PID: 100 Comm: udevd Not tainted 4.4.36+ #10
[ 7.472079] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 7.478234] [] (unwind_backtrace) from [] (show_stack+0x11/0x14)
[ 7.486023] [] (show_stack) from [] (warn_slowpath_common+0x69/0x8c)
[ 7.494153] [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x2f/0x44)
[ 7.502890] [] (warn_slowpath_fmt) from [] (_enable+0x201/0x210)
[ 7.510669] [] (_enable) from [] (omap_hwmod_enable+0x15/0x20)
[ 7.518275] [] (omap_hwmod_enable) from [] (omap_device_enable+0x2b/0x5c)
[ 7.526838] [] (omap_device_enable) from [] (_od_runtime_resume+0x11/0x20)
[ 7.535492] [] (_od_runtime_resume) from [] (rpm_callback+0x7b/0x8c)
[ 7.543621] [] (rpm_callback) from [] (rpm_resume+0x2ab/0x44c)
[ 7.551225] [] (rpm_resume) from [] (__pm_runtime_resume+0x43/0x54)
[ 7.559307] [] (__pm_runtime_resume) from [] (tilcdc_load+0x1c0/0x4b4 [tilcdc])
[ 7.568411] [] (tilcdc_load [tilcdc]) from [] (drm_dev_register+0x75/0x7c)
[ 7.577065] [] (drm_dev_register) from [] (drm_platform_init+0x35/0xa8)
[ 7.585462] [] (drm_platform_init) from [] (tilcdc_pdev_probe+0x58/0x78 [tilcdc])
[ 7.594734] [] (tilcdc_pdev_probe [tilcdc]) from [] (platform_drv_probe+0x37/0x78)
[ 7.604092] [] (platform_drv_probe) from [] (driver_probe_device+0x189/0x334)
[ 7.613006] [] (driver_probe_device) from [] (__driver_attach+0x51/0x54)
[ 7.621483] [] (__driver_attach) from [] (bus_for_each_dev+0x4b/0x74)
[ 7.629699] [] (bus_for_each_dev) from [] (bus_add_driver+0x14b/0x1bc)
[ 7.638002] [] (bus_add_driver) from [] (driver_register+0x39/0x8c)
[ 7.646049] [] (driver_register) from [] (init_module+0x34/0x3f [tilcdc])
[ 7.654622] [] (init_module [tilcdc]) from [] (do_one_initcall+0x9b/0x198)
[ 7.663274] [] (do_one_initcall) from [] (do_init_module+0x4d/0x30c)
[ 7.671413] [] (do_init_module) from [] (load_module+0x1621/0x1a04)
[ 7.679455] [] (load_module) from [] (SyS_finit_module+0x77/0x9c)
[ 7.687322] [] (SyS_finit_module) from [] (ret_fast_syscall+0x1/0x52)
[ 7.695531] —[ end trace 1b7d2ae8f41317af ]—

I am wondering if I am using the correct way of driving the LCD ?

I cannot find any documentation in the kernel for the tilcdc and frame buffer, that seemed to be depricated in 3.1x kernels.

If there is a new-er better way to drive the LCD still having an fb dev node so I can ultimately use Qt to drive the display I would love to know how.

Thanks
Marc