On Tue, 19 Feb 2019 at 14:42, Al Grant Al.Grant@arm.com wrote:
I see. Actually, if I understand the datasheet correctly, timestamp generator should be enabled by default on US+ as well. Perhaps it's the firmware who turns it off? I remember a post on this mailing list, that a firmware update on Juno fixed a similar empty timestamps problem on that platform. Fortunately, Xilinx's forks of U-Boot and ATF are public, so I'll inspect them for such operations.
If that's the case, do you think it would be beneficial to add separate bindings for TSGEN? Perhaps just another reg pair and reg-name value to ETM node, similarly to what's already done for stimulus base in STM. ETM driver could look for reg-name 'timestamp', get the corresponding pair from reg, check if TSGEN is disabled and enable it if necessary. If I understand correctly, that part should be generic, as TSGEN is a standard CS component. It's just a random idea, but I'd appreciate your comment on that.
It would be useful to have both.
Where the chip is managed by vendor firmware and the timestamp generator is shared with a system control processor (which in TrustZone terms is Secure) then the timestamp generator really does need to be directly controlled by the firmware. In that case we need an API (e.g. via the SMC API) to ask for self-hosted debug be to be enabled. That could do any number of things - turn on the power domain, turn off firewalling of debug logic etc. We were trying to get that into the SMC API - I will chase up where that has got to.
Right, there is a number of things to consider here hence suggesting to use the clock framework for this. That way a clock_get/put() would do all the things we want without smearing the CS subsystem.
Where Linux is running "bare metal" with no firmware underneath, and not sharing debug logic with Secure management, then it might be expedient to have Linux directly access the timestamp generator.
Every chip is different and there are any number of ways of setting them up... we need to give ourselves some options.
Al