From 95daec1061a9af9e170b588ed11c9350b4fc27de Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sat, 19 May 2018 20:03:00 -0500 Subject: [PATCH] u-boot: Generate boot.scr for mmc * This gives us a solid automatic entry point to u-boot * A uEnv.txt specifies the fdt file name * This should work on any modern u-boot for most architectures * Non-mmc targets will likely need some work Change-Id: I9a00316a213a15e85d3f2e18574d64920d9bdb76 --- src/system/boot/platform/u-boot/Jamfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/system/boot/platform/u-boot/Jamfile b/src/system/boot/platform/u-boot/Jamfile index e1b7414102..3e79a73d75 100644 --- a/src/system/boot/platform/u-boot/Jamfile +++ b/src/system/boot/platform/u-boot/Jamfile @@ -34,6 +34,16 @@ local libFDTSources = # and we also fake a netbsd loader anyway. local uImageFakeOS = "netbsd" ; +# Modern u-boot fill in sane addresses for us. +# We only need to fill in the FDT dtb +HAIKU_MMC_UBOOT_SCRIPT = "\ + test -e mmc 0 uEnv.txt && fatload mmc 0 ${scriptaddr} uEnv.txt && env import -t ${scriptaddr} ${filesize} \ + fatload mmc 0 ${kernel_addr_r} haiku_loader.ub \ + fatload mmc 0 ${ramdisk_addr_r} haiku-floppyboot.tgz.ub \ + fatload mmc 0 ${fdt_addr_r} ${dtb} \ + fdt addr ${fdt_addr_r} \ + bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}" ; + SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ; # First build the non arch dependent parts @@ -242,10 +252,7 @@ BuildUImage haiku_loader.ub : haiku_loader : -a $(HAIKU_BOOT_LOADER_BASE) -e $(HAIKU_BOOT_LOADER_ENTRY_LINUX) -n 'Haiku $(TARGET_KERNEL_ARCH) loader' ; -if $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME) { - BuildUImageScript $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME) : - $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT) ; -} +BuildUImageScript boot.scr : $(HAIKU_MMC_UBOOT_SCRIPT) ; # flash image targets @@ -266,7 +273,7 @@ Depends haiku-flash-uimage : haiku-$(TARGET_KERNEL_ARCH)_flash_image_uimage.img # SD/mmc image targets BuildUBootSDImage haiku-$(TARGET_KERNEL_ARCH).mmc : - $(HAIKU_IMAGE) haiku_loader.ub haiku-floppyboot.tgz.ub ; + $(HAIKU_IMAGE) haiku_loader.ub haiku-floppyboot.tgz.ub boot.scr ; BlessSDImage haiku-$(TARGET_KERNEL_ARCH).mmc ; NotFile haiku-mmc-image ; Depends haiku-mmc-image : haiku-$(TARGET_KERNEL_ARCH).mmc ;