static void setup_videolfb_tag (gd_t *gd) { /* An ATAG_VIDEOLFB node tells the kernel where and how large * the framebuffer for video was allocated (among other things). * Note that a _physical_ address is passed ! * * We only use it to pass the address and size, the other entries * in the tag_videolfb are not of interest. */ params->hdr.tag = ATAG_VIDEOLFB; params->hdr.size = tag_size (tag_videolfb); if(g_boot_mode == FACTORY_BOOT) { params->u.videolfb.lfb_base = (u32) gd->fb_base - 0x9600000; memcpy((char *)(params->u.videolfb.lfb_base), (char *)gd->fb_base, mt65xx_disp_get_vram_size()); printf("[UBOOT Factory]fb addr = %x\n", params->u.videolfb.lfb_base); } else { params->u.videolfb.lfb_base = (u32) gd->fb_base; } /* Fb size is calculated according to parameters for our panel */ //params->u.videolfb.lfb_size = calc_fbsize(); params->u.videolfb.lfb_size = mt65xx_disp_get_vram_size(); params = tag_next (params); }
/***************************************** * Routine: board_init * Description: Early hardware init. *****************************************/ int board_init (void) { /*Warning: DO NOT use "printf" before serial initialize*/ #ifdef CFG_UBOOT_PROFILING unsigned int time_disp_init; unsigned int time_led_init; unsigned int time_pmic6329_init; unsigned int time_gpio_init; unsigned int time_wdt_init; unsigned int time_serial_init; #endif mtk_serial_init(); mtk_wdt_init(); // Modify mtk_wdt.h can select dummy function. mt6577_pinmux_init(); gd->bd->bi_arch_number = MACH_TYPE_MT6577; /* board id for linux */ gd->bd->bi_boot_params = CFG_BOOTARGS_ADDR; /* address of boot parameters */ gd->fb_base = memory_size() - mt65xx_disp_get_vram_size(); #ifdef CFG_UBOOT_PROFILING time_led_init = get_timer(0); #endif leds_init(); isink0_init(); //turn on isink0, HW connection must be floating or pull low #ifdef CFG_UBOOT_PROFILING printf("[PROFILE] ------- led init takes %d ms -------- \n", get_timer(time_led_init)); #endif #ifdef CFG_LCD #ifdef CFG_UBOOT_PROFILING time_disp_init = get_timer(0); #endif mt65xx_disp_init((void*)gd->fb_base); UBOOT_TRACER; #ifdef CFG_UBOOT_PROFILING printf("[PROFILE] ------- disp init takes %d ms -------- \n", get_timer(time_disp_init)); #endif #endif #ifdef CFG_UBOOT_PROFILING time_pmic6329_init = get_timer(0); #endif pmic6329_init(); #ifdef CFG_UBOOT_PROFILING printf("[PROFILE] ------- pmic6329_init takes %d ms -------- \n", get_timer(time_pmic6329_init)); #endif printf("[CHIP]: %x-%x\n", get_chip_eco_ver(), get_chip_ver()); return 0; }
void *video_hw_init (void) { static GraphicDevice s_mt65xx_gd; memset(&s_mt65xx_gd, 0, sizeof(GraphicDevice)); s_mt65xx_gd.frameAdrs = memory_size() - mt65xx_disp_get_vram_size() + fb_size; s_mt65xx_gd.winSizeX = CFG_DISPLAY_WIDTH; s_mt65xx_gd.winSizeY = CFG_DISPLAY_HEIGHT; s_mt65xx_gd.gdfIndex = GDF_16BIT_565RGB; s_mt65xx_gd.gdfBytesPP = CFG_DISPLAY_BPP / 8; s_mt65xx_gd.memSize = s_mt65xx_gd.winSizeX * s_mt65xx_gd.winSizeY * s_mt65xx_gd.gdfBytesPP; return &s_mt65xx_gd; }