[U-Boot] [PATCH 00/16] Add macros to ease our life with independent CONFIGs between U-Boot and SPL

Masahiro Yamada yamada.masahiro at socionext.com
Sun Jul 26 10:26:44 CEST 2015


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.

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

I hope this series will make our life easier.



Masahiro Yamada (16):
  ARM: remove vpac270 board support
  kbuild: fixdep: optimize code slightly
  kbuild: add a makefile macro useful with per-image config options
  linux/kconfig.h: add CPP macros useful for per-image config options
  spl: move SPL driver entries to driver/Makefile
  dm: unify obj-$(CONFIG_DM) and obj-$(CONFIG_SPL_DM) entries
  clk: rename CONFIG_SPL_CLK_SUPPORT to CONFIG_SPL_CLK
  clk: unify obj-$(CONFIG_CLK) and obj-$(CONFIG_SPL_CLK) entries
  ram: rename CONFIG_SPL_RAM_SUPPORT to CONFIG_SPL_RAM
  ram: unify obj-$(CONFIG_RAM) and obj-$(CONFIG_SPL_RAM) entries
  led: rename CONFIG_SPL_LED_SUPPORT to CONFIG_SPL_LED
  led: unify obj-$(CONFIG_LED) and obj-$(CONFIG_SPL_LED) entries
  dm: drop CONFIG_DM_DEVICE_REMOVE from uncmd list
  fdtdec: fix OF_CONTROL switch
  of: flip CONFIG_SPL_DISABLE_OF_CONTROL into CONFIG_SPL_OF_CONTROL
  of: clean up OF_CONTROL ifdef conditionals

 arch/arm/Kconfig                                   |  10 -
 arch/arm/cpu/armv7/am33xx/board.c                  |   2 +-
 arch/arm/cpu/armv7/exynos/Kconfig                  |   8 -
 arch/arm/cpu/armv7/exynos/pinmux.c                 |   2 +-
 arch/arm/cpu/armv7/s5pc1xx/Kconfig                 |   2 -
 arch/arm/include/asm/arch-exynos/dwmmc.h           |   2 -
 arch/arm/include/asm/arch-exynos/mipi_dsim.h       |   2 -
 arch/arm/include/asm/arch-exynos/mmc.h             |   2 -
 arch/arm/mach-tegra/clock.c                        |   4 +-
 arch/arm/mach-tegra/tegra114/clock.c               |   4 +-
 arch/arm/mach-tegra/tegra124/clock.c               |   4 +-
 arch/arm/mach-tegra/tegra20/clock.c                |   4 +-
 arch/arm/mach-tegra/tegra30/clock.c                |   4 +-
 board/vpac270/Kconfig                              |   9 -
 board/vpac270/MAINTAINERS                          |   8 -
 board/vpac270/Makefile                             |  13 -
 board/vpac270/onenand.c                            |  46 ---
 board/vpac270/u-boot-spl.lds                       |  81 -----
 board/vpac270/vpac270.c                            | 126 --------
 .../xilinx/microblaze-generic/microblaze-generic.c |   2 +-
 board/xilinx/zynq/board.c                          |   2 +-
 common/cli.c                                       |   4 +-
 common/spl/spl.c                                   |   3 +-
 configs/am335x_boneblack_vboot_defconfig           |   1 -
 configs/arches_defconfig                           |   1 -
 configs/canyonlands_defconfig                      |   1 -
 configs/galileo_defconfig                          |   1 -
 configs/microblaze-generic_defconfig               |   1 -
 configs/odroid_defconfig                           |   1 -
 configs/origen_defconfig                           |   1 -
 configs/s5pc210_universal_defconfig                |   1 -
 configs/socfpga_socrates_defconfig                 |   1 -
 configs/trats2_defconfig                           |   1 -
 configs/trats_defconfig                            |   1 -
 configs/vpac270_nor_128_defconfig                  |   5 -
 configs/vpac270_nor_256_defconfig                  |   5 -
 configs/vpac270_ond_256_defconfig                  |   7 -
 doc/README.scrapyard                               |   1 +
 drivers/Makefile                                   |  41 ++-
 drivers/clk/Kconfig                                |   2 +-
 drivers/core/Makefile                              |   8 +-
 drivers/core/device.c                              |  10 +-
 drivers/core/lists.c                               |   2 +-
 drivers/core/root.c                                |   6 +-
 drivers/core/uclass.c                              |   4 +-
 drivers/gpio/mxc_gpio.c                            |   2 +-
 drivers/gpio/vybrid_gpio.c                         |   2 +-
 drivers/i2c/s3c24x0_i2c.c                          |   4 +-
 drivers/input/Makefile                             |   3 +-
 drivers/input/tegra-kbc.c                          |   2 +-
 drivers/led/Kconfig                                |   2 +-
 drivers/mmc/exynos_dw_mmc.c                        |   2 +-
 drivers/mmc/s5p_sdhci.c                            |   2 +-
 drivers/mmc/tegra_mmc.c                            |   2 +-
 drivers/mmc/zynq_sdhci.c                           |   2 +-
 drivers/mtd/spi/sf_probe.c                         |   6 +-
 drivers/net/xilinx_emaclite.c                      |   2 +-
 drivers/net/zynq_gem.c                             |   2 +-
 drivers/power/exynos-tmu.c                         |   2 +-
 drivers/power/pmic/pmic_max77686.c                 |   4 +-
 drivers/ram/Kconfig                                |   2 +-
 drivers/serial/ns16550.c                           |   2 +-
 drivers/serial/serial-uclass.c                     |   4 +-
 drivers/serial/serial_omap.c                       |   2 +-
 drivers/serial/serial_pl01x.c                      |   2 +-
 drivers/serial/serial_tegra.c                      |   4 +-
 drivers/serial/serial_uniphier.c                   |   2 +-
 drivers/serial/serial_zynq.c                       |   2 +-
 drivers/sound/max98095.c                           |   2 +-
 drivers/sound/wm8994.c                             |   2 +-
 drivers/tpm/tpm_tis_i2c.c                          |   2 +-
 drivers/video/exynos_dp.c                          |   4 +-
 drivers/video/exynos_dp_lowlevel.c                 |   2 +-
 drivers/video/exynos_fb.c                          |   8 +-
 drivers/video/exynos_fimd.c                        |   4 +-
 drivers/video/exynos_mipi_dsi.c                    |   4 +-
 drivers/video/tegra.c                              |   2 +-
 dts/Kconfig                                        |   6 +-
 include/cli.h                                      |   2 +-
 include/config_uncmd_spl.h                         |   4 -
 include/configs/microblaze-generic.h               |   3 +-
 include/configs/socfpga_common.h                   |   2 +-
 include/configs/vpac270.h                          | 326 ---------------------
 include/dm/device-internal.h                       |  10 +-
 include/dm/device.h                                |   4 +-
 include/dm/uclass-internal.h                       |   4 +-
 include/fdtdec.h                                   |  10 -
 include/linux/kconfig.h                            |  48 +++
 lib/Makefile                                       |  13 +-
 lib/fdtdec.c                                       |   4 +-
 scripts/Kbuild.include                             |   6 +
 scripts/Makefile.spl                               |  30 +-
 scripts/Makefile.uncmd_spl                         |   5 -
 scripts/basic/fixdep.c                             |  33 ++-
 94 files changed, 227 insertions(+), 818 deletions(-)
 delete mode 100644 board/vpac270/Kconfig
 delete mode 100644 board/vpac270/MAINTAINERS
 delete mode 100644 board/vpac270/Makefile
 delete mode 100644 board/vpac270/onenand.c
 delete mode 100644 board/vpac270/u-boot-spl.lds
 delete mode 100644 board/vpac270/vpac270.c
 delete mode 100644 configs/vpac270_nor_128_defconfig
 delete mode 100644 configs/vpac270_nor_256_defconfig
 delete mode 100644 configs/vpac270_ond_256_defconfig
 delete mode 100644 include/configs/vpac270.h

-- 
1.9.1



More information about the U-Boot mailing list