|
@@ -491,6 +491,20 @@ static int reserve_fdt(void)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int reserve_bootstage(void)
|
|
|
|
+{
|
|
|
|
+#ifdef CONFIG_BOOTSTAGE
|
|
|
|
+ int size = bootstage_get_size();
|
|
|
|
+
|
|
|
|
+ gd->start_addr_sp -= size;
|
|
|
|
+ gd->new_bootstage = map_sysmem(gd->start_addr_sp, size);
|
|
|
|
+ debug("Reserving %#x Bytes for bootstage at: %08lx\n", size,
|
|
|
|
+ gd->start_addr_sp);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
int arch_reserve_stacks(void)
|
|
int arch_reserve_stacks(void)
|
|
{
|
|
{
|
|
return 0;
|
|
return 0;
|
|
@@ -605,6 +619,24 @@ static int reloc_fdt(void)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int reloc_bootstage(void)
|
|
|
|
+{
|
|
|
|
+#ifdef CONFIG_BOOTSTAGE
|
|
|
|
+ if (gd->flags & GD_FLG_SKIP_RELOC)
|
|
|
|
+ return 0;
|
|
|
|
+ if (gd->new_bootstage) {
|
|
|
|
+ int size = bootstage_get_size();
|
|
|
|
+
|
|
|
|
+ debug("Copying bootstage from %p to %p, size %x\n",
|
|
|
|
+ gd->bootstage, gd->new_bootstage, size);
|
|
|
|
+ memcpy(gd->new_bootstage, gd->bootstage, size);
|
|
|
|
+ gd->bootstage = gd->new_bootstage;
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static int setup_reloc(void)
|
|
static int setup_reloc(void)
|
|
{
|
|
{
|
|
if (gd->flags & GD_FLG_SKIP_RELOC) {
|
|
if (gd->flags & GD_FLG_SKIP_RELOC) {
|
|
@@ -828,6 +860,7 @@ static const init_fnc_t init_sequence_f[] = {
|
|
setup_machine,
|
|
setup_machine,
|
|
reserve_global_data,
|
|
reserve_global_data,
|
|
reserve_fdt,
|
|
reserve_fdt,
|
|
|
|
+ reserve_bootstage,
|
|
reserve_arch,
|
|
reserve_arch,
|
|
reserve_stacks,
|
|
reserve_stacks,
|
|
dram_init_banksize,
|
|
dram_init_banksize,
|
|
@@ -849,6 +882,7 @@ static const init_fnc_t init_sequence_f[] = {
|
|
#endif
|
|
#endif
|
|
INIT_FUNC_WATCHDOG_RESET
|
|
INIT_FUNC_WATCHDOG_RESET
|
|
reloc_fdt,
|
|
reloc_fdt,
|
|
|
|
+ reloc_bootstage,
|
|
setup_reloc,
|
|
setup_reloc,
|
|
#if defined(CONFIG_X86) || defined(CONFIG_ARC)
|
|
#if defined(CONFIG_X86) || defined(CONFIG_ARC)
|
|
copy_uboot_to_ram,
|
|
copy_uboot_to_ram,
|