mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00:00
dtoc: Output nodes in order
Previously we had to worry about nodes being output before those that they depended on, thus causing build errors. So the current algorithm is careful to output nodes in the right order. We now use a different method for outputting phandles that does not involve pointers. Also we plan to add a 'declarations' header file to declare all drivers as 'extern'. Update the code to drop the dependency checking and output in a simple loop. This makes the output easier to follow since drivers are in order of thier indices (0, 1, ...), which is also the order it appears in in the linker list. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
1e0f3f46bd
commit
9eca08dc59
2 changed files with 33 additions and 42 deletions
|
@ -798,18 +798,9 @@ class DtbPlatdata():
|
|||
self.out('#include <dm.h>\n')
|
||||
self.out('#include <dt-structs.h>\n')
|
||||
self.out('\n')
|
||||
nodes_to_output = list(self._valid_nodes)
|
||||
|
||||
# Keep outputing nodes until there is none left
|
||||
while nodes_to_output:
|
||||
node = nodes_to_output[0]
|
||||
# Output all the node's dependencies first
|
||||
for req_node in node.phandles:
|
||||
if req_node in nodes_to_output:
|
||||
self.output_node(req_node)
|
||||
nodes_to_output.remove(req_node)
|
||||
for node in self._valid_nodes:
|
||||
self.output_node(node)
|
||||
nodes_to_output.remove(node)
|
||||
|
||||
# Define dm_populate_phandle_data() which will add the linking between
|
||||
# nodes using DM_DRVINFO_GET
|
||||
|
|
|
@ -422,17 +422,6 @@ U_BOOT_DRVINFO(phandle3_target) = {
|
|||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-target index 4 */
|
||||
static struct dtd_target dtv_phandle_target = {
|
||||
\t.intval\t\t\t= 0x0,
|
||||
};
|
||||
U_BOOT_DRVINFO(phandle_target) = {
|
||||
\t.name\t\t= "target",
|
||||
\t.plat\t= &dtv_phandle_target,
|
||||
\t.plat_size\t= sizeof(dtv_phandle_target),
|
||||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-source index 2 */
|
||||
static struct dtd_source dtv_phandle_source = {
|
||||
\t.clocks\t\t\t= {
|
||||
|
@ -460,6 +449,17 @@ U_BOOT_DRVINFO(phandle_source2) = {
|
|||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-target index 4 */
|
||||
static struct dtd_target dtv_phandle_target = {
|
||||
\t.intval\t\t\t= 0x0,
|
||||
};
|
||||
U_BOOT_DRVINFO(phandle_target) = {
|
||||
\t.name\t\t= "target",
|
||||
\t.plat\t= &dtv_phandle_target,
|
||||
\t.plat_size\t= sizeof(dtv_phandle_target),
|
||||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
void dm_populate_phandle_data(void) {
|
||||
}
|
||||
''', data)
|
||||
|
@ -488,16 +488,6 @@ struct dtd_target {
|
|||
with open(output) as infile:
|
||||
data = infile.read()
|
||||
self._check_strings(C_HEADER + '''
|
||||
/* Node /phandle-target index 1 */
|
||||
static struct dtd_target dtv_phandle_target = {
|
||||
};
|
||||
U_BOOT_DRVINFO(phandle_target) = {
|
||||
\t.name\t\t= "target",
|
||||
\t.plat\t= &dtv_phandle_target,
|
||||
\t.plat_size\t= sizeof(dtv_phandle_target),
|
||||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-source2 index 0 */
|
||||
static struct dtd_source dtv_phandle_source2 = {
|
||||
\t.clocks\t\t\t= {
|
||||
|
@ -510,6 +500,16 @@ U_BOOT_DRVINFO(phandle_source2) = {
|
|||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-target index 1 */
|
||||
static struct dtd_target dtv_phandle_target = {
|
||||
};
|
||||
U_BOOT_DRVINFO(phandle_target) = {
|
||||
\t.name\t\t= "target",
|
||||
\t.plat\t= &dtv_phandle_target,
|
||||
\t.plat_size\t= sizeof(dtv_phandle_target),
|
||||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
void dm_populate_phandle_data(void) {
|
||||
}
|
||||
''', data)
|
||||
|
@ -544,17 +544,6 @@ U_BOOT_DRVINFO(phandle3_target) = {
|
|||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-target index 4 */
|
||||
static struct dtd_target dtv_phandle_target = {
|
||||
\t.intval\t\t\t= 0x0,
|
||||
};
|
||||
U_BOOT_DRVINFO(phandle_target) = {
|
||||
\t.name\t\t= "target",
|
||||
\t.plat\t= &dtv_phandle_target,
|
||||
\t.plat_size\t= sizeof(dtv_phandle_target),
|
||||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-source index 2 */
|
||||
static struct dtd_source dtv_phandle_source = {
|
||||
\t.cd_gpios\t\t= {
|
||||
|
@ -582,6 +571,17 @@ U_BOOT_DRVINFO(phandle_source2) = {
|
|||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
/* Node /phandle-target index 4 */
|
||||
static struct dtd_target dtv_phandle_target = {
|
||||
\t.intval\t\t\t= 0x0,
|
||||
};
|
||||
U_BOOT_DRVINFO(phandle_target) = {
|
||||
\t.name\t\t= "target",
|
||||
\t.plat\t= &dtv_phandle_target,
|
||||
\t.plat_size\t= sizeof(dtv_phandle_target),
|
||||
\t.parent_idx\t= -1,
|
||||
};
|
||||
|
||||
void dm_populate_phandle_data(void) {
|
||||
}
|
||||
''', data)
|
||||
|
|
Loading…
Add table
Reference in a new issue