From f7995aa066b4d231c72e2ead0de4c7b58922e0d2 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 14 Mar 2010 18:28:46 +0100 Subject: u-boot: rename Makefile.in to u-boot.mk for coherency Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 293 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 293 insertions(+) create mode 100644 boot/u-boot/u-boot.mk (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk new file mode 100644 index 000000000..a875f2b5e --- /dev/null +++ b/boot/u-boot/u-boot.mk @@ -0,0 +1,293 @@ +############################################################# +# +# U-Boot +# +############################################################# +U_BOOT_VERSION:=$(call qstrip,$(BR2_UBOOT_VERSION)) + +U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2 + +U_BOOT_SITE:=$(call qstrip,$(BR2_U_BOOT_SITE)) +U_BOOT_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION) +U_BOOT_PATCH_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION)-patches +U_BOOT_CAT:=$(BZCAT) +U_BOOT_BIN:=u-boot.bin +U_BOOT_TARGET_BIN:=u-boot-$(U_BOOT_VERSION)-$(DATE).bin + +U_BOOT_TOOLS:=$(HOST_DIR)/usr/bin/mkimage +MKIMAGE:=$(U_BOOT_TOOLS) +U_BOOT_AUTOSCRIPT=$(BINARIES_DIR)/autoscript + +U_BOOT_TARGETS:=$(BINARIES_DIR)/$(U_BOOT_BIN) $(U_BOOT_TOOLS) + +ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_DEFAULT_ENV)),y) +U_BOOT_TARGETS += u-boot-autoscript +endif + +TARGET_UBOOT_IPADDR:=$(call qstrip,$(BR2_TARGET_UBOOT_IPADDR)) +TARGET_UBOOT_SERVERIP:=$(call qstrip,$(BR2_TARGET_UBOOT_SERVERIP)) +TARGET_UBOOT_GATEWAY:=$(call qstrip,$(BR2_TARGET_UBOOT_GATEWAY)) +TARGET_UBOOT_NETMASK:=$(call qstrip,$(BR2_TARGET_UBOOT_NETMASK)) +TARGET_UBOOT_ETHADDR:=$(call qstrip,$(BR2_TARGET_UBOOT_ETHADDR)) + +# u-boot still uses arch=ppc for powerpc +U_BOOT_ARCH=$(KERNEL_ARCH:powerpc=ppc) +ifeq ($(UBOOT_BOARD_NAME),) +UBOOT_BOARD_NAME:=$(call qstrip,$(BR2_TARGET_UBOOT_BOARDNAME)) +endif + +U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/config.h + +U_BOOT_TARGET_TOOLS:= +ifeq ($(BR2_TARGET_UBOOT_TOOL_MKIMAGE),y) +U_BOOT_TARGETS+=$(TARGET_DIR)/usr/bin/mkimage +endif +ifeq ($(BR2_TARGET_UBOOT_TOOL_ENV),y) +U_BOOT_TARGETS+=$(TARGET_DIR)/usr/sbin/fw_printenv +endif + +U_BOOT_CONFIGURE_OPTS := + +ifneq ($(BR2_TARGET_UBOOT_1_2_0_ATMEL),) +U_BOOT_CONFIGURE_OPTS += CONFIG_NOSOFTFLOAT=1 +endif + +# Define a helper function +define insert_define +@echo "#ifdef $(strip $(1))" >> $(U_BOOT_INC_CONF_FILE) +@echo "#undef $(strip $(1))" >> $(U_BOOT_INC_CONF_FILE) +@echo "#endif" >> $(U_BOOT_INC_CONF_FILE) +@echo '#define $(strip $(1)) $(call qstrip,$(2))' >> $(U_BOOT_INC_CONF_FILE) +endef + +$(DL_DIR)/$(U_BOOT_SOURCE): + $(call DOWNLOAD,$(U_BOOT_SITE),$(U_BOOT_SOURCE)) + +$(U_BOOT_DIR)/.unpacked: $(DL_DIR)/$(U_BOOT_SOURCE) + $(U_BOOT_CAT) $(DL_DIR)/$(U_BOOT_SOURCE) \ + | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + mkdir -p $(U_BOOT_DIR) + touch $@ + +$(U_BOOT_DIR)/.patched: $(U_BOOT_DIR)/.unpacked + toolchain/patch-kernel.sh $(U_BOOT_DIR) boot/u-boot \ + u-boot-$(U_BOOT_VERSION)-\*.patch \ + u-boot-$(U_BOOT_VERSION)-\*.patch.$(ARCH) +ifneq ($(strip $(U_BOOT_ARCH_PATCH_DIR)),) + toolchain/patch-kernel.sh $(U_BOOT_DIR) $(U_BOOT_ARCH_PATCH_DIR) \*.patch +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_CUSTOM_PATCH)),"") + @mkdir -p $(U_BOOT_PATCH_DIR) + cp -dpr $(BR2_TARGET_UBOOT_CUSTOM_PATCH) $(U_BOOT_PATCH_DIR) + toolchain/patch-kernel.sh $(U_BOOT_DIR) $(U_BOOT_PATCH_DIR) \*.patch +endif + touch $@ + +$(U_BOOT_DIR)/.configured: $(U_BOOT_DIR)/.patched + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(U_BOOT_CONFIGURE_OPTS) \ + $(MAKE) -C $(U_BOOT_DIR) \ + $(UBOOT_BOARD_NAME)_config + touch $@ + +$(U_BOOT_DIR)/.header_modified: $(U_BOOT_DIR)/.configured + # Modify configuration header in $(U_BOOT_INC_CONF_FILE) +ifdef BR2_TARGET_UBOOT_DEFAULT_ENV + @echo >> $(U_BOOT_INC_CONF_FILE) + @echo "/* Add a wrapper around the values Buildroot sets. */" >> $(U_BOOT_INC_CONF_FILE) + @echo "#ifndef __BR2_ADDED_CONFIG_H" >> $(U_BOOT_INC_CONF_FILE) + @echo "#define __BR2_ADDED_CONFIG_H" >> $(U_BOOT_INC_CONF_FILE) + $(call insert_define, DATE, $(DATE)) + $(call insert_define, CONFIG_LOAD_SCRIPTS, 1) +endif # BR2_TARGET_UBOOT_DEFAULT_ENV +ifdef BR2_TARGET_UBOOT_NETWORK +ifneq ($(strip $(BR2_TARGET_UBOOT_IPADDR)),"") + $(call insert_define, CONFIG_IPADDR, $(BR2_TARGET_UBOOT_IPADDR)) +ifneq ($(strip $(BR2_TARGET_UBOOT_GATEWAY)),"") + $(call insert_define, CONFIG_GATEWAYIP, $(BR2_TARGET_UBOOT_GATEWAY)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_NETMASK)),"") + $(call insert_define, CONFIG_NETMASK, $(BR2_TARGET_UBOOT_NETMASK)) +endif +endif # end BR2_TARGET_U_BOOT_IPADDR +ifneq ($(strip $(BR2_TARGET_UBOOT_SERVERIP)),"") + $(call insert_define, CONFIG_SERVERIP, $(BR2_TARGET_UBOOT_SERVERIP)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_ETHADDR)),"") + $(call insert_define, CONFIG_ETHADDR, $(BR2_TARGET_UBOOT_ETHADDR)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_ETH1ADDR)),) +ifneq ($(strip $(BR2_TARGET_UBOOT_ETH1ADDR)),"") + $(call insert_define, CONFIG_ETH1ADDR, $(BR2_TARGET_UBOOT_ETH1ADDR)) +endif +endif +endif # BR2_TARGET_UBOOT_NETWORK +ifeq ($(BR2_TARGET_UBOOT_SILENT),y) + $(call insert_define, CONFIG_SILENT_CONSOLE,) +endif +ifdef BR2_TARGET_UBOOT_DEFAULT_ENV +ifneq ($(strip $(BR2_TARGET_UBOOT_KERNEL_START)),"") + $(call insert_define, KERNEL_START, $(BR2_TARGET_UBOOT_KERNEL_START)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_KERNEL_LOCATION)),"") + $(call insert_define, KERNEL_LOCATION, $(BR2_TARGET_UBOOT_KERNEL_LOCATION)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_FILESYSTEM_START)),"") + $(call insert_define, FILESYSTEM_START, $(BR2_TARGET_UBOOT_FILESYSTEM_START)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_FILESYSTEM_LOCATION)),"") + $(call insert_define, FILESYSTEM_LOCATION, $(BR2_TARGET_UBOOT_FILESYSTEM_LOCATION)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_FILESYSTEM_SIZE)),"") + $(call insert_define, FILESYSTEM_SIZE, $(BR2_TARGET_UBOOT_FILESYSTEM_SIZE)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_END_OF_FLASH)),"") + $(call insert_define, END_OF_FLASH, $(BR2_TARGET_UBOOT_END_OF_FLASH)) +endif +ifneq ($(strip $(BR2_TARGET_UBOOT_MEMORY_SIZE)),"") + $(call insert_define, MEMORY_SIZE, $(BR2_TARGET_UBOOT_MEMORY_SIZE)) +endif + @echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(U_BOOT_INC_CONF_FILE) +endif # BR2_TARGET_UBOOT_DEFAULT_ENV + touch $@ + +$(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(U_BOOT_CONFIGURE_OPTS) \ + $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(U_BOOT_ARCH) \ + -C $(U_BOOT_DIR) + +$(BINARIES_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/$(U_BOOT_BIN) + rm -f $(BINARIES_DIR)/$(U_BOOT_BIN) + rm -f $(BINARIES_DIR)/$(U_BOOT_TARGET_BIN) + cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)/$(U_BOOT_TARGET_BIN) + (cd $(BINARIES_DIR); ln -s $(U_BOOT_TARGET_BIN) $(U_BOOT_BIN)) + +$(U_BOOT_TOOLS): $(U_BOOT_DIR)/$(U_BOOT_BIN) + mkdir -p $(@D) + cp -dpf $(U_BOOT_DIR)/tools/mkimage $@ + +$(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/$(U_BOOT_BIN) + mkdir -p $(@D) + $(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(U_BOOT_DIR)/tools \ + -DUSE_HOSTCC -o $@ \ + $(U_BOOT_DIR)/common/image.c \ + $(wildcard $(addprefix $(U_BOOT_DIR)/tools/,default_image.c \ + fit_image.c imximage.c kwbimage.c mkimage.c)) \ + $(addprefix $(U_BOOT_DIR)/lib_generic/,crc32.c md5.c sha1.c) \ + $(U_BOOT_DIR)/tools/os_support.c \ + $(U_BOOT_DIR)/libfdt/fdt*.c + + $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@ + +$(TARGET_DIR)/usr/sbin/fw_printenv: $(U_BOOT_DIR)/$(U_BOOT_BIN) + mkdir -p $(@D) + $(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(LINUX_HEADERS_DIR)/include \ + -DUSE_HOSTCC -o $@ \ + $(U_BOOT_DIR)/tools/env/*.c $(U_BOOT_DIR)/lib_generic/crc32.c + $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@ + ln -sf fw_printenv $(TARGET_DIR)/usr/sbin/fw_setenv + +u-boot: $(U_BOOT_TARGETS) + +u-boot-autoscript: $(U_BOOT_AUTOSCRIPT).img + +u-boot-clean: + -$(MAKE) -C $(U_BOOT_DIR) clean + rm -f $(U_BOOT_TOOLS) $(U_BOOT_TARGET_TOOLS) + +u-boot-dirclean: + rm -rf $(U_BOOT_DIR) + +u-boot-source: $(DL_DIR)/$(U_BOOT_SOURCE) + +u-boot-unpacked: $(U_BOOT_DIR)/.patched + +u-boot-configured: $(U_BOOT_DIR)/.header_modified + +############################################################# +# +# Generate an autoscript with the configration items +# +############################################################# + +$(U_BOOT_AUTOSCRIPT): .config + rm -f $(U_BOOT_AUTOSCRIPT) +ifneq ($(TARGET_UBOOT_IPADDR),) + echo setenv ipaddr $(TARGET_UBOOT_IPADDR) > $(U_BOOT_AUTOSCRIPT) +else + echo TARGET_UBOOT_IPADDR="$(TARGET_UBOOT_IPADDR)" +endif +ifneq ($(TARGET_UBOOT_SERVERIP),) + echo setenv serverip $(TARGET_UBOOT_SERVERIP) >> $(U_BOOT_AUTOSCRIPT) +endif +ifneq ($(TARGET_UBOOT_GATEWAY),) + echo setenv gatewayip $(TARGET_UBOOT_GATEWAY) >> $(U_BOOT_AUTOSCRIPT) +endif +ifneq ($(TARGET_UBOOT_NETMASK),) + echo setenv netmask $(TARGET_UBOOT_NETMASK) >> $(U_BOOT_AUTOSCRIPT) +endif + echo setenv linux $(LINUX26_KERNEL_NAME) >> $(U_BOOT_AUTOSCRIPT) + echo setenv kernel-version $(LINUX26_VERSION) >> $(U_BOOT_AUTOSCRIPT) + echo setenv kernel-date $(DATE) >> $(U_BOOT_AUTOSCRIPT) + echo setenv hostname $(TARGET_HOSTNAME) >> $(U_BOOT_AUTOSCRIPT) + echo setenv fs-date $(DATE) >> $(U_BOOT_AUTOSCRIPT) + echo setenv rd-1 rootfs.$(ARCH)-$(DATE).ext2 >> $(U_BOOT_AUTOSCRIPT) + echo setenv rd-2 rootfs.$(ARCH)-$(DATE).jffs2 >> $(U_BOOT_AUTOSCRIPT) + echo setenv rd rootfs.$(BR2_ARCH)-$(DATE).ext2 >> $(U_BOOT_AUTOSCRIPT) + echo setenv ver 1 >> $(U_BOOT_AUTOSCRIPT) +ifneq ($(TARGET_UBOOT_ETHADDR),) + echo setenv ethaddr $(TARGET_UBOOT_ETHADDR) >> $(U_BOOT_AUTOSCRIPT) +endif + echo setenv fstype ram >> $(U_BOOT_AUTOSCRIPT) + echo fs >> $(U_BOOT_AUTOSCRIPT) + echo os >> $(U_BOOT_AUTOSCRIPT) + echo setargs >> $(U_BOOT_AUTOSCRIPT) + echo saveenv >> $(U_BOOT_AUTOSCRIPT) + +$(U_BOOT_AUTOSCRIPT).img: $(U_BOOT_AUTOSCRIPT) $(MKIMAGE) + $(MKIMAGE) -A $(ARCH) \ + -O linux \ + -T script \ + -C none \ + -a 0 \ + -e 0 \ + -n "autoscr config" \ + -d $(U_BOOT_AUTOSCRIPT) \ + $(U_BOOT_AUTOSCRIPT).img + + + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(BR2_TARGET_UBOOT),y) +TARGETS+=u-boot + +# we NEED a board name +ifeq ($(UBOOT_BOARD_NAME),) +$(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting) +endif + +endif + +u-boot-status: + @echo + @echo U_BOOT_INC_CONF_FILE = $(U_BOOT_INC_CONF_FILE) + @echo BR2_UBOOT_VERSION = $(BR2_UBOOT_VERSION) + @echo BR2_TARGET_UBOOT_SERVERIP = $(BR2_TARGET_UBOOT_SERVERIP) + @echo BR2_TARGET_UBOOT_IPADDR = $(BR2_TARGET_UBOOT_IPADDR) + @echo BR2_TARGET_UBOOT_GATEWAY = $(BR2_TARGET_UBOOT_GATEWAY) + @echo BR2_TARGET_UBOOT_NETMASK = $(BR2_TARGET_UBOOT_NETMASK) + @echo BR2_TARGET_UBOOT_ETH0ADDR = $(BR2_TARGET_UBOOT_ETHADDR) + @echo BR2_TARGET_UBOOT_ETH1ADDR = $(BR2_TARGET_UBOOT_ETH1ADDR) + @echo BR2_TARGET_UBOOT_SILENT = $(BR2_TARGET_UBOOT_SILENT) + @echo UBOOT_BOARD_NAME=$(UBOOT_BOARD_NAME) + @exit 0 + -- cgit v1.2.3 From dac82dbe7a98caf71e754bcc26d83b48475f677a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 14 Mar 2010 18:31:59 +0100 Subject: u-boot: remove option to configure download site Signed-off-by: Thomas Petazzoni --- boot/u-boot/Config.in | 4 ---- boot/u-boot/u-boot.mk | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/Config.in b/boot/u-boot/Config.in index 49d66c48d..3f4110ad7 100644 --- a/boot/u-boot/Config.in +++ b/boot/u-boot/Config.in @@ -33,10 +33,6 @@ config BR2_UBOOT_VERSION default "2009.11" if BR2_TARGET_UBOOT_2009_11 default "2009.08" if BR2_TARGET_UBOOT_2009_08 -config BR2_U_BOOT_SITE - string - default "ftp://ftp.denx.de/pub/u-boot" - source "target/device/Config.in.u-boot" config BR2_TARGET_UBOOT_CUSTOM_PATCH diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index a875f2b5e..7e98ca83e 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -7,7 +7,7 @@ U_BOOT_VERSION:=$(call qstrip,$(BR2_UBOOT_VERSION)) U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2 -U_BOOT_SITE:=$(call qstrip,$(BR2_U_BOOT_SITE)) +U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot U_BOOT_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION) U_BOOT_PATCH_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION)-patches U_BOOT_CAT:=$(BZCAT) -- cgit v1.2.3 From 86074e71b6a0933afcd88b0ccdd3d7cccd2779fd Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 14 Mar 2010 18:39:31 +0100 Subject: u-boot: remove u-boot-status make target Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index 7e98ca83e..466d4a003 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -276,18 +276,3 @@ $(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting) endif endif - -u-boot-status: - @echo - @echo U_BOOT_INC_CONF_FILE = $(U_BOOT_INC_CONF_FILE) - @echo BR2_UBOOT_VERSION = $(BR2_UBOOT_VERSION) - @echo BR2_TARGET_UBOOT_SERVERIP = $(BR2_TARGET_UBOOT_SERVERIP) - @echo BR2_TARGET_UBOOT_IPADDR = $(BR2_TARGET_UBOOT_IPADDR) - @echo BR2_TARGET_UBOOT_GATEWAY = $(BR2_TARGET_UBOOT_GATEWAY) - @echo BR2_TARGET_UBOOT_NETMASK = $(BR2_TARGET_UBOOT_NETMASK) - @echo BR2_TARGET_UBOOT_ETH0ADDR = $(BR2_TARGET_UBOOT_ETHADDR) - @echo BR2_TARGET_UBOOT_ETH1ADDR = $(BR2_TARGET_UBOOT_ETH1ADDR) - @echo BR2_TARGET_UBOOT_SILENT = $(BR2_TARGET_UBOOT_SILENT) - @echo UBOOT_BOARD_NAME=$(UBOOT_BOARD_NAME) - @exit 0 - -- cgit v1.2.3 From b116aff43428adbede513850902a397fa58d0a3c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 14 Mar 2010 18:40:50 +0100 Subject: u-boot: remove reference to old 1.2.0-atmel version Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 4 ---- 1 file changed, 4 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index 466d4a003..4edef12f4 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -46,11 +46,7 @@ ifeq ($(BR2_TARGET_UBOOT_TOOL_ENV),y) U_BOOT_TARGETS+=$(TARGET_DIR)/usr/sbin/fw_printenv endif -U_BOOT_CONFIGURE_OPTS := - -ifneq ($(BR2_TARGET_UBOOT_1_2_0_ATMEL),) U_BOOT_CONFIGURE_OPTS += CONFIG_NOSOFTFLOAT=1 -endif # Define a helper function define insert_define -- cgit v1.2.3 From bbd247b7c0808b0a9783bb27688b47a4ac741ead Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 15 Mar 2010 23:25:53 +0100 Subject: u-boot: simplify custom patch handling Signed-off-by: Thomas Petazzoni --- boot/u-boot/Config.in | 9 ++++++--- boot/u-boot/u-boot.mk | 10 ++-------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/Config.in b/boot/u-boot/Config.in index 4c76d57b9..78a195d25 100644 --- a/boot/u-boot/Config.in +++ b/boot/u-boot/Config.in @@ -33,10 +33,13 @@ config BR2_UBOOT_VERSION default "2009.11" if BR2_TARGET_UBOOT_2009_11 default "2009.08" if BR2_TARGET_UBOOT_2009_08 -config BR2_TARGET_UBOOT_CUSTOM_PATCH - string "custom patch" +config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR + string "custom patch dir" help - If your board requires a custom patch, add the path to the file here. + If your board requires custom patches, add the path to the + directory containing the patches here. The patches must be + named u-boot--.patch. + Most users may leave this empty choice diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index 4edef12f4..efde3ea99 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -9,7 +9,6 @@ U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2 U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot U_BOOT_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION) -U_BOOT_PATCH_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION)-patches U_BOOT_CAT:=$(BZCAT) U_BOOT_BIN:=u-boot.bin U_BOOT_TARGET_BIN:=u-boot-$(U_BOOT_VERSION)-$(DATE).bin @@ -69,13 +68,8 @@ $(U_BOOT_DIR)/.patched: $(U_BOOT_DIR)/.unpacked toolchain/patch-kernel.sh $(U_BOOT_DIR) boot/u-boot \ u-boot-$(U_BOOT_VERSION)-\*.patch \ u-boot-$(U_BOOT_VERSION)-\*.patch.$(ARCH) -ifneq ($(strip $(U_BOOT_ARCH_PATCH_DIR)),) - toolchain/patch-kernel.sh $(U_BOOT_DIR) $(U_BOOT_ARCH_PATCH_DIR) \*.patch -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_CUSTOM_PATCH)),"") - @mkdir -p $(U_BOOT_PATCH_DIR) - cp -dpr $(BR2_TARGET_UBOOT_CUSTOM_PATCH) $(U_BOOT_PATCH_DIR) - toolchain/patch-kernel.sh $(U_BOOT_DIR) $(U_BOOT_PATCH_DIR) \*.patch +ifneq ($(qstrip $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),) + toolchain/patch-kernel.sh $(U_BOOT_DIR) $(U_BOOT_CUSTOM_PATCH_DIR) u-boot-$(U_BOOT_VERSION)-\*.patch endif touch $@ -- cgit v1.2.3 From dc63ef95f39302195b7430b6be00d250cc5c9aea Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 15 Mar 2010 23:47:45 +0100 Subject: u-boot: remove useless symbolic link Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index efde3ea99..ac16c8bf4 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -11,7 +11,6 @@ U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot U_BOOT_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION) U_BOOT_CAT:=$(BZCAT) U_BOOT_BIN:=u-boot.bin -U_BOOT_TARGET_BIN:=u-boot-$(U_BOOT_VERSION)-$(DATE).bin U_BOOT_TOOLS:=$(HOST_DIR)/usr/bin/mkimage MKIMAGE:=$(U_BOOT_TOOLS) @@ -153,9 +152,7 @@ $(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified $(BINARIES_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/$(U_BOOT_BIN) rm -f $(BINARIES_DIR)/$(U_BOOT_BIN) - rm -f $(BINARIES_DIR)/$(U_BOOT_TARGET_BIN) - cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)/$(U_BOOT_TARGET_BIN) - (cd $(BINARIES_DIR); ln -s $(U_BOOT_TARGET_BIN) $(U_BOOT_BIN)) + cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)/ $(U_BOOT_TOOLS): $(U_BOOT_DIR)/$(U_BOOT_BIN) mkdir -p $(@D) -- cgit v1.2.3 From f2d16ae0e17370131e64438cd50d5a6c7ab0ea8d Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 4 Apr 2010 17:11:33 +0200 Subject: u-boot: support building for mkimage To build mkimage for the host (which is needed to build an uImage of the kernel), it is not necessary to configure U-Boot, and therefore to have a particular board selected. Therefore, this commit: * Adds a verification at U-Boot configure step that a U-Boot board name has been defined * Sets a default U-Boot version if none has been specified, so that even when U-Boot isn't selected but we want to build mkimage for the host, a particular U-Boot version is picked. * Make the host mkimage target depend only on U-Boot being downloaded/extracted/patched, and the target mkimage/fw_printenv targets depend on U-Boot being fully configured. Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index ac16c8bf4..00724bae6 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -4,6 +4,15 @@ # ############################################################# U_BOOT_VERSION:=$(call qstrip,$(BR2_UBOOT_VERSION)) +U_BOOT_BOARD_NAME:=$(call qstrip,$(BR2_TARGET_UBOOT_BOARDNAME)) + +# U-Boot may not be selected in the configuration, but mkimage might +# be needed to build/prepare a kernel image. In this case, we just +# pick some random stable U-Boot version that will be used just to +# build mkimage. +ifeq ($(U_BOOT_VERSION),) +U_BOOT_VERSION=2010.03 +endif U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2 @@ -30,9 +39,6 @@ TARGET_UBOOT_ETHADDR:=$(call qstrip,$(BR2_TARGET_UBOOT_ETHADDR)) # u-boot still uses arch=ppc for powerpc U_BOOT_ARCH=$(KERNEL_ARCH:powerpc=ppc) -ifeq ($(UBOOT_BOARD_NAME),) -UBOOT_BOARD_NAME:=$(call qstrip,$(BR2_TARGET_UBOOT_BOARDNAME)) -endif U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/config.h @@ -73,6 +79,9 @@ endif touch $@ $(U_BOOT_DIR)/.configured: $(U_BOOT_DIR)/.patched +ifeq ($(U_BOOT_BOARD_NAME),) + $(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting) +endif $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ @@ -154,11 +163,16 @@ $(BINARIES_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/$(U_BOOT_BIN) rm -f $(BINARIES_DIR)/$(U_BOOT_BIN) cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)/ -$(U_BOOT_TOOLS): $(U_BOOT_DIR)/$(U_BOOT_BIN) +# Build just mkimage for the host. It might have already been built by +# the U-Boot build procedure, but mkimage may also be needed even if +# U-Boot isn't selected in the configuration, to generate a kernel +# uImage. +$(MKIMAGE): $(U_BOOT_DIR)/.patched mkdir -p $(@D) - cp -dpf $(U_BOOT_DIR)/tools/mkimage $@ + $(MAKE) -C $(U_BOOT_DIR) tools + cp -dpf $(U_BOOT_DIR)/tools/mkimage $(@D) -$(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/$(U_BOOT_BIN) +$(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/.configured mkdir -p $(@D) $(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(U_BOOT_DIR)/tools \ -DUSE_HOSTCC -o $@ \ @@ -171,7 +185,7 @@ $(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/$(U_BOOT_BIN) $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@ -$(TARGET_DIR)/usr/sbin/fw_printenv: $(U_BOOT_DIR)/$(U_BOOT_BIN) +$(TARGET_DIR)/usr/sbin/fw_printenv: $(U_BOOT_DIR)/.configured mkdir -p $(@D) $(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(LINUX_HEADERS_DIR)/include \ -DUSE_HOSTCC -o $@ \ -- cgit v1.2.3 From afd3bd2b03a36a42aa19124a5a8f70c7edfebfd5 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 17 Mar 2010 08:40:35 +0100 Subject: u-boot: further simplify the configuration Remove all the bootsource selection mechanism and the horribly complicated BR2_TARGET_UBOOT_DEFAULT_ENV thing, which wanted to be generic, but was in fact very AT91-specific. Just keep things simple: we build U-Boot with the board configuration file specified in BR2_TARGET_UBOOT_BOARDNAME. Signed-off-by: Thomas Petazzoni --- boot/u-boot/Config.in | 247 -------------------------------------------------- boot/u-boot/u-boot.mk | 113 ++--------------------- 2 files changed, 8 insertions(+), 352 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/Config.in b/boot/u-boot/Config.in index 78a195d25..a4f5fd954 100644 --- a/boot/u-boot/Config.in +++ b/boot/u-boot/Config.in @@ -42,53 +42,6 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR Most users may leave this empty -choice - prompt "Bootsource" - depends on BR2_BOOTSOURCE - default BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD - - config BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD - bool "Boot from dataflashcard" - depends on BR2_BOOTSOURCE_DATAFLASHCARD - - config BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - bool "Boot from dataflash" - depends on BR2_BOOTSOURCE_DATAFLASH - - config BR2_TARGET_UBOOT_BOOTSOURCE_NANDFLASH - bool "Boot from a NAND flash" - depends on BR2_BOOTSOURCE_NANDFLASH - - config BR2_TARGET_UBOOT_BOOTSOURCE_FLASH - bool "Boot from a parallell flash" - depends on BR2_BOOTSOURCE_FLASH - - config BR2_TARGET_UBOOT_BOOTSOURCE_SDCARD - bool "Boot from an SD-Card" - depends on BR2_BOOTSOURCE_SDCARD - - config BR2_TARGET_UBOOT_BOOTSOURCE_EEPROM - bool "Boot from a serial EEPROM (Not yet supported)" - depends on BR2_BOOTSOURCE_EEPROM - -endchoice - -config BR2_TARGET_UBOOT_BOOTSOURCE - string - depends on BR2_BOOTSOURCE - default "dataflash" if BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD - default "dataflash" if BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default "nandflash" if BR2_TARGET_UBOOT_BOOTSOURCE_NANDFLASH - default "flash" if BR2_TARGET_UBOOT_BOOTSOURCE_FLASH - default "sdcard" if BR2_TARGET_UBOOT_BOOTSOURCE_SDCARD - default "eeprom" if BR2_TARGET_UBOOT_BOOTSOURCE_EEPROM - -config BR2_TARGET_UBOOT_SILENT - bool "silent console" - help - If the option has been enabled, the output can be - silenced by setting the environment variable "silent". - config BR2_TARGET_UBOOT_TOOL_MKIMAGE bool "mkimage tool in target" help @@ -99,165 +52,6 @@ config BR2_TARGET_UBOOT_TOOL_ENV help Install fw_printenv / fw_setenv tools in target. -menuconfig BR2_TARGET_UBOOT_DEFAULT_ENV - bool "Generate a default environment" - help - Will generate variables for factory default command - and autoscript. - -if BR2_TARGET_UBOOT_DEFAULT_ENV -choice - prompt "SDRAM Memory size" - default BR2_TARGET_UBOOT_SDRAM_SIZE_64M - help - Size of the onboard SDRAM - -config BR2_TARGET_UBOOT_SDRAM_SIZE_256MB - bool "256 MB" - -config BR2_TARGET_UBOOT_SDRAM_SIZE_128MB - bool "128 MB" - -config BR2_TARGET_UBOOT_SDRAM_SIZE_64MB - bool "64 MB" - -config BR2_TARGET_UBOOT_SDRAM_SIZE_32MB - bool "32 MB" - -config BR2_TARGET_UBOOT_SDRAM_SIZE_16MB - bool "16 MB" - -config BR2_TARGET_UBOOT_SDRAM_SIZE_8MB - bool "8 MB" - -endchoice - -config BR2_TARGET_UBOOT_MEMORY_SIZE - string - default "256M" if BR2_TARGET_UBOOT_SDRAM_SIZE_256MB - default "128M" if BR2_TARGET_UBOOT_SDRAM_SIZE_128MB - default "64M" if BR2_TARGET_UBOOT_SDRAM_SIZE_64MB - default "32M" if BR2_TARGET_UBOOT_SDRAM_SIZE_32MB - default "16M" if BR2_TARGET_UBOOT_SDRAM_SIZE_16MB - default "8M" if BR2_TARGET_UBOOT_SDRAM_SIZE_8MB - -choice - prompt "Kernel Size" - default BR2_TARGET_UBOOT_KERNEL_SIZE_2_00MB - -config BR2_TARGET_UBOOT_KERNEL_SIZE_1_25MB - bool "Kernel size is less than 1.25 MB" - -config BR2_TARGET_UBOOT_KERNEL_SIZE_1_50MB - bool "Kernel size is less than 1.50 MB" - -config BR2_TARGET_UBOOT_KERNEL_SIZE_1_75MB - bool "Kernel size is less than 1.75 MB" - -config BR2_TARGET_UBOOT_KERNEL_SIZE_2_00MB - bool "Kernel size is less than 2.00 MB" - -config BR2_TARGET_UBOOT_KERNEL_SIZE_2_25MB - bool "Kernel size is less than 2.25 MB" - -config BR2_TARGET_UBOOT_KERNEL_SIZE_2_50MB - bool "Kernel size is less than 2.50 MB" - -endchoice - -choice - prompt "Dataflash Size" - depends on BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD || BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default BR2_TARGET_UBOOT_DATAFLASH_SIZE_2_00MB - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE_8MB - bool "Dataflash size is 8 MB" - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE_4MB - bool "Dataflash size is 4 MB" - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE_2MB - bool "Dataflash size is 2 MB" - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE_1MB - bool "Dataflash size is 1 MB" - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE_0_50MB - bool "Dataflash size is 0.5 MB" - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE_0_25MB - bool "Dataflash size is 0.25 MB" - -endchoice - -config BR2_TARGET_UBOOT_DATAFLASH_SIZE - string - depends on BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD || BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default "8M" if BR2_TARGET_DATAFLASH_SIZE_8MB - default "4M" if BR2_TARGET_DATAFLASH_SIZE_4MB - default "2M" if BR2_TARGET_DATAFLASH_SIZE_2MB - default "1M" if BR2_TARGET_DATAFLASH_SIZE_1MB - default "0.5M" if BR2_TARGET_DATAFLASH_SIZE_0_50MB - default "0.25M" if BR2_TARGET_DATAFLASH_SIZE_0_25MB - -config BR2_TARGET_UBOOT_END_OF_FLASH - string - depends on BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD || BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default "C083FFFF" if BR2_TARGET_UBOOT_DATAFLASH_SIZE_8MB - default "C041FFFF" if BR2_TARGET_UBOOT_DATAFLASH_SIZE_4MB - default "C020FFFF" if BR2_TARGET_UBOOT_DATAFLASH_SIZE_2MB - default "C0107FFF" if BR2_TARGET_UBOOT_DATAFLASH_SIZE_1MB - default "C0083FFF" if BR2_TARGET_UBOOT_DATAFLASH_SIZE_0_50MB - default "C0041FFF" if BR2_TARGET_UBOOT_DATAFLASH_SIZE_0_25MB - help - -config BR2_TARGET_UBOOT_KERNEL_START - string "Kernel SDRAM address" - default "21000000" - help - Kernel is loaded to this address in SDRAM - -config BR2_TARGET_UBOOT_KERNEL_LOCATION - string "Kernel flash address" - depends on BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD || \ - BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default "C0042000" if BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD || BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default "" - help - Kernel location in dataflash - -config BR2_TARGET_UBOOT_FILESYSTEM_START - string - default "2114A000" if BR2_TARGET_UBOOT_KERNEL_SIZE_1_25MB - default "2118C000" if BR2_TARGET_UBOOT_KERNEL_SIZE_1_50MB - default "211CE000" if BR2_TARGET_UBOOT_KERNEL_SIZE_1_75MB - default "21210000" if BR2_TARGET_UBOOT_KERNEL_SIZE_2_00MB - default "21252000" if BR2_TARGET_UBOOT_KERNEL_SIZE_2_25MB - default "21294000" if BR2_TARGET_UBOOT_KERNEL_SIZE_2_50MB - help - Kernel is loaded to this SDRAM address - Assumes SDRAM starts at 20000000 - Will need to be updated if the SDRAM is located elsewhere - -config BR2_TARGET_UBOOT_FILESYSTEM_LOCATION - string - depends on BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASHCARD || \ - BR2_TARGET_UBOOT_BOOTSOURCE_DATAFLASH - default "C018C000" if BR2_TARGET_UBOOT_KERNEL_SIZE_1_25MB - default "C01CE000" if BR2_TARGET_UBOOT_KERNEL_SIZE_1_50MB - default "C0210000" if BR2_TARGET_UBOOT_KERNEL_SIZE_1_75MB - default "C0252000" if BR2_TARGET_UBOOT_KERNEL_SIZE_2_00MB - default "C0294000" if BR2_TARGET_UBOOT_KERNEL_SIZE_2_25MB - default "C02D6000" if BR2_TARGET_UBOOT_KERNEL_SIZE_2_50MB - help - Determine location for File System in Dataflash - This needs to be updated for other memory technologies - -config BR2_TARGET_UBOOT_FILESYSTEM_SIZE - string "File System Size" - default "6000000" - help - menuconfig BR2_TARGET_UBOOT_NETWORK bool "Network Settings" default y @@ -304,45 +98,4 @@ config BR2_TARGET_UBOOT_ETH1ADDR endif # BR2_TARGET_UBOOT_NETWORK -endif # BR2_TARGET_UBOOT_DEFAULT_ENV - endif # BR2_TARGET_UBOOT - -config BR2_BOOTSOURCE_DATAFLASHCARD - bool - help - Allow use of a dataflashcard as a boot source - -config BR2_BOOTSOURCE_DATAFLASH - bool - help - Allow use of a dataflash as a boot source - -config BR2_BOOTSOURCE_NANDFLASH - bool - help - Allow use of a NAND flash as a boot source - -config BR2_BOOTSOURCE_FLASH - bool - help - Allow use of a flash RAM as a boot source - -config BR2_BOOTSOURCE_SDCARD - bool - help - Allow use of an SD-card as a boot source - -config BR2_BOOTSOURCE_EEPROM - bool - help - Allow use of a serial eeprom as a boot source - -config BR2_BOOTSOURCE - bool - default y if BR2_BOOTSOURCE_DATAFLASHCARD - default y if BR2_BOOTSOURCE_DATAFLASH - default y if BR2_BOOTSOURCE_NANDFLASH - default y if BR2_BOOTSOURCE_FLASH - default y if BR2_BOOTSOURCE_SDCARD - default y if BR2_BOOTSOURCE_EEPROM diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index 00724bae6..a562da25d 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -21,21 +21,9 @@ U_BOOT_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION) U_BOOT_CAT:=$(BZCAT) U_BOOT_BIN:=u-boot.bin -U_BOOT_TOOLS:=$(HOST_DIR)/usr/bin/mkimage -MKIMAGE:=$(U_BOOT_TOOLS) -U_BOOT_AUTOSCRIPT=$(BINARIES_DIR)/autoscript +MKIMAGE:=$(HOST_DIR)/usr/bin/mkimage -U_BOOT_TARGETS:=$(BINARIES_DIR)/$(U_BOOT_BIN) $(U_BOOT_TOOLS) - -ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_DEFAULT_ENV)),y) -U_BOOT_TARGETS += u-boot-autoscript -endif - -TARGET_UBOOT_IPADDR:=$(call qstrip,$(BR2_TARGET_UBOOT_IPADDR)) -TARGET_UBOOT_SERVERIP:=$(call qstrip,$(BR2_TARGET_UBOOT_SERVERIP)) -TARGET_UBOOT_GATEWAY:=$(call qstrip,$(BR2_TARGET_UBOOT_GATEWAY)) -TARGET_UBOOT_NETMASK:=$(call qstrip,$(BR2_TARGET_UBOOT_NETMASK)) -TARGET_UBOOT_ETHADDR:=$(call qstrip,$(BR2_TARGET_UBOOT_ETHADDR)) +U_BOOT_TARGETS:=$(BINARIES_DIR)/$(U_BOOT_BIN) $(MKIMAGE) # u-boot still uses arch=ppc for powerpc U_BOOT_ARCH=$(KERNEL_ARCH:powerpc=ppc) @@ -87,68 +75,38 @@ endif LDFLAGS="$(TARGET_LDFLAGS)" \ $(U_BOOT_CONFIGURE_OPTS) \ $(MAKE) -C $(U_BOOT_DIR) \ - $(UBOOT_BOARD_NAME)_config + $(U_BOOT_BOARD_NAME)_config touch $@ $(U_BOOT_DIR)/.header_modified: $(U_BOOT_DIR)/.configured # Modify configuration header in $(U_BOOT_INC_CONF_FILE) -ifdef BR2_TARGET_UBOOT_DEFAULT_ENV +ifdef BR2_TARGET_UBOOT_NETWORK @echo >> $(U_BOOT_INC_CONF_FILE) @echo "/* Add a wrapper around the values Buildroot sets. */" >> $(U_BOOT_INC_CONF_FILE) @echo "#ifndef __BR2_ADDED_CONFIG_H" >> $(U_BOOT_INC_CONF_FILE) @echo "#define __BR2_ADDED_CONFIG_H" >> $(U_BOOT_INC_CONF_FILE) $(call insert_define, DATE, $(DATE)) $(call insert_define, CONFIG_LOAD_SCRIPTS, 1) -endif # BR2_TARGET_UBOOT_DEFAULT_ENV -ifdef BR2_TARGET_UBOOT_NETWORK ifneq ($(strip $(BR2_TARGET_UBOOT_IPADDR)),"") $(call insert_define, CONFIG_IPADDR, $(BR2_TARGET_UBOOT_IPADDR)) +endif ifneq ($(strip $(BR2_TARGET_UBOOT_GATEWAY)),"") $(call insert_define, CONFIG_GATEWAYIP, $(BR2_TARGET_UBOOT_GATEWAY)) endif ifneq ($(strip $(BR2_TARGET_UBOOT_NETMASK)),"") $(call insert_define, CONFIG_NETMASK, $(BR2_TARGET_UBOOT_NETMASK)) endif -endif # end BR2_TARGET_U_BOOT_IPADDR ifneq ($(strip $(BR2_TARGET_UBOOT_SERVERIP)),"") $(call insert_define, CONFIG_SERVERIP, $(BR2_TARGET_UBOOT_SERVERIP)) endif ifneq ($(strip $(BR2_TARGET_UBOOT_ETHADDR)),"") $(call insert_define, CONFIG_ETHADDR, $(BR2_TARGET_UBOOT_ETHADDR)) endif -ifneq ($(strip $(BR2_TARGET_UBOOT_ETH1ADDR)),) ifneq ($(strip $(BR2_TARGET_UBOOT_ETH1ADDR)),"") $(call insert_define, CONFIG_ETH1ADDR, $(BR2_TARGET_UBOOT_ETH1ADDR)) -endif -endif -endif # BR2_TARGET_UBOOT_NETWORK -ifeq ($(BR2_TARGET_UBOOT_SILENT),y) - $(call insert_define, CONFIG_SILENT_CONSOLE,) -endif -ifdef BR2_TARGET_UBOOT_DEFAULT_ENV -ifneq ($(strip $(BR2_TARGET_UBOOT_KERNEL_START)),"") - $(call insert_define, KERNEL_START, $(BR2_TARGET_UBOOT_KERNEL_START)) -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_KERNEL_LOCATION)),"") - $(call insert_define, KERNEL_LOCATION, $(BR2_TARGET_UBOOT_KERNEL_LOCATION)) -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_FILESYSTEM_START)),"") - $(call insert_define, FILESYSTEM_START, $(BR2_TARGET_UBOOT_FILESYSTEM_START)) -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_FILESYSTEM_LOCATION)),"") - $(call insert_define, FILESYSTEM_LOCATION, $(BR2_TARGET_UBOOT_FILESYSTEM_LOCATION)) -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_FILESYSTEM_SIZE)),"") - $(call insert_define, FILESYSTEM_SIZE, $(BR2_TARGET_UBOOT_FILESYSTEM_SIZE)) -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_END_OF_FLASH)),"") - $(call insert_define, END_OF_FLASH, $(BR2_TARGET_UBOOT_END_OF_FLASH)) -endif -ifneq ($(strip $(BR2_TARGET_UBOOT_MEMORY_SIZE)),"") - $(call insert_define, MEMORY_SIZE, $(BR2_TARGET_UBOOT_MEMORY_SIZE)) endif @echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(U_BOOT_INC_CONF_FILE) -endif # BR2_TARGET_UBOOT_DEFAULT_ENV +endif # BR2_TARGET_UBOOT_NETWORK touch $@ $(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified @@ -195,11 +153,9 @@ $(TARGET_DIR)/usr/sbin/fw_printenv: $(U_BOOT_DIR)/.configured u-boot: $(U_BOOT_TARGETS) -u-boot-autoscript: $(U_BOOT_AUTOSCRIPT).img - u-boot-clean: -$(MAKE) -C $(U_BOOT_DIR) clean - rm -f $(U_BOOT_TOOLS) $(U_BOOT_TARGET_TOOLS) + rm -f $(MKIMAGE) $(U_BOOT_TARGET_TOOLS) u-boot-dirclean: rm -rf $(U_BOOT_DIR) @@ -210,59 +166,6 @@ u-boot-unpacked: $(U_BOOT_DIR)/.patched u-boot-configured: $(U_BOOT_DIR)/.header_modified -############################################################# -# -# Generate an autoscript with the configration items -# -############################################################# - -$(U_BOOT_AUTOSCRIPT): .config - rm -f $(U_BOOT_AUTOSCRIPT) -ifneq ($(TARGET_UBOOT_IPADDR),) - echo setenv ipaddr $(TARGET_UBOOT_IPADDR) > $(U_BOOT_AUTOSCRIPT) -else - echo TARGET_UBOOT_IPADDR="$(TARGET_UBOOT_IPADDR)" -endif -ifneq ($(TARGET_UBOOT_SERVERIP),) - echo setenv serverip $(TARGET_UBOOT_SERVERIP) >> $(U_BOOT_AUTOSCRIPT) -endif -ifneq ($(TARGET_UBOOT_GATEWAY),) - echo setenv gatewayip $(TARGET_UBOOT_GATEWAY) >> $(U_BOOT_AUTOSCRIPT) -endif -ifneq ($(TARGET_UBOOT_NETMASK),) - echo setenv netmask $(TARGET_UBOOT_NETMASK) >> $(U_BOOT_AUTOSCRIPT) -endif - echo setenv linux $(LINUX26_KERNEL_NAME) >> $(U_BOOT_AUTOSCRIPT) - echo setenv kernel-version $(LINUX26_VERSION) >> $(U_BOOT_AUTOSCRIPT) - echo setenv kernel-date $(DATE) >> $(U_BOOT_AUTOSCRIPT) - echo setenv hostname $(TARGET_HOSTNAME) >> $(U_BOOT_AUTOSCRIPT) - echo setenv fs-date $(DATE) >> $(U_BOOT_AUTOSCRIPT) - echo setenv rd-1 rootfs.$(ARCH)-$(DATE).ext2 >> $(U_BOOT_AUTOSCRIPT) - echo setenv rd-2 rootfs.$(ARCH)-$(DATE).jffs2 >> $(U_BOOT_AUTOSCRIPT) - echo setenv rd rootfs.$(BR2_ARCH)-$(DATE).ext2 >> $(U_BOOT_AUTOSCRIPT) - echo setenv ver 1 >> $(U_BOOT_AUTOSCRIPT) -ifneq ($(TARGET_UBOOT_ETHADDR),) - echo setenv ethaddr $(TARGET_UBOOT_ETHADDR) >> $(U_BOOT_AUTOSCRIPT) -endif - echo setenv fstype ram >> $(U_BOOT_AUTOSCRIPT) - echo fs >> $(U_BOOT_AUTOSCRIPT) - echo os >> $(U_BOOT_AUTOSCRIPT) - echo setargs >> $(U_BOOT_AUTOSCRIPT) - echo saveenv >> $(U_BOOT_AUTOSCRIPT) - -$(U_BOOT_AUTOSCRIPT).img: $(U_BOOT_AUTOSCRIPT) $(MKIMAGE) - $(MKIMAGE) -A $(ARCH) \ - -O linux \ - -T script \ - -C none \ - -a 0 \ - -e 0 \ - -n "autoscr config" \ - -d $(U_BOOT_AUTOSCRIPT) \ - $(U_BOOT_AUTOSCRIPT).img - - - ############################################################# # # Toplevel Makefile options @@ -272,7 +175,7 @@ ifeq ($(BR2_TARGET_UBOOT),y) TARGETS+=u-boot # we NEED a board name -ifeq ($(UBOOT_BOARD_NAME),) +ifeq ($(U_BOOT_BOARD_NAME),) $(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting) endif -- cgit v1.2.3 From 4a587b12eb387e0cb44e5a1c27dc765fc98a60c3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 31 May 2010 19:32:35 +0200 Subject: u-boot: remove unused U_BOOT_TARGET_TOOLS variable Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index a562da25d..220eeb2b6 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -30,7 +30,6 @@ U_BOOT_ARCH=$(KERNEL_ARCH:powerpc=ppc) U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/config.h -U_BOOT_TARGET_TOOLS:= ifeq ($(BR2_TARGET_UBOOT_TOOL_MKIMAGE),y) U_BOOT_TARGETS+=$(TARGET_DIR)/usr/bin/mkimage endif @@ -155,7 +154,7 @@ u-boot: $(U_BOOT_TARGETS) u-boot-clean: -$(MAKE) -C $(U_BOOT_DIR) clean - rm -f $(MKIMAGE) $(U_BOOT_TARGET_TOOLS) + rm -f $(MKIMAGE) u-boot-dirclean: rm -rf $(U_BOOT_DIR) -- cgit v1.2.3 From 6db01c1b3091aec8c0131f0f559daabb27e78c1c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 31 May 2010 19:34:27 +0200 Subject: u-boot: add a few comments Signed-off-by: Thomas Petazzoni --- boot/u-boot/u-boot.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index 220eeb2b6..90a45b87f 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -108,6 +108,7 @@ endif endif # BR2_TARGET_UBOOT_NETWORK touch $@ +# Build U-Boot itself $(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS)" \ @@ -116,6 +117,7 @@ $(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(U_BOOT_ARCH) \ -C $(U_BOOT_DIR) +# Copy the result to the images/ directory $(BINARIES_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/$(U_BOOT_BIN) rm -f $(BINARIES_DIR)/$(U_BOOT_BIN) cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)/ @@ -129,6 +131,7 @@ $(MKIMAGE): $(U_BOOT_DIR)/.patched $(MAKE) -C $(U_BOOT_DIR) tools cp -dpf $(U_BOOT_DIR)/tools/mkimage $(@D) +# Build manually mkimage for the target $(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/.configured mkdir -p $(@D) $(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(U_BOOT_DIR)/tools \ @@ -142,6 +145,7 @@ $(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/.configured $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@ +# Build manually fw_printenv for the target $(TARGET_DIR)/usr/sbin/fw_printenv: $(U_BOOT_DIR)/.configured mkdir -p $(@D) $(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(LINUX_HEADERS_DIR)/include \ -- cgit v1.2.3 From f15702a97f2c614840b687cae80df127433d1b44 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 12 Jun 2010 13:18:04 +0200 Subject: u-boot: re-add infrastructure to specify custom tarball The bootloader being very specific to the hardware, being able to build U-Boot from an arbitrary tarball available on the web might be needed. Therefore, for U-Boot, we provide two methods : * Get a given stable version from U-Boot official FTP server * Get an arbitrary tarball This should hopefully satisfy most needs, without complicating too much the U-Boot build procedure on Buildroot side. Signed-off-by: Thomas Petazzoni --- boot/u-boot/Config.in | 11 +++++++++++ boot/u-boot/u-boot.mk | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/Config.in b/boot/u-boot/Config.in index a4f5fd954..79c5c3da7 100644 --- a/boot/u-boot/Config.in +++ b/boot/u-boot/Config.in @@ -25,13 +25,24 @@ config BR2_TARGET_UBOOT_2009_11 config BR2_TARGET_UBOOT_2009_08 bool "u-boot-2009.08" +config BR2_TARGET_UBOOT_CUSTOM_TARBALL + bool "Custom tarball" + endchoice +if BR2_TARGET_UBOOT_CUSTOM_TARBALL + +config BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION + string "URL of custom U-Boot tarball" + +endif + config BR2_UBOOT_VERSION string default "2010.03" if BR2_TARGET_UBOOT_2010_03 default "2009.11" if BR2_TARGET_UBOOT_2009_11 default "2009.08" if BR2_TARGET_UBOOT_2009_08 + default "custom" if BR2_TARGET_UBOOT_CUSTOM_TARBALL config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR string "custom patch dir" diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index 90a45b87f..ee566112f 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -14,9 +14,17 @@ ifeq ($(U_BOOT_VERSION),) U_BOOT_VERSION=2010.03 endif +ifeq ($(U_BOOT_VERSION),custom) +# Handle custom U-Boot tarballs as specified by the configuration +U_BOOT_TARBALL=$(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION)) +U_BOOT_SITE:=$(dir $(U_BOOT_TARBALL)) +U_BOOT_SOURCE:=$(notdir $(U_BOOT_TARBALL)) +else +# Handle stable official U-Boot versions +U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2 +endif -U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot U_BOOT_DIR:=$(BUILD_DIR)/u-boot-$(U_BOOT_VERSION) U_BOOT_CAT:=$(BZCAT) U_BOOT_BIN:=u-boot.bin @@ -51,9 +59,9 @@ $(DL_DIR)/$(U_BOOT_SOURCE): $(call DOWNLOAD,$(U_BOOT_SITE),$(U_BOOT_SOURCE)) $(U_BOOT_DIR)/.unpacked: $(DL_DIR)/$(U_BOOT_SOURCE) - $(U_BOOT_CAT) $(DL_DIR)/$(U_BOOT_SOURCE) \ - | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - mkdir -p $(U_BOOT_DIR) + mkdir -p $(@D) + $(INFLATE$(suffix $(U_BOOT_SOURCE))) $(DL_DIR)/$(U_BOOT_SOURCE) \ + | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - touch $@ $(U_BOOT_DIR)/.patched: $(U_BOOT_DIR)/.unpacked -- cgit v1.2.3 From db86f18ed7ce0659f3eda3b2101c5862f07ac18b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 12 Jun 2010 13:24:49 +0200 Subject: u-boot: use BR2_TARGET_UBOOT_VERSION instead of BR2_UBOOT_VERSION In order to be coherent with all other BR2_TARGET_UBOOT_* options. Signed-off-by: Thomas Petazzoni --- boot/u-boot/Config.in | 2 +- boot/u-boot/u-boot.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'boot/u-boot/u-boot.mk') diff --git a/boot/u-boot/Config.in b/boot/u-boot/Config.in index 00fd03a74..aa680cf3d 100644 --- a/boot/u-boot/Config.in +++ b/boot/u-boot/Config.in @@ -37,7 +37,7 @@ config BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION endif -config BR2_UBOOT_VERSION +config BR2_TARGET_UBOOT_VERSION string default "2010.03" if BR2_TARGET_UBOOT_2010_03 default "2009.11" if BR2_TARGET_UBOOT_2009_11 diff --git a/boot/u-boot/u-boot.mk b/boot/u-boot/u-boot.mk index ee566112f..ad67343a9 100644 --- a/boot/u-boot/u-boot.mk +++ b/boot/u-boot/u-boot.mk @@ -3,7 +3,7 @@ # U-Boot # ############################################################# -U_BOOT_VERSION:=$(call qstrip,$(BR2_UBOOT_VERSION)) +U_BOOT_VERSION:=$(call qstrip,$(BR2_TARGET_UBOOT_VERSION)) U_BOOT_BOARD_NAME:=$(call qstrip,$(BR2_TARGET_UBOOT_BOARDNAME)) # U-Boot may not be selected in the configuration, but mkimage might -- cgit v1.2.3