cmake: dts: Tweak warning flags for unit_address check

In Zephyr we have dts in which multiple peripherals can be at the same
MMIO address.  So we want to disable the `unique_unit_address` check via
(-Wno-unique_unit_address).  However, newer dtc support a check that
makes sure if we have duplicate unit-address devices that only one is
enabled.  So if the dtc flag is supported we enable
(-Wunique_unit_address_if_enabled).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-01-18 14:10:04 -06:00 committed by Kumar Gala
commit 717aa9cea7

View file

@ -80,12 +80,20 @@ if(CONFIG_HAS_DTS)
endif()
# Run the DTC on *.dts.pre.tmp to create the intermediary file *.dts_compiled
set(DTC_WARN_UNIT_ADDR_IF_ENABLED "")
check_dtc_flag("-Wunique_unit_address_if_enabled" check)
if (check)
set(DTC_WARN_UNIT_ADDR_IF_ENABLED "-Wunique_unit_address_if_enabled")
endif()
execute_process(
COMMAND ${DTC}
-O dts
-o ${BOARD}.dts_compiled
-b 0
-E unit_address_vs_reg
-W no-unique_unit_address
${DTC_WARN_UNIT_ADDR_IF_ENABLED}
${EXTRA_DTC_FLAGS} # User settable
${BOARD}.dts.pre.tmp
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}