2008-03-11 19:26:07 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# U-Boot
|
|
|
|
#
|
|
|
|
#############################################################
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_VERSION = $(call qstrip,$(BR2_TARGET_UBOOT_VERSION))
|
|
|
|
UBOOT_BOARD_NAME = $(call qstrip,$(BR2_TARGET_UBOOT_BOARDNAME))
|
2011-07-05 21:54:07 +02:00
|
|
|
|
2012-08-18 11:25:40 +02:00
|
|
|
UBOOT_LICENSE = GPLv2+
|
|
|
|
UBOOT_LICENSE_FILES = COPYING
|
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_INSTALL_IMAGES = YES
|
2009-01-02 12:18:09 +01:00
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
ifeq ($(UBOOT_VERSION),custom)
|
2010-06-12 13:18:04 +02:00
|
|
|
# Handle custom U-Boot tarballs as specified by the configuration
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_TARBALL = $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION))
|
2013-01-09 13:12:44 +01:00
|
|
|
UBOOT_SITE = $(patsubst %/,%,$(dir $(UBOOT_TARBALL)))
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_SOURCE = $(notdir $(UBOOT_TARBALL))
|
2011-07-11 22:46:12 +02:00
|
|
|
else ifeq ($(BR2_TARGET_UBOOT_CUSTOM_GIT),y)
|
|
|
|
UBOOT_SITE = $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL))
|
|
|
|
UBOOT_SITE_METHOD = git
|
2010-06-12 13:18:04 +02:00
|
|
|
else
|
|
|
|
# Handle stable official U-Boot versions
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_SITE = ftp://ftp.denx.de/pub/u-boot
|
|
|
|
UBOOT_SOURCE = u-boot-$(UBOOT_VERSION).tar.bz2
|
2010-06-12 13:18:04 +02:00
|
|
|
endif
|
2009-01-03 16:50:38 +01:00
|
|
|
|
2010-07-26 16:14:41 +02:00
|
|
|
ifeq ($(BR2_TARGET_UBOOT_FORMAT_KWB),y)
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_BIN = u-boot.kwb
|
2011-07-14 13:41:29 +02:00
|
|
|
UBOOT_MAKE_TARGET = $(UBOOT_BIN)
|
2012-08-09 20:11:09 +02:00
|
|
|
else ifeq ($(BR2_TARGET_UBOOT_FORMAT_AIS),y)
|
|
|
|
UBOOT_BIN = u-boot.ais
|
|
|
|
UBOOT_MAKE_TARGET = $(UBOOT_BIN)
|
2011-02-07 06:49:11 +01:00
|
|
|
else ifeq ($(BR2_TARGET_UBOOT_FORMAT_LDR),y)
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_BIN = u-boot.ldr
|
2011-12-01 16:04:58 +01:00
|
|
|
else ifeq ($(BR2_TARGET_UBOOT_FORMAT_NAND_BIN),y)
|
|
|
|
UBOOT_BIN = u-boot-nand.bin
|
2012-03-18 23:04:51 +01:00
|
|
|
else ifeq ($(BR2_TARGET_UBOOT_FORMAT_IMG),y)
|
|
|
|
UBOOT_BIN = u-boot.img
|
2010-07-26 16:14:41 +02:00
|
|
|
else
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_BIN = u-boot.bin
|
2012-05-17 12:11:31 +02:00
|
|
|
UBOOT_BIN_IFT = $(UBOOT_BIN).ift
|
2010-07-26 16:14:41 +02:00
|
|
|
endif
|
2009-01-06 15:16:27 +01:00
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_ARCH=$(KERNEL_ARCH)
|
2009-01-03 16:50:38 +01:00
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
UBOOT_CONFIGURE_OPTS += CONFIG_NOSOFTFLOAT=1
|
|
|
|
UBOOT_MAKE_OPTS += \
|
2011-07-05 21:54:07 +02:00
|
|
|
CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
|
2011-07-11 22:46:09 +02:00
|
|
|
ARCH=$(UBOOT_ARCH)
|
2011-07-05 21:54:07 +02:00
|
|
|
|
|
|
|
# Helper function to fill the U-Boot config.h file.
|
|
|
|
# Argument 1: option name
|
|
|
|
# Argument 2: option value
|
|
|
|
# If the option value is empty, this function does nothing.
|
2008-03-11 19:26:07 +01:00
|
|
|
define insert_define
|
2011-07-05 21:54:07 +02:00
|
|
|
$(if $(call qstrip,$(2)),
|
|
|
|
@echo "#ifdef $(strip $(1))" >> $(@D)/include/config.h
|
|
|
|
@echo "#undef $(strip $(1))" >> $(@D)/include/config.h
|
|
|
|
@echo "#endif" >> $(@D)/include/config.h
|
|
|
|
@echo '#define $(strip $(1)) $(call qstrip,$(2))' >> $(@D)/include/config.h)
|
2008-03-11 19:26:07 +01:00
|
|
|
endef
|
2008-04-01 09:03:07 +02:00
|
|
|
|
2010-07-29 15:38:27 +02:00
|
|
|
ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),)
|
2011-07-11 22:46:09 +02:00
|
|
|
define UBOOT_APPLY_CUSTOM_PATCHES
|
2011-08-31 23:35:04 +02:00
|
|
|
support/scripts/apply-patches.sh $(@D) $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR) \
|
2011-07-11 22:46:09 +02:00
|
|
|
uboot-$(UBOOT_VERSION)-\*.patch
|
2011-07-05 21:54:07 +02:00
|
|
|
endef
|
2008-03-11 19:26:07 +01:00
|
|
|
|
2011-07-19 13:59:42 +02:00
|
|
|
UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
|
2010-04-04 17:11:33 +02:00
|
|
|
endif
|
2011-07-05 21:54:07 +02:00
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
define UBOOT_CONFIGURE_CMDS
|
|
|
|
$(TARGET_CONFIGURE_OPTS) $(UBOOT_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) \
|
|
|
|
$(UBOOT_BOARD_NAME)_config
|
2011-07-05 21:54:07 +02:00
|
|
|
@echo >> $(@D)/include/config.h
|
|
|
|
@echo "/* Add a wrapper around the values Buildroot sets. */" >> $(@D)/include/config.h
|
|
|
|
@echo "#ifndef __BR2_ADDED_CONFIG_H" >> $(@D)/include/config.h
|
|
|
|
@echo "#define __BR2_ADDED_CONFIG_H" >> $(@D)/include/config.h
|
|
|
|
$(call insert_define,DATE,$(DATE))
|
|
|
|
$(call insert_define,CONFIG_LOAD_SCRIPTS,1)
|
|
|
|
$(call insert_define,CONFIG_IPADDR,$(BR2_TARGET_UBOOT_IPADDR))
|
|
|
|
$(call insert_define,CONFIG_GATEWAYIP,$(BR2_TARGET_UBOOT_GATEWAY))
|
|
|
|
$(call insert_define,CONFIG_NETMASK,$(BR2_TARGET_UBOOT_NETMASK))
|
|
|
|
$(call insert_define,CONFIG_SERVERIP,$(BR2_TARGET_UBOOT_SERVERIP))
|
|
|
|
$(call insert_define,CONFIG_ETHADDR,$(BR2_TARGET_UBOOT_ETHADDR))
|
|
|
|
$(call insert_define,CONFIG_ETH1ADDR,$(BR2_TARGET_UBOOT_ETH1ADDR))
|
|
|
|
@echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(@D)/include/config.h
|
|
|
|
endef
|
2008-04-23 15:03:53 +02:00
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
define UBOOT_BUILD_CMDS
|
|
|
|
$(TARGET_CONFIGURE_OPTS) $(UBOOT_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) \
|
|
|
|
$(UBOOT_MAKE_TARGET)
|
2011-07-05 21:54:07 +02:00
|
|
|
endef
|
2008-03-11 19:26:07 +01:00
|
|
|
|
2012-05-17 12:11:31 +02:00
|
|
|
define UBOOT_BUILD_OMAP_IFT
|
|
|
|
$(HOST_DIR)/usr/bin/gpsign -f $(@D)/u-boot.bin \
|
|
|
|
-c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))
|
|
|
|
endef
|
|
|
|
|
2011-07-11 22:46:09 +02:00
|
|
|
define UBOOT_INSTALL_IMAGES_CMDS
|
|
|
|
cp -dpf $(@D)/$(UBOOT_BIN) $(BINARIES_DIR)/
|
2012-03-18 23:04:50 +01:00
|
|
|
$(if $(BR2_TARGET_UBOOT_SPL),
|
|
|
|
cp -dpf $(@D)/$(BR2_TARGET_UBOOT_SPL_NAME) $(BINARIES_DIR)/)
|
2011-07-05 21:54:07 +02:00
|
|
|
endef
|
2008-03-11 19:26:07 +01:00
|
|
|
|
2012-05-17 12:11:31 +02:00
|
|
|
define UBOOT_INSTALL_OMAP_IFT_IMAGE
|
|
|
|
cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/
|
|
|
|
endef
|
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_UBOOT_OMAP_IFT),y)
|
|
|
|
# we NEED a config file unless we're at make source
|
|
|
|
ifeq ($(filter source,$(MAKECMDGOALS)),)
|
|
|
|
ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)),)
|
|
|
|
$(error No gpsign config file. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting)
|
|
|
|
endif
|
|
|
|
ifeq ($(wildcard $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))),)
|
|
|
|
$(error gpsign config file $(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG) not found. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
UBOOT_DEPENDENCIES += host-omap-u-boot-utils
|
|
|
|
UBOOT_POST_BUILD_HOOKS += UBOOT_BUILD_OMAP_IFT
|
|
|
|
UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_INSTALL_OMAP_IFT_IMAGE
|
|
|
|
endif
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|
2009-01-03 01:00:46 +01:00
|
|
|
|
2008-12-08 09:15:58 +01:00
|
|
|
ifeq ($(BR2_TARGET_UBOOT),y)
|
2010-09-28 14:43:25 +02:00
|
|
|
# we NEED a board name unless we're at make source
|
|
|
|
ifeq ($(filter source,$(MAKECMDGOALS)),)
|
2011-07-11 22:46:09 +02:00
|
|
|
ifeq ($(UBOOT_BOARD_NAME),)
|
2009-01-26 15:49:19 +01:00
|
|
|
$(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting)
|
|
|
|
endif
|
2010-09-28 14:43:25 +02:00
|
|
|
endif
|
2008-03-11 19:26:07 +01:00
|
|
|
endif
|