-
Notifications
You must be signed in to change notification settings - Fork 42
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
Updated address-map
properties for Arm v8-M and similar
#161
Comments
This topic was discussed and Option #1 was my initial proposal. The preference of Rob and others in the Device Tree community was to add an extra field to address-map instead.
where the initial 0x0 and 0x1 mark whether the mapping is non-secure or secure. |
That proposal doesn't seem to require a |
Either way it seems like we may want to lift the information about the CPU into the compatible of the cluster node; something like this:
Since the |
Yes, the proposal does not require secure-reg. If you need to express different addresses for individual peripheral, it would require one of the two (not both):
here we are using ranges under amba to map a single address to 2 different addresses for secure and non-secure. But I think that we can avoid doing that if we rely only on address-map as in my other comment above. |
I am OK with adding a cpu-specific compatible string to the cluster because, as you wrote, it makes sense logically. However, it also needs to be duplicated at the cpu level I think to be "compatible" with the device tree property. We cannot remove it from cpu because we are using the same definition of the cpu node as the regular device tree. |
Just to clarify my question here, I'm asking if we can do something like this as an option 3:
And then domains If I understand correctly, then my follow-up question is: don't we now need a new |
Yes you understand correctly, but there is one difficulty here:
I don't know if there is a precedence for defining a compatible string (arm,cortex-m33f-cluster) as an extension of an existing other compatible string ("arm,cortex-m33f" + "-cluster").
No because the "flags" field in each address map entry would actually be considered the first cell of the address. So address cells go up by 1. |
address-map
propertiesaddress-map
properties for Arm v8-M and similar
@sstabellini I finally got around to implementing this and I have some follow ups. It looks like I should be doing this in
and then assuming that the first cell is always a flags cell. That's OK for me, but:
Overall it seems a lot less disruptive and more future-proof to add a new |
Currently under discussion in devicetree-org/lopper#161 Do not merge until discussion finalizes. Signed-off-by: Martí Bolívar <[email protected]>
Currently under discussion in devicetree-org/lopper#161 Do not merge until discussion finalizes. Signed-off-by: Martí Bolívar <[email protected]>
Currently under discussion in devicetree-org/lopper#161 Do not merge until discussion finalizes. Signed-off-by: Martí Bolívar <[email protected]>
Hi Marti, For AMD this is not a problem because we never have different address maps for secure/non-secure accesses. |
Problem statement
The existing
address-map
property in the CPU cluster binding doesnot properly account for multiple possible cluster address maps
depending on runtime CPU state.
Example
The motivating example is an Arm v8-M CPU with TrustZone. SoCs with
these CPUs frequently have different secure- and non-secure addresses
for identical peripherals. That is, the CPU clusters in these SoCs
have address maps that vary based on the current execution level of
the CPU.
Proposal
Extend the "cpus,cluster" binding to allow properties matching the
pattern
address-map-*
to allow for multiple address maps.This draws inspiration from the pinctrl binding,
which allows users to select multiple pin configurations, one per
desired state, using
pinctrl-<N>
properties. (In the address mapsituation, we are using multiple properties to describe hardware
rather than configure it, but the mechanism is similar.)
Extend the hardware specific portions of the "openamp,domain-v1"
binding to allow the domain to express which address map to use,
either implicitly or explicitly.
Application to Arm v8-M
Here are a couple of options for how we could use this. Other ideas
welcome.
Option 1
With the following macros:
And the following example CPU cluster:
We could define the following domains:
With the definition in the binding for "arm,cortex-m33f" CPUs that the
secure execution level should use the
address-map-secure
property,and analogously for the non-secure execution level, we could allow the
generated DTS files for a given domain to automatically apply the
correct address map in this situation.
Option 2
We could be more explicit by changing the above as follows:
And then extend the domain binding so we could, for example, do
something like this:
with the same effect.
This is more redundant and introduces room for error, however.
The text was updated successfully, but these errors were encountered: