config.mk: Delete unnecessary code
v2 cover config.mk: Delete unnecessary code
These consecutive patches delete the following code in the top-level config.mk
ifneq ($(CONFIG_SPL_TEXT_BASE),)
CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE) endif
ifneq ($(CONFIG_SPL_PAD_TO),)
CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO) endif
ifneq ($(CONFIG_TPL_PAD_TO),)
CPPFLAGS += -DCONFIG_TPL_PAD_TO=$(CONFIG_TPL_PAD_TO) endif
ifneq ($(CONFIG_UBOOT_PAD_TO),)
CPPFLAGS += -DCONFIG_UBOOT_PAD_TO=$(CONFIG_UBOOT_PAD_TO) endif
ifneq ($(RESET_VECTOR_ADDRESS),)
CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS) endif
As for CONFIG_SPL_TEXT_BASE, CONFIG_UBOOT_PAD_TO, CONFIG_RESET_VECTOR_ADDRESS, CONFIG_TPL_PAD_TO, they are not defined in makefiles but only in config headers. So, we can simply delete them. (This is done in 0001.)
As for CONFIG_SPL_PAD_TO, there is only one board which defines it in a makefile. For refactoring, 0002 patch moves the definition of CONFIG_SPL_PAD_TO from board/ait/cam_enc_4xx/config.mk to include/configs/cam_enc_4xx.h. I added Cc Heiko Schocher, the maintainer of cam_enc_4xx board.
Heiko, a review is welcome if the refactoring in 0002 is acceptable or not. If it is not acceptable, please apply only 0001 patch.
Note:
We have one more left in config.mk
ifneq ($(CONFIG_SYS_TEXT_BASE),)
CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) endif
But too many boards still define CONFIG_SYS_TEXT_BASE in makefiles. So I could not touch for now.
I think board maintainers should make effort to move
the CONFIG definition from config.mk to headers.
Masahiro Yamada (2):
config.mk: Delete unnecessary code
cam_enc_4xx: Move CONFIG_SPL_PAD_TO to a config header
board/ait/cam_enc_4xx/config.mk | 2 -- config.mk | 20 -------------------- include/configs/cam_enc_4xx.h | 2 ++ 3 files changed, 2 insertions(+), 22 deletions(-)
Signature · 1 line
1.8.1.2
PATCH v2 1/2 config.mk: Delete unnecessary code
Currently no makefiles (board-specific config.mk)
set the following variables:
CONFIG_SPL_TEXT_BASECONFIG_UBOOT_PAD_TOCONFIG_RESET_VECTOR_ADDRESSCONFIG_TPL_PAD_TO
For all target boards using above macros they are set in header files (include/configs/*.h), so we do not need to set them as CPPFLAGS.
---
Changes for v2
- Additionaly delete a glue code for CONFIG_TPL_PAD_TO
config.mk | 16 ---------------- 1 file changed, 16 deletions(-)
config.mk +0 -16
@@ -232,22 +232,10 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),) CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) endif -ifneq ($(CONFIG_SPL_TEXT_BASE),) -CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE) -endif - ifneq ($(CONFIG_SPL_PAD_TO),) CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO) endif -ifneq ($(CONFIG_TPL_PAD_TO),) -CPPFLAGS += -DCONFIG_TPL_PAD_TO=$(CONFIG_TPL_PAD_TO) -endif - -ifneq ($(CONFIG_UBOOT_PAD_TO),) -CPPFLAGS += -DCONFIG_UBOOT_PAD_TO=$(CONFIG_UBOOT_PAD_TO) -endif - ifeq ($(CONFIG_SPL_BUILD),y) CPPFLAGS += -DCONFIG_SPL_BUILD ifeq ($(CONFIG_TPL_BUILD),y)
@@ -263,10 +251,6 @@ Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file) endif endif -ifneq ($(RESET_VECTOR_ADDRESS),) -CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS) -endif - ifneq ($(OBJTREE),$(SRCTREE)) CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include endif
Signature · 1 line
1.8.1.2
PATCH v2 1/2 config.mk: Delete unnecessary code
Quoted 8 lines · Masahiro Yamada
Currently no makefiles (board-specific config.mk)
set the following variables:
CONFIG_SPL_TEXT_BASECONFIG_UBOOT_PAD_TOCONFIG_RESET_VECTOR_ADDRESSCONFIG_TPL_PAD_TO
Quoted 5 lines
For all target boards using above macros they are set in header files (
include/configs/*.h), so we do not need to set them as CPPFLAGS.Signed-off-by Masahiro Yamada <[email protected]>
Applied to u-boot/master along with 2/2, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130906/3c47ae7e/attachment.pgp>
PATCH v2 2/2 cam_enc_4xx: Move CONFIG_SPL_PAD_TO to a config header
In reply to Masahiro YamadaFor most boards which define CONFIG_SPL_PAD_TO,
it is defined in config header files.
Currently, there exists only one exception, cam_enc_4xx board.
This patch moves CONFIG_SPL_PAD_TO definition
from board/ait/cam_enc_4xx/config.mk
to include/configs/cam_enc_4xx.h.
With this modification, we can delete a glue code in the top level config.mk:
ifneq ($(CONFIG_SPL_PAD_TO),)
CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO) endif
--- board/ait/cam_enc_4xx/config.mk | 2 -- config.mk | 4 ---- include/configs/cam_enc_4xx.h | 2 ++ 3 files changed, 2 insertions(+), 6 deletions(-)
board/ait/cam_enc_4xx/config.mk +0 -2
@@ -7,8 +7,6 @@ # (mem base + reserved) # -#Provide at least 16MB spacing between us and the Linux Kernel image -CONFIG_SPL_PAD_TO := 12320 UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg ifndef CONFIG_SPL_BUILD ALL-y += $(obj)u-boot.ubl
config.mk +0 -4
@@ -232,10 +232,6 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),) CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) endif -ifneq ($(CONFIG_SPL_PAD_TO),) -CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO) -endif - ifeq ($(CONFIG_SPL_BUILD),y) CPPFLAGS += -DCONFIG_SPL_BUILD ifeq ($(CONFIG_TPL_BUILD),y)
include/configs/cam_enc_4xx.h +2 -0
@@ -216,6 +216,8 @@#define CONFIG_SPL_STACK (0x00010000 + 0x7f00)#define CONFIG_SPL_TEXT_BASE 0x00000020/*CONFIG_SYS_SRAM_START*/ +/* Provide at least 16MB spacing between us and the Linux Kernel image */ +#define CONFIG_SPL_PAD_TO 12320#define CONFIG_SPL_MAX_FOOTPRINT 12288#ifndef CONFIG_SPL_BUILD
Signature · 1 line
1.8.1.2