Hi Al.,
-----Original Message----- From: Al Grant Al.Grant@arm.com Sent: Tuesday, March 26, 2019 7:09 PM To: Mike Leach mike.leach@linaro.org; Wojciech Żmuda wzmuda@n7space.com Cc: coresight@lists.linaro.org; Michał Kurowski mkurowski@n7space.com; Michal Mosdorf mmosdorf@n7space.com; nd nd@arm.com Subject: RE: Empty trace in TMC-ETR on Xilinx Zynq US+ MPSoC
Auto-detection is not practical in an on-target environment as it can result in an unusable target, and is not always successful if the device manufacturer has not interconnected certain topology signals. With external JTAG debuggers, we can autodetect then power cycle - and in this case sufficient information had been detected to determine the connection ports of the funnel.
Just to add to this. On-target auto-detection of topology is definitely not practical or recommended as a standard way for the kernel to discover CoreSight configuration at boot. I.e. it is not an alternative to ACPI or DTS. But it is often a feasible option in a 'lab' situation, if you haven't got JTAG, and where you are happy to reset the device. So it's actually been quite useful in getting us started on devices which don't have an accessible JTAG port.
Topology auto-detection (whether by on-target programming or by JTAG) involves putting devices in a special "integration" mode and although the CoreSight spec says you should do a system reset after this, in my experience it's worth trying to just revert back to production mode, as assuming you've set registers to sensible values, more often than not it just works.
CSAL has some code for on-target ATB topology detection:
https://github.com/ARM- software/CSAL/blob/master/experimental/cs_topology_detect.c
The kernel mustn't be trying to use CoreSight at the same time. If you haven't yet got a DTS/ACPI configuration, hopefully the kernel won't be using CoreSight at all, but it's something to bear in mind if you have got a configuration and are using auto-detect to check it's complete and correct. Ideally we would have a way to tell the kernel to quiesce and relinquish all use of CoreSight.
Thanks, that's an excellent write-up. I'll be away for the next two weeks, but when I'm back, I'll try to use this technique to verify my device tree against.
Regards, Wojciech
Al