devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug or feature? /somenode overwrites /somenode@17 in fdt-overlay
@ 2023-04-25 14:55 Uwe Kleine-König
       [not found] ` <20230425145504.tswuitufzikuhmnz-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2023-04-25 14:55 UTC (permalink / raw)
  To: David Gibson; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

Hello,

TL;DR: The node &{/somenode} in my overlay overwrites &{/somenode@27}.
Is this expected?

I have the following base and overlay dts files:

	uwe@taurus:~/tmp/fdtoverlay$ cat base.dts
	/dts-v1/;

	/ {
		somenode@12 {
			property = <0x2a>;
		};

		somenode@27 {
			property = <0x20>;
		};
	};
	uwe@taurus:~/tmp/fdtoverlay$ cat overlay.dts
	/dts-v1/;
	/plugin/;

	&{/somenode} {
		property = <0x17>;
	};

When compiling these and using them with fdtoverlay I see that
/somenode@12 is overwritten(. And if I swap the order of /somenode@12
and /somenode@27 in base.dts, the latter is overwritten instead):

uwe@taurus:~/tmp/fdtoverlay$ dtc -I dts -O dtb -o base.dtb base.dts && dtc -I dts -O dtb -o overlay.dtb overlay.dts && fdtoverlay -i base.dtb -o base+overlay.dtb overlay.dtb && fdtdump base+overlay.dtb
base.dts:4.14-6.4: Warning (unit_address_vs_reg): /somenode@12: node has a unit name, but no reg or ranges property
base.dts:8.14-10.4: Warning (unit_address_vs_reg): /somenode@27: node has a unit name, but no reg or ranges property

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
****     dtc -I dtb -O dts <filename>

/dts-v1/;
// magic:		0xd00dfeed
// totalsize:		0x99 (153)
// off_dt_struct:	0x38
// off_dt_strings:	0x90
// off_mem_rsvmap:	0x28
// version:		17
// last_comp_version:	16
// boot_cpuid_phys:	0x0
// size_dt_strings:	0x9
// size_dt_struct:	0x58

/ {
    somenode@12 {
        property = <0x00000017>;
    };
    somenode@27 {
        property = <0x00000020>;
    };
};

I was surprised and wonder if this is as designed or if this is a bug
that should be fixed. Any insights?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-29  6:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 14:55 Bug or feature? /somenode overwrites /somenode@17 in fdt-overlay Uwe Kleine-König
     [not found] ` <20230425145504.tswuitufzikuhmnz-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2023-04-25 16:25   ` Rob Herring
2023-04-28  7:01   ` David Gibson
2023-04-28 18:04     ` Uwe Kleine-König
     [not found]       ` <20230428180441.hn34wlwevuj75zml-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2023-04-28 18:40         ` Uwe Kleine-König
     [not found]           ` <20230428184007.56cwbzk5fe5trb4z-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2023-04-29  6:22             ` David Gibson
2023-04-29  6:21         ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).