Re: [Question] Question about supporting sysreg only CoreSight ETMv4.4 on ACPI machines

From: Suzuki K Poulose
Date: Wed Oct 19 2022 - 06:16:01 EST


Hi Russell

On 19/10/2022 09:46, Russell King (Oracle) wrote:
On Tue, Oct 18, 2022 at 10:18:08AM +0100, Suzuki Kuruppassery Poulose wrote:
That is true. Unfortunately, supporting this requires us to move away from
the AMBA framework (at least) for ETM4x devices. This is currently
developed by Anshuman. We can share it as soon as this is complete.

Can we not find a way to create AMBA devices from ACPI?


There is a way today and that is how the AMBA devices (including ETMv4)
work. But, the problem is ETM with system register access are not AMBA
devices. On a DT based system, they have different compatible and are
created as platform devices.

But on ACPI, there is a single HID (which makes sense, because they
both are ETM devices). Now, if the instance has memory resource, we
need to use the AMBA hook, but otherwise fall back to the platform
device driver. And this is not reliable, depending on which driver
gets to the scan hook first.

Also, another reason behind moving away from AMBA, in general is:
we need to explicitly add PIDs of all new CPU ETMs to the driver
to be able to probe them successfully. This doesn't work very well
for older kernels running on newer platforms. Even now the list
of PIDs is not complete and that would go on forever.

And the "party bag" of this change is the runtime power managment
on ACPI platforms, that works out of the box for platform devices.

Thanks

Suzuki