From 9aefdaff2ef893e303a67ae61f5ed3789d02ee61 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 15 Apr 2020 10:32:41 -0500 Subject: [PATCH] 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 --- cmake/kconfig.cmake | 2 ++ scripts/kconfig/kconfigfunctions.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/kconfig.cmake b/cmake/kconfig.cmake index 1adb02226c5..ab1b891d17b 100644 --- a/cmake/kconfig.cmake +++ b/cmake/kconfig.cmake @@ -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} diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index f571a8f71ac..19ba25bc954 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -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