aboutsummaryrefslogtreecommitdiff
path: root/tools/dtoc/dtb_platdata.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-03 06:01:19 -0700
committerSimon Glass <sjg@chromium.org>2021-03-22 19:23:27 +1300
commit9763e4eb93bfcb5cc50edf13b152c231b218591f (patch)
tree88b1d69c2b4465b53f3372c53351f58259181ea8 /tools/dtoc/dtb_platdata.py
parent8840bc56fb8510a6284f0334f2236a302fe934dc (diff)
dtoc: Generate a summary in the dt-plat.c file
Add a summary to the top of the generated code, to make it easier to see what the file contains. Also add a tab to .plat so that its value lines up with the others. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/dtb_platdata.py')
-rw-r--r--tools/dtoc/dtb_platdata.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index ca2e55fa52..ab26c4adca 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -639,7 +639,7 @@ class DtbPlatdata():
"""
self.buf('U_BOOT_DRVINFO(%s) = {\n' % node.var_name)
self.buf('\t.name\t\t= "%s",\n' % node.struct_name)
- self.buf('\t.plat\t= &%s%s,\n' % (VAL_PREFIX, node.var_name))
+ self.buf('\t.plat\t\t= &%s%s,\n' % (VAL_PREFIX, node.var_name))
self.buf('\t.plat_size\t= sizeof(%s%s),\n' %
(VAL_PREFIX, node.var_name))
idx = -1
@@ -860,8 +860,22 @@ class DtbPlatdata():
self.out('#include <dt-structs.h>\n')
self.out('\n')
- for node in self._valid_nodes:
- self.output_node_plat(node)
+ if self._valid_nodes:
+ self.out('/*\n')
+ self.out(
+ " * driver_info declarations, ordered by 'struct driver_info' linker_list idx:\n")
+ self.out(' *\n')
+ self.out(' * idx %-20s %-s\n' % ('driver_info', 'driver'))
+ self.out(' * --- %-20s %-s\n' % ('-' * 20, '-' * 20))
+ for node in self._valid_nodes:
+ self.out(' * %3d: %-20s %-s\n' %
+ (node.idx, node.var_name, node.struct_name))
+ self.out(' * --- %-20s %-s\n' % ('-' * 20, '-' * 20))
+ self.out(' */\n')
+ self.out('\n')
+
+ for node in self._valid_nodes:
+ self.output_node_plat(node)
self.out(''.join(self.get_buf()))