5' inch 24bit LCD kernel development for beaglebone running android

I am trying to interface 24bit lcd with BeagleBone containing TI android 4.2.2. I have made following changes to board-am335xevm.c kernel 3.2 as in the source file of TI

static const struct display_panel custom_pannel = {
WVGA,
24, //According to the 32bpp display_panel i made it to 24 for my 24 bit lcd
24, //which i am using
COLOR_ACTIVE,
};

I am using the following lcd_ctrl_config

static struct lcd_ctrl_config lcd1_cfg = {
&custom_pannel,
.ac_bias = 255,
.ac_bias_intrpt = 0,
.dma_burst_sz = 16,
.bpp = 24, // 24 bit lcd
.fdd = 0x80,
.tft_alt_mode = 0,
.stn_565_mode = 0,
.mono_8bit_mode = 0,
.invert_line_clock = 1,
.invert_frm_clock = 1,
.sync_edge = 0,
.sync_ctrl = 1,
.raster_order = 0,
};

following addition to file for my custom display pdata

struct da8xx_lcdc_platform_data buydisplay_pdata = {
.manu_name = “ThreeFive”,
.controller_data = &lcd1_cfg,
.type = “buydisplay”,
};

/* Module pin mux for LCDC */
static struct pinmux_config lcdc_pin_mux[] = {
{“lcd_data0.lcd_data0”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT

AM33XX_PULL_DISA},
{“lcd_data1.lcd_data1”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data2.lcd_data2”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data3.lcd_data3”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data4.lcd_data4”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data5.lcd_data5”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data6.lcd_data6”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data7.lcd_data7”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data8.lcd_data8”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data9.lcd_data9”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data10.lcd_data10”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data11.lcd_data11”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data12.lcd_data12”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data13.lcd_data13”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data14.lcd_data14”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“lcd_data15.lcd_data15”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
AM33XX_PULL_DISA},
{“gpmc_ad8.lcd_data16”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad9.lcd_data17”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad10.lcd_data18”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad11.lcd_data19”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad12.lcd_data20”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad13.lcd_data21”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad14.lcd_data22”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“gpmc_ad15.lcd_data23”, OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{“lcd_vsync.lcd_vsync”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
{“lcd_hsync.lcd_hsync”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
{“lcd_pclk.lcd_pclk”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
{“lcd_ac_bias_en.lcd_ac_bias_en”, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
{NULL, 0},
};

Following is my init file

static void buydisplay_init(int evm_id, int profile)
{

pr_info(“IN : %s \n”, FUNCTION);
// setup_pin_mux(lcd_cape_pin_mux);
setup_pin_mux(lcdc_pin_mux);

if (conf_disp_pll(50000000)) {
pr_info(“Failed configure display PLL, not attempting to”
“register LCDC\n”);
return;
}

gpio_request(beaglebone_lcd_avdd_en, “BONE_LCD_AVDD_EN”);
gpio_direction_output(beaglebone_lcd_avdd_en, 1);

if (am33xx_register_lcdc(&buydisplay_pdata))
pr_info(“Failed to register LCDC device\n”);

pr_info(“Setup LCD display\n”);
return;
}

I have made following changes to da8xxfb.c in TI_Android_JB_4.2.2_DevKit_4.1.1/kernel/drivers/video/da8xx-fb.c

under

static struct da8xx_panel known_lcd_panels[] = {

.

.

.

10] = {

.name = “buydisplay”,
.width = 800,
.height = 480,
.hfp = 40, // 20
.hbp = 88, // 54
.hsw = 48,
.vfp = 13,
.vbp = 32,
.vsw = 3,
.pxl_clk = 50000000,
.invert_pxl_clk = 0,
},

My cross compile toolchain path is

export PATH=/home/mihir/TI_Android_JB_4.2.2_DevKit_4.1.1/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH

and i have compiled the kernel using following command by changing my directory to " TI_Android_JB_4.2.2_DevKit_4.1.1/kernel/ " and compiled my kernel using

make ARCH=arm CROSS_COMPILE=arm-eabi- distclean

make ARCH=arm CROSS_COMPILE=arm-eabi- am335x_evm_android_defconfig

make ARCH=arm CROSS_COMPILE=arm-eabi- uImage

The image is successfully getting generated

But there is no display on the LCD which is connected. I have considered the errate sheet LCD section for my connections.

By looking into the kernel log the following is noted on terminal

1.266693] IN : bone_setup_display_daughter_board
[ 1.331512] No display cape found on BeagleBone
[ 1.336730] da8xx_lcdc.0: alias fck already exists
[ 1.342071] da8xx_lcdc da8xx_lcdc.0: GLCD: Found Sharp_LCD035Q3DG01 panel

Are there any specific guidelines to adding a custom 24 bit LCD to beaglebone ReV A6 running android?

Am I missing any part in kernel compilation?

Can you point out any other files that i need to edit?

the function buydisplay_init() is never called. It was obvious because the kernel tells you that: [ 1.331512] No display cape found on BeagleBone

just call your function without any “cape” identification and track if someone tries to use LCD’s pins in other functions.

I have changed the following in board-am335xevm.c

static void bone_setup_display_daughter_board(struct memory_accessor *m, void *c)
{
int ret;

/*

  • Read from the EEPROM to see the presence
  • of daughter board. If present, get daughter board
  • specific data.
    */
    pr_info(“IN : %s \n”, FUNCTION);
    ret = m->read(m, (char *) &cape_eeprom_config, 0,
    sizeof( struct bone_cape_eeprom_config));

if (ret == sizeof (struct bone_cape_eeprom_config))
{
pr_info(“Detected a daughter card on BeagleBone…”);

if (!strncmp(“BB-BONE-LCD7-01”, cape_eeprom_config.part_no, 15)) {
pr_info(“BeagleBone LCD7 cape board detected\n”);
pr_info(“Board Name: %s\n”, cape_eeprom_config.board_name);
pr_info(“Hardware revision: %s\n”, cape_eeprom_config.version);

if (!strncmp(“00A1”, cape_eeprom_config.version, 4))
/* rev A1 /
beaglebone_lcd_avdd_en = GPIO_TO_PIN(0, 7);
else if (!strncmp(“00A2”, cape_eeprom_config.version, 4))
/
rev A2 /
beaglebone_lcd_avdd_en = GPIO_TO_PIN(1, 31);
else
/
Rev A3 or later */
beaglebone_lcd_avdd_en = GPIO_TO_PIN(0, 2);

bone_lcd7_lcdc_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);
pr_info(“BeagleBone cape: Registering PWM backlight for LCD cape\n”);
enable_ehrpwm1(0,0);
if ((!strncmp(“00A1”, cape_eeprom_config.version, 4)) ||
(!strncmp(“00A2”, cape_eeprom_config.version, 4)))
lcd_cape_keys_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);
else
lcd7a3_cape_keys_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);

lcd_cape_tsc_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);

return;
}


else if (!strncmp(“BB-BONE-LCD3-01”, cape_eeprom_config.part_no, 15)) {
pr_info(“BeagleBone LCD3 cape board detected\n”);
pr_info(“Board Name: %s\n”, cape_eeprom_config.board_name);
pr_info(“Hardware revision: %s\n”, cape_eeprom_config.version);

bone_lcd3_lcdc_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);
lcd_cape_keys_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);
lcd_cape_tsc_init(DEV_ON_DGHTR_BRD, PROFILE_NONE);

return;
}

}

/* Display needs to be initialized even if display daughter card is not found so as

  • to enable framebuffer driver which is needed for successful Android bootup
    */
    pr_info(“No display cape found on BeagleBone\n”);

/* HDMI display is setup for BeagleBone Black */
if (am335x_evm_get_id() == BEAGLE_BONE_BLACK)
hdmi_init(DEV_ON_BASEBOARD, PROFILE_NONE);
else
//vnc_lcdc_init(DEV_ON_BASEBOARD, PROFILE_NONE);
buydisplay_init(DEV_ON_BASEBOARD, PROFILE_NONE); // My Changes

}

I have also attached compleate kernel and phot oof lcd that while booting android on board

also please let me no if the changes that i have made previously are correct along with the one that i have made.

Some excrepts of the kernel are as follows

[ 1.279907] IN : bone_setup_display_daughter_board

[ 1.339996] No display cape found on BeagleBone

[ 1.344726] IN : buydisplay_init

[ 1.348693] da8xx_lcdc.0: alias fck already exists

[ 1.354064] da8xx_lcdc da8xx_lcdc.0: GLCD: Found buydisplay panel

[ 1.371368] Setup LCD display



oot@android:/ # [ 4.211181] Disabling lock debugging due to kernel taint

[ 4.237915] android_work: did not send uevent (0 0 (null))

[ 4.262054] omaplfb: OMAPLFBInitFBDev: Device 0: Unknown FB format

[ 4.316375] android_work: sent uevent USB_STATE=CONNECTED

[ 4.322998] gadget: high-speed config #1: android

[ 4.332275] android_work: sent uevent USB_STATE=CONFIGURED

[ 4.469818] warning: `rild’ uses 32-bit capabilities (legacy support in use)

[ 5.840972] init: untracked pid 64 exited

[ 9.692321] init: untracked pid 140 exited

[ 14.131683] init: untracked pid 308 exited

[ 18.627136] init: untracked pid 314 exited

[ 24.170501] init: untracked pid 320 exited

[ 28.732818] init: untracked pid 326 exited

[ 34.273071] init: untracked pid 332 exited

[ 38.827148] init: untracked pid 338 exited

[ 44.417144] init: untracked pid 344 exited

[ 49.029754] init: untracked pid 350 exited

[ 53.621734] init: untracked pid 356 exited

[ 59.187255] init: untracked pid 362 exited

[ 63.734313] init: untracked pid 368 exited

and it goes on.

Please provid me with some inputs on the following

Kernel log Untacked pid.doc (78 KB)

photo.JPG

I have a similar problem… After adding support for the new LCD, I get a frame buffer error. Mihir showed the same problem in his log. What was the solution to overcome this?

omaplfb: OMAPLFBInitFBDev: Device 0: Unknown FB format

Following thing worked for me

I edited the following file da8xx-fb.c

static struct da8xx_panel known_lcd_panels[] = {
/* Sharp LCD035Q3DG01 */
[0] = {
.name = “Sharp_LCD035Q3DG01”,
// .width = 320,
// .height = 240,
// .hfp = 8,
// .hbp = 6,
// .hsw = 0,
// .vfp = 2,
// .vbp = 2,
// .vsw = 0,
// .pxl_clk = 4608000,
// .invert_pxl_clk = 1,
//--------------------------------------------------------------
.width = 800, // Refer your LCD
.height = 480, // datasheet for all your values
.hfp = 40,
.hbp = 88,
.hsw = 48,
.vfp = 13,
.vbp = 32,
.vsw = 3,
.pxl_clk = 35000000,
.invert_pxl_clk = 0,
},
leave the following board-am335xevm.c as it is untouched. Now try compiling the kernel