summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2019-06-12 09:05:52 -0400
committerRob Herring <robh@kernel.org>2019-06-12 09:05:52 -0400
commit9bb9c6a110eaad53054e939f8800223ae6d9b66c (patch)
treef1664ee7fd0cae45c8a12ac9b7d39ed5ebb0af2b
parent73c699ffe53868d9fc1bd50445ad2c5041f379e3 (diff)
scripts/dtc: Update to upstream version v1.5.0-23-g87963ee20693
This adds the following commits from upstream: 87963ee20693 livetree: add missing type markers in generated overlay properties 825146d13dc0 Fix typos in various documentation and source files 25bb080c18d1 Update the GPL2 text to the latest revision 243176c4ce84 Fix bogus error on rebuild ce01b21098a4 libfdt: Add FDT_CREATE_FLAG_NO_NAME_DEDUP flag that trades size for speed fbb62754ce45 libfdt: Introduce fdt_create_with_flags() 228a44cce857 libfdt: Ensure fdt_add_property frees allocated name string on failure 8f695676227b Avoid assertion in check_interrupts_property() 5c3513f68921 Link tools and tests against libfdt shared library 00f9febf9c16 tests: Rename tests.sh to testutils.sh c5d45188f923 Clean up LDLIBS handling 6ef8fcd05b74 Rebuild libfdt shared object if versioning linker script changes 26ee65a16c38 Use Python3 by default cca6546244cb libfdt: Make fdt_get_max_phandle() an inline 730875016a6a libfdt: Add phandle generation helper 7dfb61ba96b1 libfdt: Use fdt_find_max_phandle() 2bc5b66d7f6c libfdt: Add new maximum phandle lookup function 7fcf8208b8a9 libfdt: add fdt_append_addrrange() ae795b2db7a4 checks: Do not omit nodes with labels if symbol generation is requested eac2ad495b29 Update version.lds again f67b47135523 Revert "libfdt: Add phandle generation helper" 54ea41c22415 libfdt: Add phandle generation helper 4762ad051ee0 checks: Fix spelling in check_graph_endpoint d37f6b20107e Bump version to v1.5.0 a4b1a307ff3a pylibfdt:tests: Extend the way how to find a Python module 625dd8aaf20f pylibfdt: Change how passing tests are recognized 364631626bb7 pylibfdt: Test fdt.setprop take bytes on Python 3, add error handling cb0f454f73cc pylibfdt: check_err accepts only integer as a first argument. 4b68c6b3605a pylibfdt: Proper handling of bytes/unicode strings and octal literals 78e113e81c9d Use PRIxPTR for printing uintptr_t values ea7a8f6dad67 libfdt: Fix FDT_ERR_NOTFOUND typos in documentation 5aafd7ca43e0 libfdt: Fix fdt_getprop_by_offset() parameter name in documentation 7cbc550f903b checks: Add unit address check if node is enabled Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--scripts/dtc/checks.c55
-rw-r--r--scripts/dtc/dtc.h3
-rw-r--r--scripts/dtc/flattree.c2
-rw-r--r--scripts/dtc/libfdt/Makefile.libfdt2
-rw-r--r--scripts/dtc/libfdt/fdt_addresses.c47
-rw-r--r--scripts/dtc/libfdt/fdt_overlay.c10
-rw-r--r--scripts/dtc/libfdt/fdt_ro.c50
-rw-r--r--scripts/dtc/libfdt/fdt_rw.c22
-rw-r--r--scripts/dtc/libfdt/fdt_strerror.c1
-rw-r--r--scripts/dtc/libfdt/fdt_sw.c78
-rw-r--r--scripts/dtc/libfdt/libfdt.h158
-rw-r--r--scripts/dtc/libfdt/libfdt_env.h1
-rw-r--r--scripts/dtc/livetree.c20
-rw-r--r--scripts/dtc/util.h4
-rw-r--r--scripts/dtc/version_gen.h2
15 files changed, 399 insertions, 56 deletions
diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 4834e44b37b2..4719d658432b 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -660,6 +660,8 @@ ERROR(path_references, fixup_path_references, NULL, &duplicate_node_names);
660static void fixup_omit_unused_nodes(struct check *c, struct dt_info *dti, 660static void fixup_omit_unused_nodes(struct check *c, struct dt_info *dti,
661 struct node *node) 661 struct node *node)
662{ 662{
663 if (generate_symbols && node->labels)
664 return;
663 if (node->omit_if_unused && !node->is_referenced) 665 if (node->omit_if_unused && !node->is_referenced)
664 delete_node(node); 666 delete_node(node);
665} 667}
@@ -1212,8 +1214,24 @@ static void check_avoid_unnecessary_addr_size(struct check *c, struct dt_info *d
1212} 1214}
1213WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size); 1215WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size);
1214 1216
1215static void check_unique_unit_address(struct check *c, struct dt_info *dti, 1217static bool node_is_disabled(struct node *node)
1216 struct node *node) 1218{
1219 struct property *prop;
1220
1221 prop = get_property(node, "status");
1222 if (prop) {
1223 char *str = prop->val.val;
1224 if (streq("disabled", str))
1225 return true;
1226 }
1227
1228 return false;
1229}
1230
1231static void check_unique_unit_address_common(struct check *c,
1232 struct dt_info *dti,
1233 struct node *node,
1234 bool disable_check)
1217{ 1235{
1218 struct node *childa; 1236 struct node *childa;
1219 1237
@@ -1230,18 +1248,38 @@ static void check_unique_unit_address(struct check *c, struct dt_info *dti,
1230 if (!strlen(addr_a)) 1248 if (!strlen(addr_a))
1231 continue; 1249 continue;
1232 1250
1251 if (disable_check && node_is_disabled(childa))
1252 continue;
1253
1233 for_each_child(node, childb) { 1254 for_each_child(node, childb) {
1234 const char *addr_b = get_unitname(childb); 1255 const char *addr_b = get_unitname(childb);
1235 if (childa == childb) 1256 if (childa == childb)
1236 break; 1257 break;
1237 1258
1259 if (disable_check && node_is_disabled(childb))
1260 continue;
1261
1238 if (streq(addr_a, addr_b)) 1262 if (streq(addr_a, addr_b))
1239 FAIL(c, dti, childb, "duplicate unit-address (also used in node %s)", childa->fullpath); 1263 FAIL(c, dti, childb, "duplicate unit-address (also used in node %s)", childa->fullpath);
1240 } 1264 }
1241 } 1265 }
1242} 1266}
1267
1268static void check_unique_unit_address(struct check *c, struct dt_info *dti,
1269 struct node *node)
1270{
1271 check_unique_unit_address_common(c, dti, node, false);
1272}
1243WARNING(unique_unit_address, check_unique_unit_address, NULL, &avoid_default_addr_size); 1273WARNING(unique_unit_address, check_unique_unit_address, NULL, &avoid_default_addr_size);
1244 1274
1275static void check_unique_unit_address_if_enabled(struct check *c, struct dt_info *dti,
1276 struct node *node)
1277{
1278 check_unique_unit_address_common(c, dti, node, true);
1279}
1280CHECK_ENTRY(unique_unit_address_if_enabled, check_unique_unit_address_if_enabled,
1281 NULL, false, false, &avoid_default_addr_size);
1282
1245static void check_obsolete_chosen_interrupt_controller(struct check *c, 1283static void check_obsolete_chosen_interrupt_controller(struct check *c,
1246 struct dt_info *dti, 1284 struct dt_info *dti,
1247 struct node *node) 1285 struct node *node)
@@ -1542,10 +1580,14 @@ static void check_interrupts_property(struct check *c,
1542 prop = get_property(parent, "interrupt-parent"); 1580 prop = get_property(parent, "interrupt-parent");
1543 if (prop) { 1581 if (prop) {
1544 phandle = propval_cell(prop); 1582 phandle = propval_cell(prop);
1545 /* Give up if this is an overlay with external references */ 1583 if ((phandle == 0) || (phandle == -1)) {
1546 if ((phandle == 0 || phandle == -1) && 1584 /* Give up if this is an overlay with
1547 (dti->dtsflags & DTSF_PLUGIN)) 1585 * external references */
1586 if (dti->dtsflags & DTSF_PLUGIN)
1548 return; 1587 return;
1588 FAIL_PROP(c, dti, parent, prop, "Invalid phandle");
1589 continue;
1590 }
1549 1591
1550 irq_node = get_node_by_phandle(root, phandle); 1592 irq_node = get_node_by_phandle(root, phandle);
1551 if (!irq_node) { 1593 if (!irq_node) {
@@ -1714,7 +1756,7 @@ static void check_graph_endpoint(struct check *c, struct dt_info *dti,
1714 return; 1756 return;
1715 1757
1716 if (!strprefixeq(node->name, node->basenamelen, "endpoint")) 1758 if (!strprefixeq(node->name, node->basenamelen, "endpoint"))
1717 FAIL(c, dti, node, "graph endpont node name should be 'endpoint'"); 1759 FAIL(c, dti, node, "graph endpoint node name should be 'endpoint'");
1718 1760
1719 check_graph_reg(c, dti, node); 1761 check_graph_reg(c, dti, node);
1720 1762
@@ -1769,6 +1811,7 @@ static struct check *check_table[] = {
1769 &avoid_default_addr_size, 1811 &avoid_default_addr_size,
1770 &avoid_unnecessary_addr_size, 1812 &avoid_unnecessary_addr_size,
1771 &unique_unit_address, 1813 &unique_unit_address,
1814 &unique_unit_address_if_enabled,
1772 &obsolete_chosen_interrupt_controller, 1815 &obsolete_chosen_interrupt_controller,
1773 &chosen_node_is_root, &chosen_node_bootargs, &chosen_node_stdout_path, 1816 &chosen_node_is_root, &chosen_node_bootargs, &chosen_node_stdout_path,
1774 1817
diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h
index 789e0b1bc057..0d5fa215ac87 100644
--- a/scripts/dtc/dtc.h
+++ b/scripts/dtc/dtc.h
@@ -231,7 +231,8 @@ void add_child(struct node *parent, struct node *child);
231void delete_node_by_name(struct node *parent, char *name); 231void delete_node_by_name(struct node *parent, char *name);
232void delete_node(struct node *node); 232void delete_node(struct node *node);
233void append_to_property(struct node *node, 233void append_to_property(struct node *node,
234 char *name, const void *data, int len); 234 char *name, const void *data, int len,
235 enum markertype type);
235 236
236const char *get_unitname(struct node *node); 237const char *get_unitname(struct node *node);
237struct property *get_property(struct node *node, const char *propname); 238struct property *get_property(struct node *node, const char *propname);
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c
index acf04c30669f..f7f70769d73f 100644
--- a/scripts/dtc/flattree.c
+++ b/scripts/dtc/flattree.c
@@ -525,7 +525,7 @@ void dt_to_asm(FILE *f, struct dt_info *dti, int version)
525 fprintf(f, "/* Memory reserve map from source file */\n"); 525 fprintf(f, "/* Memory reserve map from source file */\n");
526 526
527 /* 527 /*
528 * Use .long on high and low halfs of u64s to avoid .quad 528 * Use .long on high and low halves of u64s to avoid .quad
529 * as it appears .quad isn't available in some assemblers. 529 * as it appears .quad isn't available in some assemblers.
530 */ 530 */
531 for (re = dti->reservelist; re; re = re->next) { 531 for (re = dti->reservelist; re; re = re->next) {
diff --git a/scripts/dtc/libfdt/Makefile.libfdt b/scripts/dtc/libfdt/Makefile.libfdt
index 3af3656df801..193da8c99d83 100644
--- a/scripts/dtc/libfdt/Makefile.libfdt
+++ b/scripts/dtc/libfdt/Makefile.libfdt
@@ -9,7 +9,9 @@ LIBFDT_VERSION = version.lds
9LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \ 9LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \
10 fdt_addresses.c fdt_overlay.c 10 fdt_addresses.c fdt_overlay.c
11LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o) 11LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
12LIBFDT_LIB = libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT)
12 13
13libfdt_clean: 14libfdt_clean:
14 @$(VECHO) CLEAN "(libfdt)" 15 @$(VECHO) CLEAN "(libfdt)"
15 rm -f $(STD_CLEANFILES:%=$(LIBFDT_dir)/%) 16 rm -f $(STD_CLEANFILES:%=$(LIBFDT_dir)/%)
17 rm -f $(LIBFDT_dir)/$(LIBFDT_soname)
diff --git a/scripts/dtc/libfdt/fdt_addresses.c b/scripts/dtc/libfdt/fdt_addresses.c
index f13a87dfa068..2cc997ea5012 100644
--- a/scripts/dtc/libfdt/fdt_addresses.c
+++ b/scripts/dtc/libfdt/fdt_addresses.c
@@ -95,3 +95,50 @@ int fdt_size_cells(const void *fdt, int nodeoffset)
95 return 1; 95 return 1;
96 return val; 96 return val;
97} 97}
98
99/* This function assumes that [address|size]_cells is 1 or 2 */
100int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
101 const char *name, uint64_t addr, uint64_t size)
102{
103 int addr_cells, size_cells, ret;
104 uint8_t data[sizeof(fdt64_t) * 2], *prop;
105
106 ret = fdt_address_cells(fdt, parent);
107 if (ret < 0)
108 return ret;
109 addr_cells = ret;
110
111 ret = fdt_size_cells(fdt, parent);
112 if (ret < 0)
113 return ret;
114 size_cells = ret;
115
116 /* check validity of address */
117 prop = data;
118 if (addr_cells == 1) {
119 if ((addr > UINT32_MAX) || ((UINT32_MAX + 1 - addr) < size))
120 return -FDT_ERR_BADVALUE;
121
122 fdt32_st(prop, (uint32_t)addr);
123 } else if (addr_cells == 2) {
124 fdt64_st(prop, addr);
125 } else {
126 return -FDT_ERR_BADNCELLS;
127 }
128
129 /* check validity of size */
130 prop += addr_cells * sizeof(fdt32_t);
131 if (size_cells == 1) {
132 if (size > UINT32_MAX)
133 return -FDT_ERR_BADVALUE;
134
135 fdt32_st(prop, (uint32_t)size);
136 } else if (size_cells == 2) {
137 fdt64_st(prop, size);
138 } else {
139 return -FDT_ERR_BADNCELLS;
140 }
141
142 return fdt_appendprop(fdt, nodeoffset, name, data,
143 (addr_cells + size_cells) * sizeof(fdt32_t));
144}
diff --git a/scripts/dtc/libfdt/fdt_overlay.c b/scripts/dtc/libfdt/fdt_overlay.c
index 5fdab6c6371d..d3e9ab2dbb7b 100644
--- a/scripts/dtc/libfdt/fdt_overlay.c
+++ b/scripts/dtc/libfdt/fdt_overlay.c
@@ -93,11 +93,11 @@ static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
93 * @pathp: pointer which receives the path of the target (or NULL) 93 * @pathp: pointer which receives the path of the target (or NULL)
94 * 94 *
95 * overlay_get_target() retrieves the target offset in the base 95 * overlay_get_target() retrieves the target offset in the base
96 * device tree of a fragment, no matter how the actual targetting is 96 * device tree of a fragment, no matter how the actual targeting is
97 * done (through a phandle or a path) 97 * done (through a phandle or a path)
98 * 98 *
99 * returns: 99 * returns:
100 * the targetted node offset in the base device tree 100 * the targeted node offset in the base device tree
101 * Negative error code on error 101 * Negative error code on error
102 */ 102 */
103static int overlay_get_target(const void *fdt, const void *fdto, 103static int overlay_get_target(const void *fdt, const void *fdto,
@@ -863,12 +863,16 @@ static int overlay_symbol_update(void *fdt, void *fdto)
863 863
864int fdt_overlay_apply(void *fdt, void *fdto) 864int fdt_overlay_apply(void *fdt, void *fdto)
865{ 865{
866 uint32_t delta = fdt_get_max_phandle(fdt); 866 uint32_t delta;
867 int ret; 867 int ret;
868 868
869 FDT_RO_PROBE(fdt); 869 FDT_RO_PROBE(fdt);
870 FDT_RO_PROBE(fdto); 870 FDT_RO_PROBE(fdto);
871 871
872 ret = fdt_find_max_phandle(fdt, &delta);
873 if (ret)
874 goto err;
875
872 ret = overlay_adjust_local_phandles(fdto, delta); 876 ret = overlay_adjust_local_phandles(fdto, delta);
873 if (ret) 877 if (ret)
874 goto err; 878 goto err;
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index eafc14282892..2c393a100bfc 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -144,29 +144,49 @@ static int fdt_string_eq_(const void *fdt, int stroffset,
144 return p && (slen == len) && (memcmp(p, s, len) == 0); 144 return p && (slen == len) && (memcmp(p, s, len) == 0);
145} 145}
146 146
147uint32_t fdt_get_max_phandle(const void *fdt) 147int fdt_find_max_phandle(const void *fdt, uint32_t *phandle)
148{ 148{
149 uint32_t max_phandle = 0; 149 uint32_t max = 0;
150 int offset; 150 int offset = -1;
151 151
152 for (offset = fdt_next_node(fdt, -1, NULL);; 152 while (true) {
153 offset = fdt_next_node(fdt, offset, NULL)) { 153 uint32_t value;
154 uint32_t phandle;
155 154
156 if (offset == -FDT_ERR_NOTFOUND) 155 offset = fdt_next_node(fdt, offset, NULL);
157 return max_phandle; 156 if (offset < 0) {
157 if (offset == -FDT_ERR_NOTFOUND)
158 break;
158 159
159 if (offset < 0) 160 return offset;
160 return (uint32_t)-1; 161 }
161 162
162 phandle = fdt_get_phandle(fdt, offset); 163 value = fdt_get_phandle(fdt, offset);
163 if (phandle == (uint32_t)-1)
164 continue;
165 164
166 if (phandle > max_phandle) 165 if (value > max)
167 max_phandle = phandle; 166 max = value;
168 } 167 }
169 168
169 if (phandle)
170 *phandle = max;
171
172 return 0;
173}
174
175int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
176{
177 uint32_t max;
178 int err;
179
180 err = fdt_find_max_phandle(fdt, &max);
181 if (err < 0)
182 return err;
183
184 if (max == FDT_MAX_PHANDLE)
185 return -FDT_ERR_NOPHANDLES;
186
187 if (phandle)
188 *phandle = max + 1;
189
170 return 0; 190 return 0;
171} 191}
172 192
diff --git a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c
index 2e49855d7cf8..9e7661509e9f 100644
--- a/scripts/dtc/libfdt/fdt_rw.c
+++ b/scripts/dtc/libfdt/fdt_rw.c
@@ -136,6 +136,14 @@ static int fdt_splice_struct_(void *fdt, void *p,
136 return 0; 136 return 0;
137} 137}
138 138
139/* Must only be used to roll back in case of error */
140static void fdt_del_last_string_(void *fdt, const char *s)
141{
142 int newlen = strlen(s) + 1;
143
144 fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) - newlen);
145}
146
139static int fdt_splice_string_(void *fdt, int newlen) 147static int fdt_splice_string_(void *fdt, int newlen)
140{ 148{
141 void *p = (char *)fdt 149 void *p = (char *)fdt
@@ -149,7 +157,7 @@ static int fdt_splice_string_(void *fdt, int newlen)
149 return 0; 157 return 0;
150} 158}
151 159
152static int fdt_find_add_string_(void *fdt, const char *s) 160static int fdt_find_add_string_(void *fdt, const char *s, int *allocated)
153{ 161{
154 char *strtab = (char *)fdt + fdt_off_dt_strings(fdt); 162 char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
155 const char *p; 163 const char *p;
@@ -157,6 +165,8 @@ static int fdt_find_add_string_(void *fdt, const char *s)
157 int len = strlen(s) + 1; 165 int len = strlen(s) + 1;
158 int err; 166 int err;
159 167
168 *allocated = 0;
169
160 p = fdt_find_string_(strtab, fdt_size_dt_strings(fdt), s); 170 p = fdt_find_string_(strtab, fdt_size_dt_strings(fdt), s);
161 if (p) 171 if (p)
162 /* found it */ 172 /* found it */
@@ -167,6 +177,8 @@ static int fdt_find_add_string_(void *fdt, const char *s)
167 if (err) 177 if (err)
168 return err; 178 return err;
169 179
180 *allocated = 1;
181
170 memcpy(new, s, len); 182 memcpy(new, s, len);
171 return (new - strtab); 183 return (new - strtab);
172} 184}
@@ -225,11 +237,12 @@ static int fdt_add_property_(void *fdt, int nodeoffset, const char *name,
225 int nextoffset; 237 int nextoffset;
226 int namestroff; 238 int namestroff;
227 int err; 239 int err;
240 int allocated;
228 241
229 if ((nextoffset = fdt_check_node_offset_(fdt, nodeoffset)) < 0) 242 if ((nextoffset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
230 return nextoffset; 243 return nextoffset;
231 244
232 namestroff = fdt_find_add_string_(fdt, name); 245 namestroff = fdt_find_add_string_(fdt, name, &allocated);
233 if (namestroff < 0) 246 if (namestroff < 0)
234 return namestroff; 247 return namestroff;
235 248
@@ -237,8 +250,11 @@ static int fdt_add_property_(void *fdt, int nodeoffset, const char *name,
237 proplen = sizeof(**prop) + FDT_TAGALIGN(len); 250 proplen = sizeof(**prop) + FDT_TAGALIGN(len);
238 251
239 err = fdt_splice_struct_(fdt, *prop, 0, proplen); 252 err = fdt_splice_struct_(fdt, *prop, 0, proplen);
240 if (err) 253 if (err) {
254 if (allocated)
255 fdt_del_last_string_(fdt, name);
241 return err; 256 return err;
257 }
242 258
243 (*prop)->tag = cpu_to_fdt32(FDT_PROP); 259 (*prop)->tag = cpu_to_fdt32(FDT_PROP);
244 (*prop)->nameoff = cpu_to_fdt32(namestroff); 260 (*prop)->nameoff = cpu_to_fdt32(namestroff);
diff --git a/scripts/dtc/libfdt/fdt_strerror.c b/scripts/dtc/libfdt/fdt_strerror.c
index 9677a1887e57..0e6b4fd5e7ce 100644
--- a/scripts/dtc/libfdt/fdt_strerror.c
+++ b/scripts/dtc/libfdt/fdt_strerror.c
@@ -82,6 +82,7 @@ static struct fdt_errtabent fdt_errtable[] = {
82 FDT_ERRTABENT(FDT_ERR_BADVALUE), 82 FDT_ERRTABENT(FDT_ERR_BADVALUE),
83 FDT_ERRTABENT(FDT_ERR_BADOVERLAY), 83 FDT_ERRTABENT(FDT_ERR_BADOVERLAY),
84 FDT_ERRTABENT(FDT_ERR_NOPHANDLES), 84 FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
85 FDT_ERRTABENT(FDT_ERR_BADFLAGS),
85}; 86};
86#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0])) 87#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
87 88
diff --git a/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c
index 9fa4a94d83c3..e773157d0fc4 100644
--- a/scripts/dtc/libfdt/fdt_sw.c
+++ b/scripts/dtc/libfdt/fdt_sw.c
@@ -121,6 +121,12 @@ static int fdt_sw_probe_struct_(void *fdt)
121 return err; \ 121 return err; \
122 } 122 }
123 123
124static inline uint32_t sw_flags(void *fdt)
125{
126 /* assert: (fdt_magic(fdt) == FDT_SW_MAGIC) */
127 return fdt_last_comp_version(fdt);
128}
129
124/* 'complete' state: Enter this state after fdt_finish() 130/* 'complete' state: Enter this state after fdt_finish()
125 * 131 *
126 * Allowed functions: none 132 * Allowed functions: none
@@ -141,7 +147,7 @@ static void *fdt_grab_space_(void *fdt, size_t len)
141 return fdt_offset_ptr_w_(fdt, offset); 147 return fdt_offset_ptr_w_(fdt, offset);
142} 148}
143 149
144int fdt_create(void *buf, int bufsize) 150int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags)
145{ 151{
146 const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header), 152 const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
147 sizeof(struct fdt_reserve_entry)); 153 sizeof(struct fdt_reserve_entry));
@@ -150,11 +156,22 @@ int fdt_create(void *buf, int bufsize)
150 if (bufsize < hdrsize) 156 if (bufsize < hdrsize)
151 return -FDT_ERR_NOSPACE; 157 return -FDT_ERR_NOSPACE;
152 158
159 if (flags & ~FDT_CREATE_FLAGS_ALL)
160 return -FDT_ERR_BADFLAGS;
161
153 memset(buf, 0, bufsize); 162 memset(buf, 0, bufsize);
154 163
164 /*
165 * magic and last_comp_version keep intermediate state during the fdt
166 * creation process, which is replaced with the proper FDT format by
167 * fdt_finish().
168 *
169 * flags should be accessed with sw_flags().
170 */
155 fdt_set_magic(fdt, FDT_SW_MAGIC); 171 fdt_set_magic(fdt, FDT_SW_MAGIC);
156 fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION); 172 fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
157 fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION); 173 fdt_set_last_comp_version(fdt, flags);
174
158 fdt_set_totalsize(fdt, bufsize); 175 fdt_set_totalsize(fdt, bufsize);
159 176
160 fdt_set_off_mem_rsvmap(fdt, hdrsize); 177 fdt_set_off_mem_rsvmap(fdt, hdrsize);
@@ -164,6 +181,11 @@ int fdt_create(void *buf, int bufsize)
164 return 0; 181 return 0;
165} 182}
166 183
184int fdt_create(void *buf, int bufsize)
185{
186 return fdt_create_with_flags(buf, bufsize, 0);
187}
188
167int fdt_resize(void *fdt, void *buf, int bufsize) 189int fdt_resize(void *fdt, void *buf, int bufsize)
168{ 190{
169 size_t headsize, tailsize; 191 size_t headsize, tailsize;
@@ -262,19 +284,13 @@ int fdt_end_node(void *fdt)
262 return 0; 284 return 0;
263} 285}
264 286
265static int fdt_find_add_string_(void *fdt, const char *s) 287static int fdt_add_string_(void *fdt, const char *s)
266{ 288{
267 char *strtab = (char *)fdt + fdt_totalsize(fdt); 289 char *strtab = (char *)fdt + fdt_totalsize(fdt);
268 const char *p;
269 int strtabsize = fdt_size_dt_strings(fdt); 290 int strtabsize = fdt_size_dt_strings(fdt);
270 int len = strlen(s) + 1; 291 int len = strlen(s) + 1;
271 int struct_top, offset; 292 int struct_top, offset;
272 293
273 p = fdt_find_string_(strtab - strtabsize, strtabsize, s);
274 if (p)
275 return p - strtab;
276
277 /* Add it */
278 offset = -strtabsize - len; 294 offset = -strtabsize - len;
279 struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt); 295 struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
280 if (fdt_totalsize(fdt) + offset < struct_top) 296 if (fdt_totalsize(fdt) + offset < struct_top)
@@ -285,20 +301,56 @@ static int fdt_find_add_string_(void *fdt, const char *s)
285 return offset; 301 return offset;
286} 302}
287 303
304/* Must only be used to roll back in case of error */
305static void fdt_del_last_string_(void *fdt, const char *s)
306{
307 int strtabsize = fdt_size_dt_strings(fdt);
308 int len = strlen(s) + 1;
309
310 fdt_set_size_dt_strings(fdt, strtabsize - len);
311}
312
313static int fdt_find_add_string_(void *fdt, const char *s, int *allocated)
314{
315 char *strtab = (char *)fdt + fdt_totalsize(fdt);
316 int strtabsize = fdt_size_dt_strings(fdt);
317 const char *p;
318
319 *allocated = 0;
320
321 p = fdt_find_string_(strtab - strtabsize, strtabsize, s);
322 if (p)
323 return p - strtab;
324
325 *allocated = 1;
326
327 return fdt_add_string_(fdt, s);
328}
329
288int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp) 330int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp)
289{ 331{
290 struct fdt_property *prop; 332 struct fdt_property *prop;
291 int nameoff; 333 int nameoff;
334 int allocated;
292 335
293 FDT_SW_PROBE_STRUCT(fdt); 336 FDT_SW_PROBE_STRUCT(fdt);
294 337
295 nameoff = fdt_find_add_string_(fdt, name); 338 /* String de-duplication can be slow, _NO_NAME_DEDUP skips it */
339 if (sw_flags(fdt) & FDT_CREATE_FLAG_NO_NAME_DEDUP) {
340 allocated = 1;
341 nameoff = fdt_add_string_(fdt, name);
342 } else {
343 nameoff = fdt_find_add_string_(fdt, name, &allocated);
344 }
296 if (nameoff == 0) 345 if (nameoff == 0)
297 return -FDT_ERR_NOSPACE; 346 return -FDT_ERR_NOSPACE;
298 347
299 prop = fdt_grab_space_(fdt, sizeof(*prop) + FDT_TAGALIGN(len)); 348 prop = fdt_grab_space_(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
300 if (! prop) 349 if (! prop) {
350 if (allocated)
351 fdt_del_last_string_(fdt, name);
301 return -FDT_ERR_NOSPACE; 352 return -FDT_ERR_NOSPACE;
353 }
302 354
303 prop->tag = cpu_to_fdt32(FDT_PROP); 355 prop->tag = cpu_to_fdt32(FDT_PROP);
304 prop->nameoff = cpu_to_fdt32(nameoff); 356 prop->nameoff = cpu_to_fdt32(nameoff);
@@ -360,6 +412,10 @@ int fdt_finish(void *fdt)
360 412
361 /* Finally, adjust the header */ 413 /* Finally, adjust the header */
362 fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt)); 414 fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
415
416 /* And fix up fields that were keeping intermediate state. */
417 fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
363 fdt_set_magic(fdt, FDT_MAGIC); 418 fdt_set_magic(fdt, FDT_MAGIC);
419
364 return 0; 420 return 0;
365} 421}
diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h
index 627da2e079c9..be14bf63e577 100644
--- a/scripts/dtc/libfdt/libfdt.h
+++ b/scripts/dtc/libfdt/libfdt.h
@@ -138,7 +138,15 @@
138 /* FDT_ERR_NOPHANDLES: The device tree doesn't have any 138 /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
139 * phandle available anymore without causing an overflow */ 139 * phandle available anymore without causing an overflow */
140 140
141#define FDT_ERR_MAX 17 141#define FDT_ERR_BADFLAGS 18
142 /* FDT_ERR_BADFLAGS: The function was passed a flags field that
143 * contains invalid flags or an invalid combination of flags. */
144
145#define FDT_ERR_MAX 18
146
147/* constants */
148#define FDT_MAX_PHANDLE 0xfffffffe
149 /* Valid values for phandles range from 1 to 2^32-2. */
142 150
143/**********************************************************************/ 151/**********************************************************************/
144/* Low-level functions (you probably don't need these) */ 152/* Low-level functions (you probably don't need these) */
@@ -171,6 +179,16 @@ static inline uint32_t fdt32_ld(const fdt32_t *p)
171 | bp[3]; 179 | bp[3];
172} 180}
173 181
182static inline void fdt32_st(void *property, uint32_t value)
183{
184 uint8_t *bp = property;
185
186 bp[0] = value >> 24;
187 bp[1] = (value >> 16) & 0xff;
188 bp[2] = (value >> 8) & 0xff;
189 bp[3] = value & 0xff;
190}
191
174static inline uint64_t fdt64_ld(const fdt64_t *p) 192static inline uint64_t fdt64_ld(const fdt64_t *p)
175{ 193{
176 const uint8_t *bp = (const uint8_t *)p; 194 const uint8_t *bp = (const uint8_t *)p;
@@ -185,6 +203,20 @@ static inline uint64_t fdt64_ld(const fdt64_t *p)
185 | bp[7]; 203 | bp[7];
186} 204}
187 205
206static inline void fdt64_st(void *property, uint64_t value)
207{
208 uint8_t *bp = property;
209
210 bp[0] = value >> 56;
211 bp[1] = (value >> 48) & 0xff;
212 bp[2] = (value >> 40) & 0xff;
213 bp[3] = (value >> 32) & 0xff;
214 bp[4] = (value >> 24) & 0xff;
215 bp[5] = (value >> 16) & 0xff;
216 bp[6] = (value >> 8) & 0xff;
217 bp[7] = value & 0xff;
218}
219
188/**********************************************************************/ 220/**********************************************************************/
189/* Traversal functions */ 221/* Traversal functions */
190/**********************************************************************/ 222/**********************************************************************/
@@ -227,7 +259,7 @@ int fdt_next_subnode(const void *fdt, int offset);
227 * ... 259 * ...
228 * } 260 * }
229 * 261 *
230 * if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) { 262 * if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
231 * Error handling 263 * Error handling
232 * } 264 * }
233 * 265 *
@@ -362,6 +394,20 @@ const char *fdt_get_string(const void *fdt, int stroffset, int *lenp);
362const char *fdt_string(const void *fdt, int stroffset); 394const char *fdt_string(const void *fdt, int stroffset);
363 395
364/** 396/**
397 * fdt_find_max_phandle - find and return the highest phandle in a tree
398 * @fdt: pointer to the device tree blob
399 * @phandle: return location for the highest phandle value found in the tree
400 *
401 * fdt_find_max_phandle() finds the highest phandle value in the given device
402 * tree. The value returned in @phandle is only valid if the function returns
403 * success.
404 *
405 * returns:
406 * 0 on success or a negative error code on failure
407 */
408int fdt_find_max_phandle(const void *fdt, uint32_t *phandle);
409
410/**
365 * fdt_get_max_phandle - retrieves the highest phandle in a tree 411 * fdt_get_max_phandle - retrieves the highest phandle in a tree
366 * @fdt: pointer to the device tree blob 412 * @fdt: pointer to the device tree blob
367 * 413 *
@@ -369,12 +415,39 @@ const char *fdt_string(const void *fdt, int stroffset);
369 * device tree. This will ignore badly formatted phandles, or phandles 415 * device tree. This will ignore badly formatted phandles, or phandles
370 * with a value of 0 or -1. 416 * with a value of 0 or -1.
371 * 417 *
418 * This function is deprecated in favour of fdt_find_max_phandle().
419 *
372 * returns: 420 * returns:
373 * the highest phandle on success 421 * the highest phandle on success
374 * 0, if no phandle was found in the device tree 422 * 0, if no phandle was found in the device tree
375 * -1, if an error occurred 423 * -1, if an error occurred
376 */ 424 */
377uint32_t fdt_get_max_phandle(const void *fdt); 425static inline uint32_t fdt_get_max_phandle(const void *fdt)
426{
427 uint32_t phandle;
428 int err;
429
430 err = fdt_find_max_phandle(fdt, &phandle);
431 if (err < 0)
432 return (uint32_t)-1;
433
434 return phandle;
435}
436
437/**
438 * fdt_generate_phandle - return a new, unused phandle for a device tree blob
439 * @fdt: pointer to the device tree blob
440 * @phandle: return location for the new phandle
441 *
442 * Walks the device tree blob and looks for the highest phandle value. On
443 * success, the new, unused phandle value (one higher than the previously
444 * highest phandle value in the device tree blob) will be returned in the
445 * @phandle parameter.
446 *
447 * Returns:
448 * 0 on success or a negative error-code on failure
449 */
450int fdt_generate_phandle(const void *fdt, uint32_t *phandle);
378 451
379/** 452/**
380 * fdt_num_mem_rsv - retrieve the number of memory reserve map entries 453 * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
@@ -566,7 +639,7 @@ int fdt_next_property_offset(const void *fdt, int offset);
566 * ... 639 * ...
567 * } 640 * }
568 * 641 *
569 * if ((property < 0) && (property != -FDT_ERR_NOT_FOUND)) { 642 * if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) {
570 * Error handling 643 * Error handling
571 * } 644 * }
572 * 645 *
@@ -669,7 +742,7 @@ static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
669/** 742/**
670 * fdt_getprop_by_offset - retrieve the value of a property at a given offset 743 * fdt_getprop_by_offset - retrieve the value of a property at a given offset
671 * @fdt: pointer to the device tree blob 744 * @fdt: pointer to the device tree blob
672 * @ffset: offset of the property to read 745 * @offset: offset of the property to read
673 * @namep: pointer to a string variable (will be overwritten) or NULL 746 * @namep: pointer to a string variable (will be overwritten) or NULL
674 * @lenp: pointer to an integer variable (will be overwritten) or NULL 747 * @lenp: pointer to an integer variable (will be overwritten) or NULL
675 * 748 *
@@ -1360,7 +1433,45 @@ int fdt_nop_node(void *fdt, int nodeoffset);
1360/* Sequential write functions */ 1433/* Sequential write functions */
1361/**********************************************************************/ 1434/**********************************************************************/
1362 1435
1436/* fdt_create_with_flags flags */
1437#define FDT_CREATE_FLAG_NO_NAME_DEDUP 0x1
1438 /* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property
1439 * names in the fdt. This can result in faster creation times, but
1440 * a larger fdt. */
1441
1442#define FDT_CREATE_FLAGS_ALL (FDT_CREATE_FLAG_NO_NAME_DEDUP)
1443
1444/**
1445 * fdt_create_with_flags - begin creation of a new fdt
1446 * @fdt: pointer to memory allocated where fdt will be created
1447 * @bufsize: size of the memory space at fdt
1448 * @flags: a valid combination of FDT_CREATE_FLAG_ flags, or 0.
1449 *
1450 * fdt_create_with_flags() begins the process of creating a new fdt with
1451 * the sequential write interface.
1452 *
1453 * fdt creation process must end with fdt_finished() to produce a valid fdt.
1454 *
1455 * returns:
1456 * 0, on success
1457 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1458 * -FDT_ERR_BADFLAGS, flags is not valid
1459 */
1460int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags);
1461
1462/**
1463 * fdt_create - begin creation of a new fdt
1464 * @fdt: pointer to memory allocated where fdt will be created
1465 * @bufsize: size of the memory space at fdt
1466 *
1467 * fdt_create() is equivalent to fdt_create_with_flags() with flags=0.
1468 *
1469 * returns:
1470 * 0, on success
1471 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1472 */
1363int fdt_create(void *buf, int bufsize); 1473int fdt_create(void *buf, int bufsize);
1474
1364int fdt_resize(void *fdt, void *buf, int bufsize); 1475int fdt_resize(void *fdt, void *buf, int bufsize);
1365int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size); 1476int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
1366int fdt_finish_reservemap(void *fdt); 1477int fdt_finish_reservemap(void *fdt);
@@ -1832,6 +1943,43 @@ static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
1832 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1) 1943 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1833 1944
1834/** 1945/**
1946 * fdt_appendprop_addrrange - append a address range property
1947 * @fdt: pointer to the device tree blob
1948 * @parent: offset of the parent node
1949 * @nodeoffset: offset of the node to add a property at
1950 * @name: name of property
1951 * @addr: start address of a given range
1952 * @size: size of a given range
1953 *
1954 * fdt_appendprop_addrrange() appends an address range value (start
1955 * address and size) to the value of the named property in the given
1956 * node, or creates a new property with that value if it does not
1957 * already exist.
1958 * If "name" is not specified, a default "reg" is used.
1959 * Cell sizes are determined by parent's #address-cells and #size-cells.
1960 *
1961 * This function may insert data into the blob, and will therefore
1962 * change the offsets of some existing nodes.
1963 *
1964 * returns:
1965 * 0, on success
1966 * -FDT_ERR_BADLAYOUT,
1967 * -FDT_ERR_BADMAGIC,
1968 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1969 * #address-cells property
1970 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1971 * -FDT_ERR_BADSTATE,
1972 * -FDT_ERR_BADSTRUCTURE,
1973 * -FDT_ERR_BADVERSION,
1974 * -FDT_ERR_BADVALUE, addr or size doesn't fit to respective cells size
1975 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1976 * contain a new property
1977 * -FDT_ERR_TRUNCATED, standard meanings
1978 */
1979int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
1980 const char *name, uint64_t addr, uint64_t size);
1981
1982/**
1835 * fdt_delprop - delete a property 1983 * fdt_delprop - delete a property
1836 * @fdt: pointer to the device tree blob 1984 * @fdt: pointer to the device tree blob
1837 * @nodeoffset: offset of the node whose property to nop 1985 * @nodeoffset: offset of the node whose property to nop
diff --git a/scripts/dtc/libfdt/libfdt_env.h b/scripts/dtc/libfdt/libfdt_env.h
index eb2053845c9c..4d1cdfa58547 100644
--- a/scripts/dtc/libfdt/libfdt_env.h
+++ b/scripts/dtc/libfdt/libfdt_env.h
@@ -52,6 +52,7 @@
52 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 52 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53 */ 53 */
54 54
55#include <stdbool.h>
55#include <stddef.h> 56#include <stddef.h>
56#include <stdint.h> 57#include <stdint.h>
57#include <stdlib.h> 58#include <stdlib.h>
diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c
index 7a2e6446a17b..21c274125c2c 100644
--- a/scripts/dtc/livetree.c
+++ b/scripts/dtc/livetree.c
@@ -249,6 +249,7 @@ struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref)
249 char *name; 249 char *name;
250 250
251 if (ref[0] == '/') { 251 if (ref[0] == '/') {
252 d = data_add_marker(d, TYPE_STRING, ref);
252 d = data_append_data(d, ref, strlen(ref) + 1); 253 d = data_append_data(d, ref, strlen(ref) + 1);
253 254
254 p = build_property("target-path", d, NULL); 255 p = build_property("target-path", d, NULL);
@@ -350,17 +351,20 @@ void delete_node(struct node *node)
350} 351}
351 352
352void append_to_property(struct node *node, 353void append_to_property(struct node *node,
353 char *name, const void *data, int len) 354 char *name, const void *data, int len,
355 enum markertype type)
354{ 356{
355 struct data d; 357 struct data d;
356 struct property *p; 358 struct property *p;
357 359
358 p = get_property(node, name); 360 p = get_property(node, name);
359 if (p) { 361 if (p) {
360 d = data_append_data(p->val, data, len); 362 d = data_add_marker(p->val, type, name);
363 d = data_append_data(d, data, len);
361 p->val = d; 364 p->val = d;
362 } else { 365 } else {
363 d = data_append_data(empty_data, data, len); 366 d = data_add_marker(empty_data, type, name);
367 d = data_append_data(d, data, len);
364 p = build_property(name, d, NULL); 368 p = build_property(name, d, NULL);
365 add_property(node, p); 369 add_property(node, p);
366 } 370 }
@@ -858,8 +862,8 @@ static void generate_label_tree_internal(struct dt_info *dti,
858 862
859 /* insert it */ 863 /* insert it */
860 p = build_property(l->label, 864 p = build_property(l->label,
861 data_copy_mem(node->fullpath, 865 data_copy_escape_string(node->fullpath,
862 strlen(node->fullpath) + 1), 866 strlen(node->fullpath)),
863 NULL); 867 NULL);
864 add_property(an, p); 868 add_property(an, p);
865 } 869 }
@@ -910,7 +914,7 @@ static void add_fixup_entry(struct dt_info *dti, struct node *fn,
910 914
911 xasprintf(&entry, "%s:%s:%u", 915 xasprintf(&entry, "%s:%s:%u",
912 node->fullpath, prop->name, m->offset); 916 node->fullpath, prop->name, m->offset);
913 append_to_property(fn, m->ref, entry, strlen(entry) + 1); 917 append_to_property(fn, m->ref, entry, strlen(entry) + 1, TYPE_STRING);
914 918
915 free(entry); 919 free(entry);
916} 920}
@@ -970,7 +974,7 @@ static void add_local_fixup_entry(struct dt_info *dti,
970 char **compp; 974 char **compp;
971 int i, depth; 975 int i, depth;
972 976
973 /* walk back retreiving depth */ 977 /* walk back retrieving depth */
974 depth = 0; 978 depth = 0;
975 for (wn = node; wn; wn = wn->parent) 979 for (wn = node; wn; wn = wn->parent)
976 depth++; 980 depth++;
@@ -993,7 +997,7 @@ static void add_local_fixup_entry(struct dt_info *dti,
993 free(compp); 997 free(compp);
994 998
995 value_32 = cpu_to_fdt32(m->offset); 999 value_32 = cpu_to_fdt32(m->offset);
996 append_to_property(wn, prop->name, &value_32, sizeof(value_32)); 1000 append_to_property(wn, prop->name, &value_32, sizeof(value_32), TYPE_UINT32);
997} 1001}
998 1002
999static void generate_local_fixups_tree_internal(struct dt_info *dti, 1003static void generate_local_fixups_tree_internal(struct dt_info *dti,
diff --git a/scripts/dtc/util.h b/scripts/dtc/util.h
index 7658781a6200..fc3c0d05ada3 100644
--- a/scripts/dtc/util.h
+++ b/scripts/dtc/util.h
@@ -122,7 +122,7 @@ int utilfdt_read_err(const char *filename, char **buffp, size_t *len);
122 * stderr. 122 * stderr.
123 * 123 *
124 * @param filename The filename to write, or - for stdout 124 * @param filename The filename to write, or - for stdout
125 * @param blob Poiner to buffer containing fdt 125 * @param blob Pointer to buffer containing fdt
126 * @return 0 if ok, -1 on error 126 * @return 0 if ok, -1 on error
127 */ 127 */
128int utilfdt_write(const char *filename, const void *blob); 128int utilfdt_write(const char *filename, const void *blob);
@@ -133,7 +133,7 @@ int utilfdt_write(const char *filename, const void *blob);
133 * an error message for the user. 133 * an error message for the user.
134 * 134 *
135 * @param filename The filename to write, or - for stdout 135 * @param filename The filename to write, or - for stdout
136 * @param blob Poiner to buffer containing fdt 136 * @param blob Pointer to buffer containing fdt
137 * @return 0 if ok, else an errno value representing the error 137 * @return 0 if ok, else an errno value representing the error
138 */ 138 */
139int utilfdt_write_err(const char *filename, const void *blob); 139int utilfdt_write_err(const char *filename, const void *blob);
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
index 75f383c0b9d3..2111a6e351f9 100644
--- a/scripts/dtc/version_gen.h
+++ b/scripts/dtc/version_gen.h
@@ -1 +1 @@
#define DTC_VERSION "DTC 1.4.7-gf267e674" #define DTC_VERSION "DTC 1.5.0-g87963ee2"