Skip to content

Commit a97d8ff

Browse files
committed
Merge tag 'qcom-drivers-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers
Qualcomm driver updates for v5.11 This adds support for the core power domains on MSM8916, MSM8939, SDM660 and SDX55. It adds SM8150 support to the last-level cache controller driver and it makes it possible to build the Command DB and RPMh drivers as modules. It also contains a slew of smaller cleanups, style and bug fixes throughout the various drivers. * tag 'qcom-drivers-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (39 commits) soc: qcom: rpmhpd: Add SDX55 power domains dt-bindings: power: Add rpm power domain bindings for sdx55 soc: qcom: rpmh: Use __fill_rpmh_msg API during rpmh_write() samples: qmi: Constify static qmi ops soc: qcom: pdr: Constify static qmi structs soc: qcom: initialize local variable soc: qcom: socinfo: add soc ids for msm8953 variants soc: qcom: geni: Remove "iova" check soc: qcom: llcc: Add configuration data for SM8150 dt-bindings: msm: Add LLCC for SM8150 soc: qcom: rpmh: Fix possible doc-rot in rpmh_write()'s header soc: qcom: kryo-l2-accessors: Fix misnaming of 'val' soc: qcom: rpmhpd: Provide some missing struct member descriptions soc: qcom: llcc-qcom: Fix expected kernel-doc formatting soc: qcom: smp2p: Remove unused struct attribute provide another soc: qcom: wcnss_ctrl: Demote non-conformant struct header and fix function headers soc: qcom: smsm: Fix some kernel-doc formatting and naming problems soc: qcom: smem: Fix formatting and missing documentation issues soc: qcom: qcom-geni-se: Fix misnamed function parameter 'rx_rfr' soc: qcom: qcom_aoss: Add missing description for 'cooling_devs' ... Link: https://lore.kernel.org/r/20201130190142.345246-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 00c543f + 9c45662 commit a97d8ff

23 files changed

Lines changed: 345 additions & 99 deletions

File tree

‎Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ properties:
2323
enum:
2424
- qcom,sc7180-llcc
2525
- qcom,sdm845-llcc
26+
- qcom,sm8150-llcc
2627

2728
reg:
2829
items:

‎Documentation/devicetree/bindings/power/qcom,rpmpd.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ description:
1616
properties:
1717
compatible:
1818
enum:
19+
- qcom,msm8916-rpmpd
20+
- qcom,msm8939-rpmpd
1921
- qcom,msm8976-rpmpd
2022
- qcom,msm8996-rpmpd
2123
- qcom,msm8998-rpmpd
2224
- qcom,qcs404-rpmpd
25+
- qcom,sdm660-rpmpd
2326
- qcom,sc7180-rpmhpd
2427
- qcom,sdm845-rpmhpd
28+
- qcom,sdx55-rpmhpd
2529
- qcom,sm8150-rpmhpd
2630
- qcom,sm8250-rpmhpd
2731

‎drivers/i2c/busses/i2c-qcom-geni.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,14 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
366366
geni_se_select_mode(se, GENI_SE_FIFO);
367367

368368
writel_relaxed(len, se->base + SE_I2C_RX_TRANS_LEN);
369+
geni_se_setup_m_cmd(se, I2C_READ, m_param);
369370

370371
if (dma_buf && geni_se_rx_dma_prep(se, dma_buf, len, &rx_dma)) {
371372
geni_se_select_mode(se, GENI_SE_FIFO);
372373
i2c_put_dma_safe_msg_buf(dma_buf, msg, false);
373374
dma_buf = NULL;
374375
}
375376

376-
geni_se_setup_m_cmd(se, I2C_READ, m_param);
377-
378377
time_left = wait_for_completion_timeout(&gi2c->done, XFER_TIMEOUT);
379378
if (!time_left)
380379
geni_i2c_abort_xfer(gi2c);
@@ -408,15 +407,14 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
408407
geni_se_select_mode(se, GENI_SE_FIFO);
409408

410409
writel_relaxed(len, se->base + SE_I2C_TX_TRANS_LEN);
410+
geni_se_setup_m_cmd(se, I2C_WRITE, m_param);
411411

412412
if (dma_buf && geni_se_tx_dma_prep(se, dma_buf, len, &tx_dma)) {
413413
geni_se_select_mode(se, GENI_SE_FIFO);
414414
i2c_put_dma_safe_msg_buf(dma_buf, msg, false);
415415
dma_buf = NULL;
416416
}
417417

418-
geni_se_setup_m_cmd(se, I2C_WRITE, m_param);
419-
420418
if (!dma_buf) /* Get FIFO IRQ */
421419
writel_relaxed(1, se->base + SE_GENI_TX_WATERMARK_REG);
422420

‎drivers/soc/qcom/Kconfig‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ config QCOM_AOSS_QMP
1717
Subsystem (AOSS) using Qualcomm Messaging Protocol (QMP).
1818

1919
config QCOM_COMMAND_DB
20-
bool "Qualcomm Command DB"
20+
tristate "Qualcomm Command DB"
2121
depends on ARCH_QCOM || COMPILE_TEST
2222
depends on OF_RESERVED_MEM
2323
help
@@ -108,8 +108,9 @@ config QCOM_RMTFS_MEM
108108
Say y here if you intend to boot the modem remoteproc.
109109

110110
config QCOM_RPMH
111-
bool "Qualcomm RPM-Hardened (RPMH) Communication"
111+
tristate "Qualcomm RPM-Hardened (RPMH) Communication"
112112
depends on ARCH_QCOM || COMPILE_TEST
113+
depends on (QCOM_COMMAND_DB || !QCOM_COMMAND_DB)
113114
help
114115
Support for communication with the hardened-RPM blocks in
115116
Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an

‎drivers/soc/qcom/cmd-db.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */
2+
/* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. */
33

44
#include <linux/debugfs.h>
55
#include <linux/kernel.h>
6+
#include <linux/module.h>
67
#include <linux/of.h>
78
#include <linux/of_address.h>
89
#include <linux/of_reserved_mem.h>
@@ -340,12 +341,14 @@ static const struct of_device_id cmd_db_match_table[] = {
340341
{ .compatible = "qcom,cmd-db" },
341342
{ }
342343
};
344+
MODULE_DEVICE_TABLE(of, cmd_db_match_table);
343345

344346
static struct platform_driver cmd_db_dev_driver = {
345347
.probe = cmd_db_dev_probe,
346348
.driver = {
347349
.name = "cmd-db",
348350
.of_match_table = cmd_db_match_table,
351+
.suppress_bind_attrs = true,
349352
},
350353
};
351354

@@ -354,3 +357,6 @@ static int __init cmd_db_device_init(void)
354357
return platform_driver_register(&cmd_db_dev_driver);
355358
}
356359
arch_initcall(cmd_db_device_init);
360+
361+
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Command DB Driver");
362+
MODULE_LICENSE("GPL v2");

‎drivers/soc/qcom/kryo-l2-accessors.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static DEFINE_RAW_SPINLOCK(l2_access_lock);
1616
/**
1717
* kryo_l2_set_indirect_reg() - write value to an L2 register
1818
* @reg: Address of L2 register.
19-
* @value: Value to be written to register.
19+
* @val: Value to be written to register.
2020
*
2121
* Use architecturally required barriers for ordering between system register
2222
* accesses, and system registers with respect to device memory

‎drivers/soc/qcom/llcc-qcom.c‎

Lines changed: 106 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@
4545
#define LLCC_TRP_ATTR0_CFGn(n) (0x21000 + SZ_8 * n)
4646
#define LLCC_TRP_ATTR1_CFGn(n) (0x21004 + SZ_8 * n)
4747

48+
#define LLCC_TRP_SCID_DIS_CAP_ALLOC 0x21f00
49+
#define LLCC_TRP_PCB_ACT 0x21f04
50+
4851
#define BANK_OFFSET_STRIDE 0x80000
4952

5053
/**
51-
* llcc_slice_config - Data associated with the llcc slice
54+
* struct llcc_slice_config - Data associated with the llcc slice
5255
* @usecase_id: Unique id for the client's use case
5356
* @slice_id: llcc slice id for each client
5457
* @max_cap: The maximum capacity of the cache slice provided in KB
@@ -89,6 +92,7 @@ struct llcc_slice_config {
8992
struct qcom_llcc_config {
9093
const struct llcc_slice_config *sct_data;
9194
int size;
95+
bool need_llcc_cfg;
9296
};
9397

9498
static const struct llcc_slice_config sc7180_data[] = {
@@ -119,14 +123,45 @@ static const struct llcc_slice_config sdm845_data[] = {
119123
{ LLCC_AUDHW, 22, 1024, 1, 1, 0xffc, 0x2, 0, 0, 1, 1, 0 },
120124
};
121125

126+
static const struct llcc_slice_config sm8150_data[] = {
127+
{ LLCC_CPUSS, 1, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 1 },
128+
{ LLCC_VIDSC0, 2, 512, 2, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
129+
{ LLCC_VIDSC1, 3, 512, 2, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
130+
{ LLCC_AUDIO, 6, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
131+
{ LLCC_MDMHPGRW, 7, 3072, 1, 0, 0xFF, 0xF00, 0, 0, 0, 1, 0 },
132+
{ LLCC_MDM, 8, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
133+
{ LLCC_MODHW, 9, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
134+
{ LLCC_CMPT, 10, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
135+
{ LLCC_GPUHTW , 11, 512, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
136+
{ LLCC_GPU, 12, 2560, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
137+
{ LLCC_MMUHWT, 13, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 1 },
138+
{ LLCC_CMPTDMA, 15, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
139+
{ LLCC_DISP, 16, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
140+
{ LLCC_MDMHPFX, 20, 1024, 2, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
141+
{ LLCC_MDMHPFX, 21, 1024, 0, 1, 0xF, 0x0, 0, 0, 0, 1, 0 },
142+
{ LLCC_AUDHW, 22, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
143+
{ LLCC_NPU, 23, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
144+
{ LLCC_WLHW, 24, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 1, 0 },
145+
{ LLCC_MODPE, 29, 256, 1, 1, 0xF, 0x0, 0, 0, 0, 1, 0 },
146+
{ LLCC_APTCM, 30, 256, 3, 1, 0x0, 0x1, 1, 0, 0, 1, 0 },
147+
{ LLCC_WRCACHE, 31, 128, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0 },
148+
};
149+
122150
static const struct qcom_llcc_config sc7180_cfg = {
123151
.sct_data = sc7180_data,
124152
.size = ARRAY_SIZE(sc7180_data),
153+
.need_llcc_cfg = true,
125154
};
126155

127156
static const struct qcom_llcc_config sdm845_cfg = {
128157
.sct_data = sdm845_data,
129158
.size = ARRAY_SIZE(sdm845_data),
159+
.need_llcc_cfg = false,
160+
};
161+
162+
static const struct qcom_llcc_config sm8150_cfg = {
163+
.sct_data = sm8150_data,
164+
.size = ARRAY_SIZE(sm8150_data),
130165
};
131166

132167
static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER;
@@ -318,62 +353,91 @@ size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
318353
}
319354
EXPORT_SYMBOL_GPL(llcc_get_slice_size);
320355

321-
static int qcom_llcc_cfg_program(struct platform_device *pdev)
356+
static int _qcom_llcc_cfg_program(const struct llcc_slice_config *config,
357+
const struct qcom_llcc_config *cfg)
322358
{
323-
int i;
359+
int ret;
324360
u32 attr1_cfg;
325361
u32 attr0_cfg;
326362
u32 attr1_val;
327363
u32 attr0_val;
328364
u32 max_cap_cacheline;
365+
struct llcc_slice_desc desc;
366+
367+
attr1_val = config->cache_mode;
368+
attr1_val |= config->probe_target_ways << ATTR1_PROBE_TARGET_WAYS_SHIFT;
369+
attr1_val |= config->fixed_size << ATTR1_FIXED_SIZE_SHIFT;
370+
attr1_val |= config->priority << ATTR1_PRIORITY_SHIFT;
371+
372+
max_cap_cacheline = MAX_CAP_TO_BYTES(config->max_cap);
373+
374+
/*
375+
* LLCC instances can vary for each target.
376+
* The SW writes to broadcast register which gets propagated
377+
* to each llcc instance (llcc0,.. llccN).
378+
* Since the size of the memory is divided equally amongst the
379+
* llcc instances, we need to configure the max cap accordingly.
380+
*/
381+
max_cap_cacheline = max_cap_cacheline / drv_data->num_banks;
382+
max_cap_cacheline >>= CACHE_LINE_SIZE_SHIFT;
383+
attr1_val |= max_cap_cacheline << ATTR1_MAX_CAP_SHIFT;
384+
385+
attr1_cfg = LLCC_TRP_ATTR1_CFGn(config->slice_id);
386+
387+
ret = regmap_write(drv_data->bcast_regmap, attr1_cfg, attr1_val);
388+
if (ret)
389+
return ret;
390+
391+
attr0_val = config->res_ways & ATTR0_RES_WAYS_MASK;
392+
attr0_val |= config->bonus_ways << ATTR0_BONUS_WAYS_SHIFT;
393+
394+
attr0_cfg = LLCC_TRP_ATTR0_CFGn(config->slice_id);
395+
396+
ret = regmap_write(drv_data->bcast_regmap, attr0_cfg, attr0_val);
397+
if (ret)
398+
return ret;
399+
400+
if (cfg->need_llcc_cfg) {
401+
u32 disable_cap_alloc, retain_pc;
402+
403+
disable_cap_alloc = config->dis_cap_alloc << config->slice_id;
404+
ret = regmap_write(drv_data->bcast_regmap,
405+
LLCC_TRP_SCID_DIS_CAP_ALLOC, disable_cap_alloc);
406+
if (ret)
407+
return ret;
408+
409+
retain_pc = config->retain_on_pc << config->slice_id;
410+
ret = regmap_write(drv_data->bcast_regmap,
411+
LLCC_TRP_PCB_ACT, retain_pc);
412+
if (ret)
413+
return ret;
414+
}
415+
416+
if (config->activate_on_init) {
417+
desc.slice_id = config->slice_id;
418+
ret = llcc_slice_activate(&desc);
419+
}
420+
421+
return ret;
422+
}
423+
424+
static int qcom_llcc_cfg_program(struct platform_device *pdev,
425+
const struct qcom_llcc_config *cfg)
426+
{
427+
int i;
329428
u32 sz;
330429
int ret = 0;
331430
const struct llcc_slice_config *llcc_table;
332-
struct llcc_slice_desc desc;
333431

334432
sz = drv_data->cfg_size;
335433
llcc_table = drv_data->cfg;
336434

337435
for (i = 0; i < sz; i++) {
338-
attr1_cfg = LLCC_TRP_ATTR1_CFGn(llcc_table[i].slice_id);
339-
attr0_cfg = LLCC_TRP_ATTR0_CFGn(llcc_table[i].slice_id);
340-
341-
attr1_val = llcc_table[i].cache_mode;
342-
attr1_val |= llcc_table[i].probe_target_ways <<
343-
ATTR1_PROBE_TARGET_WAYS_SHIFT;
344-
attr1_val |= llcc_table[i].fixed_size <<
345-
ATTR1_FIXED_SIZE_SHIFT;
346-
attr1_val |= llcc_table[i].priority <<
347-
ATTR1_PRIORITY_SHIFT;
348-
349-
max_cap_cacheline = MAX_CAP_TO_BYTES(llcc_table[i].max_cap);
350-
351-
/* LLCC instances can vary for each target.
352-
* The SW writes to broadcast register which gets propagated
353-
* to each llcc instace (llcc0,.. llccN).
354-
* Since the size of the memory is divided equally amongst the
355-
* llcc instances, we need to configure the max cap accordingly.
356-
*/
357-
max_cap_cacheline = max_cap_cacheline / drv_data->num_banks;
358-
max_cap_cacheline >>= CACHE_LINE_SIZE_SHIFT;
359-
attr1_val |= max_cap_cacheline << ATTR1_MAX_CAP_SHIFT;
360-
361-
attr0_val = llcc_table[i].res_ways & ATTR0_RES_WAYS_MASK;
362-
attr0_val |= llcc_table[i].bonus_ways << ATTR0_BONUS_WAYS_SHIFT;
363-
364-
ret = regmap_write(drv_data->bcast_regmap, attr1_cfg,
365-
attr1_val);
436+
ret = _qcom_llcc_cfg_program(&llcc_table[i], cfg);
366437
if (ret)
367438
return ret;
368-
ret = regmap_write(drv_data->bcast_regmap, attr0_cfg,
369-
attr0_val);
370-
if (ret)
371-
return ret;
372-
if (llcc_table[i].activate_on_init) {
373-
desc.slice_id = llcc_table[i].slice_id;
374-
ret = llcc_slice_activate(&desc);
375-
}
376439
}
440+
377441
return ret;
378442
}
379443

@@ -472,7 +536,7 @@ static int qcom_llcc_probe(struct platform_device *pdev)
472536
mutex_init(&drv_data->lock);
473537
platform_set_drvdata(pdev, drv_data);
474538

475-
ret = qcom_llcc_cfg_program(pdev);
539+
ret = qcom_llcc_cfg_program(pdev, cfg);
476540
if (ret)
477541
goto err;
478542

@@ -494,6 +558,7 @@ static int qcom_llcc_probe(struct platform_device *pdev)
494558
static const struct of_device_id qcom_llcc_of_match[] = {
495559
{ .compatible = "qcom,sc7180-llcc", .data = &sc7180_cfg },
496560
{ .compatible = "qcom,sdm845-llcc", .data = &sdm845_cfg },
561+
{ .compatible = "qcom,sm8150-llcc", .data = &sm8150_cfg },
497562
{ }
498563
};
499564

‎drivers/soc/qcom/pdr_interface.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void pdr_locator_del_server(struct qmi_handle *qmi,
110110
pdr->locator_addr.sq_port = 0;
111111
}
112112

113-
static struct qmi_ops pdr_locator_ops = {
113+
static const struct qmi_ops pdr_locator_ops = {
114114
.new_server = pdr_locator_new_server,
115115
.del_server = pdr_locator_del_server,
116116
};
@@ -238,7 +238,7 @@ static void pdr_notifier_del_server(struct qmi_handle *qmi,
238238
mutex_unlock(&pdr->list_lock);
239239
}
240240

241-
static struct qmi_ops pdr_notifier_ops = {
241+
static const struct qmi_ops pdr_notifier_ops = {
242242
.new_server = pdr_notifier_new_server,
243243
.del_server = pdr_notifier_del_server,
244244
};
@@ -343,7 +343,7 @@ static void pdr_indication_cb(struct qmi_handle *qmi,
343343
queue_work(pdr->indack_wq, &pdr->indack_work);
344344
}
345345

346-
static struct qmi_msg_handler qmi_indication_handler[] = {
346+
static const struct qmi_msg_handler qmi_indication_handler[] = {
347347
{
348348
.type = QMI_INDICATION,
349349
.msg_id = SERVREG_STATE_UPDATED_IND_ID,
@@ -569,7 +569,7 @@ EXPORT_SYMBOL(pdr_add_lookup);
569569
int pdr_restart_pd(struct pdr_handle *pdr, struct pdr_service *pds)
570570
{
571571
struct servreg_restart_pd_resp resp;
572-
struct servreg_restart_pd_req req;
572+
struct servreg_restart_pd_req req = { 0 };
573573
struct sockaddr_qrtr addr;
574574
struct pdr_service *tmp;
575575
struct qmi_txn txn;

0 commit comments

Comments
 (0)