All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/16] Add macros to ease our life with independent CONFIGs between U-Boot and SPL
@ 2015-07-26  8:26 Masahiro Yamada
  2015-07-26  8:26 ` [U-Boot] [PATCH 01/16] ARM: remove vpac270 board support Masahiro Yamada
                   ` (16 more replies)
  0 siblings, 17 replies; 32+ messages in thread
From: Masahiro Yamada @ 2015-07-26  8:26 UTC (permalink / raw)
  To: u-boot


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

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

end of thread, other threads:[~2015-08-01 16:36 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [U-Boot] [PATCH 00/16] Add macros to ease our life with independent CONFIGs between U-Boot and SPL Scott Wood

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.