summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-29 14:15:57 -0600
committerSimon Glass <sjg@chromium.org>2017-09-15 05:27:47 -0600
commit35d503700f294b6f5dd930e2c1b0dd841f1b58fb (patch)
treeef01c0239b7b32381f7c62cc5f56a80c81c29dbf /tools
parent0d15463c0537806f70ea2359e32e4deb8c4766c2 (diff)
dtoc: Put each phandle on a separate line
When writing values from properties which contain phandles, dtoc currently writes 8 phandles per line. Change this to write one phandle per line. This helps reduce line length, since phandles are generally longer and may have arguments. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/dtoc/dtb_platdata.py12
-rw-r--r--tools/dtoc/test_dtoc.py3
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 0234f71b767..c0a3ae692bc 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -468,15 +468,17 @@ class DtbPlatdata(object):
target_node = self._fdt.phandle_to_node[phandle]
name = conv_name_to_c(target_node.name)
vals.append('{&%s%s, %d}' % (VAL_PREFIX, name, id_num))
+ for val in vals:
+ self.buf('\n\t\t%s,' % val)
else:
for val in prop.value:
vals.append(get_value(prop.type, val))
- # Put 8 values per line to avoid very long lines.
- for i in xrange(0, len(vals), 8):
- if i:
- self.buf(',\n\t\t')
- self.buf(', '.join(vals[i:i + 8]))
+ # Put 8 values per line to avoid very long lines.
+ for i in xrange(0, len(vals), 8):
+ if i:
+ self.buf(',\n\t\t')
+ self.buf(', '.join(vals[i:i + 8]))
self.buf('}')
else:
self.buf(get_value(prop.type, prop.value))
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index 23c4439ed91..aa617a649c8 100644
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -252,7 +252,8 @@ U_BOOT_DEVICE(phandle_target) = {
};
static struct dtd_source dtv_phandle_source = {
-\t.clocks\t\t\t= {{&dtv_phandle_target, 1}},
+\t.clocks\t\t\t= {
+\t\t{&dtv_phandle_target, 1},},
};
U_BOOT_DEVICE(phandle_source) = {
\t.name\t\t= "source",