[PATCH] {Makefile,config.mk,a/Kconfig}: introduce SUPPLIER
Jens Rehsack
sno at netbsd.org
Thu Feb 13 14:33:53 CET 2020
From: Jens Rehsack <sno at NetBSD.org>
Introduce SUPPLIER analogous to VENDOR to allow (from customer perspective)
a VENDOR using it's SUPPLIER's common/ code.
This is reasonable, when a VENDOR (from customer perspective) builds
several machines sharing some features (e.g. some FPGA which has to be
initialized during u-boot) but wants to use common NXP or Samsung code
for the BSP instead of copying and create merge overhead.
Signed-off-by: Jens Rehsack <sno at NetBSD.org>
---
Makefile | 4 +++-
arch/Kconfig | 12 ++++++++++++
config.mk | 6 +++++-
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 0af89e0a78..94ef1e5003 100644
--- a/Makefile
+++ b/Makefile
@@ -427,7 +427,7 @@ UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
-export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR
+export ARCH CPU BOARD VENDOR SUPPLIER SOC CPUDIR BOARDDIR
export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
export MAKE LEX YACC AWK PERL PYTHON PYTHON2 PYTHON3
@@ -721,9 +721,11 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
# U-Boot objects....order is important (i.e. start must be first)
HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+HAVE_SUPPLIER_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(SUPPLIER)/common/Makefile),y,n)
libs-y += lib/
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
+libs-$(HAVE_SUPPLIER_COMMON_LIB) += board/$(SUPPLIER)/common/
libs-$(CONFIG_OF_EMBED) += dts/
libs-y += fs/
libs-y += net/
diff --git a/arch/Kconfig b/arch/Kconfig
index ae9c93ed7b..512ba7c0ac 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -248,6 +248,18 @@ config SYS_SOC
This is optional. For those targets without the SoC directory,
leave this option empty.
+config SYS_SUPPLIER
+ string
+ help
+ This option should contain the supplier name of the target soc.
+ One could even distinguish between SYS_SUPPLIER and SYS_VENDOR as
+ SYS_SOC_VENDOR and SYS_BOARD_VENDOR. If it is set and
+ board/<CONFIG_SYS_SUPPLIER>/common/Makefile exists, the supplier
+ common directory is compiled.
+
+ This is optional. For those targets without the vendor directory,
+ leave this option empty.
+
config SYS_VENDOR
string
help
diff --git a/config.mk b/config.mk
index caf0dd9b81..993d5a2b40 100644
--- a/config.mk
+++ b/config.mk
@@ -17,8 +17,9 @@ LDFLAGS :=
LDFLAGS_FINAL :=
LDFLAGS_STANDALONE :=
OBJCOPYFLAGS :=
-# clear VENDOR for tcsh
+# clear VENDOR & SUPPLIER for tcsh
VENDOR :=
+SUPPLIER :=
#########################################################################
ARCH := $(CONFIG_SYS_ARCH:"%"=%)
@@ -32,6 +33,9 @@ BOARD := $(CONFIG_SYS_BOARD:"%"=%)
ifneq ($(CONFIG_SYS_VENDOR),)
VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
endif
+ifneq ($(CONFIG_SYS_SUPPLIER),)
+SUPPLIER := $(CONFIG_SYS_SUPPLIER:"%"=%)
+endif
ifneq ($(CONFIG_SYS_SOC),)
SOC := $(CONFIG_SYS_SOC:"%"=%)
endif
--
2.17.1
More information about the U-Boot
mailing list