cmake: kconfig: pass EXTRA_DTC_FLAGS to kconfig for EDT init

Pass EXTRA_DTC_FLAGS to kconfig so the EDT object we have in
kconfigfunctions can use that to set warn_reg_unit_address_mismatch
properly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-15 10:32:41 -05:00 committed by Kumar Gala
commit 9aefdaff2e
2 changed files with 10 additions and 1 deletions

View file

@ -48,6 +48,7 @@ set(ENV{ARCH_DIR} ${ARCH_DIR})
set(ENV{DTS_POST_CPP} ${DTS_POST_CPP})
set(ENV{DTS_ROOT_BINDINGS} "${DTS_ROOT_BINDINGS}")
set(ENV{TOOLCHAIN_KCONFIG_DIR} "${TOOLCHAIN_KCONFIG_DIR}")
set(ENV{EXTRA_DTC_FLAGS} ${EXTRA_DTC_FLAGS})
# Allow out-of-tree users to add their own Kconfig python frontend
# targets by appending targets to the CMake list
@ -92,6 +93,7 @@ foreach(kconfig_target
ZEPHYR_TOOLCHAIN_VARIANT=${ZEPHYR_TOOLCHAIN_VARIANT}
TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR}
ARCH_DIR=$ENV{ARCH_DIR}
EXTRA_DTC_FLAGS=${EXTRA_DTC_FLAGS}
DTS_POST_CPP=${DTS_POST_CPP}
DTS_ROOT_BINDINGS=${DTS_ROOT_BINDINGS}
${PYTHON_EXECUTABLE}

View file

@ -19,10 +19,17 @@ doc_mode = os.environ.get('KCONFIG_DOC_MODE') == "1"
if not doc_mode:
DTS_POST_CPP = os.environ["DTS_POST_CPP"]
BINDINGS_DIRS = os.environ.get("DTS_ROOT_BINDINGS")
DTC_FLAGS = os.environ.get("EXTRA_DTC_FLAGS")
if DTC_FLAGS is not None and "-Wno-simple_bus_reg" in DTC_FLAGS:
edt_warn_flag = False
else:
edt_warn_flag = True
# if a board port doesn't use DTS than these might not be set
if os.path.isfile(DTS_POST_CPP) and BINDINGS_DIRS is not None:
edt = edtlib.EDT(DTS_POST_CPP, BINDINGS_DIRS.split("?"))
edt = edtlib.EDT(DTS_POST_CPP, BINDINGS_DIRS.split("?"),
warn_reg_unit_address_mismatch=edt_warn_flag)
else:
edt = None