-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Message-ID: <[email protected]> Signed-off-by: David Gibson <[email protected]>
- Loading branch information
Showing
4 changed files
with
334 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2024 Uwe Kleine-König | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
&{/} { | ||
/* | ||
* /b already has a label "node_b" in the base dts, also b is already | ||
* referenced in the base, so both the base's b and this b have a | ||
* phandle value. | ||
*/ | ||
node_b2: b { | ||
value = <42>; | ||
d = <&node_d>; | ||
}; | ||
|
||
node_c: c { | ||
value = <23>; | ||
b = <&node_b2>; | ||
}; | ||
|
||
d { | ||
a = <&node_a>; | ||
c = <&node_c>; | ||
}; | ||
}; | ||
|
||
&node_a { | ||
value = <32>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters