Index: u-boot-1.1.4/lib_arm/armlinux.c =================================================================== --- u-boot-1.1.4.orig/lib_arm/armlinux.c +++ u-boot-1.1.4/lib_arm/armlinux.c @@ -416,3 +416,37 @@ static void setup_end_tag (bd_t *bd) } #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ + +/* + * Function used for snapshot boot (bootss command) + */ +void ss_jump_to_resume(unsigned long start) +{ + unsigned long zero = 0x0; + unsigned long dac = 0xffffffff; + unsigned long ttb = 0x10004000; /* 0x11f84000 */ + unsigned long ctl = 0x5317f; /* 0x5507f; */ + + printf("bootss: jumping to kernel resume point: 0x%08lx\n", start); + + /* disable interrupts, turn off I/D-cache, flush I/D cache */ + cleanup_before_linux(); + + /* invalidate I/D cache */ + asm ("mcr p15, 0, %0, c7, c7, 0" : : "r"(zero)); + /* drain write buffer */ + asm ("mcr p15, 0, %0, c7, c10, 4" : : "r"(zero)); + /* invalidate I/D TLB */ + asm ("mcr p15, 0, %0, c8, c7, 0" : : "r"(zero)); + + /* load domain access register */ + asm ("mcr p15, 0, %0, c3, c0, 0" : : "r"(dac)); + /* set Translation Table Base */ + asm ("mcr p15, 0, %0, c2, c0, 0" : : "r"(ttb)); + /* turn MMU on */ + asm ("mcr p15, 0, %0, c1, c0, 0" : : "r"(ctl)); + /* nop */ + asm ("mov r0, r0"); + /* jump to swsusp_arch_resume + offset(after page copy) */ + asm ("mov pc, %0" : : "r"(start)); +}