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

Commit 03016331 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu
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: I1530e031dcd12aab3d85d8fe49fb618f875d5f6a
Acked-by: default avatarSreekanth Gande <sgande@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 27dee6a5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -732,6 +732,17 @@ config QMP_DEBUGFS_CLIENT
	help
	  This options enables a driver which allows clients to send messages
	  to Alway On processor using QMP transport.

config QCOM_CDSP_RM
	bool "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.

endmenu

config QCOM_HYP_CORE_CTL
+1 −0
Original line number Diff line number Diff line
@@ -81,3 +81,4 @@ obj-$(CONFIG_QCOM_MEM_OFFLINE) += mem-offline.o
obj-$(CONFIG_QMP_DEBUGFS_CLIENT) += qmp-debugfs-client.o
obj-$(CONFIG_QCOM_HYP_CORE_CTL) += hyp_core_ctl.o
obj-$(CONFIG_MSM_PERFORMANCE) += msm_performance.o
obj-$(CONFIG_QCOM_CDSP_RM) += cdsprm.o
+1127 −0

File added.

Preview size limit exceeded, changes collapsed.

+42 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2018-2019, 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 Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2018-2019, 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