@@ -18,20 +18,6 @@ ASM_FUNC(cpu_init_bootmethod)
ASM_FUNC(start_bootmethod)
cpuid x0, x1
bl find_logical_id
-
- /*
- * Primary CPU (x0 = 0) jumps to kernel, the other ones wait for an
- * address to appear in mbox
- */
- adr x3, mbox
- adr x4, kernel_address
- cmp x0, #0
- csel x1, x3, x4, ne
+ adr x1, mbox
mov x2, #0
bl first_spin
-
- .align 3
-kernel_address:
- .long 0
-
- .ltorg
@@ -27,7 +27,7 @@ const unsigned long id_table[] = { CPU_IDS };
* @invalid: value of an invalid address, 0 or -1 depending on the boot method
* @is_entry: when true, pass boot parameters to the kernel, instead of 0
*/
-void __noreturn spin(unsigned long *mbox, unsigned long invalid, int is_entry)
+void __noreturn spin(unsigned long *mbox, unsigned long invalid)
{
unsigned long addr = invalid;
@@ -36,13 +36,6 @@ void __noreturn spin(unsigned long *mbox, unsigned long invalid, int is_entry)
addr = *mbox;
}
- if (is_entry)
-#ifdef KERNEL_32
- jump_kernel(addr, 0, ~0, (unsigned long)&dtb, 0);
-#else
- jump_kernel(addr, (unsigned long)&dtb, 0, 0, 0);
-#endif
-
jump_kernel(addr, 0, 0, 0, 0);
unreachable();
@@ -60,12 +53,15 @@ void __noreturn first_spin(unsigned int cpu, unsigned long *mbox,
unsigned long invalid)
{
if (cpu == 0) {
- *mbox = (unsigned long)&entrypoint;
- sevl();
- spin(mbox, invalid, 1);
+ unsigned long addr = (unsigned long)&entrypoint;
+#ifdef KERNEL_32
+ jump_kernel(addr, 0, ~0, (unsigned long)&dtb, 0);
+#else
+ jump_kernel(addr, (unsigned long)&dtb, 0, 0, 0);
+#endif
} else {
*mbox = invalid;
- spin(mbox, invalid, 0);
+ spin(mbox, invalid);
}
unreachable();
@@ -57,7 +57,7 @@ static int psci_cpu_off(void)
branch_table[cpu] = PSCI_ADDR_INVALID;
- spin(branch_table + cpu, PSCI_ADDR_INVALID, 0);
+ spin(branch_table + cpu, PSCI_ADDR_INVALID);
unreachable();
}
@@ -12,7 +12,7 @@
#include <compiler.h>
#include <stdbool.h>
-void __noreturn spin(unsigned long *mbox, unsigned long invalid, int is_entry);
+void __noreturn spin(unsigned long *mbox, unsigned long invalid);
void __noreturn first_spin(unsigned int cpu, unsigned long *mbox,
unsigned long invalid_addr);