Skip to content

Commit 0fe53eb

Browse files
committed
kconfig.py: import edt into kconfig.py
pull edt into kconfig so we can look at devicetree stuff Signed-off-by: Kumar Gala <[email protected]>
1 parent 439201c commit 0fe53eb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/kconfig/kconfig.py

+16
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
import os
1414
import sys
1515
import textwrap
16+
import pickle
17+
from pathlib import Path
18+
ZEPHYR_BASE = str(Path(__file__).resolve().parents[2])
19+
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts", "dts",
20+
"python-devicetree", "src"))
21+
22+
from devicetree import edtlib
1623

1724
# Zephyr doesn't use tristate symbols. They're supported here just to make the
1825
# script a bit more generic.
@@ -96,6 +103,15 @@ def main():
96103
# Write the list of parsed Kconfig files to a file
97104
write_kconfig_filenames(kconf, args.kconfig_list_out)
98105

106+
EDT_PICKLE = os.environ.get("EDT_PICKLE")
107+
108+
# The "if" handles a missing dts.
109+
if EDT_PICKLE is not None and os.path.isfile(EDT_PICKLE):
110+
with open(EDT_PICKLE, 'rb') as f:
111+
edt = pickle.load(f)
112+
else:
113+
edt = None
114+
99115

100116
def check_no_promptless_assign(kconf):
101117
# Checks that no promptless symbols are assigned

0 commit comments

Comments
 (0)