Skip to content

dtoverlay: cannot add/remove fragments alongside non-integer parameters #182

Description

@compholio

It is convenient to not require more parameters than necessary when using dtmerge/dtoverlay, toward that end it would be nice to support enabling a fragment while also turning on other parameters. For example, this snippet could allow an optional PHY handle to be applied to an ethernet overlay:

/ {
	phy: fragment@3 {
		phy_handle: __dormant__ { };
	};
	__overrides__ {
		phy =
			<0>,"+3"
		,
			<&phy>,"target-path"
		,
			<&phy_handle>,"dtoverlay,phandle:0=",<&phy_handle>
		,
			<&overlay>,"phy-handle:0=",<&phy_handle>
		;
};

Note: I have separately patched dtmerge to allow it to override a phandle at the toplevel when the parameter is named "dtoverlay,phandle".

So, in this example "phy=alias-for-phy" or "phy=/a-full-path/to/a-phy@0" would permit enabling the "phy" fragment along with setting the target path. I've attached a patch that allows this behavior (+/- with a string override):

override-strings.patch

I'd like to have thoughts on this, if something like this is acceptable I'm happy to open a merge request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions