From 649b5b92509dba021ed47ef4c04f358de83ba36f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 14 Mar 2010 18:20:45 +0100 Subject: bootloaders: move bootloader build code to boot/ Signed-off-by: Thomas Petazzoni --- boot/at91dataflashboot/Config.in | 23 +++++++++++++++ boot/at91dataflashboot/at91dataflashboot.mk | 44 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 boot/at91dataflashboot/Config.in create mode 100644 boot/at91dataflashboot/at91dataflashboot.mk (limited to 'boot/at91dataflashboot') diff --git a/boot/at91dataflashboot/Config.in b/boot/at91dataflashboot/Config.in new file mode 100644 index 000000000..c6711c45d --- /dev/null +++ b/boot/at91dataflashboot/Config.in @@ -0,0 +1,23 @@ +menuconfig BR2_TARGET_DATAFLASHBOOT + depends on BR2_arm + bool "AT91 DataFlashBoot" + +choice + prompt "Target Architecture" + default BR2_TARGET_DATAFLASHBOOT_AT91RM9200 + depends on BR2_TARGET_DATAFLASHBOOT + help + Select Chip for which Dataflash boot should be built + Currently only AT91RM9200 Supported + +config BR2_TARGET_DATAFLASHBOOT_AT91RM9200 + depends on BR2_TARGET_AT91RM9200 + bool "AT91RM9200" +config BR2_TARGET_DATAFLASHBOOT_AT91SAM9261 + depends on BR2_TARGET_AT91SAM9261 + bool "AT91SAM9261" +config BR2_TARGET_DATAFLASHBOOT_AT91SAM9261S + depends on BR2_TARGET_AT91SAM9261S + bool "AT91SAM9261S" + +endchoice diff --git a/boot/at91dataflashboot/at91dataflashboot.mk b/boot/at91dataflashboot/at91dataflashboot.mk new file mode 100644 index 000000000..8939c2897 --- /dev/null +++ b/boot/at91dataflashboot/at91dataflashboot.mk @@ -0,0 +1,44 @@ +############################################################# +# +# DataFlashBoot +# +############################################################# +DATAFLASHBOOT_VERSION:=1.05 +DATAFLASHBOOT_NAME:=DataflashBoot-$(DATAFLASHBOOT_VERSION) +ATMEL_MIRROR:=$(call qstrip,$(BR2_ATMEL_MIRROR)) +DATAFLASHBOOT_SITE:=$(ATMEL_MIRROR) +DATAFLASHBOOT_SOURCE:=$(DATAFLASHBOOT_NAME).tar.bz2 +DATAFLASHBOOT_DIR:=$(BUILD_DIR)/$(DATAFLASHBOOT_NAME) +DATAFLASHBOOT_BINARY:=$(DATAFLASHBOOT_NAME).bin + +$(DL_DIR)/$(DATAFLASHBOOT_SOURCE): + $(call DOWNLOAD,$(DATAFLASHBOOT_SITE),$(DATAFLASHBOOT_SOURCE)) + +$(DATAFLASHBOOT_DIR)/.unpacked: $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) + mkdir -p $(BUILD_DIR) + ls $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) + $(BZCAT) $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(DATAFLASHBOOT_DIR)/.unpacked + +$(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY): $(DATAFLASHBOOT_DIR)/.unpacked + ls $(DATAFLASHBOOT_DIR)/.unpacked + make -C $(DATAFLASHBOOT_DIR) CROSS_COMPILE=$(TARGET_CROSS) + +DataflashBoot-clean: + make -C $(DATAFLASHBOOT_DIR) clean + +DataflashBoot-dirclean: + rm -rf $(DATAFLASHBOOT_DIR) + +dataflash: $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY) + $(call COPY_FILE, $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY), $(TARGET_ATMEL_COPYTO), $(BOARD_NAME)-$(DATAFLASHBOOT_BINARY)) + + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(BR2_TARGET_DATAFLASHBOOT),y) +TARGETS+=dataflash +endif -- cgit v1.2.3 From 5eaa0e7faea81f21c5d0c9fb8c3b8fd8a53386b0 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 14 Mar 2010 18:25:25 +0100 Subject: boot: remove references to COPYTO Signed-off-by: Thomas Petazzoni --- boot/at91bootstrap/at91bootstrap.mk | 6 ------ boot/at91dataflashboot/at91dataflashboot.mk | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'boot/at91dataflashboot') diff --git a/boot/at91bootstrap/at91bootstrap.mk b/boot/at91bootstrap/at91bootstrap.mk index 2072c6bf6..dc475e4f2 100644 --- a/boot/at91bootstrap/at91bootstrap.mk +++ b/boot/at91bootstrap/at91bootstrap.mk @@ -63,22 +63,16 @@ $(AT91BOOTSTRAP_DIR)/.installed:: $(AT91BOOTSTRAP_TARGET) mkdir -p $(BINARIES_DIR) ifeq ($(AT91BOOTSTRAP_VERSION),2.3) cp $(AT91BOOTSTRAP_TARGET) $(BINARIES_DIR)/$(AT91BOOTSTRAP_BINARY) - $(call COPY_FILE, $(AT91BOOTSTRAP_TARGET), $(BR2_TARGET_ATMEL_COPYTO), $(AT91BOOTSTRAP_BINARY)) else make MEMORY=$(AT91BOOTSTRAP_MEMORY) \ CROSS_COMPILE=$(TARGET_CROSS) \ -C $(AT91BOOTSTRAP_DIR) boot make DESTDIR=$(BINARIES_DIR) -C $(AT91BOOTSTRAP_DIR) install || \ echo "Could not copy bootstrap to BINARIES_DIR" -ifneq ($(BR2_TARGET_ATMEL_COPYTO),) - make DESTDIR=$(BR2_TARGET_ATMEL_COPYTO) -C $(AT91BOOTSTRAP_DIR) install || \ - echo "Could not copy bootstrap to BR2_ATMEL_COPYTO" -endif endif touch $@ # cp $(AT91BOOTSTRAP_TARGET) $(BINARIES_DIR)/$(AT91BOOTSTRAP_BINARY) -# cp $(AT91BOOTSTRAP_TARGET) $(BR2_TARGET_ATMEL_COPYTO)/$(AT91BOOTSTRAP_BINARY) .PHONY: at91bootstrap at91bootstrap-source diff --git a/boot/at91dataflashboot/at91dataflashboot.mk b/boot/at91dataflashboot/at91dataflashboot.mk index 8939c2897..519328c6c 100644 --- a/boot/at91dataflashboot/at91dataflashboot.mk +++ b/boot/at91dataflashboot/at91dataflashboot.mk @@ -31,8 +31,7 @@ DataflashBoot-dirclean: rm -rf $(DATAFLASHBOOT_DIR) dataflash: $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY) - $(call COPY_FILE, $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY), $(TARGET_ATMEL_COPYTO), $(BOARD_NAME)-$(DATAFLASHBOOT_BINARY)) - + cp $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY) $(BINARIES_DIR) ############################################################# # -- cgit v1.2.3 From 21aa87d6c67571afafe0812d619b3389f049279e Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 17 Mar 2010 08:52:41 +0100 Subject: at91dataflashboot: fix configuration options Signed-off-by: Thomas Petazzoni --- boot/at91dataflashboot/Config.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'boot/at91dataflashboot') diff --git a/boot/at91dataflashboot/Config.in b/boot/at91dataflashboot/Config.in index c6711c45d..25b9723c8 100644 --- a/boot/at91dataflashboot/Config.in +++ b/boot/at91dataflashboot/Config.in @@ -2,22 +2,24 @@ menuconfig BR2_TARGET_DATAFLASHBOOT depends on BR2_arm bool "AT91 DataFlashBoot" +if BR2_TARGET_DATAFLASHBOOT + choice prompt "Target Architecture" default BR2_TARGET_DATAFLASHBOOT_AT91RM9200 - depends on BR2_TARGET_DATAFLASHBOOT help Select Chip for which Dataflash boot should be built Currently only AT91RM9200 Supported config BR2_TARGET_DATAFLASHBOOT_AT91RM9200 - depends on BR2_TARGET_AT91RM9200 bool "AT91RM9200" + config BR2_TARGET_DATAFLASHBOOT_AT91SAM9261 - depends on BR2_TARGET_AT91SAM9261 bool "AT91SAM9261" + config BR2_TARGET_DATAFLASHBOOT_AT91SAM9261S - depends on BR2_TARGET_AT91SAM9261S bool "AT91SAM9261S" endchoice + +endif # BR2_TARGET_DATAFLASHBOOT -- cgit v1.2.3 From a4c1f0635036f3fed16c1290281bfdc6f2c9ccb8 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 17 Mar 2010 08:57:54 +0100 Subject: at91dataflashboot: various fixes Fix the URL, fix the directory to which it gets unpacked, fix make target names to be lower-case only. Signed-off-by: Thomas Petazzoni --- boot/at91dataflashboot/at91dataflashboot.mk | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'boot/at91dataflashboot') diff --git a/boot/at91dataflashboot/at91dataflashboot.mk b/boot/at91dataflashboot/at91dataflashboot.mk index 519328c6c..dcbe1ef03 100644 --- a/boot/at91dataflashboot/at91dataflashboot.mk +++ b/boot/at91dataflashboot/at91dataflashboot.mk @@ -5,29 +5,27 @@ ############################################################# DATAFLASHBOOT_VERSION:=1.05 DATAFLASHBOOT_NAME:=DataflashBoot-$(DATAFLASHBOOT_VERSION) -ATMEL_MIRROR:=$(call qstrip,$(BR2_ATMEL_MIRROR)) -DATAFLASHBOOT_SITE:=$(ATMEL_MIRROR) +DATAFLASHBOOT_SITE:=ftp://www.at91.com/pub/buildroot/ DATAFLASHBOOT_SOURCE:=$(DATAFLASHBOOT_NAME).tar.bz2 -DATAFLASHBOOT_DIR:=$(BUILD_DIR)/$(DATAFLASHBOOT_NAME) +DATAFLASHBOOT_DIR:=$(BUILD_DIR)/at91dataflashboot-$(DATAFLASHBOOT_VERSION) DATAFLASHBOOT_BINARY:=$(DATAFLASHBOOT_NAME).bin $(DL_DIR)/$(DATAFLASHBOOT_SOURCE): $(call DOWNLOAD,$(DATAFLASHBOOT_SITE),$(DATAFLASHBOOT_SOURCE)) $(DATAFLASHBOOT_DIR)/.unpacked: $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) - mkdir -p $(BUILD_DIR) - ls $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) - $(BZCAT) $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + mkdir -p $(@D) + $(BZCAT) $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - touch $(DATAFLASHBOOT_DIR)/.unpacked $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY): $(DATAFLASHBOOT_DIR)/.unpacked ls $(DATAFLASHBOOT_DIR)/.unpacked make -C $(DATAFLASHBOOT_DIR) CROSS_COMPILE=$(TARGET_CROSS) -DataflashBoot-clean: +dataflashboot-clean: make -C $(DATAFLASHBOOT_DIR) clean -DataflashBoot-dirclean: +dataflashboot-dirclean: rm -rf $(DATAFLASHBOOT_DIR) dataflash: $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY) -- cgit v1.2.3 From 470888bede7d604c870a6d47c6f41fa53a47a5d3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 17 Mar 2010 09:15:26 +0100 Subject: at91dataflashboot: add a patch step Signed-off-by: Thomas Petazzoni --- boot/at91dataflashboot/at91dataflashboot.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'boot/at91dataflashboot') diff --git a/boot/at91dataflashboot/at91dataflashboot.mk b/boot/at91dataflashboot/at91dataflashboot.mk index dcbe1ef03..d11f842d8 100644 --- a/boot/at91dataflashboot/at91dataflashboot.mk +++ b/boot/at91dataflashboot/at91dataflashboot.mk @@ -18,7 +18,11 @@ $(DATAFLASHBOOT_DIR)/.unpacked: $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) $(BZCAT) $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - touch $(DATAFLASHBOOT_DIR)/.unpacked -$(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY): $(DATAFLASHBOOT_DIR)/.unpacked +$(DATAFLASHBOOT_DIR)/.patched: $(DATAFLASHBOOT_DIR)/.unpacked + toolchain/patch-kernel.sh $(@D) boot/at91dataflashboot \ + at91dataflashboot-$(DATAFLASHBOOT_VERSION)-\*.patch + +$(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY): $(DATAFLASHBOOT_DIR)/.patched ls $(DATAFLASHBOOT_DIR)/.unpacked make -C $(DATAFLASHBOOT_DIR) CROSS_COMPILE=$(TARGET_CROSS) -- cgit v1.2.3 From ef81363d69b7293e3c8088a0939d34a10845e675 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 17 Mar 2010 09:15:42 +0100 Subject: at91dataflashboot: add two patches The first patch allows to build with an EABI toolchain. The second patch disables the install step of at91dataflashboot Makefile since it tries to copy files to /tftpboot. Signed-off-by: Thomas Petazzoni --- .../at91dataflashboot-1.05-do-not-install.patch | 22 +++++++++++ .../at91dataflashboot-1.05-eabi-fixes.patch | 43 ++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 boot/at91dataflashboot/at91dataflashboot-1.05-do-not-install.patch create mode 100644 boot/at91dataflashboot/at91dataflashboot-1.05-eabi-fixes.patch (limited to 'boot/at91dataflashboot') diff --git a/boot/at91dataflashboot/at91dataflashboot-1.05-do-not-install.patch b/boot/at91dataflashboot/at91dataflashboot-1.05-do-not-install.patch new file mode 100644 index 000000000..41d97ad20 --- /dev/null +++ b/boot/at91dataflashboot/at91dataflashboot-1.05-do-not-install.patch @@ -0,0 +1,22 @@ +Disable the automatic installation of at91dataflashboot since it tries +to install things to /tftpboot, which is not possible when not +building as root. + +Signed-off-by: Thomas Petazzoni +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: at91dataflashboot-1.05/Makefile +=================================================================== +--- at91dataflashboot-1.05.orig/Makefile ++++ at91dataflashboot-1.05/Makefile +@@ -40,7 +40,7 @@ + + I=config.h com.h dataflash.h embedded_services.h main.h stdio.h include/AT91RM9200.h include/lib_AT91RM9200.h + +-all: clean $(BINNAME) $(LSSNAME) install ++all: clean $(BINNAME) $(LSSNAME) + $(SIZE) $(OUTNAME) + + # C objects here diff --git a/boot/at91dataflashboot/at91dataflashboot-1.05-eabi-fixes.patch b/boot/at91dataflashboot/at91dataflashboot-1.05-eabi-fixes.patch new file mode 100644 index 000000000..e38905f7c --- /dev/null +++ b/boot/at91dataflashboot/at91dataflashboot-1.05-eabi-fixes.patch @@ -0,0 +1,43 @@ +Get at91dataflashboot to build with EABI toolchains, by providing the +__aeabi_uidiv and __aeabi_uidivmod symbols. The code is based on +U-Boot's code. + +Signed-off-by: Thomas Petazzoni +--- + _udivsi3.S | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +Index: DataflashBoot-1.05/_udivsi3.S +=================================================================== +--- DataflashBoot-1.05.orig/_udivsi3.S ++++ DataflashBoot-1.05/_udivsi3.S +@@ -12,8 +12,11 @@ + .text + .globl __udivsi3 + .type __udivsi3 ,function ++ .globl __aeabi_uidiv ++ .type __aeabi_uidiv ,function + .align 0 + __udivsi3 : ++ __aeabi_uidiv: + cmp divisor, #0 + beq Ldiv0 + mov curbit, #1 +@@ -68,6 +71,17 @@ + mov r0, #0 @ about as wrong as it could be + ldmia sp!, {pc} + .size __udivsi3 , . - __udivsi3 ++ ++.globl __aeabi_uidivmod ++__aeabi_uidivmod: ++ ++ stmfd sp!, {r0, r1, ip, lr} ++ bl __aeabi_uidiv ++ ldmfd sp!, {r1, r2, ip, lr} ++ mul r3, r0, r2 ++ sub r1, r1, r3 ++ mov pc, lr ++ + /* # 235 "libgcc1.S" */ + /* # 320 "libgcc1.S" */ + /* # 421 "libgcc1.S" */ -- cgit v1.2.3