Skip to contentSkip to conversation

Define CONFIG_SYS_LEGACY_BOARD everywhere

PATCH New Simon Glass 2 participants 3 messages Mar 8, 2013

Subsystems (9)
Arm (32-bit) x86 PowerPC MIPS +5 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH v7 7/31 Define CONFIG_SYS_LEGACY_BOARD everywhere

We are introducing a new unified board setup and we want this to be the default. So we need to opt all architectures out first.

---
Changes in v7:
- Add description of CONFIG_SYS_LEGACY_BOARD to README

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 README                    | 21 +++++++++++++++++++++
 arch/arm/config.mk        |  3 +++
 arch/avr32/config.mk      |  3 +++
 arch/blackfin/config.mk   |  3 +++
 arch/m68k/config.mk       |  3 +++
 arch/microblaze/config.mk |  3 +++
 arch/mips/config.mk       |  3 +++
 arch/nds32/config.mk      |  3 +++
 arch/nios2/config.mk      |  3 +++
 arch/powerpc/config.mk    |  3 +++
 arch/sandbox/config.mk    |  3 +++
 arch/sh/config.mk         |  3 +++
 arch/sparc/config.mk      |  3 +++
 arch/x86/config.mk        |  3 +++
 config.mk                 |  8 ++++++++
 15 files changed, 68 insertions(+)
README +21 -0
index 42544ce..47aa719 100644
@@ -3211,6 +3211,27 @@ Configuration Settings:
 	If defined, don't allow the -f switch to env set override variable
 	access flags.
 
+- CONFIG_SYS_GENERIC_BOARD
+	This selects the architecture-generic board system instead of the
+	architecture-specific board files. It is intended to move boards
+	to this new framework over time. Defining this will disable the
+	arch/foo/lib/board.c file and use common/board_f.c and
+	common/board_r.c instead. To use this option your architecture
+	must support it (i.e. must NOT define CONFIG_SYS_LEGACY_BOARD in
+	its config.mk file). If you find problems enabling this option on
+	your board please report the problem and send patches!
+
+- CONFIG_SYS_LEGACY_BOARD
+	This option should not be defined by board config files.
+	This is an internal CONFIG defined by architectures which do not
+	support CONFIG_SYS_GENERIC_BOARD. It is used as a check that boards
+	don't accidentally define CONFIG_SYS_GENERIC_BOARD when their
+	architecture cannot support it, and U-Boot would then either not
+	build or not work. When an architecture supports generic board,
+	then CONFIG_SYS_LEGACY_BOARD can be removed from the architecture's
+	config.mk file so that generic board becomes available.
+
+
 The following definitions that deal with the placement and management
 of environment data (variable area); in general, we support the
 following configurations:
arch/arm/config.mk +3 -0
index 24b9d7c..c159675 100644
@@ -49,6 +49,9 @@ ifneq ($(CONFIG_SPL_BUILD),y)
 ALL-$(CONFIG_SYS_THUMB_BUILD)	+= checkthumb
 endif
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 # Try if EABI is supported, else fall back to old API,
 # i. e. for example:
 # - with ELDK 4.2 (EABI supported), use:
arch/avr32/config.mk +3 -0
index a751a3d..bd5703e 100644
@@ -29,3 +29,6 @@ PLATFORM_RELFLAGS	+= -ffixed-r5 -fPIC -mno-init-got -mrelax
 PLATFORM_RELFLAGS	+= -ffunction-sections -fdata-sections
 
 LDFLAGS_u-boot		= --gc-sections --relax
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/blackfin/config.mk +3 -0
index 3595aa2..972afb1 100644
@@ -37,6 +37,9 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 LDFLAGS_FINAL += --gc-sections
 LDFLAGS += -m elf32bfin
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
arch/m68k/config.mk +3 -0
index 11ba334..11ad9a5 100644
@@ -29,3 +29,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
 PLATFORM_RELFLAGS              += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL                  += --gc-sections
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/microblaze/config.mk +3 -0
index b4935f0..300e3c5 100644
@@ -33,3 +33,6 @@ PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
 LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
 
 CONFIG_ARCH_DEVICE_TREE := microblaze
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/mips/config.mk +3 -0
index aaa94e8..7a0275a 100644
@@ -41,6 +41,9 @@ ENDIANNESS ?= -EB
 
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 #
 # From Linux arch/mips/Makefile
 #
arch/nds32/config.mk +3 -0
index c589829..f989053 100644
@@ -33,3 +33,6 @@ PLATFORM_RELFLAGS	+= -gdwarf-2
 PLATFORM_CPPFLAGS	+= -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
 
 LDFLAGS_u-boot		= --gc-sections --relax
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/nios2/config.mk +3 -0
index 7b03ed8..0172f70 100644
@@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -G0
 
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/powerpc/config.mk +3 -0
index b706281..bf77090 100644
@@ -29,6 +29,9 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 #
 # When cross-compiling on NetBSD, we have to define __PPC__ or else we
 # will pick up a va_list declaration that is incompatible with the
arch/sandbox/config.mk +3 -0
index 4fd0d4e..049d5f7 100644
@@ -20,3 +20,6 @@
 PLATFORM_CPPFLAGS += -DCONFIG_SANDBOX -D__SANDBOX__ -U_FORTIFY_SOURCE
 PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM
 PLATFORM_LIBS += -lrt
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/sh/config.mk +3 -0
index 07ff8b9..0c21ef5 100644
@@ -31,3 +31,6 @@ endif
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
 PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE)
 LDFLAGS_FINAL = --gc-sections
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/sparc/config.mk +3 -0
index cae7478..b98a173 100644
@@ -26,3 +26,6 @@ CROSS_COMPILE ?= sparc-elf-
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds
 
 PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
arch/x86/config.mk +3 -0
index 23cacff..7be3036 100644
@@ -48,3 +48,6 @@ NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
 PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC))
 
 export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC))
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
config.mk +8 -0
index b7cd481..9d3b185 100644
@@ -221,6 +221,14 @@ ifeq ($(CONFIG_SPL_BUILD),y)
 CPPFLAGS += -DCONFIG_SPL_BUILD
 endif
 
+# Does this architecture support generic board init?
+ifneq ($(CONFIG_SYS_LEGACY_BOARD),)
+ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
+$(error Your architecture does not support generic board. 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
Signature · 1 line
1.8.1.3
#1 lore raw

PATCH v7 7/31 Define CONFIG_SYS_LEGACY_BOARD everywhere

Dear Simon Glass,

Quoted 2 lines · In message <[email protected]> you wrote:

We are introducing a new unified board setup and we want this to be the default. So we need to opt all architectures out first.

...

README Configuration Settings: · line 3232

Quoted 9 lines

+- CONFIG_SYS_LEGACY_BOARD

README +8 -0
+	This option should not be defined by board config files.
+	This is an internal CONFIG defined by architectures which do not
+	support CONFIG_SYS_GENERIC_BOARD. It is used as a check that boards
+	don't accidentally define CONFIG_SYS_GENERIC_BOARD when their
+	architecture cannot support it, and U-Boot would then either not
+	build or not work. When an architecture supports generic board,
+	then CONFIG_SYS_LEGACY_BOARD can be removed from the architecture's
+	config.mk file so that generic board becomes available.

Hm... I understand that you selected the ...LEGACY_BOARD name to make it easy to see the relation to ...GENERIC_BOARD? But then, the name is misleading - if my understanding is correct, then ...LEGACY_BOARD is NOT a _board_ specific config option, but an _architecture_ speci- fic one.

Actually this is then not a real CONFIG_SYS_ thing at all.

Should we rather use something like __HAVE_ARCH_GENERIC_BOARD ?? This would also make clear this is an internal macro only.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No journaling file system can recover your data if the disk dies.
                                 - Steve Rago in <[email protected]>
#2 lore raw

PATCH v7 7/31 Define CONFIG_SYS_LEGACY_BOARD everywhere

Hi Wolfgang,

Quoted 17 lines · Wolfgang Denk

Dear Simon Glass,

Quoted 2 lines · In message <[email protected]> you wrote:

We are introducing a new unified board setup and we want this to be the default. So we need to opt all architectures out first.

...

README Configuration Settings: · line 3232

Quoted 9 lines

+- CONFIG_SYS_LEGACY_BOARD

README +8 -0
+     This option should not be defined by board config files.
+     This is an internal CONFIG defined by architectures which do not
+     support CONFIG_SYS_GENERIC_BOARD. It is used as a check that boards
+     don't accidentally define CONFIG_SYS_GENERIC_BOARD when their
+     architecture cannot support it, and U-Boot would then either not
+     build or not work. When an architecture supports generic board,
+     then CONFIG_SYS_LEGACY_BOARD can be removed from the architecture's
+     config.mk file so that generic board becomes available.
Quoted 6 lines

Hm... I understand that you selected the ...LEGACY_BOARD name to make it easy to see the relation to ...GENERIC_BOARD? But then, the name is misleading - if my understanding is correct, then ...LEGACY_BOARD is NOT a _board_ specific config option, but an _architecture_ speci- fic one.

That's right.

Quoted 6 lines

Actually this is then not a real CONFIG_SYS_ thing at all.

Should we rather use something like __HAVE_ARCH_GENERIC_BOARD ?? This would also make clear this is an internal macro only.

Yes, I will do that. It switches the meaning to positive, but there is no sense in it being the 'default' right now anyway. Since it doesn't start with CONFIG_ I will have to define it in the Makefile, since it won't appear in autoconf.mk, but that is fine too, since only Makefiles will reference it.

Regards,
Simon