mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
libfdt: overlay: ensure that existing phandles are not overwritten
A phandle in an overlay is not supposed to overwrite a phandle that already exists in the base dtb as this breaks references to the respective node in the base. So add another iteration over the fdto that checks for such overwrites and fixes the fdto phandle's value to match the fdt's. A test is added that checks that newly added phandles and existing phandles work as expected. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Message-ID: <20240225175422.156393-2-u.kleine-koenig@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
b0aacd0a77
commit
1fad065080
4 changed files with 334 additions and 0 deletions
21
tests/overlay_base_phandle.dts
Normal file
21
tests/overlay_base_phandle.dts
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Uwe Kleine-König
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
node_a: a {
|
||||
value = <17>;
|
||||
};
|
||||
|
||||
node_b: b {
|
||||
a = <&node_a>;
|
||||
};
|
||||
|
||||
node_d: d {
|
||||
b = <&node_b>;
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue