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.12' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers

Qualcomm driver updates for 5.12

The socinfo driver gains support for dumping information about the platform's
PMICs, as well as new definitions for a number of platforms. The LLCC driver
gains SM8250 support, AOSS QMP gains SM8350 support and the RPMPD driver gains
support for MSM8994 power domains. In addition to this it contains a few minor
fixes in the ocmem, rpmh and llcc drivers.

* tag 'qcom-drivers-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
soc: qcom: ocmem: don't return NULL in of_get_ocmem
soc: qcom: socinfo: Remove unwanted le32_to_cpu()
soc: qcom: aoss: Add SM8350 compatible
drivers: soc: qcom: rpmpd: Add msm8994 RPM Power Domains
soc: qcom: socinfo: Fix an off by one in qcom_show_pmic_model()
soc: qcom: socinfo: Fix off-by-one array index bounds check
soc: qcom: socinfo: Add MDM9607 IDs
soc: qcom: socinfo: Add SoC IDs for APQ/MSM8998
soc: qcom: socinfo: Add SoC IDs for 630 family
soc: qcom: socinfo: Open read access to all for debugfs
soc: qcom: socinfo: add info from PMIC models array
soc: qcom: socinfo: add several PMIC IDs
soc: qcom: socinfo: add qrb5165 SoC ID
soc: qcom: rpmh: Remove serialization of TCS commands
soc: qcom: smem: use %*ph to print small buffer
dt-bindings: soc: qcom: convert qcom,smem bindings to yaml
drivers: qcom: rpmh-rsc: Do not read back the register write on trigger
soc: qcom: llcc-qcom: Add support for SM8250 SoC
soc: qcom: llcc-qcom: Extract major hardware version
dt-bindings: msm: Add LLCC for SM8250

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

+273 -100
+1
Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
··· 24 24 - qcom,sc7180-llcc 25 25 - qcom,sdm845-llcc 26 26 - qcom,sm8150-llcc 27 + - qcom,sm8250-llcc 27 28 28 29 reg: 29 30 items:
+1
Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
··· 19 19 - qcom,msm8916-rpmpd 20 20 - qcom,msm8939-rpmpd 21 21 - qcom,msm8976-rpmpd 22 + - qcom,msm8994-rpmpd 22 23 - qcom,msm8996-rpmpd 23 24 - qcom,msm8998-rpmpd 24 25 - qcom,qcs404-rpmpd
+1
Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt
··· 20 20 "qcom,sdm845-aoss-qmp" 21 21 "qcom,sm8150-aoss-qmp" 22 22 "qcom,sm8250-aoss-qmp" 23 + "qcom,sm8350-aoss-qmp" 23 24 24 25 - reg: 25 26 Usage: required
-57
Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
··· 1 - Qualcomm Shared Memory Manager binding 2 - 3 - This binding describes the Qualcomm Shared Memory Manager, used to share data 4 - between various subsystems and OSes in Qualcomm platforms. 5 - 6 - - compatible: 7 - Usage: required 8 - Value type: <stringlist> 9 - Definition: must be: 10 - "qcom,smem" 11 - 12 - - memory-region: 13 - Usage: required 14 - Value type: <prop-encoded-array> 15 - Definition: handle to memory reservation for main SMEM memory region. 16 - 17 - - qcom,rpm-msg-ram: 18 - Usage: required 19 - Value type: <prop-encoded-array> 20 - Definition: handle to RPM message memory resource 21 - 22 - - hwlocks: 23 - Usage: required 24 - Value type: <prop-encoded-array> 25 - Definition: reference to a hwspinlock used to protect allocations from 26 - the shared memory 27 - 28 - = EXAMPLE 29 - The following example shows the SMEM setup for MSM8974, with a main SMEM region 30 - at 0xfa00000 and the RPM message ram at 0xfc428000: 31 - 32 - reserved-memory { 33 - #address-cells = <1>; 34 - #size-cells = <1>; 35 - ranges; 36 - 37 - smem_region: smem@fa00000 { 38 - reg = <0xfa00000 0x200000>; 39 - no-map; 40 - }; 41 - }; 42 - 43 - smem@fa00000 { 44 - compatible = "qcom,smem"; 45 - 46 - memory-region = <&smem_region>; 47 - qcom,rpm-msg-ram = <&rpm_msg_ram>; 48 - 49 - hwlocks = <&tcsr_mutex 3>; 50 - }; 51 - 52 - soc { 53 - rpm_msg_ram: memory@fc428000 { 54 - compatible = "qcom,rpm-msg-ram"; 55 - reg = <0xfc428000 0x4000>; 56 - }; 57 - };
+72
Documentation/devicetree/bindings/soc/qcom/qcom,smem.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/soc/qcom/qcom,smem.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: Qualcomm Shared Memory Manager binding 8 + 9 + maintainers: 10 + - Andy Gross <agross@kernel.org> 11 + - Bjorn Andersson <bjorn.andersson@linaro.org> 12 + 13 + description: | 14 + This binding describes the Qualcomm Shared Memory Manager, used to share data 15 + between various subsystems and OSes in Qualcomm platforms. 16 + 17 + properties: 18 + compatible: 19 + const: qcom,smem 20 + 21 + memory-region: 22 + maxItems: 1 23 + description: handle to memory reservation for main SMEM memory region. 24 + 25 + hwlocks: 26 + maxItems: 1 27 + 28 + qcom,rpm-msg-ram: 29 + $ref: /schemas/types.yaml#/definitions/phandle 30 + description: handle to RPM message memory resource 31 + 32 + required: 33 + - compatible 34 + - memory-region 35 + - hwlocks 36 + 37 + additionalProperties: false 38 + 39 + examples: 40 + - | 41 + reserved-memory { 42 + #address-cells = <1>; 43 + #size-cells = <1>; 44 + ranges; 45 + 46 + smem_region: smem@fa00000 { 47 + reg = <0xfa00000 0x200000>; 48 + no-map; 49 + }; 50 + }; 51 + 52 + smem { 53 + compatible = "qcom,smem"; 54 + 55 + memory-region = <&smem_region>; 56 + qcom,rpm-msg-ram = <&rpm_msg_ram>; 57 + 58 + hwlocks = <&tcsr_mutex 3>; 59 + }; 60 + 61 + soc { 62 + #address-cells = <1>; 63 + #size-cells = <1>; 64 + ranges; 65 + 66 + rpm_msg_ram: sram@fc428000 { 67 + compatible = "qcom,rpm-msg-ram"; 68 + reg = <0xfc428000 0x4000>; 69 + }; 70 + }; 71 + 72 + ...
+50
drivers/soc/qcom/llcc-qcom.c
··· 4 4 * 5 5 */ 6 6 7 + #include <linux/bitfield.h> 7 8 #include <linux/bitmap.h> 8 9 #include <linux/bitops.h> 9 10 #include <linux/device.h> ··· 36 35 37 36 #define CACHE_LINE_SIZE_SHIFT 6 38 37 38 + #define LLCC_COMMON_HW_INFO 0x00030000 39 + #define LLCC_MAJOR_VERSION_MASK GENMASK(31, 24) 40 + 39 41 #define LLCC_COMMON_STATUS0 0x0003000c 40 42 #define LLCC_LB_CNT_MASK GENMASK(31, 28) 41 43 #define LLCC_LB_CNT_SHIFT 28 ··· 51 47 52 48 #define LLCC_TRP_SCID_DIS_CAP_ALLOC 0x21f00 53 49 #define LLCC_TRP_PCB_ACT 0x21f04 50 + #define LLCC_TRP_WRSC_EN 0x21f20 54 51 55 52 #define BANK_OFFSET_STRIDE 0x80000 56 53 ··· 78 73 * then the ways assigned to this client are not flushed on power 79 74 * collapse. 80 75 * @activate_on_init: Activate the slice immediately after it is programmed 76 + * @write_scid_en: Bit enables write cache support for a given scid. 81 77 */ 82 78 struct llcc_slice_config { 83 79 u32 usecase_id; ··· 93 87 bool dis_cap_alloc; 94 88 bool retain_on_pc; 95 89 bool activate_on_init; 90 + bool write_scid_en; 96 91 }; 97 92 98 93 struct qcom_llcc_config { ··· 154 147 { LLCC_WRCACHE, 31, 128, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0 }, 155 148 }; 156 149 150 + static const struct llcc_slice_config sm8250_data[] = { 151 + { LLCC_CPUSS, 1, 3072, 1, 1, 0xfff, 0x0, 0, 0, 0, 1, 1, 0 }, 152 + { LLCC_VIDSC0, 2, 512, 3, 1, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 153 + { LLCC_AUDIO, 6, 1024, 1, 0, 0xfff, 0x0, 0, 0, 0, 0, 0, 0 }, 154 + { LLCC_CMPT, 10, 1024, 1, 0, 0xfff, 0x0, 0, 0, 0, 0, 0, 0 }, 155 + { LLCC_GPUHTW, 11, 1024, 1, 1, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 156 + { LLCC_GPU, 12, 1024, 1, 0, 0xfff, 0x0, 0, 0, 0, 1, 0, 1 }, 157 + { LLCC_MMUHWT, 13, 1024, 1, 1, 0xfff, 0x0, 0, 0, 0, 0, 1, 0 }, 158 + { LLCC_CMPTDMA, 15, 1024, 1, 0, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 159 + { LLCC_DISP, 16, 3072, 1, 1, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 160 + { LLCC_VIDFW, 17, 512, 1, 0, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 161 + { LLCC_AUDHW, 22, 1024, 1, 1, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 162 + { LLCC_NPU, 23, 3072, 1, 1, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 163 + { LLCC_WLHW, 24, 1024, 1, 0, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 164 + { LLCC_CVP, 28, 256, 3, 1, 0xfff, 0x0, 0, 0, 0, 1, 0, 0 }, 165 + { LLCC_APTCM, 30, 128, 3, 0, 0x0, 0x3, 1, 0, 0, 1, 0, 0 }, 166 + { LLCC_WRCACHE, 31, 256, 1, 1, 0xfff, 0x0, 0, 0, 0, 0, 1, 0 }, 167 + }; 168 + 157 169 static const struct qcom_llcc_config sc7180_cfg = { 158 170 .sct_data = sc7180_data, 159 171 .size = ARRAY_SIZE(sc7180_data), ··· 188 162 static const struct qcom_llcc_config sm8150_cfg = { 189 163 .sct_data = sm8150_data, 190 164 .size = ARRAY_SIZE(sm8150_data), 165 + }; 166 + 167 + static const struct qcom_llcc_config sm8250_cfg = { 168 + .sct_data = sm8250_data, 169 + .size = ARRAY_SIZE(sm8250_data), 191 170 }; 192 171 193 172 static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER; ··· 444 413 return ret; 445 414 } 446 415 416 + if (drv_data->major_version == 2) { 417 + u32 wren; 418 + 419 + wren = config->write_scid_en << config->slice_id; 420 + ret = regmap_update_bits(drv_data->bcast_regmap, LLCC_TRP_WRSC_EN, 421 + BIT(config->slice_id), wren); 422 + if (ret) 423 + return ret; 424 + } 425 + 447 426 if (config->activate_on_init) { 448 427 desc.slice_id = config->slice_id; 449 428 ret = llcc_slice_activate(&desc); ··· 517 476 const struct qcom_llcc_config *cfg; 518 477 const struct llcc_slice_config *llcc_cfg; 519 478 u32 sz; 479 + u32 version; 520 480 521 481 drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL); 522 482 if (!drv_data) { ··· 537 495 ret = PTR_ERR(drv_data->bcast_regmap); 538 496 goto err; 539 497 } 498 + 499 + /* Extract major version of the IP */ 500 + ret = regmap_read(drv_data->bcast_regmap, LLCC_COMMON_HW_INFO, &version); 501 + if (ret) 502 + goto err; 503 + 504 + drv_data->major_version = FIELD_GET(LLCC_MAJOR_VERSION_MASK, version); 540 505 541 506 ret = regmap_read(drv_data->regmap, LLCC_COMMON_STATUS0, 542 507 &num_banks); ··· 608 559 { .compatible = "qcom,sc7180-llcc", .data = &sc7180_cfg }, 609 560 { .compatible = "qcom,sdm845-llcc", .data = &sdm845_cfg }, 610 561 { .compatible = "qcom,sm8150-llcc", .data = &sm8150_cfg }, 562 + { .compatible = "qcom,sm8250-llcc", .data = &sm8250_cfg }, 611 563 { } 612 564 }; 613 565
+7 -1
drivers/soc/qcom/ocmem.c
··· 189 189 { 190 190 struct platform_device *pdev; 191 191 struct device_node *devnode; 192 + struct ocmem *ocmem; 192 193 193 194 devnode = of_parse_phandle(dev->of_node, "sram", 0); 194 195 if (!devnode || !devnode->parent) { ··· 203 202 return ERR_PTR(-EPROBE_DEFER); 204 203 } 205 204 206 - return platform_get_drvdata(pdev); 205 + ocmem = platform_get_drvdata(pdev); 206 + if (!ocmem) { 207 + dev_err(dev, "Cannot get ocmem\n"); 208 + return ERR_PTR(-ENODEV); 209 + } 210 + return ocmem; 207 211 } 208 212 EXPORT_SYMBOL(of_get_ocmem); 209 213
+1
drivers/soc/qcom/qcom_aoss.c
··· 600 600 { .compatible = "qcom,sdm845-aoss-qmp", }, 601 601 { .compatible = "qcom,sm8150-aoss-qmp", }, 602 602 { .compatible = "qcom,sm8250-aoss-qmp", }, 603 + { .compatible = "qcom,sm8350-aoss-qmp", }, 603 604 {} 604 605 }; 605 606 MODULE_DEVICE_TABLE(of, qmp_dt_match);
+10 -14
drivers/soc/qcom/rpmh-rsc.c
··· 231 231 if (bitmap_empty(tcs->slots, MAX_TCS_SLOTS)) 232 232 return; 233 233 234 - for (m = tcs->offset; m < tcs->offset + tcs->num_tcs; m++) { 234 + for (m = tcs->offset; m < tcs->offset + tcs->num_tcs; m++) 235 235 write_tcs_reg_sync(drv, RSC_DRV_CMD_ENABLE, m, 0); 236 - write_tcs_reg_sync(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, m, 0); 237 - } 236 + 238 237 bitmap_zero(tcs->slots, MAX_TCS_SLOTS); 239 238 } 240 239 ··· 363 364 enable = TCS_AMC_MODE_ENABLE; 364 365 write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); 365 366 enable |= TCS_AMC_MODE_TRIGGER; 366 - write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); 367 + write_tcs_reg(drv, RSC_DRV_CONTROL, tcs_id, enable); 367 368 } 368 369 } 369 370 ··· 442 443 skip: 443 444 /* Reclaim the TCS */ 444 445 write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, i, 0); 445 - write_tcs_reg(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, i, 0); 446 446 writel_relaxed(BIT(i), drv->tcs_base + RSC_DRV_IRQ_CLEAR); 447 447 spin_lock(&drv->lock); 448 448 clear_bit(i, drv->tcs_in_use); ··· 474 476 static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id, 475 477 const struct tcs_request *msg) 476 478 { 477 - u32 msgid, cmd_msgid; 479 + u32 msgid; 480 + u32 cmd_msgid = CMD_MSGID_LEN | CMD_MSGID_WRITE; 478 481 u32 cmd_enable = 0; 479 - u32 cmd_complete; 480 482 struct tcs_cmd *cmd; 481 483 int i, j; 482 484 483 - cmd_msgid = CMD_MSGID_LEN; 485 + /* Convert all commands to RR when the request has wait_for_compl set */ 484 486 cmd_msgid |= msg->wait_for_compl ? CMD_MSGID_RESP_REQ : 0; 485 - cmd_msgid |= CMD_MSGID_WRITE; 486 - 487 - cmd_complete = read_tcs_reg(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, tcs_id); 488 487 489 488 for (i = 0, j = cmd_id; i < msg->num_cmds; i++, j++) { 490 489 cmd = &msg->cmds[i]; 491 490 cmd_enable |= BIT(j); 492 - cmd_complete |= cmd->wait << j; 493 491 msgid = cmd_msgid; 492 + /* 493 + * Additionally, if the cmd->wait is set, make the command 494 + * response reqd even if the overall request was fire-n-forget. 495 + */ 494 496 msgid |= cmd->wait ? CMD_MSGID_RESP_REQ : 0; 495 497 496 498 write_tcs_cmd(drv, RSC_DRV_CMD_MSGID, tcs_id, j, msgid); ··· 499 501 trace_rpmh_send_msg(drv, tcs_id, j, msgid, cmd); 500 502 } 501 503 502 - write_tcs_reg(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, tcs_id, cmd_complete); 503 504 cmd_enable |= read_tcs_reg(drv, RSC_DRV_CMD_ENABLE, tcs_id); 504 505 write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, tcs_id, cmd_enable); 505 506 } ··· 649 652 * cleaned from rpmh_flush() by invoking rpmh_rsc_invalidate() 650 653 */ 651 654 write_tcs_reg_sync(drv, RSC_DRV_CMD_ENABLE, tcs_id, 0); 652 - write_tcs_reg_sync(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, tcs_id, 0); 653 655 enable_tcs_irq(drv, tcs_id, true); 654 656 } 655 657 spin_unlock_irqrestore(&drv->lock, flags);
+28
drivers/soc/qcom/rpmpd.c
··· 21 21 * RPMPD_X is X encoded as a little-endian, lower-case, ASCII string */ 22 22 #define RPMPD_SMPA 0x61706d73 23 23 #define RPMPD_LDOA 0x616f646c 24 + #define RPMPD_SMPB 0x62706d73 25 + #define RPMPD_LDOB 0x626f646c 24 26 #define RPMPD_RWCX 0x78637772 25 27 #define RPMPD_RWMX 0x786d7772 26 28 #define RPMPD_RWLC 0x636c7772 ··· 186 184 .max_state = RPM_SMD_LEVEL_TURBO_HIGH, 187 185 }; 188 186 187 + /* msm8994 RPM Power domains */ 188 + DEFINE_RPMPD_PAIR(msm8994, vddcx, vddcx_ao, SMPA, CORNER, 1); 189 + DEFINE_RPMPD_PAIR(msm8994, vddmx, vddmx_ao, SMPA, CORNER, 2); 190 + /* Attention! *Some* 8994 boards with pm8004 may use SMPC here! */ 191 + DEFINE_RPMPD_CORNER(msm8994, vddgfx, SMPB, 2); 192 + 193 + DEFINE_RPMPD_VFC(msm8994, vddcx_vfc, SMPA, 1); 194 + DEFINE_RPMPD_VFC(msm8994, vddgfx_vfc, SMPB, 2); 195 + 196 + static struct rpmpd *msm8994_rpmpds[] = { 197 + [MSM8994_VDDCX] = &msm8994_vddcx, 198 + [MSM8994_VDDCX_AO] = &msm8994_vddcx_ao, 199 + [MSM8994_VDDCX_VFC] = &msm8994_vddcx_vfc, 200 + [MSM8994_VDDMX] = &msm8994_vddmx, 201 + [MSM8994_VDDMX_AO] = &msm8994_vddmx_ao, 202 + [MSM8994_VDDGFX] = &msm8994_vddgfx, 203 + [MSM8994_VDDGFX_VFC] = &msm8994_vddgfx_vfc, 204 + }; 205 + 206 + static const struct rpmpd_desc msm8994_desc = { 207 + .rpmpds = msm8994_rpmpds, 208 + .num_pds = ARRAY_SIZE(msm8994_rpmpds), 209 + .max_state = MAX_CORNER_RPMPD_STATE, 210 + }; 211 + 189 212 /* msm8996 RPM Power domains */ 190 213 DEFINE_RPMPD_PAIR(msm8996, vddcx, vddcx_ao, SMPA, CORNER, 1); 191 214 DEFINE_RPMPD_PAIR(msm8996, vddmx, vddmx_ao, SMPA, CORNER, 2); ··· 329 302 { .compatible = "qcom,msm8916-rpmpd", .data = &msm8916_desc }, 330 303 { .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc }, 331 304 { .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc }, 305 + { .compatible = "qcom,msm8994-rpmpd", .data = &msm8994_desc }, 332 306 { .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc }, 333 307 { .compatible = "qcom,msm8998-rpmpd", .data = &msm8998_desc }, 334 308 { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc },
+1 -3
drivers/soc/qcom/smem.c
··· 732 732 header = smem->regions[0].virt_base + le32_to_cpu(entry->offset); 733 733 734 734 if (memcmp(header->magic, SMEM_PART_MAGIC, sizeof(header->magic))) { 735 - dev_err(smem->dev, "bad partition magic %02x %02x %02x %02x\n", 736 - header->magic[0], header->magic[1], 737 - header->magic[2], header->magic[3]); 735 + dev_err(smem->dev, "bad partition magic %4ph\n", header->magic); 738 736 return NULL; 739 737 } 740 738
+81 -24
drivers/soc/qcom/socinfo.c
··· 15 15 #include <linux/sys_soc.h> 16 16 #include <linux/types.h> 17 17 18 + #include <asm/unaligned.h> 19 + 18 20 /* 19 21 * SoC version type with major number in the upper 16 bits and minor 20 22 * number in the lower 16 bits. ··· 85 83 [23] = "PM8038", 86 84 [24] = "PM8922", 87 85 [25] = "PM8917", 86 + [30] = "PM8150", 87 + [31] = "PM8150L", 88 + [32] = "PM8150B", 89 + [33] = "PMK8002", 90 + [36] = "PM8009", 88 91 }; 89 92 #endif /* CONFIG_DEBUG_FS */ 90 93 ··· 224 217 { 250, "MSM8616" }, 225 218 { 251, "MSM8992" }, 226 219 { 253, "APQ8094" }, 220 + { 290, "MDM9607" }, 227 221 { 291, "APQ8096" }, 222 + { 292, "MSM8998" }, 228 223 { 293, "MSM8953" }, 224 + { 296, "MDM8207" }, 225 + { 297, "MDM9207" }, 226 + { 298, "MDM9307" }, 227 + { 299, "MDM9628" }, 229 228 { 304, "APQ8053" }, 230 229 { 305, "MSM8996SG" }, 231 230 { 310, "MSM8996AU" }, 232 231 { 311, "APQ8096AU" }, 233 232 { 312, "APQ8096SG" }, 233 + { 317, "SDM660" }, 234 234 { 318, "SDM630" }, 235 + { 319, "APQ8098" }, 235 236 { 321, "SDM845" }, 237 + { 322, "MDM9206" }, 238 + { 324, "SDA660" }, 239 + { 325, "SDM658" }, 240 + { 326, "SDA658" }, 241 + { 327, "SDA630" }, 236 242 { 338, "SDM450" }, 237 243 { 341, "SDA845" }, 244 + { 345, "SDM636" }, 245 + { 346, "SDA636" }, 238 246 { 349, "SDM632" }, 239 247 { 350, "SDA632" }, 240 248 { 351, "SDA450" }, 241 249 { 356, "SM8250" }, 242 250 { 402, "IPQ6018" }, 243 251 { 425, "SC7180" }, 252 + { 455, "QRB5165" }, 244 253 }; 245 254 246 255 static const char *socinfo_machine(struct device *dev, unsigned int id) ··· 287 264 } 288 265 289 266 #define DEBUGFS_ADD(info, name) \ 290 - debugfs_create_file(__stringify(name), 0400, \ 267 + debugfs_create_file(__stringify(name), 0444, \ 291 268 qcom_socinfo->dbg_root, \ 292 269 info, &qcom_ ##name## _ops) 293 270 ··· 309 286 if (model < 0) 310 287 return -EINVAL; 311 288 312 - if (model <= ARRAY_SIZE(pmic_models) && pmic_models[model]) 289 + if (model < ARRAY_SIZE(pmic_models) && pmic_models[model]) 313 290 seq_printf(seq, "%s\n", pmic_models[model]); 314 291 else 315 292 seq_printf(seq, "unknown (%d)\n", model); 293 + 294 + return 0; 295 + } 296 + 297 + static int qcom_show_pmic_model_array(struct seq_file *seq, void *p) 298 + { 299 + struct socinfo *socinfo = seq->private; 300 + unsigned int num_pmics = le32_to_cpu(socinfo->num_pmics); 301 + unsigned int pmic_array_offset = le32_to_cpu(socinfo->pmic_array_offset); 302 + int i; 303 + void *ptr = socinfo; 304 + 305 + ptr += pmic_array_offset; 306 + 307 + /* No need for bounds checking, it happened at socinfo_debugfs_init */ 308 + for (i = 0; i < num_pmics; i++) { 309 + unsigned int model = SOCINFO_MINOR(get_unaligned_le32(ptr + 2 * i * sizeof(u32))); 310 + unsigned int die_rev = get_unaligned_le32(ptr + (2 * i + 1) * sizeof(u32)); 311 + 312 + if (model < ARRAY_SIZE(pmic_models) && pmic_models[model]) 313 + seq_printf(seq, "%s %u.%u\n", pmic_models[model], 314 + SOCINFO_MAJOR(die_rev), 315 + SOCINFO_MINOR(die_rev)); 316 + else 317 + seq_printf(seq, "unknown (%d)\n", model); 318 + } 316 319 317 320 return 0; 318 321 } ··· 365 316 366 317 QCOM_OPEN(build_id, qcom_show_build_id); 367 318 QCOM_OPEN(pmic_model, qcom_show_pmic_model); 319 + QCOM_OPEN(pmic_model_array, qcom_show_pmic_model_array); 368 320 QCOM_OPEN(pmic_die_rev, qcom_show_pmic_die_revision); 369 321 QCOM_OPEN(chip_id, qcom_show_chip_id); 370 322 ··· 394 344 DEFINE_IMAGE_OPS(oem); 395 345 396 346 static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, 397 - struct socinfo *info) 347 + struct socinfo *info, size_t info_size) 398 348 { 399 349 struct smem_image_version *versions; 400 350 struct dentry *dentry; 401 351 size_t size; 402 352 int i; 353 + unsigned int num_pmics; 354 + unsigned int pmic_array_offset; 403 355 404 356 qcom_socinfo->dbg_root = debugfs_create_dir("qcom_socinfo", NULL); 405 357 406 358 qcom_socinfo->info.fmt = __le32_to_cpu(info->fmt); 407 359 408 - debugfs_create_x32("info_fmt", 0400, qcom_socinfo->dbg_root, 360 + debugfs_create_x32("info_fmt", 0444, qcom_socinfo->dbg_root, 409 361 &qcom_socinfo->info.fmt); 410 362 411 363 switch (qcom_socinfo->info.fmt) { 412 364 case SOCINFO_VERSION(0, 15): 413 365 qcom_socinfo->info.nmodem_supported = __le32_to_cpu(info->nmodem_supported); 414 366 415 - debugfs_create_u32("nmodem_supported", 0400, qcom_socinfo->dbg_root, 367 + debugfs_create_u32("nmodem_supported", 0444, qcom_socinfo->dbg_root, 416 368 &qcom_socinfo->info.nmodem_supported); 417 369 fallthrough; 418 370 case SOCINFO_VERSION(0, 14): ··· 423 371 qcom_socinfo->info.num_defective_parts = __le32_to_cpu(info->num_defective_parts); 424 372 qcom_socinfo->info.ndefective_parts_array_offset = __le32_to_cpu(info->ndefective_parts_array_offset); 425 373 426 - debugfs_create_u32("num_clusters", 0400, qcom_socinfo->dbg_root, 374 + debugfs_create_u32("num_clusters", 0444, qcom_socinfo->dbg_root, 427 375 &qcom_socinfo->info.num_clusters); 428 - debugfs_create_u32("ncluster_array_offset", 0400, qcom_socinfo->dbg_root, 376 + debugfs_create_u32("ncluster_array_offset", 0444, qcom_socinfo->dbg_root, 429 377 &qcom_socinfo->info.ncluster_array_offset); 430 - debugfs_create_u32("num_defective_parts", 0400, qcom_socinfo->dbg_root, 378 + debugfs_create_u32("num_defective_parts", 0444, qcom_socinfo->dbg_root, 431 379 &qcom_socinfo->info.num_defective_parts); 432 - debugfs_create_u32("ndefective_parts_array_offset", 0400, qcom_socinfo->dbg_root, 380 + debugfs_create_u32("ndefective_parts_array_offset", 0444, qcom_socinfo->dbg_root, 433 381 &qcom_socinfo->info.ndefective_parts_array_offset); 434 382 fallthrough; 435 383 case SOCINFO_VERSION(0, 13): 436 384 qcom_socinfo->info.nproduct_id = __le32_to_cpu(info->nproduct_id); 437 385 438 - debugfs_create_u32("nproduct_id", 0400, qcom_socinfo->dbg_root, 386 + debugfs_create_u32("nproduct_id", 0444, qcom_socinfo->dbg_root, 439 387 &qcom_socinfo->info.nproduct_id); 440 388 DEBUGFS_ADD(info, chip_id); 441 389 fallthrough; ··· 447 395 qcom_socinfo->info.raw_device_num = 448 396 __le32_to_cpu(info->raw_device_num); 449 397 450 - debugfs_create_x32("chip_family", 0400, qcom_socinfo->dbg_root, 398 + debugfs_create_x32("chip_family", 0444, qcom_socinfo->dbg_root, 451 399 &qcom_socinfo->info.chip_family); 452 - debugfs_create_x32("raw_device_family", 0400, 400 + debugfs_create_x32("raw_device_family", 0444, 453 401 qcom_socinfo->dbg_root, 454 402 &qcom_socinfo->info.raw_device_family); 455 - debugfs_create_x32("raw_device_number", 0400, 403 + debugfs_create_x32("raw_device_number", 0444, 456 404 qcom_socinfo->dbg_root, 457 405 &qcom_socinfo->info.raw_device_num); 458 406 fallthrough; 459 407 case SOCINFO_VERSION(0, 11): 408 + num_pmics = le32_to_cpu(info->num_pmics); 409 + pmic_array_offset = le32_to_cpu(info->pmic_array_offset); 410 + if (pmic_array_offset + 2 * num_pmics * sizeof(u32) <= info_size) 411 + DEBUGFS_ADD(info, pmic_model_array); 412 + fallthrough; 460 413 case SOCINFO_VERSION(0, 10): 461 414 case SOCINFO_VERSION(0, 9): 462 415 qcom_socinfo->info.foundry_id = __le32_to_cpu(info->foundry_id); 463 416 464 - debugfs_create_u32("foundry_id", 0400, qcom_socinfo->dbg_root, 417 + debugfs_create_u32("foundry_id", 0444, qcom_socinfo->dbg_root, 465 418 &qcom_socinfo->info.foundry_id); 466 419 fallthrough; 467 420 case SOCINFO_VERSION(0, 8): ··· 478 421 qcom_socinfo->info.hw_plat_subtype = 479 422 __le32_to_cpu(info->hw_plat_subtype); 480 423 481 - debugfs_create_u32("hardware_platform_subtype", 0400, 424 + debugfs_create_u32("hardware_platform_subtype", 0444, 482 425 qcom_socinfo->dbg_root, 483 426 &qcom_socinfo->info.hw_plat_subtype); 484 427 fallthrough; ··· 486 429 qcom_socinfo->info.accessory_chip = 487 430 __le32_to_cpu(info->accessory_chip); 488 431 489 - debugfs_create_u32("accessory_chip", 0400, 432 + debugfs_create_u32("accessory_chip", 0444, 490 433 qcom_socinfo->dbg_root, 491 434 &qcom_socinfo->info.accessory_chip); 492 435 fallthrough; 493 436 case SOCINFO_VERSION(0, 4): 494 437 qcom_socinfo->info.plat_ver = __le32_to_cpu(info->plat_ver); 495 438 496 - debugfs_create_u32("platform_version", 0400, 439 + debugfs_create_u32("platform_version", 0444, 497 440 qcom_socinfo->dbg_root, 498 441 &qcom_socinfo->info.plat_ver); 499 442 fallthrough; 500 443 case SOCINFO_VERSION(0, 3): 501 444 qcom_socinfo->info.hw_plat = __le32_to_cpu(info->hw_plat); 502 445 503 - debugfs_create_u32("hardware_platform", 0400, 446 + debugfs_create_u32("hardware_platform", 0444, 504 447 qcom_socinfo->dbg_root, 505 448 &qcom_socinfo->info.hw_plat); 506 449 fallthrough; 507 450 case SOCINFO_VERSION(0, 2): 508 451 qcom_socinfo->info.raw_ver = __le32_to_cpu(info->raw_ver); 509 452 510 - debugfs_create_u32("raw_version", 0400, qcom_socinfo->dbg_root, 453 + debugfs_create_u32("raw_version", 0444, qcom_socinfo->dbg_root, 511 454 &qcom_socinfo->info.raw_ver); 512 455 fallthrough; 513 456 case SOCINFO_VERSION(0, 1): ··· 524 467 525 468 dentry = debugfs_create_dir(socinfo_image_names[i], 526 469 qcom_socinfo->dbg_root); 527 - debugfs_create_file("name", 0400, dentry, &versions[i], 470 + debugfs_create_file("name", 0444, dentry, &versions[i], 528 471 &qcom_image_name_ops); 529 - debugfs_create_file("variant", 0400, dentry, &versions[i], 472 + debugfs_create_file("variant", 0444, dentry, &versions[i], 530 473 &qcom_image_variant_ops); 531 - debugfs_create_file("oem", 0400, dentry, &versions[i], 474 + debugfs_create_file("oem", 0444, dentry, &versions[i], 532 475 &qcom_image_oem_ops); 533 476 } 534 477 } ··· 539 482 } 540 483 #else 541 484 static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, 542 - struct socinfo *info) 485 + struct socinfo *info, size_t info_size) 543 486 { 544 487 } 545 488 static void socinfo_debugfs_exit(struct qcom_socinfo *qcom_socinfo) { } ··· 579 522 if (IS_ERR(qs->soc_dev)) 580 523 return PTR_ERR(qs->soc_dev); 581 524 582 - socinfo_debugfs_init(qs, info); 525 + socinfo_debugfs_init(qs, info, item_size); 583 526 584 527 /* Feed the soc specific unique data into entropy pool */ 585 528 add_device_randomness(info, item_size);
+9
include/dt-bindings/power/qcom-rpmpd.h
··· 94 94 #define MSM8976_VDDMX_AO 4 95 95 #define MSM8976_VDDMX_VFL 5 96 96 97 + /* MSM8994 Power Domain Indexes */ 98 + #define MSM8994_VDDCX 0 99 + #define MSM8994_VDDCX_AO 1 100 + #define MSM8994_VDDCX_VFC 2 101 + #define MSM8994_VDDMX 3 102 + #define MSM8994_VDDMX_AO 4 103 + #define MSM8994_VDDGFX 5 104 + #define MSM8994_VDDGFX_VFC 6 105 + 97 106 /* MSM8996 Power Domain Indexes */ 98 107 #define MSM8996_VDDCX 0 99 108 #define MSM8996_VDDCX_AO 1
+3
include/linux/soc/qcom/llcc-qcom.h
··· 29 29 #define LLCC_AUDHW 22 30 30 #define LLCC_NPU 23 31 31 #define LLCC_WLHW 24 32 + #define LLCC_CVP 28 32 33 #define LLCC_MODPE 29 33 34 #define LLCC_APTCM 30 34 35 #define LLCC_WRCACHE 31 ··· 80 79 * @bitmap: Bit map to track the active slice ids 81 80 * @offsets: Pointer to the bank offsets array 82 81 * @ecc_irq: interrupt for llcc cache error detection and reporting 82 + * @major_version: Indicates the LLCC major version 83 83 */ 84 84 struct llcc_drv_data { 85 85 struct regmap *regmap; ··· 93 91 unsigned long *bitmap; 94 92 u32 *offsets; 95 93 int ecc_irq; 94 + u32 major_version; 96 95 }; 97 96 98 97 #if IS_ENABLED(CONFIG_QCOM_LLCC)
+8 -1
include/soc/qcom/tcs.h
··· 30 30 * 31 31 * @addr: the address of the resource slv_id:18:16 | offset:0:15 32 32 * @data: the resource state request 33 - * @wait: wait for this request to be complete before sending the next 33 + * @wait: ensure that this command is complete before returning. 34 + * Setting "wait" here only makes sense during rpmh_write_batch() for 35 + * active-only transfers, this is because: 36 + * rpmh_write() - Always waits. 37 + * (DEFINE_RPMH_MSG_ONSTACK will set .wait_for_compl) 38 + * rpmh_write_async() - Never waits. 39 + * (There's no request completion callback) 34 40 */ 35 41 struct tcs_cmd { 36 42 u32 addr; ··· 49 43 * 50 44 * @state: state for the request. 51 45 * @wait_for_compl: wait until we get a response from the h/w accelerator 46 + * (same as setting cmd->wait for all commands in the request) 52 47 * @num_cmds: the number of @cmds in this request 53 48 * @cmds: an array of tcs_cmds 54 49 */