Skip to content
Permalink
Browse files

scripts/dts: Change DT_<COMPAT>_<INSTANCE>_<PROP> define

Its possible that the <INSTANCE> number could conflict with the register
number.  This is shown to happen for a device like soc-nv-flash at
address 0.

So change naming convention to DT_INST_<INSTANCE>_<COMPAT>_<PROP> and
make DT_<COMPAT>_<INSTANCE>_<PROP> as deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
  • Loading branch information...
galak committed Jun 7, 2019
1 parent a788ce2 commit 01e54a54721aa989e4f0947d97607cc84e6b1721
Showing with 6 additions and 0 deletions.
  1. +4 −0 scripts/dts/extract/globals.py
  2. +2 −0 scripts/dts/extract_dts_includes.py
@@ -18,6 +18,7 @@
bindings = {}
bus_bindings = {}
binding_compats = []
deprecated = []
old_alias_names = False

regs_config = {
@@ -262,6 +263,9 @@ def add_compat_alias(node_path, label_postfix, label, prop_aliases):
for k in instance:
i = instance[k]
b = 'DT_' + str_to_label(k) + '_' + str(i) + '_' + label_postfix
deprecated.append(b)
prop_aliases[b] = label
b = "DT_INST_{}_{}_{}".format(str(i), str_to_label(k), label_postfix)
prop_aliases[b] = label

def add_prop_aliases(node_path,
@@ -302,6 +302,8 @@ def max_dict_key(dct):
# for now we special case LED, SW, and *PWM_LED*
if not alias.startswith(('DT_', 'LED', 'SW')) and not 'PWM_LED' in alias:
deprecated_warn = True
if alias in deprecated:
deprecated_warn = True
f.write(define_str(alias, alias_target, value_tabs, deprecated_warn))

f.write('\n')

0 comments on commit 01e54a5

Please sign in to comment.
You can’t perform that action at this time.