Merge "platform : msm-geni-se: fix voting unit for bus bandwidth"

This commit is contained in:
qctecmdr 2020-04-24 15:45:25 -07:00 • committed by Gerrit - the friendly Code Review server
commit 3a2d617606
10 changed files with 2239 additions and 438 deletions

View file

@ -50,7 +50,6 @@
#define SLV_ADDR_SHFT (9)
#define I2C_PACK_EN (BIT(0) | BIT(1))
#define I2C_CORE2X_VOTE (960)
#define GP_IRQ0 0
#define GP_IRQ1 1
#define GP_IRQ2 2

View file

@ -189,9 +189,6 @@ enum geni_i3c_err_code {
#define PACKING_BYTES_PW 4
#define XFER_TIMEOUT HZ
#define DFS_INDEX_MAX 7
#define I3C_CORE2X_VOTE (960)
#define DEFAULT_BUS_WIDTH (4)
#define DEFAULT_SE_CLK (19200000)
#define I3C_DDR_READ_CMD BIT(7)
#define I3C_ADDR_MASK 0x7f

View file

@ -76,11 +76,11 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm, bool init)
agg_peak[bucket] = max(agg_peak[bucket], temp);
}
temp = agg_avg[bucket] * 1000ULL;
temp = agg_avg[bucket] * bcm->vote_scale;
do_div(temp, le32_to_cpu(bcm->aux_data.unit));
bcm->vote_x[bucket] = temp;
temp = agg_peak[bucket] * 1000ULL;
temp = agg_peak[bucket] * bcm->vote_scale;
do_div(temp, le32_to_cpu(bcm->aux_data.unit));
bcm->vote_y[bucket] = temp;
}

View file

@ -150,6 +150,9 @@ int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
INIT_LIST_HEAD(&bcm->list);
INIT_LIST_HEAD(&bcm->ws_list);
if (!bcm->vote_scale)
bcm->vote_scale = 1000;
/*
* Link Qnodes to their respective BCMs
*/

View file

@ -89,6 +89,7 @@ struct qcom_icc_node {
* @addr: address offsets used when voting to RPMH
* @vote_x: aggregated threshold values, represents sum_bw when @type is bw bcm
* @vote_y: aggregated threshold values, represents peak_bw when @type is bw bcm
* @vote_scale: scaling factor for vote_x and vote_y
* @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
@ -104,6 +105,7 @@ struct qcom_icc_bcm {
u32 addr;
u64 vote_x[QCOM_ICC_NUM_BUCKETS];
u64 vote_y[QCOM_ICC_NUM_BUCKETS];
u64 vote_scale;
bool dirty;
bool keepalive;
struct bcm_db aux_data;

File diff suppressed because it is too large Load diff

View file

@ -29,8 +29,7 @@
#define GENI_SE_DMA_PTR_H(ptr) 0
#endif
/* Convert BCM threshold to actual frequency x 4 */
#define CONV_TO_BW(x) (x*20000*4)
#define CONV_TO_BW(x) (x*4)
#define NUM_LOG_PAGES 2
#define MAX_CLK_PERF_LEVEL 32
static unsigned long default_bus_bw_set[] = {0, 19200000, 50000000,

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*/
@ -83,7 +83,6 @@
#define TIMESTAMP_AFTER BIT(3)
#define POST_CMD_DELAY BIT(4)
#define SPI_CORE2X_VOTE (5000)
/* GSI CONFIG0 TRE Params */
/* Flags bit fields */
#define GSI_LOOPBACK_EN (BIT(0))

View file

@ -106,8 +106,6 @@
#define DEF_FIFO_DEPTH_WORDS (16)
#define DEF_TX_WM (2)
#define DEF_FIFO_WIDTH_BITS (32)
#define UART_CORE2X_VOTE (5000)
#define UART_CONSOLE_CORE2X_VOTE (960)
#define WAKEBYTE_TIMEOUT_MSEC (2000)
#define WAIT_XFER_MAX_ITER (2)

View file

@ -336,7 +336,6 @@ struct se_geni_rsc {
#define RX_GENI_GP_IRQ_EXT (GENMASK(13, 12))
#define DEFAULT_BUS_WIDTH (4)
#define DEFAULT_SE_CLK (19200000)
/* GSI TRE fields */
/* Packing fields */
@ -366,6 +365,13 @@ if (print) { \
} \
} while (0)
/* In KHz */
#define DEFAULT_SE_CLK 19200
#define I2C_CORE2X_VOTE 19200
#define I3C_CORE2X_VOTE 19200
#define SPI_CORE2X_VOTE 100000
#define UART_CORE2X_VOTE 100000
#define UART_CONSOLE_CORE2X_VOTE 19200
#if IS_ENABLED(CONFIG_MSM_GENI_SE)
/**