hrev48214 adds 2 changesets to branch 'master' old head: 43e35cdebada95cc9d9ce864f6101469d1e94878 new head: cb3ea122d3c5d2ad41eff682dd5f78e0e1193d10 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=cb3ea12+%5E43e35cd ---------------------------------------------------------------------------- b56dad5: ARM: overo: use same load address as beagle xm And leave 8M for the kernel. cb3ea12: U-Boot: delay checking /chosen:bootargs after remapping FDT This avoids having to copy the strings. For now we disregard argv[] as it is not remapped before being used in add_stage2_driver_settings() and is not used by the linux entry point. This makes the overo loader panic at the same place as the beagle xm one now, even though it fails to display anything with the default RAM size since we allocate the framebuffer beyond 128MB... [ François Revol <revol@xxxxxxx> ] ---------------------------------------------------------------------------- 2 files changed, 35 insertions(+), 18 deletions(-) build/jam/board/overo/BoardSetup | 14 +++++----- src/system/boot/platform/u-boot/start.cpp | 39 +++++++++++++++++++-------- ############################################################################ Commit: b56dad50b454e68b187d58be3261ccb14bce4dcc URL: http://cgit.haiku-os.org/haiku/commit/?id=b56dad5 Author: François Revol <revol@xxxxxxx> Date: Mon Nov 3 17:44:56 2014 UTC ARM: overo: use same load address as beagle xm And leave 8M for the kernel. ---------------------------------------------------------------------------- diff --git a/build/jam/board/overo/BoardSetup b/build/jam/board/overo/BoardSetup index 3f90a2e..560edc0 100644 --- a/build/jam/board/overo/BoardSetup +++ b/build/jam/board/overo/BoardSetup @@ -8,18 +8,18 @@ HAIKU_BOARD_FDT_NAME = "omap3-overo-tobi" ; # # load address for haiku_loader -HAIKU_BOARD_LOADER_BASE = 0x80008000 ; +HAIKU_BOARD_LOADER_BASE = 0x80800000 ; # entry points (raw binary, and netbsd loader emulation) -HAIKU_BOARD_LOADER_ENTRY_RAW = 0x80008000 ; -HAIKU_BOARD_LOADER_ENTRY_NBSD = 0x80008008 ; -HAIKU_BOARD_LOADER_ENTRY_LINUX = 0x80008010 ; +HAIKU_BOARD_LOADER_ENTRY_RAW = 0x80800000 ; +HAIKU_BOARD_LOADER_ENTRY_NBSD = 0x80800008 ; +HAIKU_BOARD_LOADER_ENTRY_LINUX = 0x80800010 ; HAIKU_BOARD_LOADER_ENTRY = $(HAIKU_BOARD_LOADER_ENTRY_NBSD) ; HAIKU_BOARD_LOADER_FAKE_OS = netbsd ; # load address for haiku_loader uimage # (must be different than real load address) -HAIKU_BOARD_LOADER_UIBASE = 0x84000000 ; +HAIKU_BOARD_LOADER_UIBASE = 0x82800000 ; # # Flash image @@ -73,9 +73,9 @@ HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT = "\ setenv bootargs debug_screen true; \ if mmc rescan; then \ fatload mmc 0 0x80100000 $(HAIKU_BOARD_FDT_NAME).dtb ; \ - fatload mmc 0 0x80200000 haiku-floppyboot.tgz.ub; \ + fatload mmc 0 0x81200000 haiku-floppyboot.tgz.ub; \ fatload mmc 0 $(HAIKU_BOARD_LOADER_UIBASE) haiku_loader_linux.ub; \ - bootm $(HAIKU_BOARD_LOADER_UIBASE) 0x80200000 0x80100000; \ + bootm $(HAIKU_BOARD_LOADER_UIBASE) 0x81200000 0x80100000; \ fi" ; HAIKU_BOARD_SDIMAGE_FILES = ############################################################################ Revision: hrev48214 Commit: cb3ea122d3c5d2ad41eff682dd5f78e0e1193d10 URL: http://cgit.haiku-os.org/haiku/commit/?id=cb3ea12 Author: François Revol <revol@xxxxxxx> Date: Mon Nov 3 18:38:41 2014 UTC U-Boot: delay checking /chosen:bootargs after remapping FDT This avoids having to copy the strings. For now we disregard argv[] as it is not remapped before being used in add_stage2_driver_settings() and is not used by the linux entry point. This makes the overo loader panic at the same place as the beagle xm one now, even though it fails to display anything with the default RAM size since we allocate the framebuffer beyond 128MB... ---------------------------------------------------------------------------- diff --git a/src/system/boot/platform/u-boot/start.cpp b/src/system/boot/platform/u-boot/start.cpp index 6556675..7bcbdea 100644 --- a/src/system/boot/platform/u-boot/start.cpp +++ b/src/system/boot/platform/u-boot/start.cpp @@ -133,7 +133,6 @@ start_netbsd(struct board_info *bd, struct image_header *image, { const char *argv[] = { "haiku", cmdline }; int argc = 1; - // TODO: Ensure cmdline is mapped into memory by MMU before usage. if (cmdline && *cmdline) argc++; return start_gen(argc, argv, image); @@ -193,9 +192,10 @@ start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt) if (argv) { // skip the kernel name - args.arguments = ++argv; - args.arguments_count = --argc; + ++argv; + --argc; } + // TODO: Ensure cmdline is mapped into memory by MMU before usage. // if we get passed a uimage, try to find the third blob // only if we do not have FDT data yet @@ -236,14 +236,7 @@ start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt) dprintf("Found boot tgz from FDT @ %p, %" B_PRIu32 " bytes\n", args.platform.boot_tgz_data, args.platform.boot_tgz_size); } - prop = fdt_getprop(gFDT, node, "bootargs", &len); - if (prop) { - dprintf("Found bootargs: %s\n", (const char *)prop); - static const char *sArgs[] = { NULL, NULL }; - sArgs[0] = (const char *)prop; - args.arguments = sArgs; - args.arguments_count = 1; - } + // we check for bootargs after remapping the FDT } } @@ -292,6 +285,30 @@ start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt) if (gFDT != NULL) gFDT = (void*)mmu_map_physical_memory((addr_t)gFDT, fdtSize, kDefaultPageFlags); + // if we get passed an FDT, check /chosen for bootargs now + // to avoid having to copy them. + if (gFDT != NULL) { + int node = fdt_path_offset(gFDT, "/chosen"); + const void *prop; + int len; + + if (node >= 0) { + prop = fdt_getprop(gFDT, node, "bootargs", &len); + if (prop) { + dprintf("Found bootargs: %s\n", (const char *)prop); + static const char *sArgs[] = { NULL, NULL }; + sArgs[0] = (const char *)prop; + // override main() args + args.arguments = sArgs; + args.arguments_count = 1; + } + } + dprintf("args.arguments_count = %d\n", args.arguments_count); + for (int i = 0; i < args.arguments_count; i++) + dprintf("args.arguments[%d] @%lx = '%s'\n", i, + (uint32)args.arguments[i], args.arguments[i]); + } + // wait a bit to give the user the opportunity to press a key // spin(750000);