On Mon, 15 Dec 2025 at 17:05, Alex BennĂ©e <[email protected]> wrote:
>
> The TrustZone peripheral protection controller (tz-ppc) sits between
> peripherals and the main system. However this results in "info mtree"
> looking at bit confusing, especially as the sequence numbers can
> overlap and miss steps:
>
>       0000000000000000-ffffffffffffffff (prio -2, i/o): system
>         0000000000000000-00000000003fffff (prio 0, i/o): tz-mpc-upstream
>         0000000000400000-00000000007fffff (prio 0, i/o): alias ssram-0-alias 
> @tz-mpc-upstream 0000000000000000-00000000003fffff
>         0000000028000000-00000000281fffff (prio 0, i/o): tz-mpc-upstream
>         0000000028200000-00000000283fffff (prio 0, i/o): tz-mpc-upstream
>         0000000040080000-0000000040080fff (prio 0, i/o): iotkit-secctl-ns-regs
>         0000000040100000-0000000040100fff (prio 0, i/o): tz-ppc-port[1]
>         0000000040101000-0000000040101fff (prio 0, i/o): tz-ppc-port[2]
>         0000000040102000-0000000040102fff (prio 0, i/o): tz-ppc-port[3]
>         0000000040103000-0000000040103fff (prio 0, i/o): tz-ppc-port[4]
>         0000000040110000-0000000040110fff (prio 0, i/o): tz-ppc-port[0]
>         0000000040111000-0000000040111fff (prio 0, i/o): tz-ppc-port[1]

> So as a quality of life feature lets expose the name of the underlying
> region so we get something more useful:
>
>     0000000000000000-ffffffffffffffff (prio -2, i/o): system
>       0000000000000000-00000000003fffff (prio 0, i/o): tz-mpc-upstream
>       0000000000400000-00000000007fffff (prio 0, i/o): alias ssram-0-alias 
> @tz-mpc-upstream 0000000000000000-00000000003fffff
>       0000000028000000-00000000281fffff (prio 0, i/o): tz-mpc-upstream
>       0000000028200000-00000000283fffff (prio 0, i/o): tz-mpc-upstream
>       0000000040080000-0000000040080fff (prio 0, i/o): iotkit-secctl-ns-regs
>       0000000040100000-0000000040100fff (prio 0, i/o): tz-ppc-port[gpio0]
>       0000000040101000-0000000040101fff (prio 0, i/o): tz-ppc-port[gpio1]
>       0000000040102000-0000000040102fff (prio 0, i/o): tz-ppc-port[gpio2]
>       0000000040103000-0000000040103fff (prio 0, i/o): tz-ppc-port[gpio3]

Maybe we should print both the port number and the downstream device,
so eg tz-ppc-port[1:gpio0], etc ? Especially for the uart ports
this would disambiguate:

>       0000000040200000-0000000040200fff (prio 0, i/o): tz-ppc-port[uart]
>       0000000040201000-0000000040201fff (prio 0, i/o): tz-ppc-port[uart]
>       0000000040202000-0000000040202fff (prio 0, i/o): tz-ppc-port[uart]
>       0000000040203000-0000000040203fff (prio 0, i/o): tz-ppc-port[uart]
>       0000000040204000-0000000040204fff (prio 0, i/o): tz-ppc-port[uart]

(and if you are actually programming the thing then knowing which port is
which might be helpful).

The other thing that is confusing in this output is that there are
multiple TYPE_TZ_PPC devices in this system, but we don't have
any indication of that in the output. (This is why the port numbers
repeat: port 1 on one TZ_PPC is different from port 1 on a different
TZ_PPC.) I was going to suggest that we could make "info mtree"
print the owner of the MR, but it looks like we already have
that, we just don't document it: there's an "owner=' suboption
that can be set to true...

thanks
-- PMM

Reply via email to