From ac15f9dd1676a372dda7b47aadc7a6484f008894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 9 Aug 2009 16:40:17 +0000 Subject: [PATCH] [ARM] Add rule to handle uimage, and board-specific stuff to handle load addresses. Need to fix them, u-boot doesn't like loading the file with the header where the header says it should go, must copy to a different address. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32214 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/u-boot/Jamfile | 23 ++++++++++++++++--- src/system/boot/platform/u-boot/board/Jamfile | 6 +++++ .../boot/platform/u-boot/board/overo/Jamfile | 4 ++++ .../boot/platform/u-boot/board/verdex/Jamfile | 4 ++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 src/system/boot/platform/u-boot/board/Jamfile create mode 100644 src/system/boot/platform/u-boot/board/overo/Jamfile create mode 100644 src/system/boot/platform/u-boot/board/verdex/Jamfile diff --git a/src/system/boot/platform/u-boot/Jamfile b/src/system/boot/platform/u-boot/Jamfile index 435fe20bd9..7f4935c28b 100644 --- a/src/system/boot/platform/u-boot/Jamfile +++ b/src/system/boot/platform/u-boot/Jamfile @@ -36,6 +36,11 @@ KernelMergeObject boot_platform_u-boot.o : : -fno-pic ; +# include board-specific defs +SubInclude HAIKU_TOP src system boot platform $(TARGET_BOOT_PLATFORM) board ; +# reset SubDir +SubDir HAIKU_TOP src system boot platform u-boot ; + # bootable flash image rule BuildUBootFlashImage image : haikuLoader : uboot_image { Depends $(image) : $(haikuLoader) ; @@ -51,8 +56,6 @@ rule BuildUBootFlashImage image : haikuLoader : uboot_image { actions BuildUBootFlashImage1 { - echo "$(1)" - echo "$(2)" $(RM) $(<) # make an empty image dd if=/dev/zero of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) count=$(FLASH_IMAGE_BLOCK_COUNT) @@ -64,9 +67,23 @@ actions BuildUBootFlashImage1 { dd if=$(>[1]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc seek=$(FLASH_IMAGE_LOADER_OFFSET) } +# uImage +rule BuildUImage image : data : args { + Depends $(image) : $(data) ; + LocalClean clean : $(image) ; + MKIMAGE_ARGS on $(image) = $(args) ; + BuildUImage1 $(image) : $(data) ; +} + +actions BuildUImage1 { + mkimage $(MKIMAGE_ARGS) -d $(>) $(<) +} + +BuildUImage haiku_loader.ub : haiku_loader : "-A arm -O netbsd -T kernel -C none -a $(BOARD_UBOOT_LOADER_ADDRESS) -e $(BOARD_UBOOT_LOADER_ADDRESS) -n 'haiku_loader'" ; + BuildUBootFlashImage haiku_flash_image_raw.img : haiku_loader : $(UBOOT_IMAGE) ; #BuildUBootFlashImage haiku_flash_image_elf.img : boot_loader_u-boot : $(UBOOT_IMAGE) ; -#BuildUBootFlashImage haiku_flash_image_uimage.img : boot_loader_u-boot_uimage : $(UBOOT_IMAGE) ; +BuildUBootFlashImage haiku_flash_image_uimage.img : haiku_loader.ub : $(UBOOT_IMAGE) ; SEARCH on [ FGristFiles text_menu.cpp ] = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ; diff --git a/src/system/boot/platform/u-boot/board/Jamfile b/src/system/boot/platform/u-boot/board/Jamfile new file mode 100644 index 0000000000..369ca7c773 --- /dev/null +++ b/src/system/boot/platform/u-boot/board/Jamfile @@ -0,0 +1,6 @@ +SubDir HAIKU_TOP src system boot platform u-boot board ; + +if $(TARGET_BOOT_BOARD) { + SubInclude HAIKU_TOP src system boot platform $(TARGET_BOOT_PLATFORM) board $(TARGET_BOOT_BOARD) ; +} + diff --git a/src/system/boot/platform/u-boot/board/overo/Jamfile b/src/system/boot/platform/u-boot/board/overo/Jamfile new file mode 100644 index 0000000000..691ef688a7 --- /dev/null +++ b/src/system/boot/platform/u-boot/board/overo/Jamfile @@ -0,0 +1,4 @@ +SubDir HAIKU_TOP src system boot platform u-boot board $(TARGET_BOOT_BOARD) ; + +BOARD_UBOOT_LOADER_ADDRESS = 0x80008000 ; + diff --git a/src/system/boot/platform/u-boot/board/verdex/Jamfile b/src/system/boot/platform/u-boot/board/verdex/Jamfile new file mode 100644 index 0000000000..4147b2e6f7 --- /dev/null +++ b/src/system/boot/platform/u-boot/board/verdex/Jamfile @@ -0,0 +1,4 @@ +SubDir HAIKU_TOP src system boot platform u-boot board $(TARGET_BOOT_BOARD) ; + +BOARD_UBOOT_LOADER_ADDRESS = 0xa2000000 ; +