mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-06 21:25:05 -05:00
Restore labels from __symbols__ node
If the input has a __symbols__ node, restore the named labels for the respective nodes. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
This commit is contained in:
parent
635b958d27
commit
6a6f5aecd4
3 changed files with 24 additions and 0 deletions
2
dtc.c
2
dtc.c
|
|
@ -338,6 +338,8 @@ int main(int argc, char *argv[])
|
|||
if (auto_label_aliases)
|
||||
generate_label_tree(dti, "aliases", false);
|
||||
|
||||
generate_labels_from_tree(dti, "__symbols__");
|
||||
|
||||
if (generate_symbols)
|
||||
generate_label_tree(dti, "__symbols__", true);
|
||||
|
||||
|
|
|
|||
1
dtc.h
1
dtc.h
|
|
@ -339,6 +339,7 @@ struct dt_info *build_dt_info(unsigned int dtsflags,
|
|||
struct reserve_info *reservelist,
|
||||
struct node *tree, uint32_t boot_cpuid_phys);
|
||||
void sort_tree(struct dt_info *dti);
|
||||
void generate_labels_from_tree(struct dt_info *dti, const char *name);
|
||||
void generate_label_tree(struct dt_info *dti, const char *name, bool allocph);
|
||||
void generate_fixups_tree(struct dt_info *dti, const char *name);
|
||||
void generate_local_fixups_tree(struct dt_info *dti, const char *name);
|
||||
|
|
|
|||
21
livetree.c
21
livetree.c
|
|
@ -1046,6 +1046,27 @@ static void generate_local_fixups_tree_internal(struct dt_info *dti,
|
|||
generate_local_fixups_tree_internal(dti, lfn, c);
|
||||
}
|
||||
|
||||
void generate_labels_from_tree(struct dt_info *dti, const char *name)
|
||||
{
|
||||
struct node *an;
|
||||
struct property *p;
|
||||
|
||||
an = get_subnode(dti->dt, name);
|
||||
if (!an)
|
||||
return;
|
||||
|
||||
for_each_property(an, p) {
|
||||
struct node *labeled_node;
|
||||
|
||||
labeled_node = get_node_by_path(dti->dt, p->val.val);
|
||||
if (labeled_node)
|
||||
add_label(&labeled_node->labels, p->name);
|
||||
else if (quiet < 1)
|
||||
fprintf(stderr, "Warning: Path %s referenced in property %s/%s missing",
|
||||
p->val.val, name, p->name);
|
||||
}
|
||||
}
|
||||
|
||||
void generate_label_tree(struct dt_info *dti, const char *name, bool allocph)
|
||||
{
|
||||
if (!any_label_tree(dti, dti->dt))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue