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

Commit 855f7692 authored by Girish Mahadevan's avatar Girish Mahadevan
Browse files

msm: msm_bus: Add NoC limiter and regulator mode for adhoc driver



Add the ability to switch NoC masters to be in limiter and regulator mode
for the adhoc bus driver. These modes offer differing degrees of
throttling the io traffic from NoC master ports if needed.

Change-Id: If2f868430ebccff1a11aad7d90fa5b352ea2c876
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent ce52cb49
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -85,6 +85,11 @@ qcom,prio-rd: Read priority for a BIMC bus master (Can be 0/1/2)
qcom,prio-wr:		Write priority for a BIMC bus master (Can be 0/1/2)
qcom,prio0:		Priority low signal for a NoC bus master
			(Can be 0/1/2).
qcom,reg-prio1:		Regulator mode Priority high signal for a NoC bus master if the master port is in
			regulator QoS mode
qcom,reg-prio0:		Regulator Priority low signal for a NoC bus master if the master port is in
			regulator Qos mode.
			(Can be 0/1/2).
qcom,prio1:		Priority high signal for a NoC bus master
qcom,bw_buffer:		Optional parameter in KBytes used to specify a buffer value that should be added to
			the voted bandwidth value to figure out the limiting bandwidth for a master port.
+4 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ struct msm_bus_noc_ops {
			uint32_t qos_delta, uint32_t qos_freq);
	int (*limit_mport)(struct msm_bus_node_device_type *dev,
			void __iomem *qos_base, uint32_t qos_off,
			uint32_t qos_delta, uint32_t qos_freq, bool enable_lim,
			uint32_t qos_delta, uint32_t qos_freq, int enable_lim,
			uint64_t lim_bw);
	bool (*update_bw_reg)(int mode);
};
@@ -71,6 +71,8 @@ struct qos_params_type {
	unsigned int prio_wr;
	unsigned int prio1;
	unsigned int prio0;
	unsigned int reg_prio1;
	unsigned int reg_prio0;
	unsigned int gp;
	unsigned int thmp;
	unsigned int ws;
@@ -119,7 +121,7 @@ struct msm_bus_node_device_type {
};

int msm_bus_enable_limiter(struct msm_bus_node_device_type *nodedev,
				bool throttle_en, uint64_t lim_bw);
				int throttle_en, uint64_t lim_bw);
int msm_bus_update_clks(struct msm_bus_node_device_type *nodedev,
	int ctx, int **dirty_nodes, int *num_dirty);
int msm_bus_commit_data(int *dirty_nodes, int ctx, int num_dirty);
+2 −4
Original line number Diff line number Diff line
@@ -473,7 +473,6 @@ static int msm_bus_apply_rules(struct list_head *list, bool after_clk_commit)
	struct device *dev = NULL;
	struct msm_bus_node_device_type *dev_info = NULL;
	int ret = 0;
	bool throttle_en = false;

	list_for_each_entry(rule, list, link) {
		if (!rule)
@@ -492,12 +491,11 @@ static int msm_bus_apply_rules(struct list_head *list, bool after_clk_commit)
		}
		dev_info = dev->platform_data;

		throttle_en = ((rule->throttle == THROTTLE_ON) ? true : false);
		ret = msm_bus_enable_limiter(dev_info, throttle_en,
		ret = msm_bus_enable_limiter(dev_info, rule->throttle,
							rule->lim_bw);
		if (ret)
			MSM_BUS_ERR("Failed to set limiter for %d", rule->id);
		trace_bus_rules_apply(rule->id, rule->lim_bw, throttle_en);
		trace_bus_rules_apply(rule->id, rule->lim_bw, rule->throttle);
	}

	return ret;
+2 −2
Original line number Diff line number Diff line
@@ -1906,7 +1906,7 @@ static int msm_bus_bimc_port_unhalt(uint32_t haltid, uint8_t mport)
static int msm_bus_bimc_limit_mport(struct msm_bus_node_device_type *info,
				void __iomem *qos_base, uint32_t qos_off,
				uint32_t qos_delta, uint32_t qos_freq,
				bool enable_lim, u64 lim_bw)
				int enable_lim, u64 lim_bw)
{
	int mode;
	int i;
@@ -1916,7 +1916,7 @@ static int msm_bus_bimc_limit_mport(struct msm_bus_node_device_type *info,
		return 0;
	}

	if (enable_lim && lim_bw) {
	if ((enable_lim == THROTTLE_ON) && lim_bw) {
		mode =  BIMC_QOS_MODE_LIMITER;

		if (!info->node_info->lim_bw) {
+3 −1
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ exit_enable_qos_clk:
}

int msm_bus_enable_limiter(struct msm_bus_node_device_type *node_dev,
				bool enable, uint64_t lim_bw)
				int enable, uint64_t lim_bw)
{
	int ret = 0;
	struct msm_bus_node_device_type *bus_node_dev;
@@ -886,6 +886,8 @@ static int msm_bus_copy_node_info(struct msm_bus_node_device_type *pdata,
	node_info->qos_params.mode = pdata_node_info->qos_params.mode;
	node_info->qos_params.prio1 = pdata_node_info->qos_params.prio1;
	node_info->qos_params.prio0 = pdata_node_info->qos_params.prio0;
	node_info->qos_params.reg_prio1 = pdata_node_info->qos_params.reg_prio1;
	node_info->qos_params.reg_prio0 = pdata_node_info->qos_params.reg_prio0;
	node_info->qos_params.prio_lvl = pdata_node_info->qos_params.prio_lvl;
	node_info->qos_params.prio_rd = pdata_node_info->qos_params.prio_rd;
	node_info->qos_params.prio_wr = pdata_node_info->qos_params.prio_wr;
Loading