Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07b0a87f authored by Bavyasritha Alahari's avatar Bavyasritha Alahari Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: add CDSP request manager



CDSPRM module implements a RPMSG interface to communicate with CDSP
while providing a way for CDSP to vote for CPU L3 clock, CPU QoS to
benefit CDSP applications performance. The module also implements
an interface with NPU for Cx i-peak limit management and registers
cooling devices for CDSP and HVX thermal mitigation.

Change-Id: I5aa592cb8de19367f7361e1f31d1077ceba386df
Acked-by: default avatarSreekanth Gande <sgande@qti.qualcomm.com>
Signed-off-by: default avatarBavyasritha Alahari <alahari@codeaurora.org>
parent 885277a7
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -725,6 +725,16 @@ config QCOM_SOC_SLEEP_STATS
	  various SoC level low power modes statistics and export to sysfs
	  various SoC level low power modes statistics and export to sysfs
	  interface.
	  interface.


config QCOM_CDSP_RM
	tristate "CDSP request manager"
	depends on QCOM_GLINK
	help
	  This driver serves CDSP requests for CPU L3 clock and CPU QoS thus
	  improving CDSP performance. Using this driver, CDSP can set appropriate
	  CPU L3 clock for improving IO-Coherent throughput and opt for QoS mode
	  to improve RPC latency. The driver also registers cooling devices for
	  CDSP subsystem and implements Cx ipeak limit management.

config QCOM_WATCHDOG
config QCOM_WATCHDOG
	tristate "Qualcomm Watchdog Support"
	tristate "Qualcomm Watchdog Support"
	depends on ARCH_QCOM
	depends on ARCH_QCOM
+1 −0
Original line number Original line Diff line number Diff line
@@ -70,6 +70,7 @@ obj-$(CONFIG_QTI_RPM_STATS_LOG) += rpmh_master_stat.o
obj-$(CONFIG_QPNP_PBS) += qpnp-pbs.o
obj-$(CONFIG_QPNP_PBS) += qpnp-pbs.o
obj-$(CONFIG_QCOM_WATCHDOG) += qcom_watchdog.o
obj-$(CONFIG_QCOM_WATCHDOG) += qcom_watchdog.o
obj-$(CONFIG_MSM_SPCOM) += spcom.o
obj-$(CONFIG_MSM_SPCOM) += spcom.o
obj-$(CONFIG_QCOM_CDSP_RM) += cdsprm.o
obj-$(CONFIG_QCOM_FSA4480_I2C) += fsa4480-i2c.o
obj-$(CONFIG_QCOM_FSA4480_I2C) += fsa4480-i2c.o
obj-$(CONFIG_QCOM_EUD) += eud.o
obj-$(CONFIG_QCOM_EUD) += eud.o
obj-$(CONFIG_QCOM_GUESTVM) += guestvm_loader.o
obj-$(CONFIG_QCOM_GUESTVM) += guestvm_loader.o
+1244 −0

File added.

Preview size limit exceeded, changes collapsed.

+42 −0
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */

/*
 * This header is for cdspl3 devfreq governor in drivers/devfreq.
 */

#ifndef __QCOM_CDSPRM_H__
#define __QCOM_CDSPRM_H__

/**
 * struct cdsprm_l3 - register with set L3 clock frequency method
 * @set_l3_freq:    Sets desired L3 clock frequency in kilo-hertz.
 *                  cdsprm module would call this method to set L3
 *                  clock frequency as requested by CDSP subsystem.
 */
struct cdsprm_l3 {
	int (*set_l3_freq)(unsigned int freq_khz);
};

/**
 * cdsprm_register_cdspl3gov() - Register a method to set L3 clock
 *                               frequency
 * @arg: cdsprm_l3 structure with set L3 clock frequency method
 *
 * Note: To be called from cdspl3 governor only. Called when the governor is
 *       started.
 */
void cdsprm_register_cdspl3gov(struct cdsprm_l3 *arg);

/**
 * cdsprm_unregister_cdspl3gov() - Unregister the method to set L3 clock
 *                                 frequency
 *
 * Note: To be called from cdspl3 governor only. Called when the governor is
 *       stopped
 */
void cdsprm_unregister_cdspl3gov(void);

#endif
+83 −0
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */

#ifndef __QCOM_CDSPRM_LIMITS_H__
#define __QCOM_CDSPRM_LIMITS_H__

enum cdsprm_npu_corner {
	CDSPRM_NPU_CLK_OFF = 0,
	CDSPRM_NPU_MIN_SVS,
	CDSPRM_NPU_LOW_SVS,
	CDSPRM_NPU_SVS,
	CDSPRM_NPU_SVS_L1,
	CDSPRM_NPU_NOM,
	CDSPRM_NPU_NOM_L1,
	CDSPRM_NPU_TURBO,
	CDSPRM_NPU_TURBO_L1,
};

struct cdsprm_npu_limit_cbs {
	int (*set_corner_limit)(enum cdsprm_npu_corner);
};

enum cdsprm_compute_priority {
	CDSPRM_COMPUTE_HVX_MAX = 1,
	CDSPRM_COMPUTE_AIX_MAX = 2,
	CDSPRM_COMPUTE_HVX_OVER_AIX = 3,
	CDSPRM_COMPUTE_AIX_OVER_HVX = 4,
	CDSPRM_COMPUTE_BALANCED = 5,
};

int cdsprm_compute_core_set_priority(enum cdsprm_compute_priority);

/* For NPU driver */

/**
 * cdsprm_cxlimit_npu_limit_register() - Register NPU corner limit method with
 * cdspprm cxlimit driver.
 * @arg: cdsprm_npu_limit_cbs structure with set_corner_limit method defined
 *
 * Note: To be called from NPU driver only.
 */
int cdsprm_cxlimit_npu_limit_register(const struct cdsprm_npu_limit_cbs *arg);
/**
 * cdsprm_cxlimit_npu_limit_deregister() - deregister NPU corner limit
 * notification from cdsprm cxlimit driver.
 *
 * Note: To be called from NPU driver only.
 */
int cdsprm_cxlimit_npu_limit_deregister(void);
/**
 * cdsprm_cxlimit_npu_activity_notify() - Notify NPU activity status to
 * cdsprm cxlimit driver.
 * @arg: b_enabled 0 - After NPU activity stop
 *                 1 - Before NPU activity start
 *
 * Note: To be called from NPU driver only.
 */
int cdsprm_cxlimit_npu_activity_notify(unsigned int b_enabled);
/**
 * cdsprm_cxlimit_npu_corner_notify() - Notify cdsprm cxlimit driver of NPU
 * corner request.
 * @arg: enum cdsprm_npu_corner - NPU corner value.
 *            CDSPRM_NPU_CLK_OFF for clock off notification.
 *
 * Note: To be called from NPU driver only.
 */
enum cdsprm_npu_corner cdsprm_cxlimit_npu_corner_notify(enum cdsprm_npu_corner);

/* For Camera driver */

/**
 * cdsprm_cxlimit_camera_activity_notify() - Notify cdsprm cxlimit driver of
 * Camera activity
 * @arg: b_enabled 0 - After Camera activity stop
 *                 1 - Before Camera activity start
 *
 * Note: To be called from Camera driver only.
 */
int cdsprm_cxlimit_camera_activity_notify(unsigned int b_enabled);

#endif