18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# Coresight configuration
48c2ecf20Sopenharmony_ci#
58c2ecf20Sopenharmony_cimenuconfig CORESIGHT
68c2ecf20Sopenharmony_ci	tristate "CoreSight Tracing Support"
78c2ecf20Sopenharmony_ci	depends on ARM || ARM64
88c2ecf20Sopenharmony_ci	depends on OF || ACPI
98c2ecf20Sopenharmony_ci	select ARM_AMBA
108c2ecf20Sopenharmony_ci	select PERF_EVENTS
118c2ecf20Sopenharmony_ci	help
128c2ecf20Sopenharmony_ci	  This framework provides a kernel interface for the CoreSight debug
138c2ecf20Sopenharmony_ci	  and trace drivers to register themselves with. It's intended to build
148c2ecf20Sopenharmony_ci	  a topological view of the CoreSight components based on a DT
158c2ecf20Sopenharmony_ci	  specification and configure the right series of components when a
168c2ecf20Sopenharmony_ci	  trace source gets enabled.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
198c2ecf20Sopenharmony_ci	  module will be called coresight.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciif CORESIGHT
228c2ecf20Sopenharmony_ciconfig CORESIGHT_LINKS_AND_SINKS
238c2ecf20Sopenharmony_ci	tristate "CoreSight Link and Sink drivers"
248c2ecf20Sopenharmony_ci	help
258c2ecf20Sopenharmony_ci	  This enables support for CoreSight link and sink drivers that are
268c2ecf20Sopenharmony_ci	  responsible for transporting and collecting the trace data
278c2ecf20Sopenharmony_ci	  respectively.  Link and sinks are dynamically aggregated with a trace
288c2ecf20Sopenharmony_ci	  entity at run time to form a complete trace path.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci	  To compile these drivers as modules, choose M here: the
318c2ecf20Sopenharmony_ci	  modules will be called coresight-funnel and coresight-replicator.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciconfig CORESIGHT_LINK_AND_SINK_TMC
348c2ecf20Sopenharmony_ci	tristate "Coresight generic TMC driver"
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci	depends on CORESIGHT_LINKS_AND_SINKS
378c2ecf20Sopenharmony_ci	help
388c2ecf20Sopenharmony_ci	  This enables support for the Trace Memory Controller driver.
398c2ecf20Sopenharmony_ci	  Depending on its configuration the device can act as a link (embedded
408c2ecf20Sopenharmony_ci	  trace router - ETR) or sink (embedded trace FIFO).  The driver
418c2ecf20Sopenharmony_ci	  complies with the generic implementation of the component without
428c2ecf20Sopenharmony_ci	  special enhancement or added features.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
458c2ecf20Sopenharmony_ci	  module will be called coresight-tmc.
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciconfig CORESIGHT_CATU
488c2ecf20Sopenharmony_ci	tristate "Coresight Address Translation Unit (CATU) driver"
498c2ecf20Sopenharmony_ci	depends on CORESIGHT_LINK_AND_SINK_TMC
508c2ecf20Sopenharmony_ci	help
518c2ecf20Sopenharmony_ci	   Enable support for the Coresight Address Translation Unit (CATU).
528c2ecf20Sopenharmony_ci	   CATU supports a scatter gather table of 4K pages, with forward/backward
538c2ecf20Sopenharmony_ci	   lookup. CATU helps TMC ETR to use a large physically non-contiguous trace
548c2ecf20Sopenharmony_ci	   buffer by translating the addresses used by ETR to the physical address
558c2ecf20Sopenharmony_ci	   by looking up the provided table. CATU can also be used in pass-through
568c2ecf20Sopenharmony_ci	   mode where the address is not translated.
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci	   To compile this driver as a module, choose M here: the
598c2ecf20Sopenharmony_ci	   module will be called coresight-catu.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciconfig CORESIGHT_SINK_TPIU
628c2ecf20Sopenharmony_ci	tristate "Coresight generic TPIU driver"
638c2ecf20Sopenharmony_ci	depends on CORESIGHT_LINKS_AND_SINKS
648c2ecf20Sopenharmony_ci	help
658c2ecf20Sopenharmony_ci	  This enables support for the Trace Port Interface Unit driver,
668c2ecf20Sopenharmony_ci	  responsible for bridging the gap between the on-chip coresight
678c2ecf20Sopenharmony_ci	  components and a trace for bridging the gap between the on-chip
688c2ecf20Sopenharmony_ci	  coresight components and a trace port collection engine, typically
698c2ecf20Sopenharmony_ci	  connected to an external host for use case capturing more traces than
708c2ecf20Sopenharmony_ci	  the on-board coresight memory can handle.
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
738c2ecf20Sopenharmony_ci	  module will be called coresight-tpiu.
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciconfig CORESIGHT_SINK_ETBV10
768c2ecf20Sopenharmony_ci	tristate "Coresight ETBv1.0 driver"
778c2ecf20Sopenharmony_ci	depends on CORESIGHT_LINKS_AND_SINKS
788c2ecf20Sopenharmony_ci	help
798c2ecf20Sopenharmony_ci	  This enables support for the Embedded Trace Buffer version 1.0 driver
808c2ecf20Sopenharmony_ci	  that complies with the generic implementation of the component without
818c2ecf20Sopenharmony_ci	  special enhancement or added features.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
848c2ecf20Sopenharmony_ci	  module will be called coresight-etb10.
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciconfig CORESIGHT_SOURCE_ETM3X
878c2ecf20Sopenharmony_ci	tristate "CoreSight Embedded Trace Macrocell 3.x driver"
888c2ecf20Sopenharmony_ci	depends on !ARM64
898c2ecf20Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
908c2ecf20Sopenharmony_ci	help
918c2ecf20Sopenharmony_ci	  This driver provides support for processor ETM3.x and PTM1.x modules,
928c2ecf20Sopenharmony_ci	  which allows tracing the instructions that a processor is executing
938c2ecf20Sopenharmony_ci	  This is primarily useful for instruction level tracing.  Depending
948c2ecf20Sopenharmony_ci	  the ETM version data tracing may also be available.
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
978c2ecf20Sopenharmony_ci	  module will be called coresight-etm3x.
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ciconfig CORESIGHT_SOURCE_ETM4X
1008c2ecf20Sopenharmony_ci	tristate "CoreSight Embedded Trace Macrocell 4.x driver"
1018c2ecf20Sopenharmony_ci	depends on ARM64
1028c2ecf20Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
1038c2ecf20Sopenharmony_ci	select PID_IN_CONTEXTIDR
1048c2ecf20Sopenharmony_ci	help
1058c2ecf20Sopenharmony_ci	  This driver provides support for the ETM4.x tracer module, tracing the
1068c2ecf20Sopenharmony_ci	  instructions that a processor is executing. This is primarily useful
1078c2ecf20Sopenharmony_ci	  for instruction level tracing. Depending on the implemented version
1088c2ecf20Sopenharmony_ci	  data tracing may also be available.
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
1118c2ecf20Sopenharmony_ci	  module will be called coresight-etm4x.
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ciconfig CORESIGHT_STM
1148c2ecf20Sopenharmony_ci	tristate "CoreSight System Trace Macrocell driver"
1158c2ecf20Sopenharmony_ci	depends on (ARM && !(CPU_32v3 || CPU_32v4 || CPU_32v4T)) || ARM64
1168c2ecf20Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
1178c2ecf20Sopenharmony_ci	select STM
1188c2ecf20Sopenharmony_ci	help
1198c2ecf20Sopenharmony_ci	  This driver provides support for hardware assisted software
1208c2ecf20Sopenharmony_ci	  instrumentation based tracing. This is primarily used for
1218c2ecf20Sopenharmony_ci	  logging useful software events or data coming from various entities
1228c2ecf20Sopenharmony_ci	  in the system, possibly running different OSs
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
1258c2ecf20Sopenharmony_ci	  module will be called coresight-stm.
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ciconfig CORESIGHT_CPU_DEBUG
1288c2ecf20Sopenharmony_ci	tristate "CoreSight CPU Debug driver"
1298c2ecf20Sopenharmony_ci	depends on ARM || ARM64
1308c2ecf20Sopenharmony_ci	depends on DEBUG_FS
1318c2ecf20Sopenharmony_ci	help
1328c2ecf20Sopenharmony_ci	  This driver provides support for coresight debugging module. This
1338c2ecf20Sopenharmony_ci	  is primarily used to dump sample-based profiling registers when
1348c2ecf20Sopenharmony_ci	  system triggers panic, the driver will parse context registers so
1358c2ecf20Sopenharmony_ci	  can quickly get to know program counter (PC), secure state,
1368c2ecf20Sopenharmony_ci	  exception level, etc. Before use debugging functionality, platform
1378c2ecf20Sopenharmony_ci	  needs to ensure the clock domain and power domain are enabled
1388c2ecf20Sopenharmony_ci	  properly, please refer Documentation/trace/coresight/coresight-cpu-debug.rst
1398c2ecf20Sopenharmony_ci	  for detailed description and the example for usage.
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
1428c2ecf20Sopenharmony_ci	  module will be called coresight-cpu-debug.
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ciconfig CORESIGHT_CTI
1458c2ecf20Sopenharmony_ci	tristate "CoreSight Cross Trigger Interface (CTI) driver"
1468c2ecf20Sopenharmony_ci	depends on ARM || ARM64
1478c2ecf20Sopenharmony_ci	help
1488c2ecf20Sopenharmony_ci	  This driver provides support for CoreSight CTI and CTM components.
1498c2ecf20Sopenharmony_ci	  These provide hardware triggering events between CoreSight trace
1508c2ecf20Sopenharmony_ci	  source and sink components. These can be used to halt trace or
1518c2ecf20Sopenharmony_ci	  inject events into the trace stream. CTI also provides a software
1528c2ecf20Sopenharmony_ci	  control to trigger the same halt events. This can provide fast trace
1538c2ecf20Sopenharmony_ci	  halt compared to disabling sources and sinks normally in driver
1548c2ecf20Sopenharmony_ci	  software.
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci	  To compile this driver as a module, choose M here: the
1578c2ecf20Sopenharmony_ci	  module will be called coresight-cti.
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ciconfig CORESIGHT_CTI_INTEGRATION_REGS
1608c2ecf20Sopenharmony_ci	bool "Access CTI CoreSight Integration Registers"
1618c2ecf20Sopenharmony_ci	depends on CORESIGHT_CTI
1628c2ecf20Sopenharmony_ci	help
1638c2ecf20Sopenharmony_ci	  This option adds support for the CoreSight integration registers on
1648c2ecf20Sopenharmony_ci	  this device. The integration registers allow the exploration of the
1658c2ecf20Sopenharmony_ci	  CTI trigger connections between this and other devices.These
1668c2ecf20Sopenharmony_ci	  registers are not used in normal operation and can leave devices in
1678c2ecf20Sopenharmony_ci	  an inconsistent state.
1688c2ecf20Sopenharmony_ciendif
169