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>
diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py
index f571a8f..19ba25b 100644
--- a/scripts/kconfig/kconfigfunctions.py
+++ b/scripts/kconfig/kconfigfunctions.py
@@ -19,10 +19,17 @@
 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