162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci#
362306a36Sopenharmony_ci# Coresight configuration
462306a36Sopenharmony_ci#
562306a36Sopenharmony_cimenuconfig CORESIGHT
662306a36Sopenharmony_ci	tristate "CoreSight Tracing Support"
762306a36Sopenharmony_ci	depends on ARM || ARM64
862306a36Sopenharmony_ci	depends on OF || ACPI
962306a36Sopenharmony_ci	select ARM_AMBA
1062306a36Sopenharmony_ci	select PERF_EVENTS
1162306a36Sopenharmony_ci	select CONFIGFS_FS
1262306a36Sopenharmony_ci	help
1362306a36Sopenharmony_ci	  This framework provides a kernel interface for the CoreSight debug
1462306a36Sopenharmony_ci	  and trace drivers to register themselves with. It's intended to build
1562306a36Sopenharmony_ci	  a topological view of the CoreSight components based on a DT
1662306a36Sopenharmony_ci	  specification and configure the right series of components when a
1762306a36Sopenharmony_ci	  trace source gets enabled.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
2062306a36Sopenharmony_ci	  module will be called coresight.
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ciif CORESIGHT
2362306a36Sopenharmony_ciconfig CORESIGHT_LINKS_AND_SINKS
2462306a36Sopenharmony_ci	tristate "CoreSight Link and Sink drivers"
2562306a36Sopenharmony_ci	help
2662306a36Sopenharmony_ci	  This enables support for CoreSight link and sink drivers that are
2762306a36Sopenharmony_ci	  responsible for transporting and collecting the trace data
2862306a36Sopenharmony_ci	  respectively.  Link and sinks are dynamically aggregated with a trace
2962306a36Sopenharmony_ci	  entity at run time to form a complete trace path.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci	  To compile these drivers as modules, choose M here: the
3262306a36Sopenharmony_ci	  modules will be called coresight-funnel and coresight-replicator.
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ciconfig CORESIGHT_LINK_AND_SINK_TMC
3562306a36Sopenharmony_ci	tristate "Coresight generic TMC driver"
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci	depends on CORESIGHT_LINKS_AND_SINKS
3862306a36Sopenharmony_ci	help
3962306a36Sopenharmony_ci	  This enables support for the Trace Memory Controller driver.
4062306a36Sopenharmony_ci	  Depending on its configuration the device can act as a link (embedded
4162306a36Sopenharmony_ci	  trace router - ETR) or sink (embedded trace FIFO).  The driver
4262306a36Sopenharmony_ci	  complies with the generic implementation of the component without
4362306a36Sopenharmony_ci	  special enhancement or added features.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
4662306a36Sopenharmony_ci	  module will be called coresight-tmc.
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciconfig CORESIGHT_CATU
4962306a36Sopenharmony_ci	tristate "Coresight Address Translation Unit (CATU) driver"
5062306a36Sopenharmony_ci	depends on CORESIGHT_LINK_AND_SINK_TMC
5162306a36Sopenharmony_ci	help
5262306a36Sopenharmony_ci	   Enable support for the Coresight Address Translation Unit (CATU).
5362306a36Sopenharmony_ci	   CATU supports a scatter gather table of 4K pages, with forward/backward
5462306a36Sopenharmony_ci	   lookup. CATU helps TMC ETR to use a large physically non-contiguous trace
5562306a36Sopenharmony_ci	   buffer by translating the addresses used by ETR to the physical address
5662306a36Sopenharmony_ci	   by looking up the provided table. CATU can also be used in pass-through
5762306a36Sopenharmony_ci	   mode where the address is not translated.
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci	   To compile this driver as a module, choose M here: the
6062306a36Sopenharmony_ci	   module will be called coresight-catu.
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ciconfig CORESIGHT_SINK_TPIU
6362306a36Sopenharmony_ci	tristate "Coresight generic TPIU driver"
6462306a36Sopenharmony_ci	depends on CORESIGHT_LINKS_AND_SINKS
6562306a36Sopenharmony_ci	help
6662306a36Sopenharmony_ci	  This enables support for the Trace Port Interface Unit driver,
6762306a36Sopenharmony_ci	  responsible for bridging the gap between the on-chip coresight
6862306a36Sopenharmony_ci	  components and a trace for bridging the gap between the on-chip
6962306a36Sopenharmony_ci	  coresight components and a trace port collection engine, typically
7062306a36Sopenharmony_ci	  connected to an external host for use case capturing more traces than
7162306a36Sopenharmony_ci	  the on-board coresight memory can handle.
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
7462306a36Sopenharmony_ci	  module will be called coresight-tpiu.
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ciconfig CORESIGHT_SINK_ETBV10
7762306a36Sopenharmony_ci	tristate "Coresight ETBv1.0 driver"
7862306a36Sopenharmony_ci	depends on CORESIGHT_LINKS_AND_SINKS
7962306a36Sopenharmony_ci	help
8062306a36Sopenharmony_ci	  This enables support for the Embedded Trace Buffer version 1.0 driver
8162306a36Sopenharmony_ci	  that complies with the generic implementation of the component without
8262306a36Sopenharmony_ci	  special enhancement or added features.
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
8562306a36Sopenharmony_ci	  module will be called coresight-etb10.
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ciconfig CORESIGHT_SOURCE_ETM3X
8862306a36Sopenharmony_ci	tristate "CoreSight Embedded Trace Macrocell 3.x driver"
8962306a36Sopenharmony_ci	depends on !ARM64
9062306a36Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
9162306a36Sopenharmony_ci	help
9262306a36Sopenharmony_ci	  This driver provides support for processor ETM3.x and PTM1.x modules,
9362306a36Sopenharmony_ci	  which allows tracing the instructions that a processor is executing
9462306a36Sopenharmony_ci	  This is primarily useful for instruction level tracing.  Depending
9562306a36Sopenharmony_ci	  the ETM version data tracing may also be available.
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
9862306a36Sopenharmony_ci	  module will be called coresight-etm3x.
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ciconfig CORESIGHT_SOURCE_ETM4X
10162306a36Sopenharmony_ci	tristate "CoreSight ETMv4.x / ETE driver"
10262306a36Sopenharmony_ci	depends on ARM64
10362306a36Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
10462306a36Sopenharmony_ci	select PID_IN_CONTEXTIDR
10562306a36Sopenharmony_ci	help
10662306a36Sopenharmony_ci	  This driver provides support for the CoreSight Embedded Trace Macrocell
10762306a36Sopenharmony_ci	  version 4.x and the Embedded Trace Extensions (ETE). Both are CPU tracer
10862306a36Sopenharmony_ci	  modules, tracing the instructions that a processor is executing. This is
10962306a36Sopenharmony_ci	  primarily useful for instruction level tracing.
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
11262306a36Sopenharmony_ci	  module will be called coresight-etm4x.
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ciconfig ETM4X_IMPDEF_FEATURE
11562306a36Sopenharmony_ci	bool "Control implementation defined overflow support in ETM 4.x driver"
11662306a36Sopenharmony_ci	depends on CORESIGHT_SOURCE_ETM4X
11762306a36Sopenharmony_ci	help
11862306a36Sopenharmony_ci	  This control provides implementation define control for CoreSight
11962306a36Sopenharmony_ci	  ETM 4.x tracer module that can't reduce commit rate automatically.
12062306a36Sopenharmony_ci	  This avoids overflow between the ETM tracer module and the cpu core.
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ciconfig CORESIGHT_STM
12362306a36Sopenharmony_ci	tristate "CoreSight System Trace Macrocell driver"
12462306a36Sopenharmony_ci	depends on (ARM && !(CPU_32v3 || CPU_32v4 || CPU_32v4T)) || ARM64
12562306a36Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
12662306a36Sopenharmony_ci	select STM
12762306a36Sopenharmony_ci	help
12862306a36Sopenharmony_ci	  This driver provides support for hardware assisted software
12962306a36Sopenharmony_ci	  instrumentation based tracing. This is primarily used for
13062306a36Sopenharmony_ci	  logging useful software events or data coming from various entities
13162306a36Sopenharmony_ci	  in the system, possibly running different OSs
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
13462306a36Sopenharmony_ci	  module will be called coresight-stm.
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ciconfig CORESIGHT_CPU_DEBUG
13762306a36Sopenharmony_ci	tristate "CoreSight CPU Debug driver"
13862306a36Sopenharmony_ci	depends on ARM || ARM64
13962306a36Sopenharmony_ci	depends on DEBUG_FS
14062306a36Sopenharmony_ci	help
14162306a36Sopenharmony_ci	  This driver provides support for coresight debugging module. This
14262306a36Sopenharmony_ci	  is primarily used to dump sample-based profiling registers when
14362306a36Sopenharmony_ci	  system triggers panic, the driver will parse context registers so
14462306a36Sopenharmony_ci	  can quickly get to know program counter (PC), secure state,
14562306a36Sopenharmony_ci	  exception level, etc. Before use debugging functionality, platform
14662306a36Sopenharmony_ci	  needs to ensure the clock domain and power domain are enabled
14762306a36Sopenharmony_ci	  properly, please refer Documentation/trace/coresight/coresight-cpu-debug.rst
14862306a36Sopenharmony_ci	  for detailed description and the example for usage.
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
15162306a36Sopenharmony_ci	  module will be called coresight-cpu-debug.
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ciconfig CORESIGHT_CPU_DEBUG_DEFAULT_ON
15462306a36Sopenharmony_ci	bool "Enable CoreSight CPU Debug by default"
15562306a36Sopenharmony_ci	depends on CORESIGHT_CPU_DEBUG
15662306a36Sopenharmony_ci	help
15762306a36Sopenharmony_ci	  Say Y here to enable the CoreSight Debug panic-debug by default. This
15862306a36Sopenharmony_ci	  can also be enabled via debugfs, but this ensures the debug feature
15962306a36Sopenharmony_ci	  is enabled as early as possible.
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci	  Has the same effect as setting coresight_cpu_debug.enable=1 on the
16262306a36Sopenharmony_ci	  kernel command line.
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci	  Say N if unsure.
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ciconfig CORESIGHT_CTI
16762306a36Sopenharmony_ci	tristate "CoreSight Cross Trigger Interface (CTI) driver"
16862306a36Sopenharmony_ci	depends on ARM || ARM64
16962306a36Sopenharmony_ci	help
17062306a36Sopenharmony_ci	  This driver provides support for CoreSight CTI and CTM components.
17162306a36Sopenharmony_ci	  These provide hardware triggering events between CoreSight trace
17262306a36Sopenharmony_ci	  source and sink components. These can be used to halt trace or
17362306a36Sopenharmony_ci	  inject events into the trace stream. CTI also provides a software
17462306a36Sopenharmony_ci	  control to trigger the same halt events. This can provide fast trace
17562306a36Sopenharmony_ci	  halt compared to disabling sources and sinks normally in driver
17662306a36Sopenharmony_ci	  software.
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
17962306a36Sopenharmony_ci	  module will be called coresight-cti.
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ciconfig CORESIGHT_CTI_INTEGRATION_REGS
18262306a36Sopenharmony_ci	bool "Access CTI CoreSight Integration Registers"
18362306a36Sopenharmony_ci	depends on CORESIGHT_CTI
18462306a36Sopenharmony_ci	help
18562306a36Sopenharmony_ci	  This option adds support for the CoreSight integration registers on
18662306a36Sopenharmony_ci	  this device. The integration registers allow the exploration of the
18762306a36Sopenharmony_ci	  CTI trigger connections between this and other devices.These
18862306a36Sopenharmony_ci	  registers are not used in normal operation and can leave devices in
18962306a36Sopenharmony_ci	  an inconsistent state.
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ciconfig CORESIGHT_TRBE
19262306a36Sopenharmony_ci	tristate "Trace Buffer Extension (TRBE) driver"
19362306a36Sopenharmony_ci	depends on ARM64 && CORESIGHT_SOURCE_ETM4X
19462306a36Sopenharmony_ci	help
19562306a36Sopenharmony_ci	  This driver provides support for percpu Trace Buffer Extension (TRBE).
19662306a36Sopenharmony_ci	  TRBE always needs to be used along with its corresponding percpu ETE
19762306a36Sopenharmony_ci	  component. ETE generates trace data which is then captured with TRBE.
19862306a36Sopenharmony_ci	  Unlike traditional sink devices, TRBE is a CPU feature accessible via
19962306a36Sopenharmony_ci	  system registers. But its explicit dependency with trace unit (ETE)
20062306a36Sopenharmony_ci	  requires it to be plugged in as a coresight sink device.
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
20362306a36Sopenharmony_ci	  called coresight-trbe.
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ciconfig ULTRASOC_SMB
20662306a36Sopenharmony_ci	tristate "Ultrasoc system memory buffer drivers"
20762306a36Sopenharmony_ci	depends on ACPI || COMPILE_TEST
20862306a36Sopenharmony_ci	depends on ARM64 && CORESIGHT_LINKS_AND_SINKS
20962306a36Sopenharmony_ci	help
21062306a36Sopenharmony_ci	  This driver provides support for the Ultrasoc system memory buffer (SMB).
21162306a36Sopenharmony_ci	  SMB is responsible for receiving the trace data from Coresight ETM devices
21262306a36Sopenharmony_ci	  and storing them to a system buffer.
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
21562306a36Sopenharmony_ci	  called ultrasoc-smb.
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ciconfig CORESIGHT_TPDM
21862306a36Sopenharmony_ci	tristate "CoreSight Trace, Profiling & Diagnostics Monitor driver"
21962306a36Sopenharmony_ci	select CORESIGHT_LINKS_AND_SINKS
22062306a36Sopenharmony_ci	select CORESIGHT_TPDA
22162306a36Sopenharmony_ci	help
22262306a36Sopenharmony_ci	  This driver provides support for configuring monitor. Monitors are
22362306a36Sopenharmony_ci	  primarily responsible for data set collection and support the
22462306a36Sopenharmony_ci	  ability to collect any permutation of data set types.
22562306a36Sopenharmony_ci
22662306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
22762306a36Sopenharmony_ci	  called coresight-tpdm.
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ciconfig CORESIGHT_TPDA
23062306a36Sopenharmony_ci	tristate "CoreSight Trace, Profiling & Diagnostics Aggregator driver"
23162306a36Sopenharmony_ci	help
23262306a36Sopenharmony_ci	  This driver provides support for configuring aggregator. This is
23362306a36Sopenharmony_ci	  primarily useful for pulling the data sets from one or more
23462306a36Sopenharmony_ci	  attached monitors and pushing the resultant data out. Multiple
23562306a36Sopenharmony_ci	  monitors are connected on different input ports of TPDA.
23662306a36Sopenharmony_ci
23762306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
23862306a36Sopenharmony_ci	  called coresight-tpda.
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ciconfig CORESIGHT_DUMMY
24162306a36Sopenharmony_ci	tristate "Dummy driver support"
24262306a36Sopenharmony_ci	help
24362306a36Sopenharmony_ci	  Enables support for dummy driver. Dummy driver can be used for
24462306a36Sopenharmony_ci	  CoreSight sources/sinks that are owned and configured by some
24562306a36Sopenharmony_ci	  other subsystem and use Linux drivers to configure rest of trace
24662306a36Sopenharmony_ci	  path.
24762306a36Sopenharmony_ci
24862306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
24962306a36Sopenharmony_ci	  called coresight-dummy.
25062306a36Sopenharmony_ciendif
251