summaryrefslogtreecommitdiff
path: root/scripts/dtc/treesource.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-07-17 18:07:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-07-17 18:07:31 -0700
commit0ffb8a4c96e55ecf0e572aec1a0220af3da84e22 (patch)
treeea497c6728d2b93b31f1f4535a1413a436a59683 /scripts/dtc/treesource.c
parent5b9ac6c2a735f5b1721e0bc7331f8707190f9ef6 (diff)
parent76be2f9823b10c07daf814cb6c732eb1456a0b9e (diff)
Merge tag 'devicetree-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring: "DT Bindings: - Convert and add a bunch of IBM FSI related bindings - Add a new schema listing legacy compatibles which will (probably) never be documented. This will silence various checks warning about them. - Add bindings for Sierra Wireless mangOH Green SPI IoT interface, new Arm 2024 Cortex and Neoverse CPUs, QCom sc8180x PDC, QCom SDX75 GPI DMA, imx8mp/imx8qxp fsl,irqsteer, and Renesas RZ/G2UL CRU and CSI-2 blocks - Convert Spreadtrum sprd-timer, FSL cpm_qe, FSL fsl,ls-scfg-msi, FSL q(b)man-*, FSL qoriq-mc, and img,pdc-wdt bindings to DT schema - Drop obsolete stericsson,abx500.txt DT core: - Update dtc to upstream version v1.7.0-93-g1df7b047fe43 - Add support to run DT validation on DTs with applied overlays - Add helper for creating boolean properties in dynamic nodes and use that for dynamic PCI nodes - Clean-up early parsing of '#{address,size}-cells'" * tag 'devicetree-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (39 commits) dt-bindings: timer: sprd-timer: convert to YAML dt-bindings: incomplete-devices: document devices without bindings dt-bindings: trivial-devices: document the Sierra Wireless mangOH Green SPI IoT interface scripts/dtc: Update to upstream version v1.7.0-93-g1df7b047fe43 dt-bindings: soc: fsl: Add fsl,ls1028a-reset for reset syscon node dt-bindings: soc: fsl: cpm_qe: convert to yaml format dt-bindings: i2c: i2c-fsi: Convert to json-schema dt-bindings: fsi: Document the FSI Hub Controller dt-bindings: fsi: Document the AST2700 FSI controller dt-bindings: fsi: ast2600-fsi-master: Convert to json-schema dt-bindings: fsi: ibm,i2cr-fsi-master: Reference common FSI controller dt-bindings: fsi: Document the FSI controller common properties dt-bindings: fsi: Document the IBM SBEFIFO engine dt-bindings: fsi: p9-occ: Convert to json-schema dt-bindings: fsi: Document the IBM SCOM engine dt-bindings: fsi: fsi2spi: Document SPI controller child nodes dt-bindings: interrupt-controller: convert fsl,ls-scfg-msi to yaml dt-bindings: soc: fsl: Convert q(b)man-* to yaml format dt-bindings: misc: fsl,qoriq-mc: convert to yaml format dt-bindings: drop stale Anson Huang from maintainers ...
Diffstat (limited to 'scripts/dtc/treesource.c')
-rw-r--r--scripts/dtc/treesource.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/dtc/treesource.c b/scripts/dtc/treesource.c
index 33fedee82d58..ae15839ba6a5 100644
--- a/scripts/dtc/treesource.c
+++ b/scripts/dtc/treesource.c
@@ -139,6 +139,28 @@ static const char *delim_end[] = {
[TYPE_STRING] = "",
};
+static void add_string_markers(struct property *prop)
+{
+ int l, len = prop->val.len;
+ const char *p = prop->val.val;
+
+ for (l = strlen(p) + 1; l < len; l += strlen(p + l) + 1) {
+ struct marker *m, **nextp;
+
+ m = xmalloc(sizeof(*m));
+ m->offset = l;
+ m->type = TYPE_STRING;
+ m->ref = NULL;
+ m->next = NULL;
+
+ /* Find the end of the markerlist */
+ nextp = &prop->val.markers;
+ while (*nextp)
+ nextp = &((*nextp)->next);
+ *nextp = m;
+ }
+}
+
static enum markertype guess_value_type(struct property *prop)
{
int len = prop->val.len;
@@ -164,6 +186,8 @@ static enum markertype guess_value_type(struct property *prop)
if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= (len-nnul))
&& (nnotstringlbl == 0)) {
+ if (nnul > 1)
+ add_string_markers(prop);
return TYPE_STRING;
} else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
return TYPE_UINT32;
@@ -241,6 +265,8 @@ static void write_propval(FILE *f, struct property *prop)
} else {
write_propval_int(f, p, chunk_len, 4);
}
+ if (data_len > chunk_len)
+ fputc(' ', f);
break;
case TYPE_UINT64:
write_propval_int(f, p, chunk_len, 8);