Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'qcom-drivers-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers

Qualcomm driver updates for 5.13

This introduces SC7280 and SM8350 support in the RPMH power-domain
driver, SC7280 support to the LLCC driver, SC7280 support tot he AOSS
QMP driver, cleanups to the RPMH driver and a few smaller fixes to the
SMEM, QMI and EBI2 drivers.

* tag 'qcom-drivers-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
bus: qcom: Put child node before return
dt-bindings: firmware: scm: Add sc7280 support
soc: qcom: rpmh-rsc: Fold WARN_ON() into if condition
soc: qcom: rpmh-rsc: Loop over fewer bits in irq handler
soc: qcom: rpmh-rsc: Remove tcs_is_free() API
soc: qcom: smem: Update max processor count
soc: qcom: aoss: Add AOSS QMP support for SC7280
dt-bindings: soc: qcom: aoss: Add SC7280 compatible
soc: qcom: llcc: Add configuration data for SC7280
dt-bindings: arm: msm: Add LLCC for SC7280
soc: qcom: Fix typos in the file qmi_encdec.c
soc: qcom: rpmhpd: Add sc7280 powerdomains
dt-bindings: power: rpmpd: Add sc7280 to rpmpd binding
soc: qcom: rpmhpd: Add SM8350 power domains
dt-bindings: power: Add rpm power domain bindings for SM8350

Link: https://lore.kernel.org/r/20210404164951.713045-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+137 -49
+1
Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
··· 22 22 compatible: 23 23 enum: 24 24 - qcom,sc7180-llcc 25 + - qcom,sc7280-llcc 25 26 - qcom,sdm845-llcc 26 27 - qcom,sm8150-llcc 27 28 - qcom,sm8250-llcc
+1
Documentation/devicetree/bindings/firmware/qcom,scm.txt
··· 20 20 * "qcom,scm-msm8996" 21 21 * "qcom,scm-msm8998" 22 22 * "qcom,scm-sc7180" 23 + * "qcom,scm-sc7280" 23 24 * "qcom,scm-sdm845" 24 25 * "qcom,scm-sm8150" 25 26 * "qcom,scm-sm8250"
+2
Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
··· 25 25 - qcom,qcs404-rpmpd 26 26 - qcom,sdm660-rpmpd 27 27 - qcom,sc7180-rpmhpd 28 + - qcom,sc7280-rpmhpd 28 29 - qcom,sdm845-rpmhpd 29 30 - qcom,sdx55-rpmhpd 30 31 - qcom,sm8150-rpmhpd 31 32 - qcom,sm8250-rpmhpd 33 + - qcom,sm8350-rpmhpd 32 34 33 35 '#power-domain-cells': 34 36 const: 1
+1
Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt
··· 17 17 Value type: <string> 18 18 Definition: must be one of: 19 19 "qcom,sc7180-aoss-qmp" 20 + "qcom,sc7280-aoss-qmp" 20 21 "qcom,sdm845-aoss-qmp" 21 22 "qcom,sm8150-aoss-qmp" 22 23 "qcom,sm8250-aoss-qmp"
+3 -1
drivers/bus/qcom-ebi2.c
··· 353 353 354 354 /* Figure out the chipselect */ 355 355 ret = of_property_read_u32(child, "reg", &csindex); 356 - if (ret) 356 + if (ret) { 357 + of_node_put(child); 357 358 return ret; 359 + } 358 360 359 361 if (csindex > 5) { 360 362 dev_err(dev,
+19
drivers/soc/qcom/llcc-qcom.c
··· 109 109 { LLCC_GPU, 12, 128, 1, 0, 0xf, 0x0, 0, 0, 0, 1, 0 }, 110 110 }; 111 111 112 + static const struct llcc_slice_config sc7280_data[] = { 113 + { LLCC_CPUSS, 1, 768, 1, 0, 0x3f, 0x0, 0, 0, 0, 1, 1, 0}, 114 + { LLCC_MDMHPGRW, 7, 512, 2, 1, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 115 + { LLCC_CMPT, 10, 768, 1, 1, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 116 + { LLCC_GPUHTW, 11, 256, 1, 1, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 117 + { LLCC_GPU, 12, 512, 1, 0, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 118 + { LLCC_MMUHWT, 13, 256, 1, 1, 0x3f, 0x0, 0, 0, 0, 1, 1, 0}, 119 + { LLCC_MDMPNG, 21, 768, 0, 1, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 120 + { LLCC_WLHW, 24, 256, 1, 1, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 121 + { LLCC_MODPE, 29, 64, 1, 1, 0x3f, 0x0, 0, 0, 0, 1, 0, 0}, 122 + }; 123 + 112 124 static const struct llcc_slice_config sdm845_data[] = { 113 125 { LLCC_CPUSS, 1, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 1 }, 114 126 { LLCC_VIDSC0, 2, 512, 2, 1, 0x0, 0x0f0, 0, 0, 1, 1, 0 }, ··· 188 176 static const struct qcom_llcc_config sc7180_cfg = { 189 177 .sct_data = sc7180_data, 190 178 .size = ARRAY_SIZE(sc7180_data), 179 + .need_llcc_cfg = true, 180 + }; 181 + 182 + static const struct qcom_llcc_config sc7280_cfg = { 183 + .sct_data = sc7280_data, 184 + .size = ARRAY_SIZE(sc7280_data), 191 185 .need_llcc_cfg = true, 192 186 }; 193 187 ··· 624 606 625 607 static const struct of_device_id qcom_llcc_of_match[] = { 626 608 { .compatible = "qcom,sc7180-llcc", .data = &sc7180_cfg }, 609 + { .compatible = "qcom,sc7280-llcc", .data = &sc7280_cfg }, 627 610 { .compatible = "qcom,sdm845-llcc", .data = &sdm845_cfg }, 628 611 { .compatible = "qcom,sm8150-llcc", .data = &sm8150_cfg }, 629 612 { .compatible = "qcom,sm8250-llcc", .data = &sm8250_cfg },
+1
drivers/soc/qcom/qcom_aoss.c
··· 597 597 598 598 static const struct of_device_id qmp_dt_match[] = { 599 599 { .compatible = "qcom,sc7180-aoss-qmp", }, 600 + { .compatible = "qcom,sc7280-aoss-qmp", }, 600 601 { .compatible = "qcom,sdm845-aoss-qmp", }, 601 602 { .compatible = "qcom,sm8150-aoss-qmp", }, 602 603 { .compatible = "qcom,sm8250-aoss-qmp", },
+4 -4
drivers/soc/qcom/qmi_encdec.c
··· 451 451 452 452 /** 453 453 * qmi_decode_struct_elem() - Decodes elements of struct data type 454 - * @ei_array: Struct info array descibing the struct element. 454 + * @ei_array: Struct info array describing the struct element. 455 455 * @buf_dst: Buffer to store the decoded element. 456 456 * @buf_src: Buffer containing the elements in QMI wire format. 457 457 * @elem_len: Number of elements to be decoded. 458 - * @tlv_len: Total size of the encoded inforation corresponding to 458 + * @tlv_len: Total size of the encoded information corresponding to 459 459 * this struct element. 460 460 * @dec_level: Depth of the nested structure from the main structure. 461 461 * ··· 499 499 500 500 /** 501 501 * qmi_decode_string_elem() - Decodes elements of string data type 502 - * @ei_array: Struct info array descibing the string element. 502 + * @ei_array: Struct info array describing the string element. 503 503 * @buf_dst: Buffer to store the decoded element. 504 504 * @buf_src: Buffer containing the elements in QMI wire format. 505 - * @tlv_len: Total size of the encoded inforation corresponding to 505 + * @tlv_len: Total size of the encoded information corresponding to 506 506 * this string element. 507 507 * @dec_level: Depth of the string element from the main structure. 508 508 *
+22 -43
drivers/soc/qcom/rpmh-rsc.c
··· 195 195 } 196 196 197 197 /** 198 - * tcs_is_free() - Return if a TCS is totally free. 199 - * @drv: The RSC controller. 200 - * @tcs_id: The global ID of this TCS. 201 - * 202 - * Returns true if nobody has claimed this TCS (by setting tcs_in_use). 203 - * 204 - * Context: Must be called with the drv->lock held. 205 - * 206 - * Return: true if the given TCS is free. 207 - */ 208 - static bool tcs_is_free(struct rsc_drv *drv, int tcs_id) 209 - { 210 - return !test_bit(tcs_id, drv->tcs_in_use); 211 - } 212 - 213 - /** 214 198 * tcs_invalidate() - Invalidate all TCSes of the given type (sleep or wake). 215 199 * @drv: The RSC controller. 216 200 * @type: SLEEP_TCS or WAKE_TCS ··· 392 408 393 409 irq_status = readl_relaxed(drv->tcs_base + RSC_DRV_IRQ_STATUS); 394 410 395 - for_each_set_bit(i, &irq_status, BITS_PER_LONG) { 411 + for_each_set_bit(i, &irq_status, BITS_PER_TYPE(u32)) { 396 412 req = get_req_from_tcs(drv, i); 397 - if (!req) { 398 - WARN_ON(1); 413 + if (WARN_ON(!req)) 399 414 goto skip; 400 - } 401 415 402 416 err = 0; 403 417 for (j = 0; j < req->num_cmds; j++) { ··· 502 520 * 503 521 * Return: 0 if nothing in flight or -EBUSY if we should try again later. 504 522 * The caller must re-enable interrupts between tries since that's 505 - * the only way tcs_is_free() will ever return true and the only way 523 + * the only way tcs_in_use will ever be updated and the only way 506 524 * RSC_DRV_CMD_ENABLE will ever be cleared. 507 525 */ 508 526 static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs, ··· 510 528 { 511 529 unsigned long curr_enabled; 512 530 u32 addr; 513 - int i, j, k; 514 - int tcs_id = tcs->offset; 531 + int j, k; 532 + int i = tcs->offset; 515 533 516 - for (i = 0; i < tcs->num_tcs; i++, tcs_id++) { 517 - if (tcs_is_free(drv, tcs_id)) 518 - continue; 519 - 520 - curr_enabled = read_tcs_reg(drv, RSC_DRV_CMD_ENABLE, tcs_id); 534 + for_each_set_bit_from(i, drv->tcs_in_use, tcs->offset + tcs->num_tcs) { 535 + curr_enabled = read_tcs_reg(drv, RSC_DRV_CMD_ENABLE, i); 521 536 522 537 for_each_set_bit(j, &curr_enabled, MAX_CMDS_PER_TCS) { 523 - addr = read_tcs_cmd(drv, RSC_DRV_CMD_ADDR, tcs_id, j); 538 + addr = read_tcs_cmd(drv, RSC_DRV_CMD_ADDR, i, j); 524 539 for (k = 0; k < msg->num_cmds; k++) { 525 540 if (addr == msg->cmds[k].addr) 526 541 return -EBUSY; ··· 535 556 * 536 557 * Must be called with the drv->lock held since that protects tcs_in_use. 537 558 * 538 - * Return: The first tcs that's free. 559 + * Return: The first tcs that's free or -EBUSY if all in use. 539 560 */ 540 561 static int find_free_tcs(struct tcs_group *tcs) 541 562 { 542 - int i; 563 + const struct rsc_drv *drv = tcs->drv; 564 + unsigned long i; 565 + unsigned long max = tcs->offset + tcs->num_tcs; 543 566 544 - for (i = 0; i < tcs->num_tcs; i++) { 545 - if (tcs_is_free(tcs->drv, tcs->offset + i)) 546 - return tcs->offset + i; 547 - } 567 + i = find_next_zero_bit(drv->tcs_in_use, max, tcs->offset); 568 + if (i >= max) 569 + return -EBUSY; 548 570 549 - return -EBUSY; 571 + return i; 550 572 } 551 573 552 574 /** ··· 734 754 */ 735 755 static bool rpmh_rsc_ctrlr_is_busy(struct rsc_drv *drv) 736 756 { 737 - int m; 738 - struct tcs_group *tcs = &drv->tcs[ACTIVE_TCS]; 757 + unsigned long set; 758 + const struct tcs_group *tcs = &drv->tcs[ACTIVE_TCS]; 759 + unsigned long max; 739 760 740 761 /* 741 762 * If we made an active request on a RSC that does not have a ··· 747 766 if (!tcs->num_tcs) 748 767 tcs = &drv->tcs[WAKE_TCS]; 749 768 750 - for (m = tcs->offset; m < tcs->offset + tcs->num_tcs; m++) { 751 - if (!tcs_is_free(drv, m)) 752 - return true; 753 - } 769 + max = tcs->offset + tcs->num_tcs; 770 + set = find_next_bit(drv->tcs_in_use, max, tcs->offset); 754 771 755 - return false; 772 + return set < max; 756 773 } 757 774 758 775 /**
+56
drivers/soc/qcom/rpmhpd.c
··· 200 200 .num_pds = ARRAY_SIZE(sm8250_rpmhpds), 201 201 }; 202 202 203 + /* SM8350 Power domains */ 204 + static struct rpmhpd sm8350_mxc_ao; 205 + static struct rpmhpd sm8350_mxc = { 206 + .pd = { .name = "mxc", }, 207 + .peer = &sm8150_mmcx_ao, 208 + .res_name = "mxc.lvl", 209 + }; 210 + 211 + static struct rpmhpd sm8350_mxc_ao = { 212 + .pd = { .name = "mxc_ao", }, 213 + .active_only = true, 214 + .peer = &sm8350_mxc, 215 + .res_name = "mxc.lvl", 216 + }; 217 + 218 + static struct rpmhpd *sm8350_rpmhpds[] = { 219 + [SM8350_CX] = &sdm845_cx, 220 + [SM8350_CX_AO] = &sdm845_cx_ao, 221 + [SM8350_EBI] = &sdm845_ebi, 222 + [SM8350_GFX] = &sdm845_gfx, 223 + [SM8350_LCX] = &sdm845_lcx, 224 + [SM8350_LMX] = &sdm845_lmx, 225 + [SM8350_MMCX] = &sm8150_mmcx, 226 + [SM8350_MMCX_AO] = &sm8150_mmcx_ao, 227 + [SM8350_MX] = &sdm845_mx, 228 + [SM8350_MX_AO] = &sdm845_mx_ao, 229 + [SM8350_MXC] = &sm8350_mxc, 230 + [SM8350_MXC_AO] = &sm8350_mxc_ao, 231 + [SM8350_MSS] = &sdm845_mss, 232 + }; 233 + 234 + static const struct rpmhpd_desc sm8350_desc = { 235 + .rpmhpds = sm8350_rpmhpds, 236 + .num_pds = ARRAY_SIZE(sm8350_rpmhpds), 237 + }; 238 + 203 239 /* SC7180 RPMH powerdomains */ 204 240 static struct rpmhpd *sc7180_rpmhpds[] = { 205 241 [SC7180_CX] = &sdm845_cx, ··· 253 217 .num_pds = ARRAY_SIZE(sc7180_rpmhpds), 254 218 }; 255 219 220 + /* SC7280 RPMH powerdomains */ 221 + static struct rpmhpd *sc7280_rpmhpds[] = { 222 + [SC7280_CX] = &sdm845_cx, 223 + [SC7280_CX_AO] = &sdm845_cx_ao, 224 + [SC7280_EBI] = &sdm845_ebi, 225 + [SC7280_GFX] = &sdm845_gfx, 226 + [SC7280_MX] = &sdm845_mx, 227 + [SC7280_MX_AO] = &sdm845_mx_ao, 228 + [SC7280_LMX] = &sdm845_lmx, 229 + [SC7280_LCX] = &sdm845_lcx, 230 + [SC7280_MSS] = &sdm845_mss, 231 + }; 232 + 233 + static const struct rpmhpd_desc sc7280_desc = { 234 + .rpmhpds = sc7280_rpmhpds, 235 + .num_pds = ARRAY_SIZE(sc7280_rpmhpds), 236 + }; 237 + 256 238 static const struct of_device_id rpmhpd_match_table[] = { 257 239 { .compatible = "qcom,sc7180-rpmhpd", .data = &sc7180_desc }, 240 + { .compatible = "qcom,sc7280-rpmhpd", .data = &sc7280_desc }, 258 241 { .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc }, 259 242 { .compatible = "qcom,sdx55-rpmhpd", .data = &sdx55_desc}, 260 243 { .compatible = "qcom,sm8150-rpmhpd", .data = &sm8150_desc }, 261 244 { .compatible = "qcom,sm8250-rpmhpd", .data = &sm8250_desc }, 245 + { .compatible = "qcom,sm8350-rpmhpd", .data = &sm8350_desc }, 262 246 { } 263 247 }; 264 248 MODULE_DEVICE_TABLE(of, rpmhpd_match_table);
+1 -1
drivers/soc/qcom/smem.c
··· 84 84 #define SMEM_GLOBAL_HOST 0xfffe 85 85 86 86 /* Max number of processors/hosts in a system */ 87 - #define SMEM_HOST_COUNT 11 87 + #define SMEM_HOST_COUNT 14 88 88 89 89 /** 90 90 * struct smem_proc_comm - proc_comm communication struct (legacy)
+26
include/dt-bindings/power/qcom-rpmpd.h
··· 45 45 #define SM8250_MX 8 46 46 #define SM8250_MX_AO 9 47 47 48 + /* SM8350 Power Domain Indexes */ 49 + #define SM8350_CX 0 50 + #define SM8350_CX_AO 1 51 + #define SM8350_EBI 2 52 + #define SM8350_GFX 3 53 + #define SM8350_LCX 4 54 + #define SM8350_LMX 5 55 + #define SM8350_MMCX 6 56 + #define SM8350_MMCX_AO 7 57 + #define SM8350_MX 8 58 + #define SM8350_MX_AO 9 59 + #define SM8350_MXC 10 60 + #define SM8350_MXC_AO 11 61 + #define SM8350_MSS 12 62 + 48 63 /* SC7180 Power Domain Indexes */ 49 64 #define SC7180_CX 0 50 65 #define SC7180_CX_AO 1 ··· 69 54 #define SC7180_LMX 5 70 55 #define SC7180_LCX 6 71 56 #define SC7180_MSS 7 57 + 58 + /* SC7280 Power Domain Indexes */ 59 + #define SC7280_CX 0 60 + #define SC7280_CX_AO 1 61 + #define SC7280_EBI 2 62 + #define SC7280_GFX 3 63 + #define SC7280_MX 4 64 + #define SC7280_MX_AO 5 65 + #define SC7280_LMX 6 66 + #define SC7280_LCX 7 67 + #define SC7280_MSS 8 72 68 73 69 /* SDM845 Power Domain performance levels */ 74 70 #define RPMH_REGULATOR_LEVEL_RETENTION 16