Skip to content

Commit 6be751a

Browse files
nordicjmjhedberg
authored andcommitted
cmake: Remove HWMv1 checks
Removes checks for HWMv1 as the code for HWMv1 was removed from Zephyr some time ago and these checks are not needed Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
1 parent 9812e07 commit 6be751a

File tree

5 files changed

+35
-44
lines changed

5 files changed

+35
-44
lines changed

boards/common/openocd-nrf5.board.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
if(NOT DEFINED OPENOCD_NRF5_SUBFAMILY)
1010
string(REGEX MATCH nrf5. OPENOCD_NRF5_SUBFAMILY "${BOARD}")
1111

12-
if(HWMv2 AND "${OPENOCD_NRF5_SUBFAMILY}" STREQUAL "")
12+
if("${OPENOCD_NRF5_SUBFAMILY}" STREQUAL "")
1313
string(REGEX MATCH nrf5. OPENOCD_NRF5_SUBFAMILY "${BOARD_QUALIFIERS}")
1414
endif()
1515
endif()

cmake/modules/arch.cmake

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,22 @@
2525

2626
include_guard(GLOBAL)
2727

28-
if(HWMv2)
29-
# HWMv2 obtains arch from Kconfig for the given Board / SoC variant because
30-
# the Board / SoC path is no longer sufficient for determine the arch
31-
# (read: multi-core and multi-arch SoC).
32-
set(ARCH ${CONFIG_ARCH})
33-
string(TOUPPER "${ARCH}" arch_upper)
28+
# HWMv2 obtains arch from Kconfig for the given Board / SoC variant because
29+
# the Board / SoC path is no longer sufficient for determine the arch
30+
# (read: multi-core and multi-arch SoC).
31+
set(ARCH ${CONFIG_ARCH})
32+
string(TOUPPER "${ARCH}" arch_upper)
3433

35-
if(NOT ARCH)
36-
message(FATAL_ERROR "ARCH not defined. Check that BOARD=${BOARD}, is selecting "
37-
"an appropriate SoC in Kconfig, SoC=${CONFIG_SOC}, and that the SoC "
38-
"is selecting the correct architecture."
39-
)
40-
endif()
34+
if(NOT ARCH)
35+
message(FATAL_ERROR "ARCH not defined. Check that BOARD=${BOARD}, is selecting "
36+
"an appropriate SoC in Kconfig, SoC=${CONFIG_SOC}, and that the SoC "
37+
"is selecting the correct architecture."
38+
)
39+
endif()
4140

42-
cmake_path(GET ARCH_V2_${arch_upper}_DIR PARENT_PATH ARCH_DIR)
43-
if(NOT ARCH_DIR)
44-
message(FATAL_ERROR "Could not find ARCH=${ARCH} for BOARD=${BOARD}, \
41+
cmake_path(GET ARCH_V2_${arch_upper}_DIR PARENT_PATH ARCH_DIR)
42+
if(NOT ARCH_DIR)
43+
message(FATAL_ERROR "Could not find ARCH=${ARCH} for BOARD=${BOARD}, \
4544
please check your installation. ARCH roots searched: \n\
4645
${ARCH_ROOT}")
47-
endif()
4846
endif()

cmake/modules/boards.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Hints:
141141
endif()
142142
endforeach()
143143

144-
if(HWMv2 AND NOT EXISTS ${BOARD_DIR}/board.yml)
144+
if(NOT EXISTS ${BOARD_DIR}/board.yml)
145145
message(WARNING "BOARD_DIR: ${BOARD_DIR} has been moved or deleted. "
146146
"Trying to find new location."
147147
)
@@ -180,7 +180,7 @@ if(NOT BOARD_DIR)
180180
endif()
181181
endif()
182182

183-
set(format_str "{NAME}\;{DIR}\;{HWM}\;")
183+
set(format_str "{NAME}\;{DIR}\;")
184184
set(format_str "${format_str}{REVISION_FORMAT}\;{REVISION_DEFAULT}\;{REVISION_EXACT}\;")
185185
set(format_str "${format_str}{REVISIONS}\;{SOCS}\;{QUALIFIERS}")
186186

@@ -197,7 +197,7 @@ endif()
197197

198198
if(NOT "${ret_board}" STREQUAL "")
199199
string(STRIP "${ret_board}" ret_board)
200-
set(single_val "NAME;HWM;REVISION_FORMAT;REVISION_DEFAULT;REVISION_EXACT")
200+
set(single_val "NAME;REVISION_FORMAT;REVISION_DEFAULT;REVISION_EXACT")
201201
set(multi_val "DIR;REVISIONS;SOCS;QUALIFIERS")
202202
cmake_parse_arguments(LIST_BOARD "" "${single_val}" "${multi_val}" ${ret_board})
203203
list(GET LIST_BOARD_DIR 0 BOARD_DIR)
@@ -210,12 +210,12 @@ if(NOT "${ret_board}" STREQUAL "")
210210
# Create two CMake variables identifying the hw model.
211211
# CMake variable: HWM=v2
212212
# CMake variable: HWMv2=True
213-
set(HWM ${LIST_BOARD_HWM} CACHE INTERNAL "Zephyr hardware model version")
214-
set(HWM${HWM} True CACHE INTERNAL "Zephyr hardware model")
213+
set(HWM v2 CACHE INTERNAL "Zephyr hardware model version")
214+
set(HWMv2 True CACHE INTERNAL "Zephyr hardware model")
215215
elseif(BOARD_DIR)
216216
message(FATAL_ERROR "Error finding board: ${BOARD} in ${BOARD_DIR}.\n"
217217
"This indicates the board has been removed, renamed, or placed at a new location.\n"
218-
"Please run a pristine build."
218+
"Please run a pristine build."
219219
)
220220
else()
221221
message("No board named '${BOARD}' found. Did you mean:\n")

cmake/modules/hwm_v2.cmake

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
include_guard(GLOBAL)
2121

22-
if(NOT HWMv2)
23-
return()
24-
endif()
25-
2622
# Internal helper function for creation of Kconfig files.
2723
function(kconfig_gen bin_dir file dirs comment)
2824
set(kconfig_header "# Load ${comment} descriptions.\n")
@@ -47,7 +43,7 @@ list(TRANSFORM SOC_ROOT PREPEND "--soc-root=" OUTPUT_VARIABLE soc_root_args)
4743
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/list_hardware.py
4844
${arch_root_args} ${soc_root_args}
4945
--archs --socs
50-
--cmakeformat={TYPE}\;{NAME}\;{DIR}\;{HWM}
46+
--cmakeformat={TYPE}\;{NAME}\;{DIR}
5147
OUTPUT_VARIABLE ret_hw
5248
ERROR_VARIABLE err_hw
5349
RESULT_VARIABLE ret_val
@@ -73,7 +69,7 @@ while(TRUE)
7369
string(TOUPPER "${ARCH_V2_NAME}" ARCH_V2_NAME_UPPER)
7470
set(ARCH_V2_${ARCH_V2_NAME_UPPER}_DIR ${ARCH_V2_DIR})
7571
elseif(HWM_TYPE MATCHES "^soc|^series|^family")
76-
cmake_parse_arguments(SOC_V2 "" "NAME;HWM" "DIR" ${line})
72+
cmake_parse_arguments(SOC_V2 "" "NAME" "DIR" ${line})
7773

7874
list(APPEND kconfig_soc_source_dir "${SOC_V2_DIR}")
7975
string(TOUPPER "${SOC_V2_NAME}" SOC_V2_NAME_UPPER)
@@ -112,6 +108,5 @@ kconfig_gen("boards" "Kconfig.sysbuild" "${BOARD_DIRECTORIES}" "Sysbuild
112108
# Clear variables created by cmake_parse_arguments
113109
unset(SOC_V2_NAME)
114110
unset(SOC_V2_DIR)
115-
unset(SOC_V2_HWM)
116111
unset(ARCH_V2_NAME)
117112
unset(ARCH_V2_DIR)

cmake/modules/soc.cmake

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ include_guard(GLOBAL)
2121

2222
include(kconfig)
2323

24-
if(HWMv2)
25-
set(SOC_NAME ${CONFIG_SOC})
26-
set(SOC_SERIES ${CONFIG_SOC_SERIES})
27-
set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME})
28-
set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
29-
set(SOC_V2_DIR ${SOC_${SOC_NAME}_DIR})
30-
set(SOC_FULL_DIR ${SOC_V2_DIR} CACHE PATH "Path to the SoC directory." FORCE)
31-
set(SOC_DIRECTORIES ${SOC_${SOC_NAME}_DIRECTORIES} CACHE INTERNAL
32-
"List of SoC directories for SoC (${SOC_NAME})" FORCE
33-
)
34-
foreach(dir ${SOC_DIRECTORIES})
35-
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/soc.yml)
36-
endforeach()
37-
endif()
24+
set(SOC_NAME ${CONFIG_SOC})
25+
set(SOC_SERIES ${CONFIG_SOC_SERIES})
26+
set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME})
27+
set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
28+
set(SOC_V2_DIR ${SOC_${SOC_NAME}_DIR})
29+
set(SOC_FULL_DIR ${SOC_V2_DIR} CACHE PATH "Path to the SoC directory." FORCE)
30+
set(SOC_DIRECTORIES ${SOC_${SOC_NAME}_DIRECTORIES} CACHE INTERNAL
31+
"List of SoC directories for SoC (${SOC_NAME})" FORCE
32+
)
33+
foreach(dir ${SOC_DIRECTORIES})
34+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/soc.yml)
35+
endforeach()

0 commit comments

Comments
 (0)