Beispiel #1
0
/*
 * cleanup_before_linx: Prepares the processor for linux
 */
int cleanup_before_linux (void)
{
	printf("system cleanup before entering linux ...\n");

	// (1) make sure the cache is off (turn off I/D-cache)
	// (2) make sure the cache is clean (flush I/D-cache)
	printf(" > clean cpu env\n");
	cpu_clean_env();

/* CC: remove temporarily for MT6573 porting */
#if 1
	// (3) deinit leds
	printf(" > deinit leds..\n");	
	leds_deinit();
#endif
	
	// (4) power off some unused LDO
	printf(" > perform power saving\n");		
	Uboot_power_saving();

	return (0);
}
Beispiel #2
0
int cleanup_before_linux(void)
{
	unsigned int i;

	printf(" > deinit leds..\n");	
	leds_deinit();

	/*
	 * this function is called just before we call linux
	 * it prepares the processor for linux
	 *
	 * we turn off caches etc ...
	 */
	disable_interrupts();

	/* turn off I/D-cache */
	icache_disable();
	dcache_disable();

	/* invalidate I-cache */
	cache_flush();

#ifndef CONFIG_L2_OFF
	/* turn off L2 cache */
	l2_cache_disable();
	/* invalidate L2 cache also */
	invalidate_dcache(get_device_type());
#endif
	i = 0;
	/* mem barrier to sync up things */
	asm("mcr p15, 0, %0, c7, c10, 4": :"r"(i));

#ifndef CONFIG_L2_OFF
	l2_cache_enable();
#endif

	return 0;
}
void platform_uninit(void)
{
    leds_deinit();
    platform_deinit_interrupts();
}