dts: Remove conf file generation support
The last user of the .conf file format DTS data has been removed. We can now remove the generation and associated support for the .conf file. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
acc0e9025d
commit
86887dafde
4 changed files with 0 additions and 35 deletions
|
@ -18,7 +18,6 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/generated)
|
|||
set(ZEPHYR_DTS ${PROJECT_BINARY_DIR}/zephyr.dts)
|
||||
set(DEVICETREE_UNFIXED_H ${PROJECT_BINARY_DIR}/include/generated/devicetree_unfixed.h)
|
||||
set(DEVICETREE_UNFIXED_LEGACY_H ${PROJECT_BINARY_DIR}/include/generated/devicetree_legacy_unfixed.h)
|
||||
set(DEVICETREE_CONF ${PROJECT_BINARY_DIR}/include/generated/devicetree.conf)
|
||||
set(DTS_POST_CPP ${PROJECT_BINARY_DIR}/${BOARD}.dts.pre.tmp)
|
||||
|
||||
set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
|
||||
|
@ -217,7 +216,6 @@ if(SUPPORTS_DTS)
|
|||
--dtc-flags '${EXTRA_DTC_FLAGS}'
|
||||
--bindings-dirs ${DTS_ROOT_BINDINGS}
|
||||
--header-out ${DEVICETREE_UNFIXED_LEGACY_H}
|
||||
--conf-out ${DEVICETREE_CONF}
|
||||
)
|
||||
|
||||
execute_process(
|
||||
|
|
|
@ -45,7 +45,6 @@ set(ENV{SOC_DIR} ${SOC_DIR})
|
|||
set(ENV{SHIELD_AS_LIST} "${SHIELD_AS_LIST}")
|
||||
set(ENV{CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR})
|
||||
set(ENV{ARCH_DIR} ${ARCH_DIR})
|
||||
set(ENV{DEVICETREE_CONF} ${DEVICETREE_CONF})
|
||||
set(ENV{DTS_POST_CPP} ${DTS_POST_CPP})
|
||||
set(ENV{DTS_ROOT_BINDINGS} "${DTS_ROOT_BINDINGS}")
|
||||
set(ENV{TOOLCHAIN_KCONFIG_DIR} "${TOOLCHAIN_KCONFIG_DIR}")
|
||||
|
@ -93,7 +92,6 @@ foreach(kconfig_target
|
|||
ZEPHYR_TOOLCHAIN_VARIANT=${ZEPHYR_TOOLCHAIN_VARIANT}
|
||||
TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR}
|
||||
ARCH_DIR=$ENV{ARCH_DIR}
|
||||
DEVICETREE_CONF=${DEVICETREE_CONF}
|
||||
DTS_POST_CPP=${DTS_POST_CPP}
|
||||
DTS_ROOT_BINDINGS=${DTS_ROOT_BINDINGS}
|
||||
${PYTHON_EXECUTABLE}
|
||||
|
|
|
@ -19,7 +19,6 @@ import sys
|
|||
import edtlib
|
||||
|
||||
def main():
|
||||
global conf_file
|
||||
global header_file
|
||||
global flash_area_num
|
||||
|
||||
|
@ -33,7 +32,6 @@ def main():
|
|||
except edtlib.EDTError as e:
|
||||
sys.exit(f"devicetree error: {e}")
|
||||
|
||||
conf_file = open(args.conf_out, "w", encoding="utf-8")
|
||||
header_file = open(args.header_out, "w", encoding="utf-8")
|
||||
flash_area_num = 0
|
||||
|
||||
|
@ -69,7 +67,6 @@ def main():
|
|||
write_addr_size(edt, "zephyr,ipc_shm", "IPC_SHM")
|
||||
write_flash(edt)
|
||||
|
||||
conf_file.close()
|
||||
header_file.close()
|
||||
|
||||
|
||||
|
@ -86,8 +83,6 @@ def parse_args():
|
|||
"we allow multiple")
|
||||
parser.add_argument("--header-out", required=True,
|
||||
help="path to write header to")
|
||||
parser.add_argument("--conf-out", required=True,
|
||||
help="path to write configuration file to")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
@ -749,21 +744,9 @@ def out(ident, val, aliases=(), deprecation_msg=None):
|
|||
out_define(ident, val, deprecation_msg, header_file)
|
||||
primary_ident = f"DT_{ident}"
|
||||
|
||||
# Exclude things that aren't single token values from .conf. At
|
||||
# the moment the only such items are unquoted string
|
||||
# representations of initializer lists, which begin with a curly
|
||||
# brace.
|
||||
output_to_conf = not (isinstance(val, str) and val.startswith("{"))
|
||||
if output_to_conf:
|
||||
print(f"{primary_ident}={val}", file=conf_file)
|
||||
|
||||
for alias in aliases:
|
||||
if alias != ident:
|
||||
out_define(alias, "DT_" + ident, deprecation_msg, header_file)
|
||||
if output_to_conf:
|
||||
# For the configuration file, the value is just repeated for all
|
||||
# the aliases
|
||||
print(f"DT_{alias}={val}", file=conf_file)
|
||||
|
||||
return primary_ident
|
||||
|
||||
|
@ -786,7 +769,6 @@ def out_comment(s, blank_before=True):
|
|||
|
||||
if blank_before:
|
||||
print(file=header_file)
|
||||
print(file=conf_file)
|
||||
|
||||
if "\n" in s:
|
||||
# Format multi-line comments like
|
||||
|
@ -810,9 +792,6 @@ def out_comment(s, blank_before=True):
|
|||
# /* foo bar */
|
||||
print("/* " + s + " */", file=header_file)
|
||||
|
||||
print("\n".join("# " + line if line.strip() else "#"
|
||||
for line in s.splitlines()), file=conf_file)
|
||||
|
||||
|
||||
def escape(s):
|
||||
# Backslash-escapes any double quotes and backslashes in 's'
|
||||
|
|
|
@ -16,7 +16,6 @@ import edtlib
|
|||
|
||||
doc_mode = os.environ.get('KCONFIG_DOC_MODE') == "1"
|
||||
|
||||
dt_defines = {}
|
||||
if not doc_mode:
|
||||
DTS_POST_CPP = os.environ["DTS_POST_CPP"]
|
||||
BINDINGS_DIRS = os.environ.get("DTS_ROOT_BINDINGS")
|
||||
|
@ -27,15 +26,6 @@ if not doc_mode:
|
|||
else:
|
||||
edt = None
|
||||
|
||||
# The env. var DEVICETREE_CONF must be set unless we are in doc mode
|
||||
DEVICETREE_CONF = os.environ['DEVICETREE_CONF']
|
||||
if os.path.isfile(DEVICETREE_CONF):
|
||||
with open(DEVICETREE_CONF, 'r', encoding='utf-8') as fd:
|
||||
for line in fd:
|
||||
if '=' in line:
|
||||
define, val = line.split('=', 1)
|
||||
dt_defines[define] = val.strip()
|
||||
|
||||
|
||||
def _warn(kconf, msg):
|
||||
print("{}:{}: WARNING: {}".format(kconf.filename, kconf.linenr, msg))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue