#endif
}
+int __fixup_cpu(void)
+{
+ return 0;
+}
+
+int fixup_cpu(void) __attribute__((weak, alias("__fixup_cpu")));
+
/*
* This is the first part of the initialization sequence that is
* implemented in C, but still running from ROM.
* We need to make sure the location we intend to put secondary core
* boot code is reserved and not used by any part of u-boot
*/
- if (addr > determine_mp_bootpg()) {
- addr = determine_mp_bootpg();
+ if (addr > determine_mp_bootpg(NULL)) {
+ addr = determine_mp_bootpg(NULL);
debug("Reserving MP boot page to %08lx\n", addr);
}
#endif
addr_sp -= 16;
addr_sp &= ~0xF;
s = (ulong *) addr_sp;
- *s-- = 0;
- *s-- = 0;
- addr_sp = (ulong) s;
+ *s = 0; /* Terminate back chain */
+ *++s = 0; /* NULL return address */
debug("Stack Pointer at: %08lx\n", addr_sp);
/*
* We need to update it to point to the same CPU entry in RAM.
*/
gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
+
+ /*
+ * If we didn't know the cpu mask & # cores, we can save them of
+ * now rather than 'computing' them constantly
+ */
+ fixup_cpu();
#endif
#ifdef CONFIG_SYS_EXTRA_ENV_RELOC
gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
#endif
-#ifdef CONFIG_SERIAL_MULTI
serial_initialize();
-#endif
debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);