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

Nested indirect buses #167

Open
mbolivar-nordic opened this issue Mar 2, 2023 · 1 comment
Open

Nested indirect buses #167

mbolivar-nordic opened this issue Mar 2, 2023 · 1 comment

Comments

@mbolivar-nordic
Copy link
Contributor

Is nesting indirect buses allowed? It seems to introduce a lot of
complication if so, and my guess is that it should just be explicitly
forbidden in the specification, but I'd like to know.

For example:

/ {
	parent {
		compatible = "indirect-bus";
		child {
			compatible = "indirect-bus";
			peripheral@deadbeef { /* ... */ };
		};
	};
};

If this is allowed, what are the semantics for mapping in
peripheral@deadbeef above in the address-map property of a
"cpus,cluster" node?

  • If I map in parent, do I automatically get peripheral@deadbeef
    too even if I don't map child?

    • If so, via what address map translation through child?
    • If not, does that mean I can simply ignore any "indirect-bus"
      node, along with all of its children, that aren't mapped
      explicitly (assuming peripheral@deadbeef is not present in the
      address-map property)?
  • If I map in child but not parent, how can I generate an
    equivalent devicetree? Do I need to lift child to be under the
    root node or something like that?

@sstabellini
Copy link
Collaborator

I don't think we can or should disallow this. "indirect-bus" is not particularly special, so the same way one can nest simple-buses one should also be able to nest indirect-buses. The mapping would work based on the address-map property as usual.

Yes if you map the parent, including the entire range of the parent that is a superset, then yes the child is also mapped. The address of peripheral@deadbeef would be translated 3 times:

  • ranges of child
  • ranges of parent
  • address-bus

Yes you can map the child and not the parent too. You can generate an equivalent device tree by creating a parent node empty if not for the child node. Yes the device tree hierarchy should be retained. This would be the same without nesting:

amba {
peripheral@deadbeef {
};
};

in this case if address map is only mapping peripheral@deadbeef and not the whole of amba, should peripheral@deadbeef be moved directly under the root node? The answer is no. The hierarchy should be retained.

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