summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-08-02 09:23:13 -0600
committerSimon Glass <sjg@chromium.org>2023-08-02 12:05:57 -0600
commit288ae53cb73605500b7fc01e5919753c878466be (patch)
tree43e41eb7334175c9b273afdd37128539de2b6051 /tools/dtoc/fdt.py
parent0236642212f87c8d589f9e16cc29503b476a45c5 (diff)
binman: Add a temporary hack for duplicate phandles
Three boards use a phandle in a FIT generator and the maintainer is away. For now, add a hack to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r--tools/dtoc/fdt.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 5963925146a..0b20d52f313 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -15,6 +15,9 @@ from libfdt import QUIET_NOTFOUND
from u_boot_pylib import tools
from u_boot_pylib import tout
+# Temporary hack
+IGNORE_DUP_PHANDLES = False
+
# This deals with a device tree, presenting it as an assortment of Node and
# Prop objects, representing nodes and properties, respectively. This file
# contains the base classes and defines the high-level API. You can use
@@ -339,10 +342,11 @@ class Node:
if phandle:
dup = self._fdt.phandle_to_node.get(phandle)
if dup:
- raise ValueError(
- f'Duplicate phandle {phandle} in nodes {dup.path} and {self.path}')
-
- self._fdt.phandle_to_node[phandle] = self
+ if not IGNORE_DUP_PHANDLES:
+ raise ValueError(
+ f'Duplicate phandle {phandle} in nodes {dup.path} and {self.path}')
+ else:
+ self._fdt.phandle_to_node[phandle] = self
offset = fdt_obj.first_subnode(self.Offset(), QUIET_NOTFOUND)
while offset >= 0: