最初的配置是不可以使用LCD屏幕的,需要进行以下配置才可以使用,配置如下:
进入内核菜单,配置选项(有可能会遗漏,希望大佬补充):
Graphics support ?--->
?Support for frame buffer devices ?--->
?Backlight & LCD device support ?--->
?Console display driver support ?--->
?Bootup logo ?--->
设置完成之后并不能直接编译,需要修改相关代码才可以编译
修改drivers/video/da8xx-fb.c文件,添加代码:
[6] = {
.name = "Lnnolux_AT070TN83",
.width = 800,
.height = 480,
.hfp = 0xd2,
.hbp = 0x2c,
.hsw = 2,
.vfp = 0x16,
.vbp = 0x15,
.vsw = 2,
.pxl_clk = 33250000,
.invert_pxl_clk = 0,
},
修改arch/arm/mach-davinci/devices-da8xx.c文件,添加代码:
struct da8xx_lcdc_platform_data lnnolux_at070tn83_pdata = {
.manu_name = "lnnolux",
.controller_data = &lcd_cfg,
.type = "Lnnolux_AT070TN83",
};
修改arch/arm/mach-davinci/include/mach/da8xx.h文件,添加代码:
extern struct da8xx_lcdc_platform_data lnnolux_at070tn83_pdata;
修改?arch/arm/mach-davinci/include/mach/mux.h文件,添加代码:
enum davinci_da850_index {
......
/* GPIO function */
......
/* GPIO bank 8 */
......
DA850_GPIO8_15,
......
}
修改?arch/arm/mach-davinci/da850.c文件,添加代码:
MUX_CFG(DA850, GPIO8_15, 18, 8, 15, 8, false)
修改?arch/arm/mach-davinci/board-da850-evm.c文件,添加/注释代码:
#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
//#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
#define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 10)
#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
......
/*
static int da850_lcd_hw_init(void)
{
int status;
status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
if (status < 0)
return status;
status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
if (status < 0) {
gpio_free(DA850_LCD_BL_PIN);
return status;
}
gpio_direction_output(DA850_LCD_BL_PIN, 0);
gpio_direction_output(DA850_LCD_PWR_PIN, 0);
return 0;
}
*/
static int da850_lcd_hw_init(void)
{
void __iomem *cfg_mstpri1_base;
void __iomem *cfg_mstpri2_base;
void __iomem *emifb;
void __iomem *myptr;
u32 val;
/*
* Default master priorities in reg 0 are all lower by default than LCD
* which is set below to 0. Hence don't need to change here.
*/
/* set EDMA30TC0 and TC1 to lower than LCDC (4 < 0) */
cfg_mstpri1_base = DA8XX_SYSCFG0_VIRT(DA8XX_MSTPRI1_REG);
val = __raw_readl(cfg_mstpri1_base);
val &= 0xFFFF00FF;
val |= 4 << 8; /* 0-high, 7-low priority*/
val |= 4 << 12; /* 0-high, 7-low priority*/
__raw_writel(val, cfg_mstpri1_base);
/*
* Reconfigure the LCDC priority to the highest to ensure that
* the throughput/latency requirements for the LCDC are met.
*/
cfg_mstpri2_base = DA8XX_SYSCFG0_VIRT(DA8XX_MSTPRI2_REG);
val = __raw_readl(cfg_mstpri2_base);
val &= 0x0fffffff;
__raw_writel(val, cfg_mstpri2_base);
/* set BPRIO */
#define DA8XX_EMIF30_CONTROL_BASE 0xB0000000
#define DA8XX_EMIF30_BPRIO_OFFSET 0x20
#define DA8XX_EMIFB_VIRT(x) (emifb + (x))
emifb = ioremap(DA8XX_EMIF30_CONTROL_BASE, SZ_4K);
myptr = DA8XX_EMIFB_VIRT(0x20);
__raw_writel(0x20, myptr);
return 0;
}
......
static __init void da850_evm_init(void){
struct da8xx_lcdc_platform_data *lcd_pdata = &lnnolux_at070tn83_pdata;
......
/*
sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
if (ret)
pr_warning("da850_evm_init: lcdc registration failed: %d\n",
ret);
*/
if (da850_lcdc_panel != NULL)
lcd_pdata = da850_lcdc_panel;
/* request lcd_pwr_pin and set diretion ouput mode */
ret = gpio_request(DA850_LCD_PWR_PIN, "lcd_pwr_pin");
if (ret)
pr_warning("Fail to request DA850_LCD_PWR_PIN.\n");
gpio_direction_output(DA850_LCD_PWR_PIN, 1);
gpio_free(DA850_LCD_PWR_PIN);
lcd_pdata->panel_power_ctrl = da850_panel_power_ctrl;
ret = da8xx_register_lcdc(lcd_pdata);
......
}
注意:IO需要根据实际需要自行更改,这里仅仅是作为一个例子
|