__s32 BSP_disp_restore_image_reg(__u32 sel, __u32 addr) { __u32 i = 0; __u32 value = 0; __u32 reg_base = 0; if(sel == 0) { reg_base = gdisp.init_para.base_image0; } else { reg_base = gdisp.init_para.base_image1; } DE_BE_Reg_Init(sel); for(i=4; i<0xe00 - 0x800; i+=4) { value = sys_get_wvalue(addr + i); sys_put_wvalue(reg_base + 0x800 + i,value); } value = sys_get_wvalue(addr); sys_put_wvalue(reg_base + 0x800,value); return 0; }
__s32 BSP_disp_restore_tvec_reg(__u32 sel ,__u32 addr) { __u32 i = 0; __u32 value = 0; __u32 reg_base = 0; if(sel == 0) { reg_base = gdisp.init_para.base_tvec0; } else { reg_base = gdisp.init_para.base_tvec1; } for(i=8; i<0x210; i+=4) { value = sys_get_wvalue(addr + i); sys_put_wvalue(reg_base + i,value); } value = sys_get_wvalue(addr); sys_put_wvalue(reg_base,value); value = sys_get_wvalue(addr + 4); sys_put_wvalue(reg_base + 4,value); value = sys_get_wvalue(addr + 24); sys_put_wvalue(reg_base + 24, value); return 0; }
__s32 bsp_disp_restore_image_reg(__u32 screen_id, __u32 addr) { __u32 i = 0; __u32 value = 0; __u32 reg_base = 0; if(addr == 0) { DE_WRN("bsp_disp_restore_image_reg, addr is NULL!"); return -1; } if(screen_id == 0) { reg_base = gdisp.init_para.reg_base[DISP_MOD_BE0]; } else { reg_base = gdisp.init_para.reg_base[DISP_MOD_BE1]; } DE_BE_Reg_Init(screen_id); for(i=4; i<0xe00 - 0x800; i+=4) { value = sys_get_wvalue(addr + i); sys_put_wvalue(reg_base + 0x800 + i,value); } value = sys_get_wvalue(addr); sys_put_wvalue(reg_base + 0x800,value); return 0; }
__s32 bsp_disp_restore_scaler_reg(__u32 scaler_index, __u32 addr) { __u32 i = 0; __u32 value = 0; __u32 reg_base = 0; if(scaler_index == 0) { reg_base = gdisp.init_para.reg_base[DISP_MOD_FE0]; } else { reg_base = gdisp.init_para.reg_base[DISP_MOD_FE1]; } for(i=8; i<0xa18; i+=4) { value = sys_get_wvalue(addr + i); sys_put_wvalue(reg_base + i,value); } value = sys_get_wvalue(addr); sys_put_wvalue(reg_base,value); value = sys_get_wvalue(addr + 4); sys_put_wvalue(reg_base + 4,value); return 0; }
__s32 Disp_lcdc_pin_cfg(__u32 sel, __disp_output_type_t out_type, __u32 bon) { if(out_type == DISP_OUTPUT_TYPE_LCD) { __hdle lcd_pin_hdl; int i; for(i=0; i<28; i++) { if(gdisp.screen[sel].lcd_cfg.lcd_io_used[i]) { user_gpio_set_t gpio_info[1]; memcpy(gpio_info, &(gdisp.screen[sel].lcd_cfg.lcd_io[i]), sizeof(user_gpio_set_t)); if(!bon) { gpio_info->mul_sel = 0; } else { if((gpanel_info[sel].lcd_if == 3) && (gpio_info->mul_sel==2)) { gpio_info->mul_sel = 3; } } lcd_pin_hdl = OSAL_GPIO_Request(gpio_info, 1); OSAL_GPIO_Release(lcd_pin_hdl, 2); } } } else if(out_type == DISP_OUTPUT_TYPE_VGA) { __u32 reg_start = 0; __u32 tmp = 0; if(sel == 0) { reg_start = gdisp.init_para.base_pioc+0x6c; } else { reg_start = gdisp.init_para.base_pioc+0xfc; } if(bon) { tmp = sys_get_wvalue(reg_start + 0x0c) & 0xffff00ff; sys_put_wvalue(reg_start + 0x0c,tmp | 0x00002200); } else { tmp = sys_get_wvalue(reg_start + 0x0c) & 0xffff00ff; sys_put_wvalue(reg_start + 0x0c,tmp); } } return DIS_SUCCESS; }
//pwm pin //pB2: 2:pwm0 //pI3: 2:pwm1 __s32 Disp_lcdc_pin_cfg(__u32 sel, __disp_output_type_t out_type, __u32 bon) //lcd pin, pwm pin { __u32 tmp = 0; if(bon) { if(sel == 0) { switch(out_type) { case DISP_OUTPUT_TYPE_LCD: case DISP_OUTPUT_TYPE_HDMI: sys_put_wvalue(gdisp.init_para.base_pioc+0x6c,0x22222222); sys_put_wvalue(gdisp.init_para.base_pioc+0x70,0x22222222); sys_put_wvalue(gdisp.init_para.base_pioc+0x74,0x22222222); sys_put_wvalue(gdisp.init_para.base_pioc+0x78,0x00002222); break; case DISP_OUTPUT_TYPE_VGA: tmp = sys_get_wvalue(gdisp.init_para.base_pioc+0x6c) & 0xffff00ff; sys_put_wvalue(gdisp.init_para.base_pioc+0x6c,tmp | 0x00002200); break; default: break; } } else if(sel == 1) { switch(out_type) { case DISP_OUTPUT_TYPE_LCD: case DISP_OUTPUT_TYPE_HDMI: sys_put_wvalue(gdisp.init_para.base_pioc+0x6c,0x44444444); sys_put_wvalue(gdisp.init_para.base_pioc+0x70,0x44444444); sys_put_wvalue(gdisp.init_para.base_pioc+0x74,0x44444444); sys_put_wvalue(gdisp.init_para.base_pioc+0x78,0x00004444); break; case DISP_OUTPUT_TYPE_VGA: tmp = sys_get_wvalue(gdisp.init_para.base_pioc+0x6c) & 0xffff00ff; sys_put_wvalue(gdisp.init_para.base_pioc+0x6c,tmp | 0x00004400); break; default: break; } } } else { sys_put_wvalue(gdisp.init_para.base_pioc+0x6c,0x00000000); sys_put_wvalue(gdisp.init_para.base_pioc+0x70,0x00000000); sys_put_wvalue(gdisp.init_para.base_pioc+0x74,0x00000000); sys_put_wvalue(gdisp.init_para.base_pioc+0x78,0x00000000); } return DIS_SUCCESS; }
s32 bsp_disp_print_reg(bool b_force_on, disp_mod_id id, char* buf) { u32 base = 0, size = 0; u32 i = 0; unsigned char str[20]; u32 count = 0; base = ((id == DISP_MOD_BE0) || (id == DISP_MOD_BE1))? (gdisp.init_para.reg_base[id] + 0x800):gdisp.init_para.reg_base[id]; size = ((id == DISP_MOD_BE0) || (id == DISP_MOD_BE1))? 0x200 : (gdisp.init_para.reg_size[id]); if(NULL == base) { return 0; } if(b_force_on) { if(buf == NULL) { //OSAL_PRINTF("%s", str); } else { count += sprintf(buf + count, "%s", str); } } else { DE_INF("%s", str); } for(i=0; i<size; i+=16) { u32 reg[4]; reg[0] = sys_get_wvalue(base + i); reg[1] = sys_get_wvalue(base + i + 4); reg[2] = sys_get_wvalue(base + i + 8); reg[3] = sys_get_wvalue(base + i + 12); #if defined(__LINUX_PLAT__) if(b_force_on) { if(buf == NULL) { printk("<0>""0x%08x:%08x,%08x:%08x,%08x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } else { count += sprintf(buf + count, "0x%08x:%08x,%08x:%08x,%08x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } } else { DE_INF("0x%08x:%08x,%08x:%08x,%08x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } #endif #ifdef __BOOT_OSAL__ if(b_force_on) { OSAL_PRINTF("0x%x:%x,%x,%x,%x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } else { DE_INF("0x%x:%x,%x:%x,%x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } #endif } return count; }
static void LCD_bl_close(__u32 sel) { __u32 tmp; __lcd_panel_init_para_t para; LCD_get_init_para(¶); /* // GPIO_O_1_EN-BL, PA5 set to 0 tmp = sys_get_wvalue(para.base_pioc + 0x10); tmp &= 0xffffffdf;//clear bit5 sys_put_wvalue(para.base_pioc+0x10, tmp); tmp = sys_get_wvalue(para.base_pioc+0x00); tmp &= 0xff8fffff; sys_put_wvalue(para.base_pioc+0x00,tmp | (1<<20));//bit22:20, 1:output tmp = sys_get_wvalue(para.base_pioc + 0x10); tmp &= 0xffffffdf;//clear bit5 sys_put_wvalue(para.base_pioc+0x10, tmp); */ // PWM disable tmp = sys_get_wvalue(para.base_ccmu+0xe0); tmp &= (~(1<<4)); sys_put_wvalue(para.base_ccmu+0xe0,tmp); }
__s32 BSP_disp_lcd_get_bright(__u32 sel) { __u32 value; __s32 bright = 0; value = sys_get_wvalue(gdisp.init_para.base_ccmu+0xe4); value = value & 0x0000ffff; if(gpanel_info[sel].lcd_pwm_pol == 0) { if(value == 0) { bright = DISP_LCD_BRIGHT_LEVEL15; } else { bright = value - 1; } } else { if(value == 0) { bright = DISP_LCD_BRIGHT_LEVEL0; } else { bright = 16 - value; } } return bright; }
//////////////////////////////////////// back light //////////////////////////////////////////////////////////////////// static void LCD_bl_open(__u32 sel) { __u32 tmp; __lcd_panel_init_para_t para; LCD_get_init_para(¶); // PWM enable tmp = sys_get_wvalue(para.base_ccmu+0xe0); tmp |= (1<<4); sys_put_wvalue(para.base_ccmu+0xe0,tmp); // GPIO_O_1_EN-BL, PA5 set to 1 /* tmp = sys_get_wvalue(para.base_pioc + 0x10); tmp |= 0x00000020;//set bit5 sys_put_wvalue(para.base_pioc+0x10, tmp); tmp = sys_get_wvalue(para.base_pioc+0x00); tmp &= 0xff8fffff; sys_put_wvalue(para.base_pioc+0x00,tmp | (1<<20));//bit22:20, 1:output tmp = sys_get_wvalue(para.base_pioc + 0x10); tmp |= 0x00000020;//set bit5 sys_put_wvalue(para.base_pioc+0x10, tmp); */ }
static __u32 sunxi_pwm_read_reg(__u32 offset) { __u32 value = 0; value = sys_get_wvalue(SUNXI_PWM_VBASE + offset); return value; }
static __u32 pwm_read_reg(__u32 offset) { __u32 value = 0; value = sys_get_wvalue(gdisp.init_para.base_pwm + offset); return value; }
uint sunxi_pwm_read_reg(uint offset) { uint value = 0; value = sys_get_wvalue(PWM03_BASE + offset); return value; }
//lcd_pwm_div = log2(24K/(16*pwm_freq)); __s32 Disp_pwm_cfg(__u32 sel) { __u32 tmp; __u32 pwm_div; __u8 lcd_pwm_div = 0x04; __u32 i; __u32 mul_val = 1; __u32 pwm_freq = gpanel_info[sel].lcd_pwm_freq; __u32 PWM_SOUCE_FREQ = 24000; __u32 PWM_LEVEL = 16; if(pwm_freq) { pwm_div = (PWM_SOUCE_FREQ/(PWM_LEVEL * pwm_freq)); } else { pwm_div = 16; } for(i = 0;i <= 12;i++) { if(pwm_div <= mul_val) { lcd_pwm_div = i; break; } mul_val = mul_val * 2; } tmp = sys_get_wvalue(gdisp.init_para.base_ccmu+0xe0); tmp |= ((1<<6) | (1<<5) | lcd_pwm_div);//bit6:gatting the special clock for pwm0; bit5:pwm0 active state is high level sys_put_wvalue(gdisp.init_para.base_ccmu+0xe0,tmp); sys_put_wvalue(gdisp.init_para.base_ccmu+0xe4,0x000f000c); tmp = sys_get_wvalue(gdisp.init_para.base_pioc+0x24); tmp &= 0xfffff8ff; sys_put_wvalue(gdisp.init_para.base_pioc+0x24,tmp | (2<<8));//pwm io,PB2, bit10:8 return DIS_SUCCESS; }
static void LCD_power_off(__u32 sel)//PH27,0 active { __u32 tmp = 0; __lcd_panel_init_para_t para; LCD_get_init_para(¶); // LCD-PWR, PH27 set to 1 tmp = sys_get_wvalue(para.base_pioc + 0x10c); tmp |= 0x08000000;//set bit27 sys_put_wvalue(para.base_pioc+0x10c, tmp); tmp = sys_get_wvalue(para.base_pioc+0x108); tmp &= 0xffff8fff; sys_put_wvalue(para.base_pioc+0x108,tmp | (1<<12));//bit18:16, 1:output tmp = sys_get_wvalue(para.base_pioc + 0x10c); tmp |= 0x08000000;//set bit27 sys_put_wvalue(para.base_pioc+0x10c, tmp); }
static void LCD_bl_close(__u32 sel) { __u32 tmp; __lcd_panel_init_para_t para; LCD_get_init_para(¶); tmp = sys_get_wvalue(para.base_timer+0xa0); tmp &= (~(1<<4)); sys_put_wvalue(para.base_timer+0xa0,tmp); }
__s32 iep_deu_resume (__u32 sel)//restore register { __u32 i; __u32 reg_val; if(deu_reg_bak[sel]) { for(i=4; i<0x60; i+=4) { reg_val = sys_get_wvalue(deu_reg_bak[sel] + i); sys_put_wvalue(DEU_EBIOS_Get_Reg_Base(sel) + i,reg_val); } reg_val = sys_get_wvalue(deu_reg_bak[sel]); sys_put_wvalue(DEU_EBIOS_Get_Reg_Base(sel),reg_val); #if defined(__LINUX_OSAL__) kfree((void*)deu_reg_bak[sel]); deu_reg_bak[sel] = 0; #endif } return 0; }
__s32 iep_drc_resume (__u32 sel)//restore register { __u32 i; __u32 reg_val; if(drc_reg_bak[sel]) { for(i=4; i<0x3fc; i+=4) { reg_val = sys_get_wvalue(drc_reg_bak[sel] + i); sys_put_wvalue(DRC_EBIOS_Get_Reg_Base(sel) + i,reg_val); } reg_val = sys_get_wvalue(drc_reg_bak[sel]); sys_put_wvalue(DRC_EBIOS_Get_Reg_Base(sel),reg_val); #if defined(__LINUX_OSAL__) kfree((void*)drc_reg_bak[sel]); drc_reg_bak[sel] = 0; #else OSAL_PhyFree((void *)drc_reg_bak[sel], sizeof(__u32)*0x3fc); #endif } return 0; }
__s32 iep_drc_suspend(__u32 sel)//save register { __u32 i,reg_val; #if defined(__LINUX_OSAL__) drc_reg_bak[sel] = (__u32)kmalloc(sizeof(__u32)*0x3fc,GFP_KERNEL | __GFP_ZERO); #endif if(drc_reg_bak[sel]) { for(i=0; i<0x3fc; i+=4) { /* save register */ reg_val = sys_get_wvalue(DRC_EBIOS_Get_Reg_Base(sel) +i); sys_put_wvalue(drc_reg_bak[sel]+i, reg_val); } } return 0; }
__s32 bsp_disp_store_image_reg(__u32 screen_id, __u32 addr) { __u32 i = 0; __u32 value = 0; __u32 reg_base = 0; if(screen_id == 0) { reg_base = gdisp.init_para.reg_base[DISP_MOD_BE0]; } else { reg_base = gdisp.init_para.reg_base[DISP_MOD_BE1]; } for(i=0; i<0xe00 - 0x800; i+=4) { value = sys_get_wvalue(reg_base + 0x800 + i); sys_put_wvalue(addr + i, value); } return 0; }
//setting: 0, 1, 2,.... 14, 15 //pol==0: 1, 2, 3,.... 15, 0 //pol==1: 0, 15, 14, ... 2, 1 __s32 BSP_disp_lcd_set_bright(__u32 sel, __disp_lcd_bright_t bright) { if(gdisp.screen[sel].status & LCD_ON) { __u32 value = 0; __u32 tmp; if(gpanel_info[sel].lcd_pwm_pol == 0) { if(bright == DISP_LCD_BRIGHT_LEVEL15) { value = 0; } else { value = bright + 1; } } else { if(bright == DISP_LCD_BRIGHT_LEVEL0) { value = 0; } else { value = 16 - bright; } } tmp = sys_get_wvalue(gdisp.init_para.base_ccmu+0xe4); sys_put_wvalue(gdisp.init_para.base_ccmu+0xe4,(tmp & 0xffff0000) | value); } return DIS_SUCCESS; }
__s32 BSP_disp_print_reg(__bool b_force_on, __u32 id) { __u32 base = 0, size = 0; __u32 i = 0; unsigned char str[20]; switch(id) { case DISP_REG_SCALER0: base = gdisp.init_para.base_scaler0; size = 0xa18; sprintf(str, "scaler0:\n"); break; case DISP_REG_SCALER1: base = gdisp.init_para.base_scaler1; size = 0xa18; sprintf(str, "scaler1:\n"); break; case DISP_REG_IMAGE0: base = gdisp.init_para.base_image0 + 0x800; size = 0xdff - 0x800; sprintf(str, "image0:\n"); break; case DISP_REG_IMAGE1: base = gdisp.init_para.base_image1 + 0x800; size = 0xdff - 0x800; sprintf(str, "image1:\n"); break; case DISP_REG_LCDC0: base = gdisp.init_para.base_lcdc0; size = 0x800; sprintf(str, "lcdc0:\n"); break; case DISP_REG_LCDC1: base = gdisp.init_para.base_lcdc1; size = 0x800; sprintf(str, "lcdc1:\n"); break; case DISP_REG_TVEC0: base = gdisp.init_para.base_tvec0; size = 0x20c; sprintf(str, "tvec0:\n"); break; case DISP_REG_TVEC1: base = gdisp.init_para.base_tvec1; size = 0x20c; sprintf(str, "tvec1:\n"); break; case DISP_REG_CCMU: base = gdisp.init_para.base_ccmu; size = 0x158; sprintf(str, "ccmu:\n"); break; case DISP_REG_PIOC: base = gdisp.init_para.base_pioc; size = 0x228; sprintf(str, "pioc:\n"); break; case DISP_REG_PWM: base = gdisp.init_para.base_pwm + 0x200; size = 0x0c; sprintf(str, "pwm:\n"); break; default: return DIS_FAIL; } if(b_force_on) { OSAL_PRINTF("%s", str); } else { DE_INF("%s", str); } for(i=0; i<size; i+=16) { __u32 reg[4]; reg[0] = sys_get_wvalue(base + i); reg[1] = sys_get_wvalue(base + i + 4); reg[2] = sys_get_wvalue(base + i + 8); reg[3] = sys_get_wvalue(base + i + 12); #ifdef __LINUX_OSAL__ if(b_force_on) { OSAL_PRINTF("0x%08x:%08x,%08x:%08x,%08x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } else { DE_INF("0x%08x:%08x,%08x:%08x,%08x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } #endif #ifdef __BOOT_OSAL__ if(b_force_on) { OSAL_PRINTF("0x%x:%x,%x,%x,%x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } else { DE_INF("0x%x:%x,%x:%x,%x\n", base + i, reg[0], reg[1], reg[2], reg[3]); } #endif } return DIS_SUCCESS; }
static void Lcd_Panel_Parameter_Check(__u32 sel) { __panel_para_t *info; __u32 cycle_num = 1; __u32 Lcd_Panel_Err_Flag = 0; __u32 Lcd_Panel_Wrn_Flag = 0; __u32 Disp_Driver_Bug_Flag = 0; __u32 lcd_fclk_frq; __u32 lcd_clk_div; info = &(gpanel_info[sel]); if (info->lcd_if == 0 && info->lcd_hv_if == 1 && info->lcd_hv_smode == 0) cycle_num = 3; else if (info->lcd_if == 0 && info->lcd_hv_if == 1 && info->lcd_hv_smode == 1) cycle_num = 2; else if (info->lcd_if == 1 && info->lcd_cpu_if == 1) cycle_num = 3; else if (info->lcd_if == 1 && info->lcd_cpu_if == 2) cycle_num = 2; else if (info->lcd_if == 1 && info->lcd_cpu_if == 3) cycle_num = 2; else if (info->lcd_if == 1 && info->lcd_cpu_if == 5) cycle_num = 2; else if (info->lcd_if == 1 && info->lcd_cpu_if == 6) cycle_num = 3; else if (info->lcd_if == 1 && info->lcd_cpu_if == 7) cycle_num = 2; else cycle_num = 1; if (info->lcd_hbp > info->lcd_hv_hspw) ; else Lcd_Panel_Err_Flag |= BIT0; if (info->lcd_vbp > info->lcd_hv_vspw) ; else Lcd_Panel_Err_Flag |= BIT1; if (info->lcd_ht >= (info->lcd_hbp + info->lcd_x * cycle_num + 4)) ; else Lcd_Panel_Err_Flag |= BIT2; if ((info->lcd_vt / 2) >= (info->lcd_vbp + info->lcd_y + 2)) ; else Lcd_Panel_Err_Flag |= BIT3; lcd_clk_div = TCON0_get_dclk_div(sel); if (lcd_clk_div >= 6) { ; } else if ((lcd_clk_div == 5) || (lcd_clk_div == 4) || (lcd_clk_div == 2)) { if ((info->lcd_io_cfg0 != 0x00000000) && (info->lcd_io_cfg0 != 0x04000000)) Lcd_Panel_Err_Flag |= BIT10; } else Disp_Driver_Bug_Flag |= 1; if ((info->lcd_if == 1 && info->lcd_cpu_if == 0) || (info->lcd_if == 3 && info->lcd_lvds_bitwidth == 1)) { if (info->lcd_frm != 1) Lcd_Panel_Wrn_Flag |= BIT0; } else if (info->lcd_if == 1 && info->lcd_cpu_if == 4) { if (info->lcd_frm != 2) Lcd_Panel_Wrn_Flag |= BIT1; } lcd_fclk_frq = (info->lcd_dclk_freq * 1000 * 1000) / ((info->lcd_vt / 2) * info->lcd_ht); if (lcd_fclk_frq < 50 || lcd_fclk_frq > 70) Lcd_Panel_Wrn_Flag |= BIT2; if (Lcd_Panel_Err_Flag != 0 || Lcd_Panel_Wrn_Flag != 0) { if (Lcd_Panel_Err_Flag != 0) { __u32 i; for (i = 0; i < 200; i++) DE_WRN("*** Lcd in danger...\n"); } DE_WRN("*******************************************************" "**********\n"); DE_WRN("***\n"); DE_WRN("*** LCD Panel Parameter Check\n"); DE_WRN("***\n"); DE_WRN("*** by dulianping\n"); DE_WRN("***\n"); DE_WRN("*******************************************************" "**********\n"); DE_WRN("***\n"); DE_WRN("*** Interface:"); if (info->lcd_if == 0 && info->lcd_hv_if == 0) { DE_WRN("*** Parallel HV Panel\n"); } else if (info->lcd_if == 0 && info->lcd_hv_if == 1) { DE_WRN("*** Serial HV Panel\n"); } else if (info->lcd_if == 0 && info->lcd_hv_if == 2) { DE_WRN("*** Serial YUV Panel\n"); } else if (info->lcd_if == 3 && info->lcd_lvds_bitwidth == 0) { DE_WRN("*** 24Bit LVDS Panel\n"); } else if (info->lcd_if == 3 && info->lcd_lvds_bitwidth == 1) { DE_WRN("*** 18Bit LVDS Panel\n"); } else if (info->lcd_if == 1 && info->lcd_cpu_if == 0) { DE_WRN("*** 18Bit CPU Panel\n"); } else if (info->lcd_if == 1 && info->lcd_cpu_if == 4) { DE_WRN("*** 16Bit CPU Panel\n"); } else { DE_WRN("\n"); DE_WRN("*** lcd_if: %d\n", info->lcd_if); DE_WRN("*** lcd_hv_if: %d\n", info->lcd_hv_if); DE_WRN("*** lcd_cpu_if: %d\n", info->lcd_cpu_if); } if (info->lcd_frm == 0) DE_WRN("*** Lcd Frm Disable\n"); else if (info->lcd_frm == 1) DE_WRN("*** Lcd Frm to RGB666\n"); else if (info->lcd_frm == 2) DE_WRN("*** Lcd Frm to RGB565\n"); DE_WRN("***\n"); DE_WRN("*** Timing:\n"); DE_WRN("*** lcd_x: %d\n", info->lcd_x); DE_WRN("*** lcd_y: %d\n", info->lcd_y); DE_WRN("*** lcd_ht: %d\n", info->lcd_ht); DE_WRN("*** lcd_hbp: %d\n", info->lcd_hbp); DE_WRN("*** lcd_vt: %d\n", info->lcd_vt); DE_WRN("*** lcd_vbp: %d\n", info->lcd_vbp); DE_WRN("*** lcd_hspw: %d\n", info->lcd_hv_hspw); DE_WRN("*** lcd_vspw: %d\n", info->lcd_hv_vspw); DE_WRN("*** lcd_frame_frq: %dHz\n", lcd_fclk_frq); /* Print Error */ DE_WRN("***\n"); if (Lcd_Panel_Err_Flag & BIT0) DE_WRN("*** Err01: Violate \"lcd_hbp > lcd_hspw\"\n"); if (Lcd_Panel_Err_Flag & BIT1) DE_WRN("*** Err02: Violate \"lcd_vbp > lcd_vspw\"\n"); if (Lcd_Panel_Err_Flag & BIT2) DE_WRN("*** Err03: Violate \"lcd_ht >= " "(lcd_hbp+lcd_x*%d+4)\"\n", cycle_num); if (Lcd_Panel_Err_Flag & BIT3) DE_WRN("*** Err04: Violate \"(lcd_vt/2) >= " "(lcd_vbp+lcd_y+2)\"\n"); if (Lcd_Panel_Err_Flag & BIT10) DE_WRN("*** Err10: Violate \"lcd_io_cfg0\", " "use \"0x00000000\" or \"0x04000000\""); if (Lcd_Panel_Wrn_Flag & BIT0) DE_WRN("*** WRN01: Recommend \"lcd_frm = 1\"\n"); if (Lcd_Panel_Wrn_Flag & BIT1) DE_WRN("*** WRN02: Recommend \"lcd_frm = 2\"\n"); if (Lcd_Panel_Wrn_Flag & BIT2) DE_WRN("*** WRN03: Recommend \"lcd_dclk_frq = %d\"\n", ((info->lcd_vt / 2) * info->lcd_ht) * 60 / (1000 * 1000)); DE_WRN("***\n"); if (Lcd_Panel_Err_Flag != 0) { __u32 image_base_addr; __u32 reg_value = 0; image_base_addr = DE_Get_Reg_Base(sel); /* set background color */ sys_put_wvalue(image_base_addr + 0x804, 0xffff00ff); reg_value = sys_get_wvalue(image_base_addr + 0x800); /* close all layer */ sys_put_wvalue(image_base_addr + 0x800, reg_value & 0xfffff0ff); LCD_delay_ms(2000); /* set background color */ sys_put_wvalue(image_base_addr + 0x804, 0x00000000); /* open layer */ sys_put_wvalue(image_base_addr + 0x800, reg_value); DE_WRN("*** Try new parameters, you can make it " "pass!\n"); } DE_WRN("*** LCD Panel Parameter Check End\n"); DE_WRN("*******************************************************" "**********\n"); } }