void bsp_hdmi_set_addr(unsigned int base_addr)
{
	uintptr_t para[5];
	int ret;

	memcpy((void *)HDMI_MAIN_START, (void *)hdmi_mc_table, hdmi_mc_table_size);
	hdmi_main = (int (*)(int type, uintptr_t* para))HDMI_MAIN_START;
	__cpuc_flush_dcache_area((void *)HDMI_MAIN_START, hdmi_mc_table_size);
	__cpuc_flush_icache_all();

	memset(para, 0, 5*sizeof(uintptr_t));
	para[0] = (uintptr_t)base_addr;
	ret = bsp_hdmi_main(HDMI_CODE_SET_ADDR, para);
}
Exemple #2
0
/*
*********************************************************************************************************
*                           aw_early_suspend
*
*Description: prepare necessary info for suspend&resume;
*
*Return     : return 0 is process successed;
*
*Notes      : 
*********************************************************************************************************
*/
static int aw_super_standby(suspend_state_t state)
{
    int result = 0;
    suspend_status_flag = 0;
    mem_para_info.axp_enable = standby_axp_enable;
    
mem_enter:
    if( 1 == mem_para_info.mem_flag){
        invalidate_branch_predictor();
        //must be called to invalidate I-cache inner shareable?
        // I+BTB cache invalidate
        __cpuc_flush_icache_all();
        //disable 0x0000 <---> 0x0000 mapping
        restore_processor_state();
        mem_flush_tlb();
        //destroy 0x0000 <---> 0x0000 mapping
        //restore_mapping(MEM_SW_VA_SRAM_BASE);
        mem_arch_resume();
        goto resume;
    }

    save_runtime_context(mem_para_info.saved_runtime_context_svc);
    mem_para_info.mem_flag = 1;
    standby_level = STANDBY_WITH_POWER_OFF;
    mem_para_info.resume_pointer = (void *)&&mem_enter;
    mem_para_info.debug_mask = debug_mask;
    mem_para_info.suspend_delay_ms = suspend_delay_ms;
    //busy_waiting();
    if(unlikely(debug_mask&PM_STANDBY_PRINT_STANDBY)){
        pr_info("resume_pointer = 0x%x. \n", (unsigned int)(mem_para_info.resume_pointer));
    }
    
    
#if 1
    /* config system wakeup evetn type */
    if(PM_SUSPEND_MEM == state || PM_SUSPEND_STANDBY == state){
        mem_para_info.axp_event = AXP_MEM_WAKEUP | AXP_WAKEUP_PIO_ANY;
    }else if(PM_SUSPEND_BOOTFAST == state){
        mem_para_info.axp_event = AXP_BOOTFAST_WAKEUP;
    }
#endif  

    result = aw_early_suspend();
    if(-2 == result){
        //mem_para_info.mem_flag = 1;
        //busy_waiting();
        suspend_status_flag = 2;
        goto mem_enter;
    }else if(-1 == result){
        suspend_status_flag = 1;
        mem_para_info.mem_flag = 0;
        goto suspend_err;
    }
    
resume:
    aw_late_resume();
    //have been disable dcache in resume1
    //enable_cache();
    
suspend_err:
    if(unlikely(debug_mask&PM_STANDBY_PRINT_RESUME)){
        pr_info("suspend_status_flag = %d. \n", suspend_status_flag);
    }

    return 0;

}