All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 00/16] Add macros to ease our life with independent CONFIGs between U-Boot and SPL
Date: Mon, 27 Jul 2015 11:51:16 -0500	[thread overview]
Message-ID: <1438015876.2993.294.camel@freescale.com> (raw)
In-Reply-To: <1437899226-14925-1-git-send-email-yamada.masahiro@socionext.com>

On Sun, 2015-07-26 at 17:26 +0900, Masahiro Yamada wrote:
> Refer to Simon's question, too:
> http://lists.denx.de/pipermail/u-boot/2015-July/219598.html
> 
> Since U-boot introduced SPL (not since Kconfig),
> enabling features for U-boot and SPL independently is always a PITA.
> 
>  - decide if each feature should be supported for SPL or not
>  - Add CONFIG_SPL_FRED_SUPPORT into Makefile.spl
>  - Add #undef include/config_uncmd_spl.h to disable features
>    we do not want to support on SPL
>  - Add "ifdef CONFIG_SPL_BUILD ... endif" here and there to adjust things
>  - Add "#ifdef CONFIG_SPL_BUILD ... #endif" here and there to fix things up
> 
> Things are getting more and more crappy.
> 
> When U-boot switched to Kconfig, first I introduced separate .config
> (.config, spl/.config, tpl/.config) to clean up them.
> But it turned out to be a pain.
> 
> So, I believe the current single .config is much better.
> But I also admit we need something systematic to subdue our PITA.

We had something systematic -- separate .configs, which could have been used 
to get rid of the CONFIG_SPL_FRED_SUPPORT stuff -- that you reverted (which 
was the only reason the uncmd stuff ever existed).

Yet somehow this is "much better". :-(

> One possibility is to support "spl-y" in makefiles.
> (This idea is cribbed from barebox.)
> 
>   obj-$(CONFIG_FOO) += foo.o
>   spl-$(CONFIG_SPL_FOO) += foo.o
> 
> is cleaner than
> 
>   ifdef CONFIG_SPL_BUILD
>     obj-$(CONFIG_SPL_FOO) += foo.o
>   else
>     obj-$(CONFIG_FOO) += foo.o
>   endif
> 
> It is a nice improvement in makefile side.
> But we still need to do something with C files.
> 
> Another option is something like
>    CONFIG_FOO=yyn  (yes for U-boot, yes for SPL, no for TPL)
> 
> To achieve this, I think a big operation is needed in Kconfig core.
> I cannot do that.
> (Of course, Patches are welcome if someone else can do that.)
> 
> So, I was thinking of something different.
> 
> My idea was inspired by IS_ENABLED() macro in include/linux/kconfig.h.
> 
> Linux defines different macros for built-in and module,
> and it is possible to write
>    #if IS_ENABLED(CONFIG_FOO)
>            ...
>    #endif
> 
>  instead of
> 
>    #if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)
>            ...
>    #endif
> 
> So, I'd like to propose new macros to write code like
> 
>    #if CONFIG_IS_ENABLED(FOO)
>             ...
>    #endif
> 
>  instead of
> 
>    #if (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_FOO)) || \
>          (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_FOO))
>              ...
>    #endif

With separate .config this is just:

#ifdef CONFIG_FOO
        ...
#endif

-Scott

      parent reply	other threads:[~2015-07-27 16:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-26  8:26 [U-Boot] [PATCH 00/16] Add macros to ease our life with independent CONFIGs between U-Boot and SPL Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 01/16] ARM: remove vpac270 board support Masahiro Yamada
2015-07-26  8:49   ` Marek Vasut
2015-07-27  2:46     ` Masahiro Yamada
2015-07-27 15:58     ` Masahiro Yamada
2015-07-27 22:31       ` Marek Vasut
2015-07-28 15:53         ` Masahiro Yamada
2015-07-28 15:57           ` Marek Vasut
2015-08-01 16:08             ` Simon Glass
2015-08-01 16:36               ` Marek Vasut
2015-07-26  8:26 ` [U-Boot] [PATCH 02/16] kbuild: fixdep: optimize code slightly Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 03/16] kbuild: add a makefile macro useful with per-image config options Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 04/16] linux/kconfig.h: add CPP macros useful for " Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 05/16] spl: move SPL driver entries to driver/Makefile Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 06/16] dm: unify obj-$(CONFIG_DM) and obj-$(CONFIG_SPL_DM) entries Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 07/16] clk: rename CONFIG_SPL_CLK_SUPPORT to CONFIG_SPL_CLK Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 08/16] clk: unify obj-$(CONFIG_CLK) and obj-$(CONFIG_SPL_CLK) entries Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 09/16] ram: rename CONFIG_SPL_RAM_SUPPORT to CONFIG_SPL_RAM Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 10/16] ram: unify obj-$(CONFIG_RAM) and obj-$(CONFIG_SPL_RAM) entries Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 11/16] led: rename CONFIG_SPL_LED_SUPPORT to CONFIG_SPL_LED Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 12/16] led: unify obj-$(CONFIG_LED) and obj-$(CONFIG_SPL_LED) entries Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 13/16] dm: drop CONFIG_DM_DEVICE_REMOVE from uncmd list Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 14/16] fdtdec: fix OF_CONTROL switch Masahiro Yamada
2015-07-26  8:26 ` [U-Boot] [PATCH 15/16] of: flip CONFIG_SPL_DISABLE_OF_CONTROL into CONFIG_SPL_OF_CONTROL Masahiro Yamada
2015-07-26  8:27 ` [U-Boot] [PATCH 16/16] of: clean up OF_CONTROL ifdef conditionals Masahiro Yamada
2015-07-26 18:38   ` Pavel Machek
2015-07-26 23:30     ` Marek Vasut
2015-07-27  1:33     ` Masahiro Yamada
2015-07-27  7:05       ` Pavel Machek
2015-07-27 10:52         ` Marek Vasut
2015-07-27 12:30           ` Masahiro Yamada
2015-07-27 16:51 ` Scott Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438015876.2993.294.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.