scripts/dts/extract_dts_includes: Add DT_ prefix to FLASH_AREA defines We generate the following FLASH prefixed defines: FLASH_AREA_MCUBOOT_LABEL FLASH_AREA_MCUBOOT_OFFSET FLASH_AREA_MCUBOOT_OFFSET_0 FLASH_AREA_MCUBOOT_READ_ONLY FLASH_AREA_MCUBOOT_SIZE FLASH_AREA_MCUBOOT_SIZE_0 Now we generate DT_ prefixed versions: DT_FLASH_AREA_MCUBOOT_LABEL DT_FLASH_AREA_MCUBOOT_OFFSET DT_FLASH_AREA_MCUBOOT_OFFSET_0 DT_FLASH_AREA_MCUBOOT_READ_ONLY DT_FLASH_AREA_MCUBOOT_SIZE DT_FLASH_AREA_MCUBOOT_SIZE_0 And will deprecate the non DT_ prefixed versions in the future. We keep them around as aliases for the time being. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
diff --git a/scripts/dts/extract/flash.py b/scripts/dts/extract/flash.py index 8861480..7f0202b 100644 --- a/scripts/dts/extract/flash.py +++ b/scripts/dts/extract/flash.py
@@ -85,6 +85,9 @@ insert_defs("DT_FLASH_AREA", prop_def, prop_alias) + def _create_legacy_label(self, prop_alias, label): + prop_alias[label.lstrip('DT_')] = label + def extract_partition(self, node_address): prop_def = {} prop_alias = {} @@ -95,12 +98,14 @@ partition_name = node['props']['label'] partition_sectors = node['props']['reg'] - label_prefix = ["FLASH_AREA", partition_name] + label_prefix = ["DT_FLASH_AREA", partition_name] label = self.get_label_string(label_prefix + ["LABEL",]) prop_def[label] = '"{}"'.format(partition_name) + self._create_legacy_label(prop_alias, label) label = self.get_label_string(label_prefix + ["READ_ONLY",]) prop_def[label] = 1 if 'read-only' in node['props'] else 0 + self._create_legacy_label(prop_alias, label) index = 0 while index < len(partition_sectors): @@ -110,17 +115,21 @@ label = self.get_label_string( label_prefix + ["OFFSET", str(sector_index)]) prop_def[label] = "{}".format(sector_start_offset) + self._create_legacy_label(prop_alias, label) label = self.get_label_string( label_prefix + ["SIZE", str(sector_index)]) prop_def[label] = "{}".format(sector_size) + self._create_legacy_label(prop_alias, label) index += 2 # alias sector 0 label = self.get_label_string(label_prefix + ["OFFSET",]) prop_alias[label] = self.get_label_string( label_prefix + ["OFFSET", '0']) + self._create_legacy_label(prop_alias, label) label = self.get_label_string(label_prefix + ["SIZE",]) prop_alias[label] = self.get_label_string( label_prefix + ["SIZE", '0']) + self._create_legacy_label(prop_alias, label) insert_defs(node_address, prop_def, prop_alias)
diff --git a/scripts/dts/extract_dts_includes.py b/scripts/dts/extract_dts_includes.py index d5ad4f9..8ed1bae 100755 --- a/scripts/dts/extract_dts_includes.py +++ b/scripts/dts/extract_dts_includes.py
@@ -481,7 +481,7 @@ node_address = chosen.get('zephyr,flash', 'dummy-flash') flash.extract(node_address, 'zephyr,flash', 'DT_FLASH') node_address = chosen.get('zephyr,code-partition', node_address) - flash.extract(node_address, 'zephyr,code-partition', 'FLASH') + flash.extract(node_address, 'zephyr,code-partition', None) def parse_arguments():