[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260112142009.1006236-32-herve.codina@bootlin.com>
Date: Mon, 12 Jan 2026 15:19:21 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: David Gibson <david@...son.dropbear.id.au>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Ayush Singh <ayush@...gleboard.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
devicetree-compiler@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
devicetree-spec@...r.kernel.org,
Hui Pu <hui.pu@...ealthcare.com>,
Ian Ray <ian.ray@...ealthcare.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Herve Codina <herve.codina@...tlin.com>
Subject: [RFC PATCH 31/77] dtc: Introduce import symbols
Import symbols allow to define a list of symbols imported and used by an
addon.
Those symbols have to be resolved when the addon is applied on a base
device-tree and will involved exported symbols provided at the node the
addon is applied to.
Import symbols are similar in term of feature to __fixups__ available
in device-tree overlays.
The goal is to identify symbols which are used by an addon but not
defined by the addon itself. Those specific symbols are the imported
symbols.
Introduce the import symbols list related to an addon. No functional
change yet but preparation for the future support for import symbol
parsing.
Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
dtc-parser.y | 3 ++-
dtc.h | 4 +++-
flattree.c | 2 +-
fstree.c | 2 +-
livetree.c | 4 +++-
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dtc-parser.y b/dtc-parser.y
index a0d0aef..4e46e9d 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -113,7 +113,8 @@ sourcefile:
headers memreserves devicetree
{
parser_output = build_dt_info($1, $2, $3,
- guess_boot_cpuid($3));
+ guess_boot_cpuid($3),
+ NULL);
}
;
diff --git a/dtc.h b/dtc.h
index 22816ba..796ed51 100644
--- a/dtc.h
+++ b/dtc.h
@@ -350,6 +350,7 @@ struct dt_info {
struct reserve_info *reservelist;
uint32_t boot_cpuid_phys;
struct node *dt; /* the device tree */
+ struct symbol *importsymlist; /* Import symbol list */
const char *outname; /* filename being written to, "-" for stdout */
};
@@ -360,7 +361,8 @@ struct dt_info {
struct dt_info *build_dt_info(unsigned int dtsflags,
struct reserve_info *reservelist,
- struct node *tree, uint32_t boot_cpuid_phys);
+ struct node *tree, uint32_t boot_cpuid_phys,
+ struct symbol *importsymlist);
void sort_tree(struct dt_info *dti);
void generate_label_tree(struct dt_info *dti, const char *name, bool allocph);
void generate_fixups_tree(struct dt_info *dti, const char *name);
diff --git a/flattree.c b/flattree.c
index d970259..47a289f 100644
--- a/flattree.c
+++ b/flattree.c
@@ -1105,5 +1105,5 @@ struct dt_info *dt_from_blob(const char *fname)
fclose(f);
- return build_dt_info(DTSF_V1 | dtsflags, reservelist, tree, boot_cpuid_phys);
+ return build_dt_info(DTSF_V1 | dtsflags, reservelist, tree, boot_cpuid_phys, NULL);
}
diff --git a/fstree.c b/fstree.c
index 445ae53..a6aaf1e 100644
--- a/fstree.c
+++ b/fstree.c
@@ -72,5 +72,5 @@ struct dt_info *dt_from_fs(const char *dirname)
tree = read_fstree(dirname);
tree = name_node(tree, "");
- return build_dt_info(DTSF_V1, NULL, tree, guess_boot_cpuid(tree));
+ return build_dt_info(DTSF_V1, NULL, tree, guess_boot_cpuid(tree), NULL);
}
diff --git a/livetree.c b/livetree.c
index 1de5990..4ec9609 100644
--- a/livetree.c
+++ b/livetree.c
@@ -531,7 +531,8 @@ struct reserve_info *add_reserve_entry(struct reserve_info *list,
struct dt_info *build_dt_info(unsigned int dtsflags,
struct reserve_info *reservelist,
- struct node *tree, uint32_t boot_cpuid_phys)
+ struct node *tree, uint32_t boot_cpuid_phys,
+ struct symbol *importsymlist)
{
struct dt_info *dti;
@@ -540,6 +541,7 @@ struct dt_info *build_dt_info(unsigned int dtsflags,
dti->reservelist = reservelist;
dti->dt = tree;
dti->boot_cpuid_phys = boot_cpuid_phys;
+ dti->importsymlist = importsymlist;
return dti;
}
--
2.52.0
Powered by blists - more mailing lists