cmake: modules: extensions: Revert using common board files

This change reverts a change that was introduced with hwmv2 which
allowed for using common board names for overlays, given the board
target ``nrf9160dk@0.7.0/nrf9160/ns``.

In hwmv1 this would have used:
    ``nrf9160dk_nrf9160_ns.conf``.
    ``nrf9160dk_nrf9160_ns_0_7_0.conf``.

In hwmv2 this would have used:
    ``nrf9160dk_nrf9160_ns.conf``
    ``nrf9160dk_nrf9160_ns_0_7_0.conf``
    ``nrf9160dk_nrf9160.conf``
    ``nrf9160dk_nrf9160_0_7_0.conf``
    ``nrf9160dk.conf``
    ``nrf9160dk_0_7_0.conf``

With these changes, the following are used (which restores the hwmv1
behaviour):
    ``nrf9160dk_nrf9160_ns.conf``
    ``nrf9160dk_nrf9160_ns_0_7_0.conf``

For a board with a default SoC which is not a variant for example
``rpi_pico`` then ``rpi_pico.conf`` will also be used, this file
will not be used for variants e.g. ``rpi_pico/rp2040/w``

This applies to .dts, .conf and .overlay files in the boards
directory, and to .conf and .overlay files in application board
overlay directories.

This revert is needed to avoid issues whereby variants have
incompatible configuration to the parent board target, which has
been affecting samples and tests.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2024-03-21 09:56:27 +00:00 committed by Carles Cufí
parent 3b895064af
commit 0be0d2175b

View file

@ -1519,8 +1519,7 @@ endfunction()
# build string as first item in the list.
# The full order of build strings returned in the list will be:
# - Normalized board target build string, this includes qualifiers and revision
# - Build string with board variants removed in addition
# - Build string with cpuset removed in addition
# - Normalized board target build string, without revision
# - Build string with soc removed in addition
#
# If BUILD is supplied, then build type will be appended to each entry in the
@ -1561,7 +1560,7 @@ endfunction()
# calling
# zephyr_build_string(build_string BOARD alpha BOARD_REVISION 1.0.0 BOARD_QUALIFIERS /soc/bar MERGE)
# will return a list of the following strings
# `alpha_soc_bar_1_0_0;alpha_soc_bar;alpha_soc_1_0_0;alpha_soc;alpha_1_0_0;alpha` in `build_string` parameter.
# `alpha_soc_bar_1_0_0;alpha_soc_bar;alpha_bar` in `build_string` parameter.
#
function(zephyr_build_string outvar)
set(options MERGE REVERSE)
@ -1595,20 +1594,17 @@ function(zephyr_build_string outvar)
string(JOIN "_" ${outvar} ${str_segment_list} ${revision_string} ${BUILD_STR_BUILD})
if(BUILD_STR_MERGE)
if(DEFINED BUILD_STR_BOARD_REVISION)
string(JOIN "_" variant_string ${str_segment_list} ${BUILD_STR_BUILD})
string(JOIN "_" variant_string ${str_segment_list} ${BUILD_STR_BUILD})
if(NOT "${variant_string}" IN_LIST ${outvar})
list(APPEND ${outvar} "${variant_string}")
endif()
list(POP_BACK str_segment_list)
while(NOT str_segment_list STREQUAL "")
if(DEFINED BUILD_STR_BOARD_REVISION)
string(JOIN "_" variant_string ${str_segment_list} ${revision_string} ${BUILD_STR_BUILD})
list(APPEND ${outvar} "${variant_string}")
endif()
string(JOIN "_" variant_string ${str_segment_list} ${BUILD_STR_BUILD})
list(APPEND ${outvar} "${variant_string}")
list(POP_BACK str_segment_list)
endwhile()
if(BUILD_STR_BOARD_QUALIFIERS)
string(REGEX REPLACE "^/[^/]*(.*)" "\\1" qualifiers_without_soc "${BUILD_STR_BOARD_QUALIFIERS}")
string(REPLACE "/" "_" qualifiers_without_soc "${qualifiers_without_soc}")
list(APPEND ${outvar} "${BUILD_STR_BOARD}${qualifiers_without_soc}")
endif()
endif()
if(BUILD_STR_REVERSE)