dts: flash: Add support for flash labels

Added a label for soc-nv-flash nodes.  Made some updates to the
generation to maintain creating defines for properties like
erase-block-size and write-block-size so they we get both
FLASH_ERASE_BLOCK_SIZE and FLASH_${LABEL}_ERASE_BLOCK_SIZE (same for
WRITE_BLOCK_SIZE).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2018-01-18 13:31:54 -06:00 committed by Kumar Gala
commit 8a6381d8e8
2 changed files with 13 additions and 0 deletions

View file

@ -850,8 +850,15 @@ def main():
raise Exception("No information parsed from dts file.")
if 'zephyr,flash' in chosen:
node_addr = chosen['zephyr,flash']
extract_reg_prop(chosen['zephyr,flash'], None,
defs, "CONFIG_FLASH", 1024, None)
flash_keys = ["label", "write-block-size", "erase-block-size"]
for key in flash_keys:
if key in reduced[node_addr]['props']:
prop = reduced[node_addr]['props'][key]
extract_single(node_addr, None, prop, key, None, defs, "FLASH")
else:
# We will add address/size of 0 for systems with no flash controller
# This is what they already do in the Kconfig options anyway