找回密码
 注册
搜索
查看: 4264|回复: 1

[讨论] [展讯][LCM][u-boot]little kernel时读不出部分LCM寄存器值

[复制链接]
发表于 2015-12-16 12:54:31 | 显示全部楼层 |阅读模式
问题背景: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;
    mipi_set_cmd_mode_t mipi_set_cmd_mode = self->info.mipi->ops->mipi_set_cmd_mode;
    mipi_force_write_t mipi_force_write = self->info.mipi->ops->mipi_force_write;
    mipi_force_read_t mipi_force_read = self->info.mipi->ops->mipi_force_read;
    mipi_eotp_set_t mipi_eotp_set = self->info.mipi->ops->mipi_eotp_set;

    LCD_PRINT("lcd_nt35516_mipi read id!\n");
//    return 0x16;    //debug
//#ifdef CONFIG_SC8830
//    return 0x16;    //debug
//#endif
    mipi_set_cmd_mode();
    mipi_eotp_set(0,1);
    for(j = 0; j < 4; j++){
        rd_prepare = rd_prep_code;
        for(i = 0; i < ARRAY_SIZE(rd_prep_code); i++){
            tag = (rd_prepare->real_cmd_code.tag >> 24);
            if(tag & LCM_TAG_SEND){
                mipi_force_write(rd_prepare->datatype, rd_prepare->real_cmd_code.data, (rd_prepare->real_cmd_code.tag & LCM_TAG_MASK));
            }else if(tag & LCM_TAG_SLEEP){
                mdelay((rd_prepare->real_cmd_code.tag & LCM_TAG_MASK));
            }
            rd_prepare++;
        }
        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寄存器却能读。
     希望各位大神帮忙看看问题出在哪,非常感谢!!
发表于 2016-2-16 13:54:17 | 显示全部楼层
顶起,顶起
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-11-23 01:30 , Processed in 0.046012 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表