infrastructure: Remove hwmv1 support
Removes support for the deprecated hardware model version 1 Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
parent
4bb5ffd786
commit
9f12f8afb2
23 changed files with 132 additions and 388 deletions
|
@ -8,7 +8,7 @@
|
||||||
# Include these first so that any properties (e.g. defaults) below can be
|
# Include these first so that any properties (e.g. defaults) below can be
|
||||||
# overridden (by defining symbols in multiple locations)
|
# overridden (by defining symbols in multiple locations)
|
||||||
|
|
||||||
source "$(ARCH_DIR)/Kconfig.$(HWM_SCHEME)"
|
source "$(KCONFIG_BINARY_DIR)/arch/Kconfig"
|
||||||
|
|
||||||
# ToDo: Generate a Kconfig.arch for loading of additional arch in HWMv2.
|
# ToDo: Generate a Kconfig.arch for loading of additional arch in HWMv2.
|
||||||
osource "$(KCONFIG_BINARY_DIR)/Kconfig.arch"
|
osource "$(KCONFIG_BINARY_DIR)/Kconfig.arch"
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
# Note: $ARCH might be a glob pattern
|
|
||||||
source "$(ARCH_DIR)/$(ARCH)/Kconfig"
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
source "$(KCONFIG_BINARY_DIR)/arch/Kconfig"
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
config BOARD
|
config BOARD
|
||||||
string
|
string
|
||||||
# When using hw model v2, then the board is inherited from CMake.
|
default "$(BOARD)"
|
||||||
default "$(BOARD)" if "$(HWM_SCHEME)" = "v2"
|
|
||||||
help
|
help
|
||||||
This option holds the name of the board and is used to locate the files
|
This option holds the name of the board and is used to locate the files
|
||||||
related to the board in the source tree (under boards/).
|
related to the board in the source tree (under boards/).
|
||||||
|
@ -53,7 +52,7 @@ config NET_DRIVERS
|
||||||
When building for a qemu target then NET_DRIVERS will be default
|
When building for a qemu target then NET_DRIVERS will be default
|
||||||
enabled to allow for easy use of SLIP or PPP
|
enabled to allow for easy use of SLIP or PPP
|
||||||
|
|
||||||
rsource "Kconfig.$(HWM_SCHEME)"
|
rsource "Kconfig.v2"
|
||||||
|
|
||||||
# Parse shields references
|
# Parse shields references
|
||||||
# Don't do it as a menuconfig, as shield selection is a CMake feature.
|
# Don't do it as a menuconfig, as shield selection is a CMake feature.
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
# Copyright (c) 2022 Nordic Semiconductor ASA
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
# In HWMv1 the KCONFIG_BOARD_DIR points directly to the BOARD_DIR.
|
|
||||||
# Set the BOARD_DIR variable for backwards compatibility to legacy hardware model.
|
|
||||||
BOARD_DIR := $(KCONFIG_BOARD_DIR)
|
|
||||||
|
|
||||||
choice
|
|
||||||
prompt "Board Selection"
|
|
||||||
|
|
||||||
source "$(KCONFIG_BOARD_DIR)/Kconfig.board"
|
|
||||||
|
|
||||||
endchoice
|
|
|
@ -1,54 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
# Copyright (c) 2022, Nordic Semiconductor ASA
|
|
||||||
|
|
||||||
#
|
|
||||||
# This CMake module is only valid for hw model v1.
|
|
||||||
# In hw model v1, then arch is determined by the board folder structure.
|
|
||||||
#
|
|
||||||
# Configure ARCH settings based on board directory and arch root.
|
|
||||||
#
|
|
||||||
# This CMake module will set the following variables in the build system based
|
|
||||||
# on board directory and arch root.
|
|
||||||
#
|
|
||||||
# If no implementation is available for the current arch an error will be raised.
|
|
||||||
#
|
|
||||||
# Outcome:
|
|
||||||
# The following variables will be defined when this CMake module completes:
|
|
||||||
#
|
|
||||||
# - ARCH: Name of the arch in use.
|
|
||||||
# - ARCH_DIR: Directory containing the arch implementation.
|
|
||||||
# - ARCH_ROOT: ARCH_ROOT with ZEPHYR_BASE appended
|
|
||||||
#
|
|
||||||
# Variable dependencies:
|
|
||||||
# - ARCH_ROOT: CMake list of arch roots containing arch implementations
|
|
||||||
# - BOARD_DIR: CMake variable specifying the directory of the selected BOARD
|
|
||||||
#
|
|
||||||
# Variables set by this module and not mentioned above are considered internal
|
|
||||||
# use only and may be removed, renamed, or re-purposed without prior notice.
|
|
||||||
|
|
||||||
include_guard(GLOBAL)
|
|
||||||
|
|
||||||
if(HWMv1)
|
|
||||||
# 'ARCH_ROOT' is a prioritized list of directories where archs may be
|
|
||||||
# found. It always includes ${ZEPHYR_BASE} at the lowest priority (except for unittesting).
|
|
||||||
if(NOT unittest IN_LIST Zephyr_FIND_COMPONENTS)
|
|
||||||
list(APPEND ARCH_ROOT ${ZEPHYR_BASE})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
cmake_path(GET BOARD_DIR PARENT_PATH board_arch_dir)
|
|
||||||
cmake_path(GET board_arch_dir FILENAME ARCH)
|
|
||||||
|
|
||||||
foreach(root ${ARCH_ROOT})
|
|
||||||
if(EXISTS ${root}/arch/${ARCH}/CMakeLists.txt)
|
|
||||||
set(ARCH_DIR ${root}/arch)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if(NOT ARCH_DIR)
|
|
||||||
message(FATAL_ERROR "Could not find ARCH=${ARCH} for BOARD=${BOARD}, \
|
|
||||||
please check your installation. ARCH roots searched: \n\
|
|
||||||
${ARCH_ROOT}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
|
@ -141,8 +141,7 @@ Hints:
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if((HWMv1 AND NOT EXISTS ${BOARD_DIR}/${BOARD}_defconfig)
|
if(HWMv2 AND NOT EXISTS ${BOARD_DIR}/board.yml)
|
||||||
OR (HWMv2 AND NOT EXISTS ${BOARD_DIR}/board.yml))
|
|
||||||
message(WARNING "BOARD_DIR: ${BOARD_DIR} has been moved or deleted. "
|
message(WARNING "BOARD_DIR: ${BOARD_DIR} has been moved or deleted. "
|
||||||
"Trying to find new location."
|
"Trying to find new location."
|
||||||
)
|
)
|
||||||
|
@ -209,9 +208,8 @@ if(NOT "${ret_board}" STREQUAL "")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Create two CMake variables identifying the hw model.
|
# Create two CMake variables identifying the hw model.
|
||||||
# CMake variable: HWM=[v1,v2]
|
# CMake variable: HWM=v2
|
||||||
# CMake variable: HWMv1=True, when HWMv1 is in use.
|
# CMake variable: HWMv2=True
|
||||||
# CMake variable: HWMv2=True, when HWMv2 is in use.
|
|
||||||
set(HWM ${LIST_BOARD_HWM} CACHE INTERNAL "Zephyr hardware model version")
|
set(HWM ${LIST_BOARD_HWM} CACHE INTERNAL "Zephyr hardware model version")
|
||||||
set(HWM${HWM} True CACHE INTERNAL "Zephyr hardware model")
|
set(HWM${HWM} True CACHE INTERNAL "Zephyr hardware model")
|
||||||
elseif(BOARD_DIR)
|
elseif(BOARD_DIR)
|
||||||
|
@ -228,86 +226,67 @@ else()
|
||||||
message(FATAL_ERROR "Invalid BOARD; see above.")
|
message(FATAL_ERROR "Invalid BOARD; see above.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HWMv1 AND DEFINED BOARD_QUALIFIERS)
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"Board '${BOARD}' does not support board qualifiers, ${BOARD}${BOARD_QUALIFIERS}.\n"
|
|
||||||
"Please specify board without qualifiers.\n"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
cmake_path(IS_PREFIX ZEPHYR_BASE "${BOARD_DIR}" NORMALIZE in_zephyr_tree)
|
cmake_path(IS_PREFIX ZEPHYR_BASE "${BOARD_DIR}" NORMALIZE in_zephyr_tree)
|
||||||
if(NOT in_zephyr_tree)
|
if(NOT in_zephyr_tree)
|
||||||
set(USING_OUT_OF_TREE_BOARD 1)
|
set(USING_OUT_OF_TREE_BOARD 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HWMv1)
|
if(LIST_BOARD_REVISION_FORMAT)
|
||||||
if(EXISTS ${BOARD_DIR}/revision.cmake)
|
if(LIST_BOARD_REVISION_FORMAT STREQUAL "custom")
|
||||||
# Board provides revision handling.
|
|
||||||
include(${BOARD_DIR}/revision.cmake)
|
include(${BOARD_DIR}/revision.cmake)
|
||||||
elseif(BOARD_REVISION)
|
else()
|
||||||
message(WARNING "Board revision ${BOARD_REVISION} specified for ${BOARD}, \
|
|
||||||
but board has no revision so revision will be ignored.")
|
|
||||||
endif()
|
|
||||||
elseif(HWMv2)
|
|
||||||
if(LIST_BOARD_REVISION_FORMAT)
|
|
||||||
if(LIST_BOARD_REVISION_FORMAT STREQUAL "custom")
|
|
||||||
include(${BOARD_DIR}/revision.cmake)
|
|
||||||
else()
|
|
||||||
if(EXISTS ${BOARD_DIR}/revision.cmake)
|
|
||||||
message(WARNING
|
|
||||||
"revision.cmake ignored, revision.cmake is only used for revision format: 'custom'"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
string(TOUPPER "${LIST_BOARD_REVISION_FORMAT}" rev_format)
|
|
||||||
if(LIST_BOARD_REVISION_EXACT)
|
|
||||||
set(rev_exact EXACT)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
board_check_revision(
|
|
||||||
FORMAT ${rev_format}
|
|
||||||
DEFAULT_REVISION ${LIST_BOARD_REVISION_DEFAULT}
|
|
||||||
VALID_REVISIONS ${LIST_BOARD_REVISIONS}
|
|
||||||
${rev_exact}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
elseif(DEFINED BOARD_REVISION)
|
|
||||||
if(EXISTS ${BOARD_DIR}/revision.cmake)
|
if(EXISTS ${BOARD_DIR}/revision.cmake)
|
||||||
message(WARNING
|
message(WARNING
|
||||||
"revision.cmake is not used, revisions must be defined in '${BOARD_DIR}/board.yml'"
|
"revision.cmake ignored, revision.cmake is only used for revision format: 'custom'"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(FATAL_ERROR "Invalid board revision: ${BOARD_REVISION}\n"
|
string(TOUPPER "${LIST_BOARD_REVISION_FORMAT}" rev_format)
|
||||||
"Board '${BOARD}' does not define any revisions."
|
if(LIST_BOARD_REVISION_EXACT)
|
||||||
|
set(rev_exact EXACT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
board_check_revision(
|
||||||
|
FORMAT ${rev_format}
|
||||||
|
DEFAULT_REVISION ${LIST_BOARD_REVISION_DEFAULT}
|
||||||
|
VALID_REVISIONS ${LIST_BOARD_REVISIONS}
|
||||||
|
${rev_exact}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
elseif(DEFINED BOARD_REVISION)
|
||||||
|
if(EXISTS ${BOARD_DIR}/revision.cmake)
|
||||||
|
message(WARNING
|
||||||
|
"revision.cmake is not used, revisions must be defined in '${BOARD_DIR}/board.yml'"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LIST_BOARD_QUALIFIERS)
|
message(FATAL_ERROR "Invalid board revision: ${BOARD_REVISION}\n"
|
||||||
# Allow users to omit the SoC when building for a board with a single SoC.
|
"Board '${BOARD}' does not define any revisions."
|
||||||
list(LENGTH LIST_BOARD_SOCS socs_length)
|
)
|
||||||
if(socs_length EQUAL 1)
|
endif()
|
||||||
set(BOARD_SINGLE_SOC TRUE)
|
|
||||||
set(BOARD_${BOARD}_SINGLE_SOC TRUE)
|
|
||||||
if(NOT DEFINED BOARD_QUALIFIERS)
|
|
||||||
set(BOARD_QUALIFIERS "/${LIST_BOARD_SOCS}")
|
|
||||||
elseif("${BOARD_QUALIFIERS}" MATCHES "^//.*")
|
|
||||||
string(REGEX REPLACE "^//" "/${LIST_BOARD_SOCS}/" BOARD_QUALIFIERS "${BOARD_QUALIFIERS}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(board_targets ${LIST_BOARD_QUALIFIERS})
|
if(LIST_BOARD_QUALIFIERS)
|
||||||
list(TRANSFORM board_targets PREPEND "${BOARD}/")
|
# Allow users to omit the SoC when building for a board with a single SoC.
|
||||||
if(NOT ("${BOARD}${BOARD_QUALIFIERS}" IN_LIST board_targets))
|
list(LENGTH LIST_BOARD_SOCS socs_length)
|
||||||
string(REPLACE ";" "\n" board_targets "${board_targets}")
|
if(socs_length EQUAL 1)
|
||||||
unset(CACHED_BOARD CACHE)
|
set(BOARD_SINGLE_SOC TRUE)
|
||||||
message(FATAL_ERROR "Board qualifiers `${BOARD_QUALIFIERS}` for board \
|
set(BOARD_${BOARD}_SINGLE_SOC TRUE)
|
||||||
`${BOARD}` not found. Please specify a valid board target.\n"
|
if(NOT DEFINED BOARD_QUALIFIERS)
|
||||||
"Valid board targets for ${LIST_BOARD_NAME} are:\n${board_targets}\n")
|
set(BOARD_QUALIFIERS "/${LIST_BOARD_SOCS}")
|
||||||
|
elseif("${BOARD_QUALIFIERS}" MATCHES "^//.*")
|
||||||
|
string(REGEX REPLACE "^//" "/${LIST_BOARD_SOCS}/" BOARD_QUALIFIERS "${BOARD_QUALIFIERS}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Unknown hw model (${HWM}) for board: ${BOARD}.")
|
set(board_targets ${LIST_BOARD_QUALIFIERS})
|
||||||
|
list(TRANSFORM board_targets PREPEND "${BOARD}/")
|
||||||
|
if(NOT ("${BOARD}${BOARD_QUALIFIERS}" IN_LIST board_targets))
|
||||||
|
string(REPLACE ";" "\n" board_targets "${board_targets}")
|
||||||
|
unset(CACHED_BOARD CACHE)
|
||||||
|
message(FATAL_ERROR "Board qualifiers `${BOARD_QUALIFIERS}` for board \
|
||||||
|
`${BOARD}` not found. Please specify a valid board target.\n"
|
||||||
|
"Valid board targets for ${LIST_BOARD_NAME} are:\n${board_targets}\n")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(board_message "Board: ${BOARD}")
|
set(board_message "Board: ${BOARD}")
|
||||||
|
|
|
@ -24,30 +24,6 @@ set_ifndef(KCONFIG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Kconfig)
|
||||||
set(KCONFIG_BOARD_DIR ${KCONFIG_BINARY_DIR}/boards)
|
set(KCONFIG_BOARD_DIR ${KCONFIG_BINARY_DIR}/boards)
|
||||||
file(MAKE_DIRECTORY ${KCONFIG_BINARY_DIR})
|
file(MAKE_DIRECTORY ${KCONFIG_BINARY_DIR})
|
||||||
|
|
||||||
if(HWMv1)
|
|
||||||
# HWMv1 only supoorts a single board dir which points directly to the board dir.
|
|
||||||
set(KCONFIG_BOARD_DIR ${BOARD_DIR})
|
|
||||||
# Support multiple SOC_ROOT
|
|
||||||
file(MAKE_DIRECTORY ${KCONFIG_BINARY_DIR}/soc)
|
|
||||||
set(kconfig_soc_root ${SOC_ROOT})
|
|
||||||
list(REMOVE_ITEM kconfig_soc_root ${ZEPHYR_BASE})
|
|
||||||
set(soc_defconfig_file ${KCONFIG_BINARY_DIR}/soc/Kconfig.defconfig)
|
|
||||||
|
|
||||||
set(OPERATION WRITE)
|
|
||||||
foreach(root ${kconfig_soc_root})
|
|
||||||
file(APPEND ${soc_defconfig_file}
|
|
||||||
"osource \"${root}/soc/$(ARCH)/*/Kconfig.defconfig\"\n")
|
|
||||||
file(${OPERATION} ${KCONFIG_BINARY_DIR}/soc/Kconfig.soc.choice
|
|
||||||
"osource \"${root}/soc/$(ARCH)/*/Kconfig.soc\"\n"
|
|
||||||
)
|
|
||||||
file(${OPERATION} ${KCONFIG_BINARY_DIR}/soc/Kconfig.soc.arch
|
|
||||||
"osource \"${root}/soc/$(ARCH)/Kconfig\"\n"
|
|
||||||
"osource \"${root}/soc/$(ARCH)/*/Kconfig\"\n"
|
|
||||||
)
|
|
||||||
set(OPERATION APPEND)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Support multiple shields in BOARD_ROOT, remove ZEPHYR_BASE as that is always sourced.
|
# Support multiple shields in BOARD_ROOT, remove ZEPHYR_BASE as that is always sourced.
|
||||||
set(kconfig_board_root ${BOARD_ROOT})
|
set(kconfig_board_root ${BOARD_ROOT})
|
||||||
list(REMOVE_ITEM kconfig_board_root ${ZEPHYR_BASE})
|
list(REMOVE_ITEM kconfig_board_root ${ZEPHYR_BASE})
|
||||||
|
@ -176,20 +152,13 @@ set(COMMON_KCONFIG_ENV_SETTINGS
|
||||||
${ZEPHYR_KCONFIG_MODULES_DIR}
|
${ZEPHYR_KCONFIG_MODULES_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(HWMv1)
|
# For HWMv2 we should in future generate a Kconfig.arch.v2 which instead
|
||||||
list(APPEND COMMON_KCONFIG_ENV_SETTINGS
|
# glob-sources all arch roots, but for Zephyr itself, the current approach is
|
||||||
ARCH=${ARCH}
|
# sufficient.
|
||||||
ARCH_DIR=${ARCH_DIR}
|
list(APPEND COMMON_KCONFIG_ENV_SETTINGS
|
||||||
)
|
ARCH=*
|
||||||
else()
|
ARCH_DIR=${ZEPHYR_BASE}/arch
|
||||||
# For HWMv2 we should in future generate a Kconfig.arch.v2 which instead
|
)
|
||||||
# glob-sources all arch roots, but for Zephyr itself, the current approach is
|
|
||||||
# sufficient.
|
|
||||||
list(APPEND COMMON_KCONFIG_ENV_SETTINGS
|
|
||||||
ARCH=*
|
|
||||||
ARCH_DIR=${ZEPHYR_BASE}/arch
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Allow out-of-tree users to add their own Kconfig python frontend
|
# Allow out-of-tree users to add their own Kconfig python frontend
|
||||||
# targets by appending targets to the CMake list
|
# targets by appending targets to the CMake list
|
||||||
|
|
|
@ -60,13 +60,9 @@ function(pre_dt_module_run)
|
||||||
# Finalize DTS_ROOT.
|
# Finalize DTS_ROOT.
|
||||||
list(REMOVE_DUPLICATES DTS_ROOT)
|
list(REMOVE_DUPLICATES DTS_ROOT)
|
||||||
|
|
||||||
if(HWMv1)
|
foreach(arch ${ARCH_V2_NAME_LIST})
|
||||||
set(arch_include dts/${ARCH})
|
list(APPEND arch_include dts/${arch})
|
||||||
else()
|
endforeach()
|
||||||
foreach(arch ${ARCH_V2_NAME_LIST})
|
|
||||||
list(APPEND arch_include dts/${arch})
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Finalize DTS_ROOT_SYSTEM_INCLUDE_DIRS.
|
# Finalize DTS_ROOT_SYSTEM_INCLUDE_DIRS.
|
||||||
set(DTS_ROOT_SYSTEM_INCLUDE_DIRS)
|
set(DTS_ROOT_SYSTEM_INCLUDE_DIRS)
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
# Copyright (c) 2021, Nordic Semiconductor ASA
|
|
||||||
|
|
||||||
# Configure SoC settings based on Kconfig settings and SoC root.
|
|
||||||
#
|
|
||||||
# This CMake module will set the following variables in the build system based
|
|
||||||
# on Kconfig settings and selected SoC.
|
|
||||||
#
|
|
||||||
# If no implementation is available for the selected SoC an error will be raised.
|
|
||||||
#
|
|
||||||
# Outcome:
|
|
||||||
# The following variables will be defined when this CMake module completes:
|
|
||||||
#
|
|
||||||
# - SOC_NAME: Name of the SoC in use, identical to CONFIG_SOC
|
|
||||||
# - SOC_SERIES: Name of the SoC series in use, identical to CONFIG_SOC_SERIES
|
|
||||||
# - SOC_FAMILY: Name of the SoC family, identical to CONFIG_SOC_FAMILY
|
|
||||||
# - SOC_PATH: Path fragment defined by either SOC_NAME or SOC_FAMILY/SOC_SERIES.
|
|
||||||
# - SOC_DIR: Directory containing the SoC implementation
|
|
||||||
# - SOC_ROOT: SOC_ROOT with ZEPHYR_BASE appended
|
|
||||||
#
|
|
||||||
# Variable dependencies:
|
|
||||||
# - SOC_ROOT: CMake list of SoC roots containing SoC implementations
|
|
||||||
#
|
|
||||||
# Variables set by this module and not mentioned above are considered internal
|
|
||||||
# use only and may be removed, renamed, or re-purposed without prior notice.
|
|
||||||
|
|
||||||
include_guard(GLOBAL)
|
|
||||||
|
|
||||||
include(kconfig)
|
|
||||||
|
|
||||||
if(HWMv1)
|
|
||||||
# 'SOC_ROOT' is a prioritized list of directories where socs may be
|
|
||||||
# found. It always includes ${ZEPHYR_BASE}/soc at the lowest priority.
|
|
||||||
list(APPEND SOC_ROOT ${ZEPHYR_BASE})
|
|
||||||
|
|
||||||
set(SOC_NAME ${CONFIG_SOC})
|
|
||||||
set(SOC_SERIES ${CONFIG_SOC_SERIES})
|
|
||||||
set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME})
|
|
||||||
set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
|
|
||||||
|
|
||||||
if("${SOC_SERIES}" STREQUAL "")
|
|
||||||
set(SOC_PATH ${SOC_NAME})
|
|
||||||
else()
|
|
||||||
set(SOC_PATH ${SOC_FAMILY}/${SOC_SERIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Use SOC to search for a 'CMakeLists.txt' file.
|
|
||||||
# e.g. zephyr/soc/xtensa/intel_adsp/CMakeLists.txt.
|
|
||||||
foreach(root ${SOC_ROOT})
|
|
||||||
# Check that the root looks reasonable.
|
|
||||||
if(NOT IS_DIRECTORY "${root}/soc")
|
|
||||||
message(WARNING "\nSOC_ROOT element(s) without a 'soc' subdirectory:
|
|
||||||
${root}
|
|
||||||
Hints:
|
|
||||||
- if your SoC family directory is '/foo/bar/soc/<ARCH>/my_soc_family', then add '/foo/bar' to SOC_ROOT, not the entire SoC family path
|
|
||||||
- if in doubt, use absolute paths\n")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(EXISTS ${root}/soc/${ARCH}/${SOC_PATH})
|
|
||||||
set(SOC_DIR ${root}/soc)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if(NOT SOC_DIR)
|
|
||||||
message(FATAL_ERROR "Could not find SOC=${SOC_NAME} for BOARD=${BOARD},\n"
|
|
||||||
"please check your installation.\n"
|
|
||||||
"SOC roots searched:\n"
|
|
||||||
"${SOC_ROOT}\n"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SOC_FULL_DIR ${SOC_DIR}/${ARCH}/${SOC_PATH})
|
|
||||||
endif()
|
|
|
@ -12,8 +12,8 @@ include(hwm_v2)
|
||||||
include(configuration_files)
|
include(configuration_files)
|
||||||
|
|
||||||
include(kconfig)
|
include(kconfig)
|
||||||
include(arch_v2)
|
include(arch)
|
||||||
include(soc_v2)
|
include(soc)
|
||||||
|
|
||||||
find_package(TargetTools)
|
find_package(TargetTools)
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,6 @@ list(APPEND zephyr_cmake_modules zephyr_module)
|
||||||
list(APPEND zephyr_cmake_modules boards)
|
list(APPEND zephyr_cmake_modules boards)
|
||||||
list(APPEND zephyr_cmake_modules shields)
|
list(APPEND zephyr_cmake_modules shields)
|
||||||
list(APPEND zephyr_cmake_modules snippets)
|
list(APPEND zephyr_cmake_modules snippets)
|
||||||
list(APPEND zephyr_cmake_modules arch_v1)
|
|
||||||
list(APPEND zephyr_cmake_modules hwm_v2)
|
list(APPEND zephyr_cmake_modules hwm_v2)
|
||||||
list(APPEND zephyr_cmake_modules configuration_files)
|
list(APPEND zephyr_cmake_modules configuration_files)
|
||||||
list(APPEND zephyr_cmake_modules generated_file_directories)
|
list(APPEND zephyr_cmake_modules generated_file_directories)
|
||||||
|
@ -110,9 +109,8 @@ list(APPEND zephyr_cmake_modules "\${pre_dt_board}")
|
||||||
# kconfig and dts should be available at the same time.
|
# kconfig and dts should be available at the same time.
|
||||||
list(APPEND zephyr_cmake_modules dts)
|
list(APPEND zephyr_cmake_modules dts)
|
||||||
list(APPEND zephyr_cmake_modules kconfig)
|
list(APPEND zephyr_cmake_modules kconfig)
|
||||||
list(APPEND zephyr_cmake_modules arch_v2)
|
list(APPEND zephyr_cmake_modules arch)
|
||||||
list(APPEND zephyr_cmake_modules soc_v1)
|
list(APPEND zephyr_cmake_modules soc)
|
||||||
list(APPEND zephyr_cmake_modules soc_v2)
|
|
||||||
|
|
||||||
foreach(component ${SUB_COMPONENTS})
|
foreach(component ${SUB_COMPONENTS})
|
||||||
if(NOT ${component} IN_LIST zephyr_cmake_modules)
|
if(NOT ${component} IN_LIST zephyr_cmake_modules)
|
||||||
|
|
|
@ -1,8 +1,35 @@
|
||||||
# Copyright (c) 2021 Nordic Semiconductor
|
# Copyright (c) 2021-2023 Nordic Semiconductor
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
rsource "Kconfig.$(HWM_SCHEME)"
|
config BOARD
|
||||||
|
string
|
||||||
|
default "$(BOARD)"
|
||||||
|
help
|
||||||
|
This option holds the name of the board and is used to locate the files
|
||||||
|
related to the board in the source tree (under boards/).
|
||||||
|
The Board is the first location where we search for a linker.ld file,
|
||||||
|
if not found we look for the linker file in
|
||||||
|
soc/<arch>/<family>/<series>
|
||||||
|
|
||||||
|
config BOARD_REVISION
|
||||||
|
def_string "$(BOARD_REVISION)"
|
||||||
|
help
|
||||||
|
If the BOARD has a revision field set, this is the revision.
|
||||||
|
Otherwise, it is the empty string. For example, if BOARD is
|
||||||
|
"plank@foo", this option will be "foo". If BOARD is "plank",
|
||||||
|
this option will be the empty string.
|
||||||
|
|
||||||
|
config BOARD_DEPRECATED_RELEASE
|
||||||
|
string
|
||||||
|
help
|
||||||
|
This hidden option is set in the board configuration and indicates
|
||||||
|
the Zephyr release that the board configuration will be removed.
|
||||||
|
When set, any build for that board will generate a clearly visible
|
||||||
|
deprecation warning.
|
||||||
|
|
||||||
|
source "boards/Kconfig.v2"
|
||||||
|
source "soc/Kconfig.v2"
|
||||||
|
|
||||||
comment "Sysbuild image configuration"
|
comment "Sysbuild image configuration"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Copyright (c) 2023 Nordic Semiconductor
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
# Intentionally left empty as sysbuild Kconfig doesn't support hw model v1.
|
|
|
@ -28,5 +28,5 @@ config BOARD_DEPRECATED_RELEASE
|
||||||
When set, any build for that board will generate a clearly visible
|
When set, any build for that board will generate a clearly visible
|
||||||
deprecation warning.
|
deprecation warning.
|
||||||
|
|
||||||
source "boards/Kconfig.$(HWM_SCHEME)"
|
source "boards/Kconfig.v2"
|
||||||
source "soc/Kconfig.$(HWM_SCHEME)"
|
source "soc/Kconfig.v2"
|
||||||
|
|
|
@ -397,23 +397,17 @@ function(ExternalZephyrProject_Add)
|
||||||
# The sysbuild BOARD is exported through sysbuild cache, and will be used
|
# The sysbuild BOARD is exported through sysbuild cache, and will be used
|
||||||
# unless <image>_BOARD is defined.
|
# unless <image>_BOARD is defined.
|
||||||
if(DEFINED ZBUILD_BOARD_REVISION)
|
if(DEFINED ZBUILD_BOARD_REVISION)
|
||||||
# Use provided board revision
|
# Use provided board revision, HWMv2 requires adding version to the board, split elements
|
||||||
if(ZBUILD_BOARD MATCHES "/")
|
# up, attach version, then reassemble into a complete string
|
||||||
# HWMv2 requires adding version to the board, split elements up, attach version, then
|
string(REPLACE "/" ";" split_board_qualifiers "${ZBUILD_BOARD}")
|
||||||
# reassemble into a complete string
|
list(GET split_board_qualifiers 0 target_board)
|
||||||
string(REPLACE "/" ";" split_board_qualifiers "${ZBUILD_BOARD}")
|
set(target_board ${target_board}@${ZBUILD_BOARD_REVISION})
|
||||||
list(GET split_board_qualifiers 0 target_board)
|
list(REMOVE_AT split_board_qualifiers 0)
|
||||||
set(target_board ${target_board}@${ZBUILD_BOARD_REVISION})
|
list(PREPEND split_board_qualifiers ${target_board})
|
||||||
list(REMOVE_AT split_board_qualifiers 0)
|
string(REPLACE ";" "/" board_qualifiers "${split_board_qualifiers}")
|
||||||
list(PREPEND split_board_qualifiers ${target_board})
|
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${board_qualifiers})
|
||||||
string(REPLACE ";" "/" board_qualifiers "${split_board_qualifiers}")
|
set(split_board_qualifiers)
|
||||||
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${board_qualifiers})
|
set(board_qualifiers)
|
||||||
set(split_board_qualifiers)
|
|
||||||
set(board_qualifiers)
|
|
||||||
else()
|
|
||||||
# Legacy HWMv1 support, version goes at end
|
|
||||||
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD}@${ZBUILD_BOARD_REVISION})
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD})
|
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -11,48 +11,30 @@ unset(_SOC_IS_IN_TREE)
|
||||||
|
|
||||||
add_subdirectory(common)
|
add_subdirectory(common)
|
||||||
|
|
||||||
if(HWMv1)
|
# Below is inclusion of HWMv2 SoC CMake lists.
|
||||||
message(DEPRECATION "
|
string(TOUPPER SOC_FAMILY_${SOC_FAMILY}_DIR family_setting_dir)
|
||||||
---------------------------------------------------------------------
|
string(TOUPPER SOC_SERIES_${SOC_SERIES}_DIR series_setting_dir)
|
||||||
--- WARNING: Functionality to describe SoCs in HWMv1 is ---
|
string(TOUPPER SOC_${SOC_NAME}_DIR soc_setting_dir)
|
||||||
--- deprecated and should be replaced with HWMv2, including ---
|
|
||||||
--- boards. HWMv1 SoCs support remains only to ease the migration ---
|
|
||||||
--- of out-of-tree SoCs and associated boards. It will not be ---
|
|
||||||
--- possible to build using HWMv1 SoCs at all in future releases. ---
|
|
||||||
---------------------------------------------------------------------"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(EXISTS ${SOC_DIR}/${ARCH}/CMakeLists.txt)
|
if(DEFINED ${soc_setting_dir})
|
||||||
add_subdirectory(${SOC_DIR}/${ARCH} soc/${ARCH})
|
add_subdirectory(${${soc_setting_dir}} soc/${SOC_NAME})
|
||||||
else()
|
elseif(DEFINED ${series_setting_dir})
|
||||||
add_subdirectory(${SOC_DIR}/${ARCH}/${SOC_PATH} soc/${ARCH}/${SOC_PATH})
|
add_subdirectory(${${series_setting_dir}} soc/${SOC_SERIES})
|
||||||
endif()
|
elseif(DEFINED ${family_setting_dir})
|
||||||
elseif(HWMv2)
|
add_subdirectory(${${family_setting_dir}} soc/${SOC_FAMILY})
|
||||||
# Below is inclusion of HWMv2 SoC CMake lists.
|
else()
|
||||||
string(TOUPPER SOC_FAMILY_${SOC_FAMILY}_DIR family_setting_dir)
|
message(FATAL_ERROR "No CMakeLists.txt file found for SoC: ${SOC_NAME}, "
|
||||||
string(TOUPPER SOC_SERIES_${SOC_SERIES}_DIR series_setting_dir)
|
"series: ${SOC_SERIES}, family: ${SOC_FAMILY}")
|
||||||
string(TOUPPER SOC_${SOC_NAME}_DIR soc_setting_dir)
|
|
||||||
|
|
||||||
if(DEFINED ${soc_setting_dir})
|
|
||||||
add_subdirectory(${${soc_setting_dir}} soc/${SOC_NAME})
|
|
||||||
elseif(DEFINED ${series_setting_dir})
|
|
||||||
add_subdirectory(${${series_setting_dir}} soc/${SOC_SERIES})
|
|
||||||
elseif(DEFINED ${family_setting_dir})
|
|
||||||
add_subdirectory(${${family_setting_dir}} soc/${SOC_FAMILY})
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "No CMakeLists.txt file found for SoC: ${SOC_NAME}, "
|
|
||||||
"series: ${SOC_SERIES}, family: ${SOC_FAMILY}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Include all SoC roots except Zephyr, as we are already in the Zephyr SoC root.
|
|
||||||
set(local_soc_root ${SOC_ROOT})
|
|
||||||
list(REMOVE_ITEM local_soc_root ${ZEPHYR_BASE})
|
|
||||||
foreach(root ${local_soc_root})
|
|
||||||
cmake_path(GET root FILENAME name)
|
|
||||||
# A SoC root for HWMv1 may not contain a CMakeLists.txt file on this so
|
|
||||||
# let's check for existence before including.
|
|
||||||
if(EXISTS ${root}/soc/CMakeLists.txt)
|
|
||||||
add_subdirectory(${root}/soc soc/${name})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Include all SoC roots except Zephyr, as we are already in the Zephyr SoC root.
|
||||||
|
set(local_soc_root ${SOC_ROOT})
|
||||||
|
list(REMOVE_ITEM local_soc_root ${ZEPHYR_BASE})
|
||||||
|
foreach(root ${local_soc_root})
|
||||||
|
cmake_path(GET root FILENAME name)
|
||||||
|
# A SoC root for HWMv1 may not contain a CMakeLists.txt file on this so
|
||||||
|
# let's check for existence before including.
|
||||||
|
if(EXISTS ${root}/soc/CMakeLists.txt)
|
||||||
|
add_subdirectory(${root}/soc soc/${name})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
|
@ -3,11 +3,9 @@
|
||||||
# Only v1 model has choice for SoC selection, therefore the optional source
|
# Only v1 model has choice for SoC selection, therefore the optional source
|
||||||
# Sourced here and not in Kconfig.v1 to keep current SoC/CPU selection menu
|
# Sourced here and not in Kconfig.v1 to keep current SoC/CPU selection menu
|
||||||
# side-by-side with "Hardware Configuration" in the menu structure.
|
# side-by-side with "Hardware Configuration" in the menu structure.
|
||||||
orsource "Kconfig.$(HWM_SCHEME).choice"
|
|
||||||
|
|
||||||
menu "Hardware Configuration"
|
menu "Hardware Configuration"
|
||||||
|
|
||||||
rsource "Kconfig.$(HWM_SCHEME)"
|
rsource "Kconfig.v2"
|
||||||
|
|
||||||
# Source Zephyr Kconfig specifics from SoC roots.
|
# Source Zephyr Kconfig specifics from SoC roots.
|
||||||
osource "$(KCONFIG_BINARY_DIR)/soc/Kconfig"
|
osource "$(KCONFIG_BINARY_DIR)/soc/Kconfig"
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
config SOC
|
|
||||||
string
|
|
||||||
help
|
|
||||||
SoC name. The value of this setting must be defined by the selected
|
|
||||||
SoC for hw model v2.
|
|
||||||
|
|
||||||
config SOC_SERIES
|
|
||||||
string
|
|
||||||
help
|
|
||||||
SoC series. The value of this setting must be defined by the selected
|
|
||||||
SoC if the SoC belongs to a common series.
|
|
||||||
|
|
||||||
config SOC_FAMILY
|
|
||||||
string
|
|
||||||
help
|
|
||||||
SoC family. The value of this setting must be defined by the selected
|
|
||||||
SoC if the SoC belongs to a SoC family. Usually a SoC family also
|
|
||||||
indicates the vendor of the SoC.
|
|
||||||
|
|
||||||
# This loads custom SoC root Kconfig (only available if custom SoC root are defined)
|
|
||||||
osource "$(KCONFIG_BINARY_DIR)/soc/Kconfig.soc.arch"
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
choice
|
|
||||||
prompt "SoC/CPU/Configuration Selection"
|
|
||||||
|
|
||||||
# This loads custom SoC root Kconfig (only available if custom SoC root are defined)
|
|
||||||
osource "$(KCONFIG_BINARY_DIR)/soc/Kconfig.soc.choice"
|
|
||||||
|
|
||||||
endchoice
|
|
|
@ -1,4 +0,0 @@
|
||||||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
rsource "unit_testing/Kconfig"
|
|
Loading…
Add table
Add a link
Reference in a new issue