From efdd9d4bdb7a696676558b83f1ce85ef81139e31 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 4 Mar 2024 09:16:10 +0000 Subject: [PATCH] boards: kconfig: Add BOARD_QUALIFIERS and BOARD_TARGET Adds the user-provided board qualifiers to Kconfig so it can be used by application code, along with one containing the full string Signed-off-by: Jamie McCrae --- boards/Kconfig | 11 +++++++++++ boards/Kconfig.v2 | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/boards/Kconfig b/boards/Kconfig index 45ca2f84d6..13599252b7 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -19,6 +19,17 @@ config BOARD_REVISION "plank@foo", this option will be "foo". If BOARD is "plank", this option will be the empty string. +config BOARD_TARGET + string + default "$(BOARD)@$(BOARD_REVISION)$(BOARD_QUALIFIERS)" if "$(BOARD_REVISION)" != "" + default "$(BOARD)$(BOARD_QUALIFIERS)" + help + Contains the board target (full string including name, revision, soc, cluster and + variant) of the board being used. + + For example, if building for ``nrf5340dk/nrf5340/cpuapp`` then this will contain the + value ``nrf5340dk/nrf5340/cpuapp``. + config BOARD_DEPRECATED_RELEASE string help diff --git a/boards/Kconfig.v2 b/boards/Kconfig.v2 index 1da8c5487e..47bb3ae224 100644 --- a/boards/Kconfig.v2 +++ b/boards/Kconfig.v2 @@ -1,9 +1,10 @@ -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 BOARD_STRING := $(normalize_upper,$(BOARD)) BOARD_TARGET_STRING := $(normalize_upper,$(BOARD)$(BOARD_QUALIFIERS)) +BOARD_QUALIFIERS_NO_SEPARATOR := $(substring,$(BOARD_QUALIFIERS),1) config BOARD_$(BOARD_STRING) def_bool y @@ -15,4 +16,13 @@ config BOARD_$(BOARD_TARGET_STRING) help Kconfig symbol identifying the board target. +config BOARD_QUALIFIERS + string + default "$(BOARD_QUALIFIERS_NO_SEPARATOR)" + help + Contains the qualifiers of the board being used without the name of the board itself. + + For example, if building for ``nrf5340dk/nrf5340/cpuapp`` then this will contain the + value ``nrf5340/cpuapp``. + osource "$(BOARD_DIR)/Kconfig.$(BOARD)"