summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/Config.in2
-rw-r--r--target/Makefile.in5
-rw-r--r--target/device/Atmel/Makefile.in4
-rw-r--r--target/device/Atmel/u-boot/Config.in24
-rw-r--r--target/device/Atmel/u-boot/u-boot-1.3.0.mk.bad149
-rw-r--r--target/device/Atmel/u-boot/u-boot.mk12
-rw-r--r--target/u-boot/Config.in72
-rw-r--r--target/u-boot/Makefile.in148
-rw-r--r--target/u-boot/u-boot-1.3.0-avr32-100-atmel.2.patch (renamed from target/device/Atmel/u-boot/u-boot-1.3.0-100-atmel.2.patch.bad)0
9 files changed, 246 insertions, 170 deletions
diff --git a/target/Config.in b/target/Config.in
index a9a40e4d3..2c70f45fb 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -18,6 +18,8 @@ source "target/x86/grub/Config.in"
#source "target/x86/grub2/Config.in"
source "target/x86/syslinux/Config.in"
source "target/powerpc/yaboot/Config.in"
+source "target/u-boot/Config.in"
+source "target/device/Atmel/u-boot/Config.in"
endmenu
menu "Kernel"
diff --git a/target/Makefile.in b/target/Makefile.in
index 3e810883f..8283aa484 100644
--- a/target/Makefile.in
+++ b/target/Makefile.in
@@ -10,7 +10,10 @@ include target/generic/Makefile.in
include target/device/Makefile.in
include target/x86/Makefile.in
include target/powerpc/Makefile.in
-include target/device/Atmel/u-boot/u-boot.mk
+
+ifeq ($(strip $(BR2_TARGET_UBOOT)),y)
+include target/u-boot/Makefile.in
+endif
# and finally build the filesystems/tarballs
include target/*/*.mk
diff --git a/target/device/Atmel/Makefile.in b/target/device/Atmel/Makefile.in
index 570941182..e723eb5a5 100644
--- a/target/device/Atmel/Makefile.in
+++ b/target/device/Atmel/Makefile.in
@@ -9,7 +9,7 @@ BOARD_PATH:=$(strip $(subst ",, $(BR2_BOARD_PATH)))
#"))
ATMEL_TARGET:=$(ATMEL_PATH)/root
-TARGET_SKELETON:=$(BOARD_PATH)/target_skeleton
+TARGET_SKELETON:=$(ATMEL_TARGET)/target_skeleton
TARGET_DEVICE_TABLE:=$(ATMEL_TARGET)/device_table.txt
TARGET_SKELETON_LINKS:=$(ATMEL_TARGET)/skel.tar.gz
@@ -69,7 +69,7 @@ ifeq ($(strip $(BR2_PACKAGE_LINUX)),y)
#include $(ATMEL_PATH)/Linux/linux.mk
endif
-ifeq ($(strip $(BR2_TARGET_UBOOT)),y)
+ifeq ($(strip $(BR2_TARGET_UBOOT_AT91)),y)
include $(ATMEL_PATH)/u-boot/u-boot.mk
endif
diff --git a/target/device/Atmel/u-boot/Config.in b/target/device/Atmel/u-boot/Config.in
index 62988ebe4..02f6863f4 100644
--- a/target/device/Atmel/u-boot/Config.in
+++ b/target/device/Atmel/u-boot/Config.in
@@ -1,4 +1,4 @@
-config BR2_TARGET_UBOOT
+config BR2_TARGET_UBOOT_AT91
bool "Das U-Boot Boot Monitor"
depends on BR2_TARGET_AT91
depends on !BR2_TARGET_AT91SAM9260PF
@@ -6,37 +6,37 @@ config BR2_TARGET_UBOOT
help
Build "Das U-Boot" Boot Monitor
-config BR2_TARGET_UBOOT_SERVERIP
+config BR2_TARGET_UBOOT_SERVERIP_AT91
string "server ip"
- depends on BR2_TARGET_UBOOT
+ depends on BR2_TARGET_UBOOT_AT91
default "10.175.196.221"
help
TFTP server ip address
-config BR2_TARGET_UBOOT_IPADDR
+config BR2_TARGET_UBOOT_IPADDR_AT91
string "ip address"
- depends on BR2_TARGET_UBOOT
+ depends on BR2_TARGET_UBOOT_AT91
default "10.175.196.18"
help
- TFTP server ip address
+ Target server ip address
-config BR2_TARGET_UBOOT_GATEWAY
+config BR2_TARGET_UBOOT_GATEWAY_AT91
string "gateway ip"
- depends on BR2_TARGET_UBOOT
+ depends on BR2_TARGET_UBOOT_AT91
default "10.175.196.1"
help
Gateway ip address
-config BR2_TARGET_UBOOT_NETMASK
+config BR2_TARGET_UBOOT_NETMASK_AT91
string "netmask"
- depends on BR2_TARGET_UBOOT
+ depends on BR2_TARGET_UBOOT_AT91
default "255.255.255.0"
help
Network Mask
-config BR2_TARGET_UBOOT_ETHADDR
+config BR2_TARGET_UBOOT_ETHADDR_AT91
string "Ethernet address"
- depends on BR2_TARGET_UBOOT
+ depends on BR2_TARGET_UBOOT_AT91
default "04:25:fe:ed:00:18"
help
Target ip address, this should be changed for production units
diff --git a/target/device/Atmel/u-boot/u-boot-1.3.0.mk.bad b/target/device/Atmel/u-boot/u-boot-1.3.0.mk.bad
deleted file mode 100644
index 59ba37cd9..000000000
--- a/target/device/Atmel/u-boot/u-boot-1.3.0.mk.bad
+++ /dev/null
@@ -1,149 +0,0 @@
-#############################################################
-#
-# U-Boot
-#
-#############################################################
-U_BOOT_VERSION:=1.3.0
-U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2
-U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot
-U_BOOT_DIR:=$(PROJECT_BUILD_DIR)/u-boot-$(U_BOOT_VERSION)
-U_BOOT_CAT:=$(BZCAT)
-U_BOOT_BIN:=u-boot.bin
-U_BOOT_TOOLS_BIN:=mkimage
-
-U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/configs/$(subst _config,,$(BR2_TARGET_U_BOOT_CONFIG_BOARD)).h
-
-$(DL_DIR)/$(U_BOOT_SOURCE):
- $(WGET) -P $(DL_DIR) $(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 $(PROJECT_BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(U_BOOT_DIR) target/device/Atmel/u-boot/ \
- u-boot-$(U_BOOT_VERSION)-\*.patch\*
- touch $@
-
-$(U_BOOT_DIR)/.header_copied: $(U_BOOT_DIR)/.unpacked
-ifneq ($(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE),"")
- @if [ ! -f "$(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE)" ]; then \
- echo " You specified BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE,"; \
- echo " but the file at:"; \
- echo " '$(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE)'"; \
- echo " does not exist."; \
- echo; \
- echo " Configure the BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE variable."; \
- echo; \
- exit 1; \
- fi
- cp -dpf $(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE) $(U_BOOT_INC_CONF_FILE)
-endif
- touch $@
-
-$(U_BOOT_DIR)/.configured: $(U_BOOT_DIR)/.header_copied
-ifeq ($(strip $(BR2_TARGET_U_BOOT_CONFIG_BOARD)),"")
- @echo
- @echo " You did not specify a target u-boot config board, so u-boot"
- @echo " has no way of knowing which board you want to build your"
- @echo " bootloader for."
- @echo
- @echo " Configure the BR2_TARGET_U_BOOT_CONFIG_BOARD variable."
- @echo
- @exit 1
-endif
- $(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- $(MAKE) -C $(U_BOOT_DIR) \
- $(BR2_TARGET_U_BOOT_CONFIG_BOARD)
- touch $@
-
-$(U_BOOT_DIR)/.header_modified: $(U_BOOT_DIR)/.configured
- # Modify configuration header in $(U_BOOT_INC_CONF_FILE)
- @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)
-ifneq ($(strip $(BR2_PROJECT)),"")
- @echo "#define CONFIG_HOSTNAME" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_HOSTNAME.*,#define CONFIG_HOSTNAME $(subst ",,$(BR2_PROJECT)),' $(U_BOOT_INC_CONF_FILE)
-endif
-ifneq ($(strip $(BR2_TARGET_U_BOOT_SERVERIP)),"")
- @echo "#define CONFIG_SERVERIP" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_SERVERIP.*,#define CONFIG_SERVERIP $(subst ",,$(BR2_TARGET_U_BOOT_SERVERIP)),' $(U_BOOT_INC_CONF_FILE)
-endif
-ifneq ($(strip $(BR2_TARGET_U_BOOT_IPADDR)),"")
- @echo "#define CONFIG_IPADDR" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_IPADDR.*,#define CONFIG_IPADDR $(subst ",,$(BR2_TARGET_U_BOOT_IPADDR)),' $(U_BOOT_INC_CONF_FILE)
-ifneq ($(strip $(BR2_TARGET_U_BOOT_GATEWAY)),"")
- @echo "#define CONFIG_GATEWAYIP" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_GATEWAYIP.*,#define CONFIG_GATEWAYIP $(subst ",,$(BR2_TARGET_U_BOOT_GATEWAY)),' $(U_BOOT_INC_CONF_FILE)
-endif
-ifneq ($(strip $(BR2_TARGET_U_BOOT_NETMASK)),"")
- @echo "#define CONFIG_NETMASK" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_NETMASK.*,#define CONFIG_NETMASK $(subst ",,$(BR2_TARGET_U_BOOT_NETMASK)),' $(U_BOOT_INC_CONF_FILE)
-endif
-endif # end BR2_TARGET_U_BOOT_IPADDR
-ifneq ($(strip $(BR2_TARGET_U_BOOT_ETH0ADDR)),"")
- @echo "#define CONFIG_ETHADDR" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_ETHADDR.*,#define CONFIG_ETHADDR $(subst ",,$(BR2_TARGET_U_BOOT_ETH0ADDR)),' $(U_BOOT_INC_CONF_FILE)
-endif
-ifneq ($(strip $(BR2_TARGET_U_BOOT_ETH1ADDR)),"")
- @echo "#define CONFIG_ETH1ADDR" >> $(U_BOOT_INC_CONF_FILE)
- $(SED) 's,^#define.*CONFIG_ETH1ADDR.*,#define CONFIG_ETH1ADDR $(subst ",,$(BR2_TARGET_U_BOOT_ETH1ADDR)),' $(U_BOOT_INC_CONF_FILE)
-endif
-ifneq ($(strip $(BR2_TARGET_U_BOOT_BOOTARGS)),"")
- @echo "#undef CONFIG_BOOTARGS" >> $(U_BOOT_INC_CONF_FILE)
- @echo '#define CONFIG_BOOTARGS $(BR2_TARGET_U_BOOT_BOOTARGS)' >> $(U_BOOT_INC_CONF_FILE)
-endif
-ifneq ($(strip $(BR2_TARGET_U_BOOT_BOOTCMD)),"")
- @echo "#undef CONFIG_BOOTCOMMAND" >> $(U_BOOT_INC_CONF_FILE)
- @echo '#define CONFIG_BOOTCOMMAND $(BR2_TARGET_U_BOOT_BOOTCMD)' >> $(U_BOOT_INC_CONF_FILE)
-endif
- @echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(U_BOOT_INC_CONF_FILE)
- touch $@
-
-$(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified
- $(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- $(MAKE) -C $(U_BOOT_DIR)
-
-$(BINARIES_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/$(U_BOOT_BIN)
- cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)
- cp -dpf $(U_BOOT_DIR)/tools/$(U_BOOT_TOOLS_BIN) $(STAGING_DIR)/usr/bin/
-
-u-boot: gcc $(BINARIES_DIR)/$(U_BOOT_BIN)
-
-u-boot-clean:
- $(MAKE) -C $(U_BOOT_DIR) clean
-
-u-boot-dirclean:
- rm -rf $(U_BOOT_DIR)
-
-u-boot-source: $(DL_DIR)/$(U_BOOT_SOURCE)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(strip $(BR2_TARGET_U_BOOT)),y)
-TARGETS+=u-boot
-endif
-
-u-boot-status:
- @echo
- @echo U_BOOT_INC_CONF_FILE = $(U_BOOT_INC_CONF_FILE)
- @echo
- @echo BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE = $(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE)
- @echo BR2_TARGET_U_BOOT_CONFIG_BOARD = $(BR2_TARGET_U_BOOT_CONFIG_BOARD)
- @echo BR2_TARGET_U_BOOT_SERVERIP = $(BR2_TARGET_U_BOOT_SERVERIP)
- @echo BR2_TARGET_U_BOOT_IPADDR = $(BR2_TARGET_U_BOOT_IPADDR)
- @echo BR2_TARGET_U_BOOT_GATEWAY = $(BR2_TARGET_U_BOOT_GATEWAY)
- @echo BR2_TARGET_U_BOOT_NETMASK = $(BR2_TARGET_U_BOOT_NETMASK)
- @echo BR2_TARGET_U_BOOT_ETH0ADDR = $(BR2_TARGET_U_BOOT_ETH0ADDR)
- @echo BR2_TARGET_U_BOOT_ETH1ADDR = $(BR2_TARGET_U_BOOT_ETH1ADDR)
- @echo BR2_TARGET_U_BOOT_BOOTARGS = $(BR2_TARGET_U_BOOT_BOOTARGS)
- @echo BR2_TARGET_U_BOOT_BOOTCMD = $(BR2_TARGET_U_BOOT_BOOTCMD)
- @echo
- @exit 0
diff --git a/target/device/Atmel/u-boot/u-boot.mk b/target/device/Atmel/u-boot/u-boot.mk
index 474359e19..1f955a3ea 100644
--- a/target/device/Atmel/u-boot/u-boot.mk
+++ b/target/device/Atmel/u-boot/u-boot.mk
@@ -30,15 +30,15 @@ UBOOT_PATCHES:=$(PROJECT_BUILD_DIR)/u-boot-patches
UBOOT_ATMEL_BMP:=$(UBOOT_PATCHES)/atmel.bmp
UBOOT_SCR=$(BINARIES_DIR)/autoscript
-TARGET_UBOOT_IPADDR:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_IPADDR)))
+TARGET_UBOOT_IPADDR:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_IPADDR_AT91)))
#"))
-TARGET_UBOOT_SERVERIP:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_SERVERIP)))
+TARGET_UBOOT_SERVERIP:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_SERVERIP_AT91)))
#"))
-TARGET_UBOOT_GATEWAY:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_GATEWAY)))
+TARGET_UBOOT_GATEWAY:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_GATEWAY_AT91)))
#"))
-TARGET_UBOOT_NETMASK:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_NETMASK)))
+TARGET_UBOOT_NETMASK:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_NETMASK_AT91)))
#"))
-TARGET_UBOOT_ETHADDR:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_ETHADDR)))
+TARGET_UBOOT_ETHADDR:=$(strip $(subst ",, $(BR2_TARGET_UBOOT_ETHADDR_AT91)))
#"))
UBOOT_CUSTOM:=$(UBOOT_DIR)/include/custom.h
@@ -247,7 +247,7 @@ ubootroot-dirclean:
# Toplevel Makefile options
#
#############################################################
-ifeq ($(strip $(BR2_TARGET_UBOOT)),y)
+ifeq ($(strip $(BR2_TARGET_UBOOT_AT91)),y)
TARGETS+=uboot
endif
diff --git a/target/u-boot/Config.in b/target/u-boot/Config.in
new file mode 100644
index 000000000..66ebaf50a
--- /dev/null
+++ b/target/u-boot/Config.in
@@ -0,0 +1,72 @@
+config BR2_TARGET_UBOOT
+ bool "Das U-Boot Boot Monitor"
+ depends on !BR2_TARGET_AT91
+ default n
+ help
+ Build "Das U-Boot" Boot Monitor
+
+config BR2_TARGET_UBOOT_BOARDNAME
+ string "board name"
+ depends on BR2_TARGET_UBOOT
+ default "$(BOARD_NAME)"
+ help
+ One of U-Boot supported boards to be built.
+ This will be suffixed with _config to meet U-Boot standard naming.
+
+config BR2_TARGET_UBOOT_CUSTOM_PATCH
+ string "custom patch"
+ depends on BR2_TARGET_UBOOT
+ help
+ If your board requires a custom patch, add the path to the file here.
+ Most users may leave this empty
+
+config BR2_TARGET_UBOOT_SERVERIP
+ string "server ip"
+ depends on BR2_TARGET_UBOOT
+ default "10.175.196.221"
+ help
+ TFTP server ip address
+
+config BR2_TARGET_UBOOT_IPADDR
+ string "ip address"
+ depends on BR2_TARGET_UBOOT
+ default "10.175.196.18"
+ help
+ Target ip address
+
+config BR2_TARGET_UBOOT_GATEWAY
+ string "gateway ip"
+ depends on BR2_TARGET_UBOOT
+ default "10.175.196.1"
+ help
+ Gateway ip address
+
+config BR2_TARGET_UBOOT_NETMASK
+ string "netmask"
+ depends on BR2_TARGET_UBOOT
+ default "255.255.255.0"
+ help
+ Network Mask
+
+config BR2_TARGET_UBOOT_ETHADDR
+ string "ethernet address"
+ depends on BR2_TARGET_UBOOT
+ default "04:25:fe:ed:00:18"
+ help
+ Target MAC address for the ethernet interface.
+ This should be changed for production units
+
+config BR2_TARGET_UBOOT_ETH1ADDR
+ string "ethernet 2 address"
+ depends on BR2_TARGET_UBOOT
+ depends on BR2_TARGET_AVR32
+ help
+ Target MAC address for the second ethernet interface.
+
+config BR2_TARGET_UBOOT_SILENT
+ bool "silent console"
+ depends on BR2_TARGET_UBOOT
+ default n
+ help
+ If the option has been enabled, the output can be
+ silenced by setting the environment variable "silent".
diff --git a/target/u-boot/Makefile.in b/target/u-boot/Makefile.in
new file mode 100644
index 000000000..8ae084bdf
--- /dev/null
+++ b/target/u-boot/Makefile.in
@@ -0,0 +1,148 @@
+#############################################################
+#
+# U-Boot
+#
+#############################################################
+U_BOOT_VERSION:=1.3.0
+U_BOOT_SOURCE:=u-boot-$(U_BOOT_VERSION).tar.bz2
+U_BOOT_SITE:=ftp://ftp.denx.de/pub/u-boot
+U_BOOT_DIR:=$(PROJECT_BUILD_DIR)/u-boot-$(U_BOOT_VERSION)
+U_BOOT_PATCH_DIR:=$(PROJECT_BUILD_DIR)/u-boot-patches
+U_BOOT_CAT:=$(BZCAT)
+U_BOOT_BIN:=u-boot.bin
+U_BOOT_TOOLS_BIN:=mkimage
+
+ifneq ($(BR2_TARGET_U_BOOT_CONFIG_BOARD),)
+U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/configs/$(subst _config,,$(BR2_TARGET_U_BOOT_CONFIG_BOARD)).h
+else
+U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/config.h
+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)) $(2)" >> $(U_BOOT_INC_CONF_FILE)
+endef
+
+$(DL_DIR)/$(U_BOOT_SOURCE):
+ $(WGET) -P $(DL_DIR) $(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 $(PROJECT_BUILD_DIR) $(TAR_OPTIONS) -
+ touch $@
+
+$(U_BOOT_DIR)/.patched: $(U_BOOT_DIR)/.unpacked
+ toolchain/patch-kernel.sh $(U_BOOT_DIR) target/u-boot/ \
+ u-boot-$(U_BOOT_VERSION)-$(BR2_ARCH)-\*.patch\*
+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)/.header_copied: $(U_BOOT_DIR)/.patched
+ifneq ($(strip $(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE)),)
+ cp -dpf $(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE) $(U_BOOT_INC_CONF_FILE)
+endif
+ touch $@
+
+$(U_BOOT_DIR)/.configured: $(U_BOOT_DIR)/.header_copied
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ $(MAKE) -C $(U_BOOT_DIR) \
+ $(BR2_TARGET_UBOOT_BOARDNAME)_config
+ touch $@
+
+$(U_BOOT_DIR)/.header_modified: $(U_BOOT_DIR)/.configured
+ # Modify configuration header in $(U_BOOT_INC_CONF_FILE)
+
+ @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)
+ifneq ($(strip $(BR2_PROJECT)),"")
+ $(call insert_define, "CONFIG_HOSTNAME", $(BR2_PROJECT))
+endif
+ifneq ($(strip $(BR2_TARGET_UBOOT_SERVERIP)),"")
+ $(call insert_define, "CONFIG_SERVERIP", $(BR2_TARGET_UBOOT_SERVERIP))
+endif
+
+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_ETHADDR)),"")
+ $(call insert_define, "CONFIG_ETHADDR", $(BR2_TARGET_UBOOT_ETHADDR))
+endif
+ifneq ($(strip $(BR2_TARGET_UBOOT_ETH1ADDR)),"")
+ $(call insert_define "CONFIG_ETH2ADDR", $(BR2_TARGET_UBOOT_ETH1ADDR))
+endif
+ifneq ($(strip $(BR2_TARGET_UBOOT_BOOTARGS)),"")
+ $(call insert_define "CONFIG_BOOTARGS", $(BR2_TARGET_UBOOT_BOOTARGS))
+endif
+ifneq ($(strip $(BR2_TARGET_UBOOT_BOOTCMD)),"")
+ $(call insert_define "CONFIG_BOOTCOMMAND", $(BR2_TARGET_UBOOT_BOOTCMD))
+endif
+ifneq ($(strip $(BR2_TARGET_UBOOT_SILENT)),"")
+ $(call insert_define "CONFIG_SILENT_CONSOLE", "")
+endif
+ @echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(U_BOOT_INC_CONF_FILE)
+ touch $@
+
+$(U_BOOT_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/.header_modified
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ $(MAKE) -C $(U_BOOT_DIR)
+
+$(BINARIES_DIR)/$(U_BOOT_BIN): $(U_BOOT_DIR)/$(U_BOOT_BIN)
+ cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)
+ cp -dpf $(U_BOOT_DIR)/tools/$(U_BOOT_TOOLS_BIN) $(STAGING_DIR)/usr/bin/
+
+u-boot: gcc $(BINARIES_DIR)/$(U_BOOT_BIN)
+
+u-boot-clean:
+ $(MAKE) -C $(U_BOOT_DIR) clean
+
+u-boot-dirclean:
+ rm -rf $(U_BOOT_DIR)
+
+u-boot-source: $(DL_DIR)/$(U_BOOT_SOURCE)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_UBOOT)),y)
+TARGETS+=u-boot
+endif
+
+u-boot-status:
+ @echo
+ @echo U_BOOT_INC_CONF_FILE = $(U_BOOT_INC_CONF_FILE)
+ @echo
+ @echo BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE = $(BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE)
+ @echo BR2_TARGET_U_BOOT_CONFIG_BOARD = $(BR2_TARGET_U_BOOT_CONFIG_BOARD)
+ @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_BOOTARGS = $(BR2_TARGET_UBOOT_BOOTARGS)
+ @echo BR2_TARGET_UBOOT_BOOTCMD = $(BR2_TARGET_UBOOT_BOOTCMD)
+ @echo BR2_TARGET_UBOOT_SILENT = $(BR2_TARGET_UBOOT_SILENT)
+ @echo
+ @exit 0
diff --git a/target/device/Atmel/u-boot/u-boot-1.3.0-100-atmel.2.patch.bad b/target/u-boot/u-boot-1.3.0-avr32-100-atmel.2.patch
index a6d484b2d..a6d484b2d 100644
--- a/target/device/Atmel/u-boot/u-boot-1.3.0-100-atmel.2.patch.bad
+++ b/target/u-boot/u-boot-1.3.0-avr32-100-atmel.2.patch