Enable LCD4 adding .dts to Kernel source v3.1x ?

Hi,

I compiled the 3.13 and 3.15 kernel using Robert tools, and I saw this hoping to get LCD4 cape support: http://www.spinics.net/lists/linux-omap/msg109735.html

I applied the patch against the kernel tree, but nothing happened at boot after a rebuild, I mean screen stayed black.

A quick look in the kernel tree dirs and the am335x-bone-display-cape.dts has not been compiled.
So I tried to ass it to Makefile, rebuild and got a fatal error from DTC.

I’m not very used to DT, so if someone could have a look at this file and tell me what can be wrong, I’ll try to rebuild it.

/*

  • Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
  • This program is free software; you can redistribute it and/or modify
  • it under the terms of the GNU General Public License version 2 as
  • published by the Free Software Foundation.
  • This DTS adds supports for display capes using LCD interface for display
  • and GPIO or PWM interface for backlight controls.
    /
    &am33xx_pinmux {
    bbcape_backlight_pins: bbcape_backlight_pins {
    pinctrl-single,pins = <
    0x48 (PIN_OUTPUT | MUX_MODE7) /
    gpmc_a[2].GPIO1[18] (backlight control) */

;
};
bbcape_lcd_pins: bbcape_lcd_pins {
pinctrl-single,pins = <
0xa0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data0.lcd_data0 /
0xa4 (PIN_OUTPUT | MUX_MODE0) /
lcd_data1.lcd_data1 /
0xa8 (PIN_OUTPUT | MUX_MODE0) /
lcd_data2.lcd_data2 /
0xac (PIN_OUTPUT | MUX_MODE0) /
lcd_data3.lcd_data3 /
0xb0 (PIN_OUTPUT | MUX_MODE0) /
lcd_data4.lcd_data4 /
0xb4 (PIN_OUTPUT | MUX_MODE0) /
lcd_data5.lcd_data5 /
0xb8 (PIN_OUTPUT | MUX_MODE0) /
lcd_data6.lcd_data6 /
0xbc (PIN_OUTPUT | MUX_MODE0) /
lcd_data7.lcd_data7 /
0xc0 (PIN_OUTPUT | MUX_MODE0) /
lcd_data8.lcd_data8 /
0xc4 (PIN_OUTPUT | MUX_MODE0) /
lcd_data9.lcd_data9 /
0xc8 (PIN_OUTPUT | MUX_MODE0) /
lcd_data10.lcd_data10 /
0xcc (PIN_OUTPUT | MUX_MODE0) /
lcd_data11.lcd_data11 /
0xd0 (PIN_OUTPUT | MUX_MODE0) /
lcd_data12.lcd_data12 /
0xd4 (PIN_OUTPUT | MUX_MODE0) /
lcd_data13.lcd_data13 /
0xd8 (PIN_OUTPUT | MUX_MODE0) /
lcd_data14.lcd_data14 /
0xdc (PIN_OUTPUT | MUX_MODE0) /
lcd_data15.lcd_data15 /
0xe0 (PIN_OUTPUT | MUX_MODE0) /
lcd_vsync.lcd_vsync /
0xe4 (PIN_OUTPUT | MUX_MODE0) /
lcd_hsync.lcd_hsync /
0xe8 (PIN_OUTPUT | MUX_MODE0) /
lcd_pclk.lcd_pclk /
0xec (PIN_OUTPUT | MUX_MODE0) /
lcd_ac_bias_en.lcd_ac_bias_en (lcd_en) /
0x1a4 (PIN_OUTPUT_PULLUP | MUX_MODE7) /
mcasp0_fsr.gpio3[19] (lcd_disen) /
;
};
bbcape_touchscreen_pins: bbcape_touchscreen_pins {
pinctrl-single,pins = <
0x184 (PIN_INPUT_PULLDOWN | MUX_MODE7) /
uart1_txd.gpio0[15] (enter) /
0x40 (PIN_INPUT_PULLDOWN | MUX_MODE7) /
gpmc_a0.gpio1[16] (left) /
0x44 (PIN_INPUT_PULLDOWN | MUX_MODE7) /
gpmc_a1.gpio1[17] (right) /
0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7) /
gpmc_a3.gpio1[19] (up) /
0x198 (PIN_INPUT_PULLDOWN | MUX_MODE7) /
mcasp0_axr0.gpio3[16] (down) */
;
};
};

/ {
backlight {
status = “okay”;
compatible = “gpio-backlight”;
pinctrl-names = “default”;
pinctrl-0 = <&bbcape_backlight_pins>;
gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
default-on;
};
panel {
status = “okay”;
compatible = “ti,tilcdc,panel”;
pinctrl-names = “default”;
pinctrl-0 = <&bbcape_lcd_pins>;
panel-info {
ac-bias = <255>;
ac-bias-intrpt = <0>;
dma-burst-sz = <16>;
bpp = <16>;
fdd = <0x80>;
sync-edge = <0>;
sync-ctrl = <1>;
raster-order = <0>;
fifo-th = <0>;
};
display-timings {
native-mode = <&timing0>;
/* www.newhavendisplay.com/app_notes/OTA5180A.pdf */
timing0: 480x272 {
clock-frequency = <9200000>;
hactive = <480>;
vactive = <272>;
hfront-porch = <8>;
hback-porch = <47>;
hsync-len = <41>;
vback-porch = <2>;
vfront-porch = <3>;
vsync-len = <10>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <0>;
};
};
};
};

Thanks

Cedric.

Hi,

I compiled the 3.13 and 3.15 kernel using Robert tools, and I saw this hoping to get LCD4 cape support: http://www.spinics.net/lists/linux-omap/msg109735.html

I applied the patch against the kernel tree, but nothing happened at boot after a rebuild, I mean screen stayed black.

A quick look in the kernel tree dirs and the am335x-bone-display-cape.dts has not been compiled.
So I tried to ass it to Makefile, rebuild and got a fatal error from DTC.

It shouldn’t be compiled. Looking at the link you provided, the patch is included in the am335x-boneblack.dts file so when this DT gets compiled, it will have support for your LCD. Make sure you copy the new am335x-boneblack.dts to your dtbs folder on your SDCard.

Regards,
John

Thanks John,

That’s what I realized this morning when looking back at the code.

But I wasn’t aware of the need to copy the dts file to the sdcard.

Will give it a try later when back home.
Regards

Cédric Malitte

Thanks John,

That’s what I realized this morning when looking back at the code.

But I wasn’t aware of the need to copy the dts file to the sdcard.

As a general rule, after building a new kernel, you should do the following from the deploy folder:

sudo tar xvpf 3.15.6-bone5-firmware.tar.gz -C /media/rootfs/firmware/
sudo tar xvpf 3.15.6-bone5-modules.tar.gz -C /media/rootfs/
tar xvpf 3.15.6-bone5-dtbs.tar.gz -C /media/BOOT/
cp 3.15.6-bone5.zImage /media/BOOT/zImage

Remember to change the kernel version above to match kernel version you are building. I recommend you add the above into a script in your deploy folder called update.sh, make it executable. Each time you update the kernel, then just run:
./update.sh

Regards,
John

John,

yes I did follow Roberts guidelines as per http://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-InstallKernelandRootFileSystem
Screen still black and not detected ;(

DT is something really new to me, but I’m learning mostly at night while kids sleeping !

I’d really like to have the LCD back and running with kernel versions supporting SGX and this will happen ! Just a matter of time…

I found this, and might try it: http://www.thing-printer.com/converting-device-tree-overlays-kernel-3-12/ even if this looks like a step back.

Anyway back to compiling, testing and learning from my errors !

Cheers,

Cedric

Ok,
so I did a rebuild on the kernel, sent the file to the SD, booted on SD.

Still black screen of death.
I have panel.10 in /sys/devices, so I assume the dts is taken into account.
No /dev/fb0 is showing and in dmesg I have:

[ 2.416178] tilcdc 4830e000.lcdc: no encoders/connectors found
[ 2.422298] tilcdc 4830e000.lcdc: failed to initialize mode setting

I really don’t know what to do next…

Cedric

Ok,

so after playing in dts and in kernel config, I finally managed to get backlight.
So now screen is white instead of black !!

I had to disable pwm examples in dts because of overlaping pin config.

Still digging.

Cedric

I’m happy :wink:

Went to bed late last night with a tought and this morning at work I tried something that led to a working LCD4 cape on v3.15 kernel !

I got to enable touchscreen but now I think it will be a bit easier as I learned a bit more on dt

Regards

Cédric Malitte

Hi Cedric,

I’m trying to make a LCD4 to work with this 3.15 kernel but I have no luck.
Can you tell me what changes did you make?

Thanks!

Regards,
Razvan

Hi,

I added a few things to the dts and a few options to kernel

see the files included.

regards,

Cedric

patch-3.15-lcd4.patch (2.23 KB)

am335x-bone-display-cape.dts (3.41 KB)

defconfig (120 KB)

Hi Cedric,
Thank you very much for the infos you sent me. I will take a look at them and see what happens

Regards,
Razvan

Hi Cedric,

Can you tell me what changes did you make to the kernel?

Regards,
Razvan

Hi,

Kernel changes should be in defconfig.
I enabled a few things, but you should try with kernel config from Roberts tree first.

What I did:
Build the kerne
Patch
Rebuild
Sgx compile
Rebuild
Install

Cédric Malitte

Hi,
The defconfig file is in binary format and I don’t exactly know what to do with it.
SGX I thought is for 3D graphics and I never build it

Regards,
Razvan

Hi All,

It works fine with Robert’s 3.15 kernel. However, the lcd4 is very dim - how do you adjust the brightness?

Lcd also works with 3.16 and 3.17 kernels but omaplfb does not load

Thanks
Rob

Sorry,
Something bad happened when I transfered it from VM

For backlight, make sure you have selected in kernel config gpio backlight, the way it is in dts, the backlight is on or off.

I did not have trouble with dim screen.

I did built sgx because I need it, but it’s not mandatory for the lcd :wink:

Cédric Malitte

Hi Cedric,

can you tell me how your applying patch i am new to device tree.
can you tell me i am using this LCD paneel
http://www.aliexpress.com/store/product/4-3-inch-40PIN-TFT-LCD-Screen-with-Touch-Panel-OTA5180A-Drive-IC-480-272-RGB/224898_1899445212.html
but its not working as per this i changes in .dts file
but LCD is not working.

Please give me details.

thanks

Hi,

you should look at this http://www.element14.com/community/servlet/JiveServlet/previewBody/65082-102-5-294046/BB%20VIEW%20User%20Manual%20V3.pdf

This is also a 24bit rgb lcd panel.

If you want to enable your panel in linux, it will depend on your kernel version.
If you have the 3.8.13, the one that came on the BBB , you will just have to enalbe the bb-view dts in the config files as a starting point.

For other kernels, I think bb-view is enabled at some point, but I’m not using those displays.
I use the 4D systems cape displays because they are 16 bits, so it saves me a few pins on the BBB.

Regards.

HI Cedric,

Thanks for your prompt reply.
I am using 3.8.13-bone68 kernel.but i am not understand how to enable
the bb-view dts in the config files as a starting point.
That file not having with me.
Please tell me how to proceed

thanks

HI Cedric,

Thanks for your prompt reply.
I am not using BB-view cape i only used

4.3 inch 40PIN TFT LCD Screen with Touch Panel OTA5180A Drive IC 480*272 RGB interface.I am using 3.8.13-bone68 kernel.but i am not understand how to enable the bb-view dts in the config files as a starting point.

That file not having with me.
Please tell me how to proceed

thanks