U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Rehsack <sno@netbsd.org>
To: u-boot@lists.denx.de
Subject: [PATCH] {Makefile,config.mk,a/Kconfig}: introduce SUPPLIER
Date: Thu, 13 Feb 2020 14:33:53 +0100	[thread overview]
Message-ID: <20200213133353.20353-1-sno@netbsd.org> (raw)

From: Jens Rehsack <sno@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@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

             reply	other threads:[~2020-02-13 13:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 13:33 Jens Rehsack [this message]
2020-02-13 15:01 ` [PATCH] {Makefile,config.mk,a/Kconfig}: introduce SUPPLIER Tom Rini
2020-02-13 16:57   ` Jens Rehsack
2020-02-13 17:48     ` Tom Rini
2020-02-14  9:36       ` Michal Simek
2020-02-14 11:37         ` Jens Rehsack
2020-02-14 11:49           ` Michal Simek
2020-02-14 13:45             ` Tom Rini
2020-02-14 14:21               ` Jens Rehsack
2020-02-14 14:28                 ` Tom Rini
2020-02-14 14:40                   ` Jens Rehsack
2020-02-14 14:43                     ` Tom Rini
2020-02-14 15:20                       ` Jens Rehsack
2020-02-17  9:42                         ` Michal Simek
2020-02-14 12:08         ` Fabio Estevam
2020-02-14 12:22           ` Jens Rehsack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200213133353.20353-1-sno@netbsd.org \
    --to=sno@netbsd.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox