TQ335X显示分辨率修改1024*768 15寸lcd

内核阅读工具:source insight

内核版本: linux 3.2.0

必备文件:AM335X芯片手册;AM335X技术参考手册;AM335X产品勘误表

分辨率修改,需要修改kernel和boot文件,kernel需要修改如下

1、335X的引脚分配定义文件在 board-am335xevm.c中,我的默认是24色,可根据自己的需要定义,此处需要用到 技术手册和数据手册。该部分内容网上可以查到。


/* Module pin mux for LCDC */
static struct pinmux_config lcdc_pin_mux[] = {
{"lcd_data0.lcd_data0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data1.lcd_data1", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data2.lcd_data2", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data3.lcd_data3", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data4.lcd_data4", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data5.lcd_data5", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data6.lcd_data6", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data7.lcd_data7", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data8.lcd_data8", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data9.lcd_data9", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data10.lcd_data10", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data11.lcd_data11", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data12.lcd_data12", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data13.lcd_data13", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data14.lcd_data14", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"lcd_data15.lcd_data15", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad8.lcd_data16", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad9.lcd_data17", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad10.lcd_data18", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad11.lcd_data19", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad12.lcd_data20", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad13.lcd_data21", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad14.lcd_data22", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"gpmc_ad15.lcd_data23", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT
      | AM33XX_PULL_DOWN | AM33XX_PULL_ENBL},
{"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},
};

更加自己底板设计和屏的参数,选择性修改

static const struct display_panel disp_panel = {
WVGA,
32,
8,//32,
COLOR_ACTIVE,
};


static const struct display_panel bone_lcd_cape_disp_panel = {
WVGA,
16,
16,
COLOR_ACTIVE,
};

static const struct display_panel dvi_panel = {
WVGA,
16,
16,
COLOR_ACTIVE,
};


static struct lcd_ctrl_config dvi_cfg = {
&dvi_panel,
.ac_bias    = 255,
.ac_bias_intrpt    = 0,
.dma_burst_sz    = 16,
.bpp      = 16,
.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,
};


2、显示驱动文件 Da8xx-fb.c


[1] =
{ .name = "Ran 2",
.width = 1024,//800,
.height = 768,//480,
.hfp = 16,//30,
.hbp = 48,//24,
.hsw = 96,//20,
.vfp = 10,//22,
.vbp = 33,//13,
.vsw = 2,//10,
.pxl_clk = 50000000,//30000000,
.invert_pxl_clk = 0,
}

我直接注释掉了该部分内容,并添加红线部分。

lcdc_info = known_lcd_panels;
//printk(KERN_ERR "__devinit fb_probe lcdc_info = known_lcd_panels;\n");
/*
/////////////////////////////////////////////////////////////////////////////////////////
#ifndef CONFIG_FB_AUTO_SCAN_TQ_LCD
#if 1 //浣跨敤闈欐€佸弬鏁帮紝绠€鍖栦笅闈㈢殑鍒ゆ柇
lcdc_info = known_lcd_panels;
printk(KERN_ERR "__devinit fb_probe lcdc_info = known_lcd_panels;\n");
#else
for (i = 0, lcdc_info = known_lcd_panels;
i < ARRAY_SIZE(known_lcd_panels);
i++, lcdc_info++) {
if (strcmp(fb_pdata->type, lcdc_info->name) == 0)
break;
}
#endif
#else
printk(KERN_ERR "__devinit fb_probe lcdc_info = get_EmbedSky_fb();;\n");
lcdc_info = get_EmbedSky_fb();
printd("auto select lcdtype  \n");
#endif 
*/

3、boot的修改embedsky_lcd_parameters.c文件,我也是注释掉我不需要的部分,添加我的屏幕参数



stuLcd.lcd_hfpd = 16;
stuLcd.lcd_hbpd = 48;
stuLcd.lcd_hspw = 96;
stuLcd.lcd_vfpd = 10;
stuLcd.lcd_vbpd = 33;
stuLcd.lcd_vspw = 2;
stuLcd.lcd_clkval = 6;
stuLcd.lcd_bpp = 32;//16;
stuLcd.lcd_xsize = 1024;
stuLcd.lcd_ysize = 768;


补充:过程中发现,如果显示565和888在硬件上是有区别的 在勘误表中有描述



你可能感兴趣的:(arm)