待解决问题
[展讯][LCM][u-boot]littlekernel时读不出部分LCM寄存器值
离问题结束还有0天0小时 |
提问者:dade1207
|
提问时间:2015-12-16 14:50
问题背景:LCM烧入OTP以改善屏幕flicker问题,现需要对烧入OTP与未烧入OTP的屏幕做兼容,烧OTP时会向DA寄存器写入0xb1,所以在开机lk找屏阶段需要读DA寄存器来判断是否烧入OTP。
但是在开机log中发现,lk阶段找屏时,读不出DA寄存器的值,在kernel找屏阶段,可以读DA寄存器。两部分关于读寄存器的代码相同,不理解为什么会这样。
读屏ID代码:
static uint32_t nt35521_readid(struct panel_spec *self)//通过读取屏幕id判断屏幕是否插入
{
/*Jessica TODO: need read id*/
int32_t i = 0;
uint32 j =0;
LCM_Force_Cmd_Code * rd_prepare = rd_prep_code;
uint8_t read_data[3] = {0};
uint8_t read_data_1[1] = {0};//otp
int32_t read_rtn = 0;
unsigned int tag = 0;
LCD_PRINT("lcd_nt35516_mipi read id!\n");
read_rtn = mipi_force_read(0xc5, 2,(uint8_t *)read_data);//读屏id
LCD_PRINT("lcd_nt35521_mipi read id 0xc5 value is 0x%x, 0x%x!\n", read_data[0], read_data[1]);
read_rtn = mipi_force_read(0xda, 1,(uint8_t *)read_data_1);//读da寄存器,判断是否烧入OTP
printk("zsw1511 read otp 0xDA value is 0x%x\n", read_data_1[0]);//OTP
printk("zsw1511 read id 0xc5 value is 0x%x0x%x\n", read_data[0], read_data[1]);//OTP
if((0xb1 == read_data_1[0])){//判断da寄存器是否等于b1(烧入OTP时会将da寄存器写入0xb1)
printk("NO VCOM\n");//OTP
printk("zsw1511 read id 0xc5 value is 0x%x0x%x\n", read_data[0], read_data[1]);//OTP
printk("zsw1511 read otp 0xDA value is 0x%x\n", read_data_1[0]);//OTP
if((0x55 == read_data[0])&&(0x21 == read_data[1])){ //判断屏id是否为5521
printk("lcd_nt35521_mipi read id success!\n");
mipi_eotp_set(1,1);//找到屏
printk("zsw1511 no vcom\n");//OTP
return 0x5521;
}
}
}
mipi_eotp_set(1,1);//没找到
return 0x0;
}
打出的log如下
lk找屏log:
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x00x0
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x550x21
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x550x21
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x550x21
sprdfb: [adapt_panel_from_readid]: LCD Panel 0x5521 attached fail!go next
kernel找屏log:
[ 1.826629] c0 lcd_nt35516_mipi read id!
[ 1.826690] c0 lcd_nt35521_mipi read id 0xc5 value is 0x55, 0x21!
[ 1.826721] c0 NO VCOM
[ 1.826721] c0 read id 0xc5 value is 0x550x21
[ 1.826721] c0 read otp 0xDA value is 0xb1
[ 1.826721] c0 lcd_nt35521_mipi read id success!
[ 1.826751] c0 zsw1511 no vcom
log中可以看出lk中读寄存器时,DA寄存器读不出,C5寄存器却能读。
希翼各位大神帮忙看看问题出在哪,非常感谢!!
但是在开机log中发现,lk阶段找屏时,读不出DA寄存器的值,在kernel找屏阶段,可以读DA寄存器。两部分关于读寄存器的代码相同,不理解为什么会这样。
读屏ID代码:
static uint32_t nt35521_readid(struct panel_spec *self)//通过读取屏幕id判断屏幕是否插入
{
/*Jessica TODO: need read id*/
int32_t i = 0;
uint32 j =0;
LCM_Force_Cmd_Code * rd_prepare = rd_prep_code;
uint8_t read_data[3] = {0};
uint8_t read_data_1[1] = {0};//otp
int32_t read_rtn = 0;
unsigned int tag = 0;
LCD_PRINT("lcd_nt35516_mipi read id!\n");
read_rtn = mipi_force_read(0xc5, 2,(uint8_t *)read_data);//读屏id
LCD_PRINT("lcd_nt35521_mipi read id 0xc5 value is 0x%x, 0x%x!\n", read_data[0], read_data[1]);
read_rtn = mipi_force_read(0xda, 1,(uint8_t *)read_data_1);//读da寄存器,判断是否烧入OTP
printk("zsw1511 read otp 0xDA value is 0x%x\n", read_data_1[0]);//OTP
printk("zsw1511 read id 0xc5 value is 0x%x0x%x\n", read_data[0], read_data[1]);//OTP
if((0xb1 == read_data_1[0])){//判断da寄存器是否等于b1(烧入OTP时会将da寄存器写入0xb1)
printk("NO VCOM\n");//OTP
printk("zsw1511 read id 0xc5 value is 0x%x0x%x\n", read_data[0], read_data[1]);//OTP
printk("zsw1511 read otp 0xDA value is 0x%x\n", read_data_1[0]);//OTP
if((0x55 == read_data[0])&&(0x21 == read_data[1])){ //判断屏id是否为5521
printk("lcd_nt35521_mipi read id success!\n");
mipi_eotp_set(1,1);//找到屏
printk("zsw1511 no vcom\n");//OTP
return 0x5521;
}
}
}
mipi_eotp_set(1,1);//没找到
return 0x0;
}
打出的log如下
lk找屏log:
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x00x0
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x550x21
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x550x21
zsw1511 read otp 0xDA value is 0x0
zsw1511 read id 0xc5 value is 0x550x21
sprdfb: [adapt_panel_from_readid]: LCD Panel 0x5521 attached fail!go next
kernel找屏log:
[ 1.826629] c0 lcd_nt35516_mipi read id!
[ 1.826690] c0 lcd_nt35521_mipi read id 0xc5 value is 0x55, 0x21!
[ 1.826721] c0 NO VCOM
[ 1.826721] c0 read id 0xc5 value is 0x550x21
[ 1.826721] c0 read otp 0xDA value is 0xb1
[ 1.826721] c0 lcd_nt35521_mipi read id success!
[ 1.826751] c0 zsw1511 no vcom
log中可以看出lk中读寄存器时,DA寄存器读不出,C5寄存器却能读。
希翼各位大神帮忙看看问题出在哪,非常感谢!!
热点问题