Skip to content
Snippets Groups Projects
Commit d5edeca0 authored by Mike Tipton's avatar Mike Tipton
Browse files

interconnect: qcom: Add support for PERF_MODE on RPMh targets


Add support for QCOM_ICC_TAG_PERF_MODE on RPMh architectures. When
QCOM_ICC_TAG_PERF_MODE is specified using icc_set_tag(), each node in
the requested path will use latency-optimized settings if supported by
the node. The improved latency comes at the cost of higher power.

Change-Id: I83c52e5677f8842b4c17987053d566971b84086f
Signed-off-by: default avatarMike Tipton <mdtipton@codeaurora.org>
parent 906a40e5
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,7 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm, bool init)
size_t i, bucket;
u64 agg_avg[QCOM_ICC_NUM_BUCKETS] = {0};
u64 agg_peak[QCOM_ICC_NUM_BUCKETS] = {0};
bool perf_mode[QCOM_ICC_NUM_BUCKETS] = {0};
u64 temp;
for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) {
......@@ -78,6 +79,8 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm, bool init)
temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width,
node->buswidth);
agg_peak[bucket] = max(agg_peak[bucket], temp);
perf_mode[bucket] |= node->perf_mode[bucket];
}
temp = agg_avg[bucket] * bcm->vote_scale;
......@@ -89,6 +92,8 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm, bool init)
if (bcm->enable_mask && (bcm->vote_x[bucket] || bcm->vote_y[bucket])) {
bcm->vote_x[bucket] = 0;
bcm->vote_y[bucket] = bcm->enable_mask;
if (perf_mode[bucket])
bcm->vote_y[bucket] |= bcm->perf_mode_mask;
}
}
......
......@@ -28,6 +28,7 @@ void qcom_icc_pre_aggregate(struct icc_node *node)
for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) {
qn->sum_avg[i] = 0;
qn->max_peak[i] = 0;
qn->perf_mode[i] = false;
}
}
EXPORT_SYMBOL_GPL(qcom_icc_pre_aggregate);
......@@ -58,6 +59,8 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
if (tag & BIT(i)) {
qn->sum_avg[i] += avg_bw;
qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw);
if (tag & QCOM_ICC_TAG_PERF_MODE && (avg_bw || peak_bw))
qn->perf_mode[i] = true;
}
}
......
......@@ -62,6 +62,7 @@ struct bcm_db {
* @buswidth: width of the interconnect between a node and the bus
* @sum_avg: current sum aggregate value of all avg bw requests
* @max_peak: current max aggregate value of all peak bw requests
* @perf_mode: current OR aggregate value of all QCOM_ICC_TAG_PERF_MODE votes
* @bcms: list of bcms associated with this logical node
* @num_bcms: num of @bcms
*/
......@@ -74,6 +75,7 @@ struct qcom_icc_node {
u16 buswidth;
u64 sum_avg[QCOM_ICC_NUM_BUCKETS];
u64 max_peak[QCOM_ICC_NUM_BUCKETS];
bool perf_mode[QCOM_ICC_NUM_BUCKETS];
struct qcom_icc_bcm *bcms[MAX_BCM_PER_NODE];
size_t num_bcms;
struct regmap *regmap;
......@@ -91,6 +93,7 @@ struct qcom_icc_node {
* @vote_y: aggregated threshold values, represents peak_bw when @type is bw bcm
* @vote_scale: scaling factor for vote_x and vote_y
* @enable_mask: optional mask to send as vote instead of vote_x/vote_y
* @perf_mode_mask: mask to OR with enable_mask when QCOM_ICC_TAG_PERF_MODE is set
* @dirty: flag used to indicate whether the bcm needs to be committed
* @keepalive: flag used to indicate whether a keepalive is required
* @aux_data: auxiliary data used when calculating threshold values and
......@@ -108,6 +111,7 @@ struct qcom_icc_bcm {
u64 vote_y[QCOM_ICC_NUM_BUCKETS];
u64 vote_scale;
u32 enable_mask;
u32 perf_mode_mask;
bool dirty;
bool keepalive;
struct bcm_db aux_data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment