diff mbox

[v3,3/3] boot/uboot: Add uboot-menuconfig and friends

Message ID 1423088981-13255-3-git-send-email-joerg.krause@embedded.rocks
State Changes Requested
Headers show

Commit Message

Jörg Krause Feb. 4, 2015, 10:29 p.m. UTC
Add uboot-menuconfig, uboot-spl/menuconfig, uboot-tpl/menuconfig and their
friends as make targets.

The Kconfig configuration in U-Boot is different from Linux. The biggest
difference is that U-Boot has to configure multiple boot images per board:
Normal, SPL, TPL. The Kconfig functions are expanded for U-Boot to handle
multiple images.

menuconfig and friends are used to configure Normal and create (or modify)
the .config file. For SPL configuration, the configutation targets are
prefixed with "spl/", for example "make spl/config", "make spl/menuconfig",
etc. Those targets create or modify the spl/.config file. Likewise, run
"make tpl/config", "make tpl/menuconfig", etc. for TPL.

The target "<board>_defconfig" is used to create the .config, spl/.config
(if CONFIG_SPL is defined) and tpl/.config (if CONFIG_TPL is defined) based
on the file configs/<board>_defconfig.

savedefconfig creates a minimal set of config based on the .config and saves
it into the "defconfig" file. If CONFIG_SPL (and CONFIG_TPL) is defined, the
common lines among .config, spl/.config (and tpl/.config) are coalesced
together with a special syntax where each line has a "<condition>:" prefix.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
Changes v2 -> v3:
  - Add spl/menuconfig and tpl/menuconfig and their friends
  - Rewrite commit log
Changes v1 -> v2:
  - Retain backward compatibility (Thomas)
---
 boot/uboot/uboot.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Yegor Yefremov March 23, 2015, 10:28 a.m. UTC | #1
Hi Jörg,

On Wed, Feb 4, 2015 at 11:29 PM, Jörg Krause
<joerg.krause@embedded.rocks> wrote:
> Add uboot-menuconfig, uboot-spl/menuconfig, uboot-tpl/menuconfig and their
> friends as make targets.
>
> The Kconfig configuration in U-Boot is different from Linux. The biggest
> difference is that U-Boot has to configure multiple boot images per board:
> Normal, SPL, TPL. The Kconfig functions are expanded for U-Boot to handle
> multiple images.
>
> menuconfig and friends are used to configure Normal and create (or modify)
> the .config file. For SPL configuration, the configutation targets are
> prefixed with "spl/", for example "make spl/config", "make spl/menuconfig",
> etc. Those targets create or modify the spl/.config file. Likewise, run
> "make tpl/config", "make tpl/menuconfig", etc. for TPL.
>
> The target "<board>_defconfig" is used to create the .config, spl/.config
> (if CONFIG_SPL is defined) and tpl/.config (if CONFIG_TPL is defined) based
> on the file configs/<board>_defconfig.
>
> savedefconfig creates a minimal set of config based on the .config and saves
> it into the "defconfig" file. If CONFIG_SPL (and CONFIG_TPL) is defined, the
> common lines among .config, spl/.config (and tpl/.config) are coalesced
> together with a special syntax where each line has a "<condition>:" prefix.
>
> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
> ---
> Changes v2 -> v3:
>   - Add spl/menuconfig and tpl/menuconfig and their friends
>   - Rewrite commit log
> Changes v1 -> v2:
>   - Retain backward compatibility (Thomas)
> ---
>  boot/uboot/uboot.mk | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 2ea9c86..2c39435 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -185,6 +185,26 @@ endif
>  $(eval $(generic-package))
>
>  ifeq ($(BR2_TARGET_UBOOT),y)
> +ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG),y)
> +uboot-menuconfig uboot-xconfig uboot-gconfig uboot-nconfig: uboot-configure
> +       $(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
> +       rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
> +uboot-spl/menuconfig uboot-spl/xconfig uboot-spl/gconfig uboot-spl/nconfig: uboot-configure
> +       $(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
> +       rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
> +uboot-tpl/menuconfig uboot-tpl/xconfig uboot-tpl/gconfig uboot-tpl/nconfig: uboot-configure
> +       $(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
> +       rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
> +uboot-savedefconfig: uboot-configure
> +       $(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
> +ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG_USE_CUSTOM_DEFCONFIG),y)
> +uboot-update-defconfig: uboot-savedefconfig
> +       cp -f $(UBOOT_DIR)/defconfig $(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG_CUSTOM_DEFCONFIG_FILE)
> +else
> +uboot-update-defconfig: ;
> +endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG_USE_CUSTOM_CONFIG
> +endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
> +
>  # we NEED a board name unless we're at make source
>  ifeq ($(filter source,$(MAKECMDGOALS)),)

could you please rework your patches to reflect the newest U-Boot
Kconfig changes?

kconfig: switch to single .config configuration
(http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/212547)

Yegor
Jörg Krause March 23, 2015, 1:43 p.m. UTC | #2
Hi Yegor,

On Mo, 2015-03-23 at 11:28 +0100, Yegor Yefremov wrote:
> 
> could you please rework your patches to reflect the newest U-Boot
> Kconfig changes?
> 
> kconfig: switch to single .config configuration
> (http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/212547)

I hope these upstream changes make it easier to use the kconfig-package
infrastructure. I will submit the reworked patches if U-Boot 2015.04 is
released.
Yegor Yefremov March 23, 2015, 1:47 p.m. UTC | #3
On Mon, Mar 23, 2015 at 2:43 PM, Jörg Krause
<joerg.krause@embedded.rocks> wrote:
> Hi Yegor,
>
> On Mo, 2015-03-23 at 11:28 +0100, Yegor Yefremov wrote:
>>
>> could you please rework your patches to reflect the newest U-Boot
>> Kconfig changes?
>>
>> kconfig: switch to single .config configuration
>> (http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/212547)
>
> I hope these upstream changes make it easier to use the kconfig-package
> infrastructure. I will submit the reworked patches if U-Boot 2015.04 is
> released.

So do I.

What board are you working with?

Yegor
Jörg Krause March 24, 2015, 12:59 p.m. UTC | #4
On Mo, 2015-03-23 at 14:47 +0100, Yegor Yefremov wrote:
> On Mon, Mar 23, 2015 at 2:43 PM, Jörg Krause
> <joerg.krause@embedded.rocks> wrote:
> > Hi Yegor,
> >
> > On Mo, 2015-03-23 at 11:28 +0100, Yegor Yefremov wrote:
> >>
> >> could you please rework your patches to reflect the newest U-Boot
> >> Kconfig changes?
> >>
> >> kconfig: switch to single .config configuration
> >> (http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/212547)
> >
> > I hope these upstream changes make it easier to use the kconfig-package
> > infrastructure. I will submit the reworked patches if U-Boot 2015.04 is
> > released.
> 
> So do I.
> 
> What board are you working with?

A custom Freescale i.MX28 board.
diff mbox

Patch

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 2ea9c86..2c39435 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -185,6 +185,26 @@  endif
 $(eval $(generic-package))
 
 ifeq ($(BR2_TARGET_UBOOT),y)
+ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG),y)
+uboot-menuconfig uboot-xconfig uboot-gconfig uboot-nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-spl/menuconfig uboot-spl/xconfig uboot-spl/gconfig uboot-spl/nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-tpl/menuconfig uboot-tpl/xconfig uboot-tpl/gconfig uboot-tpl/nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-savedefconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG_USE_CUSTOM_DEFCONFIG),y)
+uboot-update-defconfig: uboot-savedefconfig
+	cp -f $(UBOOT_DIR)/defconfig $(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG_CUSTOM_DEFCONFIG_FILE)
+else
+uboot-update-defconfig: ;
+endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG_USE_CUSTOM_CONFIG
+endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+
 # we NEED a board name unless we're at make source
 ifeq ($(filter source,$(MAKECMDGOALS)),)