* [ptxdist] [PATCH v2 1/4] u-boot: Bump default version and tweak help texts
2019-02-05 18:56 [ptxdist] [PATCH v2 0/4] u-boot: Modernize rules Alexander Dahl
@ 2019-02-05 18:56 ` Alexander Dahl
2019-02-05 18:56 ` [ptxdist] [PATCH v2 2/4] u-boot: Add option to use Kconfig based configuration Alexander Dahl
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-02-05 18:56 UTC (permalink / raw)
To: ptxdist
The default U-Boot version to be built was from 2007, maybe it's time to
bump that?
The help text better explains the make config target option now, and how
U-Boot is written in the help texts was unified.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v1 -> v2:
* This patch is new in v2.
platforms/u-boot.in | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index a403262bf..56e971659 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -9,10 +9,11 @@ if U_BOOT
config U_BOOT_VERSION
string
- default 1.2.0
+ default 2019.01
prompt "U-Boot version"
help
- Enter the Uboot version you want to build. Usually something like "1.2.0"
+ Enter the U-Boot version you want to build. Usually something like
+ "2019.01".
config U_BOOT_MD5
string
@@ -32,8 +33,12 @@ config U_BOOT_CONFIG
prompt "U-Boot config target"
help
The U-Boot make config target. Usually something like
- "yourbox_config". See Uboot's main Makefile for possible
- configuration targets.
+ "yourbox_config". Before U-Boot 2014.10 that was something from
+ the file "boards.cfg". With version 2014.10 U-Boot switched to
+ Kconfig based build and configuration, and from there you could
+ use some defconfig name as config target, e.g.
+ "yourbox_defconfig", where that name is a file from the folder
+ "configs".
comment "target install"
@@ -70,8 +75,8 @@ config U_BOOT_INSTALL_U_BOOT_IMG
prompt "install u-boot.img"
bool
help
- Installing the u-boot image with header ("u-boot.img") which is executed
- by u-boot SPL into platform image directory.
+ Installing the U-Boot image with header ("u-boot.img") which is executed
+ by U-Boot SPL into platform image directory.
endif
--
2.11.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH v2 2/4] u-boot: Add option to use Kconfig based configuration
2019-02-05 18:56 [ptxdist] [PATCH v2 0/4] u-boot: Modernize rules Alexander Dahl
2019-02-05 18:56 ` [ptxdist] [PATCH v2 1/4] u-boot: Bump default version and tweak help texts Alexander Dahl
@ 2019-02-05 18:56 ` Alexander Dahl
2019-02-05 18:56 ` [ptxdist] [PATCH v2 3/4] u-boot: Run install(1)/rm(1) with -v Alexander Dahl
2019-02-05 18:56 ` [ptxdist] [PATCH v2 4/4] u-boot: Add u-boot{-dtb, -with-spl-pbl}.bin image installation options Alexander Dahl
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-02-05 18:56 UTC (permalink / raw)
To: ptxdist
Recent versions of U-Boot (from 2014.10) use a Kconfig based
configuration. To also support the old system and not break existing
builds, this is introduced as optional, which also allows to build a
defconfig without oldconfig/menuconfig and a .config file in the BSP.
A new menu entry of type 'choice' was added to choose between the new
Kconfig based and the legacy config system (boldly inspired by
buildroot). Options for prepare and compile stage were revised and
adapted to U-Boot build documentation (CROSS_COMPILE and HOSTCC in env
instead of make options).
That part is based on the first patch 'u-boot: add support for
oldconfig/menuconfig' by Ahmad Fatoum from October 2018, but extended by
the new menu options, which more or less follows a suggestion of Michael
Olbrich to support both configuration systems and distinguish in the
make rule.
The option to avoid parallel building is only kept for the legacy build,
modern U-Boot uses the kernel build system and should build fine in
parallel.
Also added is support for ptxdist option -v for a more verbose build.
This is passed to make with V= option, which is based on a second patch
'u-boot: add V=$(PTXDIST_VERBOSE) to make options' by Ahmad Fatoum, but
squashed into this, because all those variable stuff was rewritten
anyway.
Compile tested with:
* recent DistroKit, ptxdist 2019.01.0, U-Boot 2019.01, and
defconfig for Microchip SAMA5D27-SOM1-EK1 (platform-v7a), both build
system approaches.
* custom BSP, ptxdist 2018.05.0, U-Boot 2012.04.01, and config
"at91sam9g20ek_nandflash" (arm-v5te), legacy build only.
Co-authored-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Notes:
v1 -> v2:
* Rewritten from scratch based on first patch by Ahmad Fatoum and
suggestions by Michael Olbrich
platforms/u-boot.in | 42 +++++++++++++++++++++++++++++++++++++++++-
rules/u-boot.make | 53 ++++++++++++++++++++++++++++++++++++++++++++++-------
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
--
2.11.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread