This patchset adds the first version of the CoreSight CTI hardware driver.
CTIs are defined in the device tree and associated with other CoreSight devices. The core CoreSight code has been modified to enable the registration of the CTI devices on the same bus as the other CoreSight components, but as these are not actually trace generation / capture devices, they are not part of the Coresight path when generating trace.
However, the definition of the standard CoreSight device has been extended to include a reference to an associated CTI device, and the enable / disable trace path operations will auto enable/disable any associated CTI devices at the same time.
Programming is at present via sysfs - a full API is provided to utilise the hardware capabilities. As CTI devices are unprogrammed by default, the auto enable describe above will have no effect until explicit programming takes place.
A set of device tree bindings specific to the CTI topology has been defined.
Documentation has been updated to describe both the CTI hardware, its use and programming in sysfs, and the new dts bindings required.
This patchset is fully functional - but comes with the following caveats:-
1) device tree bindings are incomplete - and in some cases not representative of the final definitions - alternative descriptions are in place to test the differing binding properties. The QCom DB410 has been used as the principle test platform.
2) the main driver file is rather large. It may benefit from having the sysfs specific code split off into a separate file as the etm drivers have done.
3) there is a sig_names field in the CTI connection structure. This is intended to potentially contain the names of the interconnecting triggers, read from the device tree - (e.g. dbgreq, restart, tmcfull) to enable users to determine the purpose of the signals attached to the CTI. This is not yet implemented and comments on the value of implementing this are welcome.
4) there is some debug logging still present. This will be removed.
5) the updates to the AMBA drivers for UCI component ID are included in the set at present for ease of use, but are not intended to be in the final set. (patches 0001 and 0002)
6) tested on a 4.20-rc1 based tree, but applies cleanly to 5.0-rc1
All comments on structure and functionality welcome.
Mike Leach (10): drivers: amba: Updates to component identification for driver matching. coresight: etmv4: Update ID register table to add UCI support drivers: coresight: Add ECT definitions to main CS header. drivers: coresight: Update to Coresight core headers for CTI. drivers: coresight: Updates to CoreSight core for CTI implementation. coresight: of: Update Coresight device tree parser code for CTI. coresight: cti: New CTI driver code. coresight: build: Add in Coresight config to build files coresight: cti: Add in device tree definitions for CTI.dts coresight: docs: Add documentation for CTI component and bindings.
.../testing/sysfs-bus-coresight-devices-cti | 178 ++ .../devicetree/bindings/arm/coresight.txt | 173 ++ Documentation/trace/coresight.txt | 125 +- arch/arm64/boot/dts/arm/juno-base.dtsi | 76 + arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi | 9 + arch/arm64/boot/dts/qcom/msm8916.dtsi | 101 +- drivers/amba/bus.c | 45 +- drivers/hwtracing/coresight/Kconfig | 12 + drivers/hwtracing/coresight/Makefile | 1 + drivers/hwtracing/coresight/coresight-cti.c | 2025 +++++++++++++++++ drivers/hwtracing/coresight/coresight-cti.h | 195 ++ drivers/hwtracing/coresight/coresight-etm4x.c | 18 +- drivers/hwtracing/coresight/coresight-priv.h | 10 + drivers/hwtracing/coresight/coresight.c | 51 +- drivers/hwtracing/coresight/of_coresight.c | 65 + include/linux/amba/bus.h | 32 + include/linux/coresight.h | 42 + 17 files changed, 3144 insertions(+), 14 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-cti create mode 100644 drivers/hwtracing/coresight/coresight-cti.c create mode 100644 drivers/hwtracing/coresight/coresight-cti.h