# SPDX-License-Identifier: GPL-2.0-only
#
# Unisoc coresight configuration
#
menuconfig UNISOC_CORESIGHT
	tristate "Unisoc CoreSight Tracing Support"
	depends on ARM || ARM64
	depends on OF || ACPI
	select ARM_AMBA
	select PERF_EVENTS
	select CONFIGFS_FS
	help
	  This framework provides a kernel interface for the CoreSight debug
	  and trace drivers to register themselves with. It's intended to build
	  a topological view of the CoreSight components based on a DT
	  specification and configure the right series of components when a
	  trace source gets enabled.

	  To compile this driver as a module, choose M here: the
	  module will be called sprd_coresight.

if UNISOC_CORESIGHT
config UNISOC_CORESIGHT_LINKS_AND_SINKS
	tristate "Unisoc CoreSight Link and Sink drivers"
	help
	  This enables support for CoreSight link and sink drivers that are
	  responsible for transporting and collecting the trace data
	  respectively.  Link and sinks are dynamically aggregated with a trace
	  entity at run time to form a complete trace path.

	  To compile these drivers as modules, choose M here: the
	  modules will be called sprd_coresight-funnel and coresight-replicator.

config UNISOC_CORESIGHT_LINK_AND_SINK_TMC
	tristate "Unisoc Coresight generic TMC driver"

	depends on UNISOC_CORESIGHT_LINKS_AND_SINKS
	help
	  This enables support for the Trace Memory Controller driver.
	  Depending on its configuration the device can act as a link (embedded
	  trace router - ETR) or sink (embedded trace FIFO).  The driver
	  complies with the generic implementation of the component without
	  special enhancement or added features.

	  To compile this driver as a module, choose M here: the
	  module will be called sprd_coresight-tmc.

config UNISOC_CORESIGHT_SOURCE_ETM4X
	tristate "Unisoc CoreSight ETMv4.x / ETE driver"
	depends on ARM64
	select UNISOC_CORESIGHT_LINKS_AND_SINKS
	select PID_IN_CONTEXTIDR
	help
	  This driver provides support for the CoreSight Embedded Trace Macrocell
	  version 4.x and the Embedded Trace Extensions (ETE). Both are CPU tracer
	  modules, tracing the instructions that a processor is executing. This is
	  primarily useful for instruction level tracing.

	  To compile this driver as a module, choose M here: the
	  module will be called sprd_coresight-etm4x.

config UNISOC_CORESIGHT_APETB
	tristate "Unisoc CoreSight APETB driver"
	depends on UNISOC_CORESIGHT_SOURCE_ETM4X
	select UNISOC_CORESIGHT_LINKS_AND_SINKS
	help
	  This driver provides support for ylog control APETB function, will automatic
	  call enable_sink and enable_source.

config UNISOC_CORESIGHT_TMC_GROUP
	tristate "Unisoc CoreSight tmc group drivers"
	help
	  This enables support for CoreSight tmc group drivers that are
	  responsible for dump several tmc data.

config UNISOC_CORESIGHT_TMC_GROUP_CTRL
	bool "Unisoc CoreSight tmc group drivers control"
	depends on UNISOC_CORESIGHT_TMC_GROUP
	help
	  This enables support for CoreSight tmc group drivers control that is
	  responsible for dump several tmc data.

source "drivers/unisoc_platform/sprd_coresight/phy/Kconfig"

endif
