Exemplo n.º 1
0
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_run_fel(void)
{
#if defined(CONFIG_SUN6I) || defined(CONFIG_ARCH_SUN8IW3P1)|| defined(CONFIG_ARCH_SUN8IW5P1) || defined(CONFIG_ARCH_SUN7I)|| defined(CONFIG_ARCH_SUN8IW8P1)
	*((volatile unsigned int *)(SUNXI_RUN_EFEX_ADDR)) = SUNXI_RUN_EFEX_FLAG;
#elif defined(CONFIG_ARCH_SUN9IW1P1) || defined(CONFIG_ARCH_SUN8IW7P1) || defined(CONFIG_ARCH_SUN8IW6P1)
	sunxi_set_fel_flag();
#endif
	printf("set next system status\n");

	axp_set_next_poweron_status(PMU_PRE_SYS_MODE);

	board_display_set_exit_mode(0);
#ifdef CONFIG_SUNXI_DISPLAY
	drv_disp_exit();
#endif
	printf("sunxi_board_close_source\n");
	sunxi_board_close_source();

	sunxi_flush_allcaches();
#if defined(CONFIG_ARCH_SUN5I)
	printf("jump to fel_base\n");
	jump_to(FEL_BASE);
#else
	printf("reset cpu\n");

	reset_cpu(0);
#endif

	return 0;
}
Exemplo n.º 2
0
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_shutdown(void)
{
#if defined(CONFIG_SUNXI_RTC)
	printf("rtc disable\n");
    rtc_disable();
#endif
	printf("set next system normal\n");
	axp_set_next_poweron_status(0x0);

	board_display_set_exit_mode(0);
#ifdef CONFIG_SUNXI_DISPLAY
    drv_disp_exit();
#endif
	sunxi_flash_exit(1);	//强制关闭FLASH
	sunxi_sprite_exit(1);
	disable_interrupts();
	interrupt_exit();

	tick_printf("power off\n");
	axp_set_hardware_poweroff_vol();
	axp_set_power_off();
#if defined(CONFIG_ARCH_SUN8IW7P1)
	power_off();
#endif
	return 0;
}
Exemplo n.º 3
0
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_run_fel(void)
{
#if defined(CONFIG_SUN6I) || defined(CONFIG_ARCH_SUN8IW3P1)|| defined(CONFIG_ARCH_SUN8IW5P1) || defined(CONFIG_ARCH_SUN7I)
	*((volatile unsigned int *)(SUNXI_RUN_EFEX_ADDR)) = SUNXI_RUN_EFEX_FLAG;
#elif defined(CONFIG_ARCH_SUN9IW1P1)
    volatile unsigned int *rtc_addr = (volatile unsigned int *)(0x08001400 + 0x1f0);

	do
	{
    	*rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
        *rtc_addr = (1<<31) | (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
        __usdelay(10);
        *rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
    }
    while((*rtc_addr & 0xff) != SUNXI_RUN_EFEX_FLAG);
#elif defined(CONFIG_ARCH_SUN8IW6P1)
        volatile unsigned int *rtc_addr = (volatile unsigned int *)(0x01f01400 + 0x1f0);
    
        do
        {
            *rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
            *rtc_addr = (1<<31) | (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
            __usdelay(10);
            *rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
        }
        while((*rtc_addr & 0xff) != SUNXI_RUN_EFEX_FLAG);

#endif
	printf("set next system status\n");

	axp_set_next_poweron_status(PMU_PRE_SYS_MODE);

	board_display_set_exit_mode(0);
#ifdef CONFIG_SUNXI_DISPLAY
	drv_disp_exit();
#endif
	printf("sunxi_board_close_source\n");
	sunxi_board_close_source();

	sunxi_flush_allcaches();
#if defined(CONFIG_ARCH_SUN5I)
	printf("jump to fel_base\n");
	jump_to(FEL_BASE);
#else
	printf("reset cpu\n");

	reset_cpu(0);
#endif

	return 0;
}
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_restart(int next_mode)
{
	if(!next_mode)
	{
		next_mode = PMU_PRE_SYS_MODE;
	}
	printf("set next mode %d\n", next_mode);
	axp_set_next_poweron_status(next_mode);
	board_display_set_exit_mode(0);
	drv_disp_exit();
	sunxi_board_close_source();
	reset_cpu(0);

	return 0;
}
Exemplo n.º 5
0
int sunxi_board_run_fel(void)
{
	sunxi_set_fel_flag();
	printf("set next system status\n");
	axp_set_next_poweron_status(PMU_PRE_SYS_MODE);
#ifdef CONFIG_SUNXI_DISPLAY
	board_display_set_exit_mode(0);
	drv_disp_exit();
#endif
	printf("sunxi_board_close_source\n");
	sunxi_board_close_source();
	sunxi_flush_allcaches();
	printf("reset cpu\n");
	reset_cpu(0);
	return 0;
}
Exemplo n.º 6
0
int sunxi_board_shutdown(void)
{


	printf("set next system normal\n");
	axp_set_next_poweron_status(0x0);

#ifdef CONFIG_SUNXI_DISPLAY
	board_display_set_exit_mode(0);
	drv_disp_exit();
#endif
	sunxi_flash_exit(1);	
	sunxi_sprite_exit(1);
	disable_interrupts();
	interrupt_exit();

	tick_printf("power off\n");
	axp_set_hardware_poweroff_vol();
	axp_set_power_off();

	return 0;

}
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_run_fel(void)
{
#if defined(CONFIG_SUN6I) || defined(CONFIG_ARCH_SUN8IW3P1) || defined(CONFIG_ARCH_SUN7I)
	*((volatile unsigned int *)(SUNXI_RUN_EFEX_ADDR)) = SUNXI_RUN_EFEX_FLAG;
#endif
	printf("set next system status\n");

	axp_set_next_poweron_status(PMU_PRE_SYS_MODE);

	board_display_set_exit_mode(0);

	drv_disp_exit();
	printf("sunxi_board_close_source\n");
	sunxi_board_close_source();

	sunxi_flush_allcaches();

	printf("reset cpu\n");

	reset_cpu(0);

	return 0;
}