mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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>
34 lines
461 B
Text
34 lines
461 B
Text
/*
|
|
* 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>;
|
|
};
|