#include <image.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
-#include <fdt.h>
#include <libfdt.h>
#include <fdt_support.h>
#include <asm/bootm.h>
+#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
sp = get_sp();
debug("## Current stack ends at 0x%08lx ", sp);
- /* adjust sp by 1K to be safe */
- sp -= 1024;
+ /* adjust sp by 4K to be safe */
+ sp -= 4096;
lmb_reserve(lmb, sp,
gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp);
}
{
printf("\nStarting kernel ...\n\n");
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
+#ifdef CONFIG_BOOTSTAGE_FDT
+ bootstage_fdt_add_report();
+#endif
#ifdef CONFIG_BOOTSTAGE_REPORT
bootstage_report();
#endif
fdt_chosen(*of_flat_tree, 1);
fixup_memory_node(*of_flat_tree);
+ fdt_fixup_ethernet(*of_flat_tree);
fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
+#ifdef CONFIG_OF_BOARD_SETUP
+ ft_board_setup(*of_flat_tree, gd->bd);
+#endif
return 0;
}
#endif
+__weak void setup_board_tags(struct tag **in_params) {}
+
/* Subcommand: PREP */
static void boot_prep_linux(bootm_headers_t *images)
{
setup_initrd_tag(gd->bd, images->rd_start,
images->rd_end);
#endif
+ setup_board_tags(¶ms);
setup_end_tag(gd->bd);
#else /* all tags */
printf("FDT and ATAGS support not compiled in - hanging\n");
unsigned long machid = gd->bd->bi_arch_number;
char *s;
void (*kernel_entry)(int zero, int arch, uint params);
+ unsigned long r2;
kernel_entry = (void (*)(int, int, uint))images->ep;
"...\n", (ulong) kernel_entry);
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
announce_and_cleanup();
- kernel_entry(0, machid, gd->bd->bi_boot_params);
+
+#ifdef CONFIG_OF_LIBFDT
+ if (images->ft_len)
+ r2 = (unsigned long)images->ft_addr;
+ else
+#endif
+ r2 = gd->bd->bi_boot_params;
+
+ kernel_entry(0, machid, r2);
}
/* Main Entry point for arm bootm implementation