summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--platforms/u-boot.in42
-rw-r--r--rules/u-boot.make53
2 files changed, 87 insertions, 8 deletions
diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 56e971659..6239a5369 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -28,9 +28,47 @@ config U_BOOT_SERIES
the u-boot patches directory. This way you can set a different
series file than the default.
-config U_BOOT_CONFIG
+choice
+ prompt "config system"
+ default U_BOOT_CONFIGSYSTEM_LEGACY
+
+config U_BOOT_CONFIGSYSTEM_KCONFIG
+ prompt "Kconfig"
+ bool
+ help
+ U-Boot from version 2014.10 uses Kconfig for configuring a target.
+ Use this if you want to configure U-Boot inside the BSP, e.g.
+ with menuconfig.
+
+ NOTE: if you just want to use a defconfig, you can still use the
+ legacy config system by using the name of a defconfig file from
+ the "configs" folder as config target.
+
+config U_BOOT_CONFIGSYSTEM_LEGACY
+ prompt "legacy"
+ bool
+ help
+ Select this if you use an old U-Boot prior 2014.10 or want to use
+ a defconfig as config target.
+
+endchoice
+
+if U_BOOT_CONFIGSYSTEM_KCONFIG
+
+config U_BOOT_CONFIGFILE_KCONFIG
+ prompt "config file"
string
+ default "u-boot.config"
+ help
+ This entry specifies the .config file used to compile U-Boot.
+
+endif
+
+if U_BOOT_CONFIGSYSTEM_LEGACY
+
+config U_BOOT_CONFIG
prompt "U-Boot config target"
+ string
help
The U-Boot make config target. Usually something like
"yourbox_config". Before U-Boot 2014.10 that was something from
@@ -40,6 +78,8 @@ config U_BOOT_CONFIG
"yourbox_defconfig", where that name is a file from the folder
"configs".
+endif
+
comment "target install"
config U_BOOT_INSTALL_SREC
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 9f69f9d49..9416ab833 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -25,6 +25,11 @@ U_BOOT_URL := ftp://ftp.denx.de/pub/u-boot/$(U_BOOT).$(U_BOOT_SUFFIX)
U_BOOT_SOURCE := $(SRCDIR)/$(U_BOOT).$(U_BOOT_SUFFIX)
U_BOOT_DIR := $(BUILDDIR)/$(U_BOOT)
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG
+U_BOOT_CONFIG := $(call ptx/in-platformconfigdir, \
+ $(call remove_quotes, $(PTXCONF_U_BOOT_CONFIGFILE_KCONFIG)))
+endif
+
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
@@ -36,17 +41,44 @@ U_BOOT_WRAPPER_BLACKLIST := \
TARGET_DEBUG \
TARGET_BUILD_ID
-U_BOOT_PATH := PATH=$(CROSS_PATH)
-U_BOOT_MAKE_OPT := CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) HOSTCC=$(HOSTCC)
-U_BOOT_MAKE_PAR := NO
-U_BOOT_TAGS_OPT := ctags cscope etags
+U_BOOT_MAKE_ENV := \
+ CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
+ HOSTCC=$(HOSTCC)
+U_BOOT_MAKE_OPT := V=$(PTXDIST_VERBOSE)
+U_BOOT_TAGS_OPT := ctags cscope etags
+
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG
+U_BOOT_CONF_TOOL := kconfig
+U_BOOT_CONF_ENV := KCONFIG_NOTIMESTAMP=1 $(U_BOOT_MAKE_ENV)
+endif
+
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY
+U_BOOT_CONF_ENV := PATH=$(CROSS_PATH) $(U_BOOT_MAKE_ENV)
+U_BOOT_CONF_OPT := \
+ $(U_BOOT_MAKE_OPT) \
+ $(call remove_quotes, $(PTXCONF_U_BOOT_CONFIG))
+U_BOOT_MAKE_PAR := NO
+endif
+
+ifdef PTXCONF_U_BOOT
+$(U_BOOT_CONFIG):
+ @echo
+ @echo "****************************************************************************"
+ @echo "***** Please generate a u-boot config with 'ptxdist menuconfig u-boot' *****"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY
$(STATEDIR)/u-boot.prepare:
@$(call targetinfo)
- cd $(U_BOOT_DIR) && \
- $(U_BOOT_PATH) \
- $(MAKE) $(U_BOOT_MAKE_OPT) $(PTXCONF_U_BOOT_CONFIG)
+ $(U_BOOT_CONF_ENV) $(MAKE) -C $(U_BOOT_DIR) $(U_BOOT_CONF_OPT)
@$(call touch)
+endif
# ----------------------------------------------------------------------------
# Install
@@ -94,4 +126,11 @@ $(STATEDIR)/u-boot.clean:
@rm -f $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
@rm -f $(IMAGEDIR)/u-boot.imx
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+u-boot_oldconfig u-boot_menuconfig u-boot_nconfig: $(STATEDIR)/u-boot.extract
+ @$(call world/kconfig, U_BOOT, $(subst u-boot_,,$@))
+
# vim: syntax=make