mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2 0/4] u-boot: Modernize rules
@ 2019-02-05 18:56 Alexander Dahl
  2019-02-05 18:56 ` [ptxdist] [PATCH v2 1/4] u-boot: Bump default version and tweak help texts Alexander Dahl
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-02-05 18:56 UTC (permalink / raw)
  To: ptxdist

Hello,

I adopted the patch series on U-Boot by Ahmad Fatoum from last year.

I considered the feedback, rewrote some parts, and dropped others for
now.

The main work went into adding support for Kconfig based configuration
of newer (post 2014) versions of U-Boot. Thanks to Ahmad and Michael
for base work and suggestions. I took some parts from the old patch,
but the whole menu extension and revised variable section is rewritten
from scratch, so I changed the author to myself and added Ahmad as
Co-author. If that's to offensive, let me know, I will change it back
then.

I dropped the controverse patches on licensing and creating U-Boot
environment and script images, maybe someone else is interested in
reviving those?

You'll find additional changelogs in each patch. Let me know, what you
think.

Greets
Alex

Ahmad Fatoum (2):
  u-boot: Run install(1)/rm(1) with -v
  u-boot: Add u-boot{-dtb, -with-spl-pbl}.bin image installation options

Alexander Dahl (2):
  u-boot: Bump default version and tweak help texts
  u-boot: Add option to use Kconfig based configuration

 platforms/u-boot.in | 73 ++++++++++++++++++++++++++++++++++++++++++-----
 rules/u-boot.make   | 82 ++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 131 insertions(+), 24 deletions(-)

-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [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

* [ptxdist] [PATCH v2 3/4] u-boot: Run install(1)/rm(1) with -v
  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 ` [ptxdist] [PATCH v2 2/4] u-boot: Add option to use Kconfig based configuration Alexander Dahl
@ 2019-02-05 18:56 ` 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; +Cc: Ahmad Fatoum

From: Ahmad Fatoum <a.fatoum@pengutronix.de>

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---

Notes:
    v1 -> v2:
      * Rebased on master (ptxdist-2019.01.0-25-g707e92fe3)
      * Add flags for new options added since v1

 rules/u-boot.make | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/rules/u-boot.make b/rules/u-boot.make
index 9416ab833..5668f8f89 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -94,24 +94,24 @@ $(STATEDIR)/u-boot.install:
 
 $(STATEDIR)/u-boot.targetinstall:
 	@$(call targetinfo)
-	@install -D -m644 $(U_BOOT_DIR)/u-boot.bin $(IMAGEDIR)/u-boot.bin
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot.bin $(IMAGEDIR)/u-boot.bin
 ifdef PTXCONF_U_BOOT_INSTALL_SREC
-	@install -D -m644 $(U_BOOT_DIR)/u-boot.srec $(IMAGEDIR)/u-boot.srec
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot.srec $(IMAGEDIR)/u-boot.srec
 endif
 ifdef PTXCONF_U_BOOT_INSTALL_ELF
-	@install -D -m644 $(U_BOOT_DIR)/u-boot $(IMAGEDIR)/u-boot.elf
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot $(IMAGEDIR)/u-boot.elf
 endif
 ifdef PTXCONF_U_BOOT_INSTALL_SPL
-	@install -D -m644 $(U_BOOT_DIR)/SPL $(IMAGEDIR)/SPL
+	@install -v -D -m644 $(U_BOOT_DIR)/SPL $(IMAGEDIR)/SPL
 endif
 ifdef PTXCONF_U_BOOT_INSTALL_MLO
-	@install -D -m644 $(U_BOOT_DIR)/MLO $(IMAGEDIR)/MLO
+	@install -v -D -m644 $(U_BOOT_DIR)/MLO $(IMAGEDIR)/MLO
 endif
 ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMG
-	@install -D -m644 $(U_BOOT_DIR)/u-boot.img $(IMAGEDIR)/u-boot.img
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot.img $(IMAGEDIR)/u-boot.img
 endif
 ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMX
-	@install -D -m644 $(U_BOOT_DIR)/u-boot.imx $(IMAGEDIR)/u-boot.imx
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot.imx $(IMAGEDIR)/u-boot.imx
 endif
 	@$(call touch)
 
@@ -122,9 +122,9 @@ endif
 $(STATEDIR)/u-boot.clean:
 	@$(call targetinfo)
 	@$(call clean_pkg, U_BOOT)
-	@rm -f $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
-	@rm -f $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
-	@rm -f $(IMAGEDIR)/u-boot.imx
+	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
+	@rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
+	@rm -vf $(IMAGEDIR)/u-boot.imx
 
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH v2 4/4] u-boot: Add u-boot{-dtb, -with-spl-pbl}.bin image installation options
  2019-02-05 18:56 [ptxdist] [PATCH v2 0/4] u-boot: Modernize rules Alexander Dahl
                   ` (2 preceding siblings ...)
  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 ` Alexander Dahl
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-02-05 18:56 UTC (permalink / raw)
  To: ptxdist; +Cc: Ahmad Fatoum

From: Ahmad Fatoum <a.fatoum@pengutronix.de>

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---

Notes:
    v1 -> v2:
      * Rebased on master (ptxdist-2019.01.0-25-g707e92fe3)

 platforms/u-boot.in | 14 ++++++++++++++
 rules/u-boot.make   |  9 +++++++++
 2 files changed, 23 insertions(+)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 6239a5369..e63830171 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -128,5 +128,19 @@ config U_BOOT_INSTALL_U_BOOT_IMX
 	  image directory. Say yes if you are building for freescale i.MX SOCs
 	  and are not using SPL.
 
+config U_BOOT_INSTALL_U_BOOT_DTB
+	prompt "install u-boot-dtb.bin"
+	bool
+	help
+	  Installing the U-Boot binary concatenated with the device tree
+	  into platform image directory.
+
+config U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
+	prompt "install u-boot-with-spl-pbl.bin"
+	bool
+	help
+	  Installing the U-Boot binary which contains as well the SPL and PBL.
+	  Say yes if you are building for Layerscape SoCs
+
 endif
 
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 5668f8f89..c72a2ea09 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -113,6 +113,14 @@ endif
 ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMX
 	@install -v -D -m644 $(U_BOOT_DIR)/u-boot.imx $(IMAGEDIR)/u-boot.imx
 endif
+ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_DTB
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-dtb.bin \
+		$(IMAGEDIR)/u-boot-dtb.bin
+endif
+ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \
+		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
@@ -125,6 +133,7 @@ $(STATEDIR)/u-boot.clean:
 	@rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-boot.elf
 	@rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO
 	@rm -vf $(IMAGEDIR)/u-boot.imx
+	@rm -vf	$(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin
 
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-05 18:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ptxdist] [PATCH v2 2/4] u-boot: Add option to use Kconfig based configuration 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox