Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of invalid overlays #68

Closed
jimpo opened this issue Apr 8, 2022 · 1 comment
Closed

Compilation of invalid overlays #68

jimpo opened this issue Apr 8, 2022 · 1 comment

Comments

@jimpo
Copy link

jimpo commented Apr 8, 2022

The dtc compiler allows compilation of DTS overlay files which fail when applied with FDT_ERR_NOTFOUND. I discovered this issue first with a Raspberry Pi overlay and reported the issue with instructions to reproduce in issue raspberrypi/firmware#1718.

It only fails when the overlay is compiled with --symbols as the issue appears to be with overlay symbols which have stale phandle references after the original node phandle is overwritten by the overlay.

A minimal example to reproduce is:

File base.dts:

/dts-v1/;

/ {
	soc {
		minibt: bluetooth {
			compatible = "brcm,bcm43438-bt";
			max-speed = <0x70800>;
			status = "disabled";
		};
	};
};

File blah.dts:

/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target = <&minibt>;
		minibt_frag: __overlay__ {
		};
	};
};
% dtc --symbols -I dts -O dtb overlay.dts > blah.dtbo
% dtc --symbols -I dts -O dtb base.dts > base.dtb
% fdtoverlay -v -i base.dtb -o base-with-overlay.dtb blah.dtbo
input  = base.dtb
output = base-with-overlay.dtb
overlay[0] = blah.dtbo

Failed to apply 'blah.dtbo': FDT_ERR_NOTFOUND
@dgibson
Copy link
Owner

dgibson commented Oct 30, 2024

This was part of a wider set of problems where the overlay could overwrite a base node's phandle. This should be corrected by this commit.

@dgibson dgibson closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants