hrev48193 adds 5 changesets to branch 'master' old head: f680a1a723180a831f5d6cefba9ee07ac09450b1 new head: c424d9e8331da73f7274064d499537898fda75d8 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=c424d9e+%5Ef680a1a ---------------------------------------------------------------------------- b1d21fa: ARM: Add URLs for MLO and U-Boot binaries taken from http://gumstix.org/how-to/70-writing-images-to-flash.html 1309cda: U-Boot: rework flash image rule to be more flexible We can now specify arbitrary content and offsets for each. Change the default block size to 1k. 10255f3: ARM: verdex: keep notes about flash content 8874b94: ARM: overo: fix flash and SD content c424d9e: ARM: overo: fix bootscript We actually now get our boot menu! [ François Revol <revol@xxxxxxx> ] ---------------------------------------------------------------------------- 3 files changed, 84 insertions(+), 34 deletions(-) build/jam/board/overo/BoardSetup | 42 +++++++++++++++++- build/jam/board/verdex/BoardSetup | 10 +++++ src/system/boot/platform/u-boot/Jamfile | 66 +++++++++++++++-------------- ############################################################################ Commit: b1d21fa3e8eca0e8f59d34c2fdeda56e1c031c6d URL: http://cgit.haiku-os.org/haiku/commit/?id=b1d21fa Author: François Revol <revol@xxxxxxx> Date: Sat Nov 1 01:27:57 2014 UTC ARM: Add URLs for MLO and U-Boot binaries taken from http://gumstix.org/how-to/70-writing-images-to-flash.html ---------------------------------------------------------------------------- diff --git a/build/jam/board/overo/BoardSetup b/build/jam/board/overo/BoardSetup index 1543a7a..7763c0e 100644 --- a/build/jam/board/overo/BoardSetup +++ b/build/jam/board/overo/BoardSetup @@ -21,6 +21,28 @@ HAIKU_BOARD_LOADER_FAKE_OS = netbsd ; HAIKU_BOARD_LOADER_UIBASE = 0x84000000 ; # +# Flash image +# + +# OMAP x-loader image, must be first file in Flash image +HAIKU_BOARD_MLO_IMAGE ?= MLO ; +HAIKU_BOARD_MLO_IMAGE_URL = + http://cumulus.gumstix.org/images/angstrom/developer/current/MLO ; + +# u-boot binary image filename, to build the flash image +# XXX: Locate it somehow (for now just put it in generated/) +HAIKU_BOARD_UBOOT_IMAGE ?= u-boot.bin ; +HAIKU_BOARD_UBOOT_IMAGE_URL = + http://cumulus.gumstix.org/images/angstrom/developer/current/u-boot.bin ; + +mloFile = [ DownloadFile $(HAIKU_BOARD_MLO_IMAGE) + : $(HAIKU_BOARD_MLO_IMAGE_URL) ] ; + +ubootFile = [ DownloadFile $(HAIKU_BOARD_UBOOT_IMAGE) + : $(HAIKU_BOARD_UBOOT_IMAGE_URL) ] ; + + +# # mmc/SD image # ############################################################################ Commit: 1309cdade9c215a2bb48823f38edfc74b4dce0f6 URL: http://cgit.haiku-os.org/haiku/commit/?id=1309cda Author: François Revol <revol@xxxxxxx> Date: Sat Nov 1 04:34:14 2014 UTC U-Boot: rework flash image rule to be more flexible We can now specify arbitrary content and offsets for each. Change the default block size to 1k. ---------------------------------------------------------------------------- diff --git a/src/system/boot/platform/u-boot/Jamfile b/src/system/boot/platform/u-boot/Jamfile index 65f917d..48691a8 100644 --- a/src/system/boot/platform/u-boot/Jamfile +++ b/src/system/boot/platform/u-boot/Jamfile @@ -69,22 +69,34 @@ BootMergeObject boot_platform_u-boot.o : boot_platform_u-boot_common.o ; +# TODO: handle flash and SD images as Container stuff ? + # bootable flash image -rule BuildUBootFlashImage image : haikuLoader : uboot_image +rule BuildUBootFlashImage image : haikuLoader : parts { Depends $(image) : $(haikuLoader) ; #Depends $(image) : $(archive) ; - Depends $(image) : $(uboot_image) ; + Depends $(image) : $(parts) ; LocalClean clean : $(image) ; - FLASH_IMAGE_BLOCK_SIZE on $(image) = 128k ; - FLASH_IMAGE_BLOCK_COUNT on $(image) = 256 ; + FLASH_IMAGE_BLOCK_SIZE on $(image) = 1024 ; + FLASH_IMAGE_BLOCK_COUNT on $(image) = 32768 ; #FLASH_IMAGE_UBOOT_OFFSET on $(image) = 0 ; FLASH_IMAGE_LOADER_OFFSET on $(image) = 248 ; - BuildUBootFlashImage1 $(image) : $(haikuLoader) $(uboot_image) ; + + # add u-boot + FLASH_OFFSET on $(haikuLoader) = $(FLASH_IMAGE_LOADER_OFFSET) ; + local offsets = ; + for dep in $(haikuLoader) $(parts) { + offsets += [ on $(dep) return $(FLASH_OFFSET) ] ; + } + FLASH_OFFSETS on $(image) = $(offsets) ; + + # create empty image + BuildUBootFlashImage1 $(image) : $(haikuLoader) $(parts) ; } -actions BuildUBootFlashImage1 +actions BuildUBootFlashImage1 bind FLASH_OFFSETS { $(RM) $(<) @@ -94,24 +106,18 @@ actions BuildUBootFlashImage1 bs=$(FLASH_IMAGE_BLOCK_SIZE) \ count=$(FLASH_IMAGE_BLOCK_COUNT) - # add u-boot - dd of=$(<) \ - if=$(>[2]) \ - bs=$(FLASH_IMAGE_BLOCK_SIZE) \ - conv=notrunc - - # add root fs -# dd of=$(<) \ -# if=$(>[3]) \ -# bs=$(FLASH_IMAGE_BLOCK_SIZE) \ -# conv=notrunc \ -# seek=$(FLASH_IMAGE_ROOTFS_OFFSET) - - # add haiku_loader (raw, elf or uimage) - dd of=$(<) \ - if=$(>[1]) \ - bs=$(FLASH_IMAGE_BLOCK_SIZE) \ - conv=notrunc seek=$(FLASH_IMAGE_LOADER_OFFSET) + # add binaries + # ugly HACK + FLASH_OFFSETS=" $(FLASH_OFFSETS) " + FLASH_OFFSETS=${FLASH_OFFSETS# } + for b in $(>) ; do + s="${FLASH_OFFSETS%% *}" + FLASH_OFFSETS="${FLASH_OFFSETS#* }" + dd of=$(<) \ + if=$b \ + bs=$(FLASH_IMAGE_BLOCK_SIZE) \ + conv=notrunc seek=$s + done } # uImage @@ -195,7 +201,7 @@ actions BuildUBootSDImage1 $(RM) $(1).mtools $(RM) uEnv.txt # Add haiku bootstrap partition to MMC image - cat $(2[0]) >> $(1) + #cat $(2[0]) >> $(1) } # uimage targets @@ -225,26 +231,22 @@ if $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME) { } # flash image targets -# they currently depend on having an U-Boot binary available -if $(ubootFile) { BuildUBootFlashImage haiku-$(HAIKU_BOOT_BOARD)_flash_image_raw.img : haiku_loader : - $(ubootFile) ; + $(FLASH_IMAGE_PARTS) ; NotFile haiku-flash-image ; Depends haiku-flash-image : haiku-$(HAIKU_BOOT_BOARD)_flash_image_raw.img ; #BuildUBootFlashImage haiku-$(HAIKU_BOOT_BOARD)_flash_image_elf.img : boot_loader_u-boot : -# $(ubootFile) ; +# $(FLASH_IMAGE_PARTS) ; #NotFile haiku-flash-elf-image ; #Depends haiku-flash-elf-image : haiku-$(HAIKU_BOOT_BOARD)_flash_image_elf.img ; BuildUBootFlashImage haiku-$(HAIKU_BOOT_BOARD)_flash_image_uimage.img : haiku_loader.ub : - $(ubootFile) ; + $(FLASH_IMAGE_PARTS) ; NotFile haiku-flash-uimage ; Depends haiku-flash-uimage : haiku-$(HAIKU_BOOT_BOARD)_flash_image_uimage.img ; -} - # SD/mmc image targets BuildUBootSDImage haiku-$(HAIKU_BOOT_BOARD).mmc : $(HAIKU_IMAGE) $(HAIKU_BOARD_SDIMAGE_FILES) ; NotFile haiku-mmc-image ; ############################################################################ Commit: 10255f396b517ef8d9626a8c6e4c99592a08730c URL: http://cgit.haiku-os.org/haiku/commit/?id=10255f3 Author: François Revol <revol@xxxxxxx> Date: Sat Nov 1 04:37:32 2014 UTC ARM: verdex: keep notes about flash content ---------------------------------------------------------------------------- diff --git a/build/jam/board/verdex/BoardSetup b/build/jam/board/verdex/BoardSetup index fb95faf..bcfc2ed 100644 --- a/build/jam/board/verdex/BoardSetup +++ b/build/jam/board/verdex/BoardSetup @@ -29,6 +29,16 @@ HAIKU_BOARD_UBOOT_IMAGE ?= u-boot-verdex-400-r1604.bin ; HAIKU_BOARD_UBOOT_IMAGE_URL = http://www.gumstix.net/feeds/u-boot/u-boot-verdex-400-r1604.bin ; +# flash offsets: +# FLASH_IMAGE_BLOCK_SIZE on $(image) = 128k ; +# FLASH_IMAGE_BLOCK_COUNT on $(image) = 256 ; +# #FLASH_IMAGE_UBOOT_OFFSET on $(image) = 0 ; +# FLASH_IMAGE_LOADER_OFFSET on $(image) = 248 ; +# in kB +FLASH_IMAGE_LOADER_OFFSET = 31744 ; + +# TODO: add U-Boot +FLASH_IMAGE_PARTS = ; # # mmc/SD image ############################################################################ Commit: 8874b947cc88314d2b7fcd3ee725ddc27001a41b URL: http://cgit.haiku-os.org/haiku/commit/?id=8874b94 Author: François Revol <revol@xxxxxxx> Date: Sat Nov 1 04:38:44 2014 UTC ARM: overo: fix flash and SD content ---------------------------------------------------------------------------- diff --git a/build/jam/board/overo/BoardSetup b/build/jam/board/overo/BoardSetup index 7763c0e..180726b 100644 --- a/build/jam/board/overo/BoardSetup +++ b/build/jam/board/overo/BoardSetup @@ -24,6 +24,8 @@ HAIKU_BOARD_LOADER_UIBASE = 0x84000000 ; # Flash image # +# cf. http://gumstix.org/how-to/70-writing-images-to-flash.html + # OMAP x-loader image, must be first file in Flash image HAIKU_BOARD_MLO_IMAGE ?= MLO ; HAIKU_BOARD_MLO_IMAGE_URL = @@ -41,6 +43,18 @@ mloFile = [ DownloadFile $(HAIKU_BOARD_MLO_IMAGE) ubootFile = [ DownloadFile $(HAIKU_BOARD_UBOOT_IMAGE) : $(HAIKU_BOARD_UBOOT_IMAGE_URL) ] ; +FLASH_IMAGE_PARTS = + $(mloFile) + $(ubootFile) + ; + +# flash offsets: +# in kB +FLASH_IMAGE_LOADER_OFFSET = 31744 ; + +FLASH_OFFSET on $(mloFile) = 0 ; +FLASH_OFFSET on $(ubootFile) = 512 ; + # # mmc/SD image @@ -53,7 +67,7 @@ HAIKU_BOARD_SDIMAGE_SIZE = 256 ; HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ; # autoboot script -HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME = gumstix-factory.script ; +HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME = boot.scr ; HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT = "\ setenv bootargs debug_screen true; \ if mmcinit; then \ @@ -62,6 +76,8 @@ if mmcinit; then \ fi" ; HAIKU_BOARD_SDIMAGE_FILES = + $(mloFile) + $(ubootFile) haiku_loader haiku_loader.ub haiku_loader_nbsd.ub ############################################################################ Revision: hrev48193 Commit: c424d9e8331da73f7274064d499537898fda75d8 URL: http://cgit.haiku-os.org/haiku/commit/?id=c424d9e Author: François Revol <revol@xxxxxxx> Date: Sat Nov 1 04:42:47 2014 UTC ARM: overo: fix bootscript We actually now get our boot menu! ---------------------------------------------------------------------------- diff --git a/build/jam/board/overo/BoardSetup b/build/jam/board/overo/BoardSetup index 180726b..8706c2a 100644 --- a/build/jam/board/overo/BoardSetup +++ b/build/jam/board/overo/BoardSetup @@ -70,7 +70,7 @@ HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ; HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME = boot.scr ; HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT = "\ setenv bootargs debug_screen true; \ -if mmcinit; then \ +if mmc rescan; then \ fatload mmc 0 $(HAIKU_BOARD_LOADER_UIBASE) haiku_loader.ub; \ bootm $(HAIKU_BOARD_LOADER_UIBASE); \ fi" ;