--- 9cf4cbf8f95b8ca9eef1baf1d8f49054999304f8 +++ 5efe59c49c7cac7d01fdd8baa881389cc635818d @@ -4,6 +4,13 @@ #include +#ifdef CONFIG_KEXEC_HARDBOOT +#include +#ifdef CONFIG_ARCH_MSM8960 +#include +#endif +#endif + .globl relocate_new_kernel relocate_new_kernel: @@ -52,6 +59,12 @@ relocate_new_kernel: b 0b 2: +#ifdef CONFIG_KEXEC_HARDBOOT + ldr r0, kexec_hardboot + teq r0, #0 + bne hardboot +#endif + /* Jump to relocated kernel */ mov lr,r1 mov r0,#0 @@ -59,6 +72,35 @@ relocate_new_kernel: ldr r2,kexec_boot_atags mov pc,lr +#ifdef CONFIG_KEXEC_HARDBOOT +hardboot: + /* Stash boot arguments in hardboot page: + * 0: KEXEC_HB_PAGE_MAGIC + * 4: kexec_start_address + * 8: kexec_mach_type + * 12: kexec_boot_atags */ + ldr r0, =KEXEC_HB_PAGE_ADDR + str r1, [r0, #4] + ldr r1, kexec_mach_type + str r1, [r0, #8] + ldr r1, kexec_boot_atags + str r1, [r0, #12] + ldr r1, =KEXEC_HB_PAGE_MAGIC + str r1, [r0] + +#ifdef CONFIG_ARCH_MSM8960 + /* Hard reset via PMIC, decompressor jumps to kernel. */ + ldr r0, =MSM8960_TLMM_PHYS + mov r1, #0 + str r1, [r0, #0x820] @ PSHOLD_CTL_SU +loop: b loop +#else +#error "No reboot method defined for hardboot." +#endif + + .ltorg +#endif + .align .globl kexec_start_address @@ -78,6 +120,12 @@ kexec_mach_type: kexec_boot_atags: .long 0x0 +#ifdef CONFIG_KEXEC_HARDBOOT + .globl kexec_hardboot +kexec_hardboot: + .long 0x0 +#endif + relocate_new_kernel_end: .globl relocate_new_kernel_size