# SPDX-License-Identifier: GPL-2.0-only
#
# QCOM Soc drivers
#
menu "Qualcomm SoC drivers"

config QCOM_AOSS_QMP
	tristate "Qualcomm AOSS Driver"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on MAILBOX
	depends on COMMON_CLK && PM
	select PM_GENERIC_DOMAINS
	help
	  This driver provides the means of communicating with and controlling
	  the low-power state for resources related to the remoteproc
	  subsystems as well as controlling the debug clocks exposed by the Always On
	  Subsystem (AOSS) using Qualcomm Messaging Protocol (QMP).

config QCOM_COMMAND_DB
	tristate "Qualcomm Command DB"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on OF_RESERVED_MEM
	help
	  Command DB queries shared memory by key string for shared system
	  resources. Platform drivers that require to set state of a shared
	  resource on a RPM-hardened platform must use this database to get
	  SoC specific identifier and information for the shared resources.

config QCOM_GENI_SE
	tristate "QCOM GENI Serial Engine Driver"
	depends on ARCH_QCOM || COMPILE_TEST
	help
	  This driver is used to manage Generic Interface (GENI) firmware based
	  Qualcomm Technologies, Inc. Universal Peripheral (QUP) Wrapper. This
	  driver is also used to manage the common aspects of multiple Serial
	  Engines present in the QUP.

config QCOM_GSBI
	tristate "QCOM General Serial Bus Interface"
	depends on ARCH_QCOM || COMPILE_TEST
	select MFD_SYSCON
	help
	  Say y here to enable GSBI support.  The GSBI provides control
	  functions for connecting the underlying serial UART, SPI, and I2C
	  devices to the output pins.

config QCOM_LLCC
	tristate "Qualcomm Technologies, Inc. LLCC driver"
	depends on ARCH_QCOM || COMPILE_TEST
	select REGMAP_MMIO
	help
	  Qualcomm Technologies, Inc. platform specific
	  Last Level Cache Controller(LLCC) driver for platforms such as,
	  SDM845. This provides interfaces to clients that use the LLCC.
	  Say yes here to enable LLCC slice driver.

config QCOM_KRYO_L2_ACCESSORS
	bool
	depends on (ARCH_QCOM || COMPILE_TEST) && ARM64

config QCOM_MDT_LOADER
	tristate
	select QCOM_SCM

config QCOM_MEMORY_DUMP_V2
	tristate "QCOM Memory Dump V2 Support"
	help
	  This enables memory dump feature. It allows various client
	  subsystems to register respective dump regions. At the time
	  of deadlocks or cpu hangs these dump regions are captured to
	  give a snapshot of the system at the time of the crash.

config QCOM_OCMEM
	tristate "Qualcomm On Chip Memory (OCMEM) driver"
	depends on ARCH_QCOM
	select QCOM_SCM
	help
	  The On Chip Memory (OCMEM) allocator allows various clients to
	  allocate memory from OCMEM based on performance, latency and power
	  requirements. This is typically used by the GPU, camera/video, and
	  audio components on some Snapdragon SoCs.

config QCOM_PANEL_EVENT_NOTIFIER
        tristate "panel event notifier"
        depends on DRM
        help
          Enabling this option adds panel event notifier driver.
          This driver is responsible for notifying clients interested in display
          panel events such as panel on , panel off, fps change etc.  Clients
          can use these notifications for power saving or align its operations
          with display panel power state.

config QCOM_PDR_HELPERS
	tristate
	select QCOM_QMI_HELPERS
	depends on NET

config QCOM_PMIC_PDCHARGER_ULOG
	tristate "Qualcomm PMIC PDCharger ULOG driver"
	depends on RPMSG
	depends on EVENT_TRACING
	help
	  The Qualcomm PMIC PDCharger ULOG driver provides access to logs of
	  the ADSP firmware PDCharger module in charge of Battery and Power
	  Delivery on modern systems.

	  Say yes here to support PDCharger ULOG event tracing on modern
	  Qualcomm platforms.

config QCOM_PMIC_GLINK
	tristate "Qualcomm PMIC GLINK driver"
	depends on RPMSG
	depends on TYPEC
	depends on DRM
	depends on NET
	depends on OF
	select AUXILIARY_BUS
	select QCOM_PDR_HELPERS
	select DRM_AUX_HPD_BRIDGE
	help
	  The Qualcomm PMIC GLINK driver provides access, over GLINK, to the
	  USB and battery firmware running on one of the coprocessors in
	  several modern Qualcomm platforms.

	  Say yes here to support USB-C and battery status on modern Qualcomm
	  platforms.

config QCOM_QMI_HELPERS
	tristate
	depends on NET

config QCOM_RAMP_CTRL
	tristate "Qualcomm Ramp Controller driver"
	depends on ARCH_QCOM || COMPILE_TEST
	help
	  The Ramp Controller is used to program the sequence ID for pulse
	  swallowing, enable sequence and link sequence IDs for the CPU
	  cores on some Qualcomm SoCs.
	  Say y here to enable support for the ramp controller.

config QCOM_RMTFS_MEM
	tristate "Qualcomm Remote Filesystem memory driver"
	depends on ARCH_QCOM
	select QCOM_SCM
	help
	  The Qualcomm remote filesystem memory driver is used for allocating
	  and exposing regions of shared memory with remote processors for the
	  purpose of exchanging sector-data between the remote filesystem
	  service and its clients.

	  Say y here if you intend to boot the modem remoteproc.

config QCOM_RPM_MASTER_STATS
	tristate "Qualcomm RPM Master stats"
	depends on ARCH_QCOM || COMPILE_TEST
	help
	  The RPM Master sleep stats driver provides detailed per-subsystem
	  sleep/wake data, read from the RPM message RAM. It can be used to
	  assess whether all the low-power modes available are entered as
	  expected or to check which part of the SoC prevents it from sleeping.

	  Say y here if you intend to debug or monitor platform sleep.

config QCOM_RPMH
	tristate "Qualcomm RPM-Hardened (RPMH) Communication"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on (QCOM_COMMAND_DB || !QCOM_COMMAND_DB)
	help
	  Support for communication with the hardened-RPM blocks in
	  Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an
	  internal bus to transmit state requests for shared resources. A set
	  of hardware components aggregate requests for these resources and
	  help apply the aggregated state on the resource.

config QCOM_SMEM
	tristate "Qualcomm Shared Memory Manager (SMEM)"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on HWSPINLOCK
	help
	  Say y here to enable support for the Qualcomm Shared Memory Manager.
	  The driver provides an interface to items in a heap shared among all
	  processors in a Qualcomm platform.

config QCOM_SMD_RPM
	tristate "Qualcomm Resource Power Manager (RPM) over SMD"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on RPMSG
	depends on RPMSG_QCOM_SMD || RPMSG_QCOM_SMD=n
	help
	  If you say yes to this option, support will be included for the
	  Resource Power Manager system found in the Qualcomm 8974 based
	  devices.

	  This is required to access many regulators, clocks and bus
	  frequencies controlled by the RPM on these devices.

	  Say M here if you want to include support for the Qualcomm RPM as a
	  module. This will build a module called "qcom-smd-rpm".

config QCOM_SMEM_STATE
	bool

config QCOM_SMP2P
	tristate "Qualcomm Shared Memory Point to Point support"
	depends on MAILBOX
	depends on QCOM_SMEM
	select QCOM_SMEM_STATE
	select IRQ_DOMAIN
	help
	  Say yes here to support the Qualcomm Shared Memory Point to Point
	  protocol.

config QCOM_SMSM
	tristate "Qualcomm Shared Memory State Machine"
	depends on QCOM_SMEM
	select QCOM_SMEM_STATE
	select IRQ_DOMAIN
	help
	  Say yes here to support the Qualcomm Shared Memory State Machine.
	  The state machine is represented by bits in shared memory.

config QCOM_SMP2P_SLEEPSTATE
	tristate "SMP2P Sleepstate notifier"
	depends on QCOM_SMP2P
	help
	  When this option is enabled, notifications are sent to remote procs
	  for the power state changes on the local processor. The notifications
	  are sent through the smp2p framework. This driver can also receive
	  notifications from the remote to prevent suspend on the local
	  processor.

config QCOM_SOCINFO
	tristate "Qualcomm socinfo driver"
	depends on QCOM_SMEM
	select SOC_BUS
	help
	 Say yes here to support the Qualcomm socinfo driver, providing
	 information about the SoC to user space.

config QCOM_SPM
	tristate "Qualcomm Subsystem Power Manager (SPM)"
	depends on ARCH_QCOM || COMPILE_TEST
	select QCOM_SCM
	help
	  Enable the support for the Qualcomm Subsystem Power Manager, used
	  to manage cores, L2 low power modes and to configure the internal
	  Adaptive Voltage Scaler parameters, where supported.

config QCOM_STATS
	tristate "Qualcomm Technologies, Inc. (QTI) Sleep stats driver"
	depends on (ARCH_QCOM && DEBUG_FS) || COMPILE_TEST
	depends on QCOM_SMEM
	depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n
	help
	  Qualcomm Technologies, Inc. (QTI) Sleep stats driver to read
	  the shared memory exported by the remote processor related to
	  various SoC level low power modes statistics and export to debugfs
	  interface.

config QCOM_WCNSS_CTRL
	tristate "Qualcomm WCNSS control driver"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on RPMSG
	help
	  Client driver for the WCNSS_CTRL SMD channel, used to download nv
	  firmware to a newly booted WCNSS chip.

config QCOM_APR
	tristate "Qualcomm APR/GPR Bus (Asynchronous/Generic Packet Router)"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on RPMSG
	depends on NET
	select QCOM_PDR_HELPERS
	help
	  Enable APR IPC protocol support between
	  application processor and QDSP6. APR is
	  used by audio driver to configure QDSP6
	  ASM, ADM and AFE modules.

config QCOM_ICC_BWMON
	tristate "QCOM Interconnect Bandwidth Monitor driver"
	depends on ARCH_QCOM || COMPILE_TEST
	select PM_OPP
	select REGMAP_MMIO
	help
	  Sets up driver monitoring bandwidth on various interconnects and
	  based on that voting for interconnect bandwidth, adjusting their
	  speed to current demand.
	  Current implementation brings support for BWMON v4, used for example
	  on SDM845 to measure bandwidth between CPU (gladiator_noc) and Last
	  Level Cache (memnoc).  Usage of this BWMON allows to remove some of
	  the fixed bandwidth votes from cpufreq (CPU nodes) thus achieve high
	  memory throughput even with lower CPU frequencies.

config QCOM_INLINE_CRYPTO_ENGINE
	tristate
	select QCOM_SCM

config QCOM_WDT_CORE
       tristate "Qualcomm Technologies, Inc. Watchdog Support"
       depends on ARCH_QCOM
       help
          This enables the watchdog framework for Qualcomm Technologies, Inc.
          devices. It causes a kernel panic if the watchdog times out. It allows
          for the detection of cpu hangs and deadlocks. It does not run during the
          bootup process, so it will not catch any early lockups. Enabling this
          only enables the framework, an individual Qualcomm Technologies, Inc.
          watchdog module must be loaded along with this for watchdog
          functionality.

config QCOM_FORCE_WDOG_BITE_ON_PANIC
       bool "QCOM force watchdog bite on panic"
       depends on QCOM_WDT_CORE
       help
         This forces a watchdog bite when the device restarts
         due to a kernel panic. On certain MSM SoCs,
         this provides additional debugging
         information.

config QCOM_WDOG_BITE_EARLY_PANIC
       bool "QCOM early panic watchdog bite"
       depends on QCOM_WDT_CORE && QCOM_FORCE_WDOG_BITE_ON_PANIC
       help
         This forces a watchdog bite early in panic sequence. On certain
         MSM SoCs, this provides us additional debugging information at the
         context of the crash. If this option is disabled, then bite occurs
         later in panic, which permits more of the restart sequence to run
         (e.g. more dmesg to flushed to console).

config QCOM_WATCHDOG_BARK_TIME
       depends on QCOM_WDT_CORE
       int "Qualcomm Technologies, Inc. Watchdog bark time in ms"
       default 11000
       range 11000 11000
       help
         The amount of time, in milliseconds, that should elapse after
         a watchdog timer reset before a bark interrupt is sent from the
         watchdog.

config QCOM_WATCHDOG_PET_TIME
       depends on QCOM_WDT_CORE
       int "Qualcomm Technologies, Inc. Watchdog pet time in ms"
       default 9360
       range 9360 9360
       help
         The amount of time, in milliseconds, that should elapse before
         a watchdog pet is initiated to reset the watchdog timer to 0.

config QCOM_WATCHDOG_IPI_PING
       depends on QCOM_WDT_CORE
       bool "Qualcomm Technologies, Inc. Watchdog ipi ping"
       default y
       help
         This boolean flag gives the watchdog driver the ability to send a
         keep-alive ping to other cpu's if it is set to 1. Otherwise, when
         it is set to 0 no keep alive pings will be sent.

config QCOM_SOC_DEBUG
       depends on RANDOMIZE_BASE
       bool "SOC Debug Module"
       help
	 This module will write kaslr address to imem to enable debug of
	 crashes which require loading of vmlinux and ramdumps. It also
	 keeps SoC watchdog device node enabled when Linux is booted in
	 hyp mode.

config QCOM_SECURE_BUFFER
	tristate "Helper functions for secure buffers through TZ"
	depends on QCOM_SCM
	help
	 Enable for targets that need to call into TZ to secure
	 memory buffers. This ensures that only the correct clients can
	 use this memory and no unauthorized access is made to the
	 buffer.

config QCOM_KVM_ENABLED
       bool "ENABLE KVM support"
       help
	 During the build process difference between Gunyah and KVM hypervisors
	 isn't necessary, but exception like watchdog and PIL loading demand
	 device tree adjustments based on the hypervisor.
	 To address this, the QCOM_KVM_ENABLED config is introduced since the
	 device tree cannot detect Kbuild configurations.

source "drivers/soc/qcom/mem_buf/Kconfig"
source "drivers/soc/qcom/smcinvoke/Kconfig"

config USB_F_QDSS
	tristate "QDSS driver"
	depends on USB_CONFIGFS
	help
	  QDSS is a usb function driver aimed for faster debug
	  functionality by merging interleaving traces and
	  application SW messaging and transferring it to the host machine
	  to which the device is connected.

config QCOM_RPROC_MINIDUMP
	tristate "QCOM Remoteproc Minidump Support"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on QCOM_SMEM
	help
	  Enablement of core Minidump feature is controlled from boot firmware
	  side, so if it is enabled from firmware, this config allow Linux to
	  query predefined Minidump segments associated with the remote processor
	  and check its validity and end up collecting the dump on remote processor
	  crash during its recovery.

config QCOM_MINIDUMP
	tristate "QCOM APSS Minidump driver"
	depends on ARCH_QCOM || COMPILE_TEST
	depends on QCOM_SMEM
	select PSTORE_RAM
	help
	  This configuration enables the Linux core infrastructure for the
	  Application Processor Subsystem (APSS) Minidump collection.
	  Specifically, it allows Linux client drivers to proactively register
	  their internal data structures and debug messages as part of the
	  APSS Minidump table. When the SoC (System on Chip) crashes, only
	  these selective regions will be dumped instead of the entire RAM dump.
	  This optimization saves a significant amount of time and storage space.

	  This has dependency on PSTORE RAM for collecting the ramoops region with
	  APSS Minidump.
endmenu
