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

Merge tag 'qcom-drivers-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers

More Qualcomm driver updates for v6.5

The detection of split/non-split firmware files in the MDT loader is
corrected. The Geni driver is updated to not enable unused interrupts,
in some configurations. The count unit for MSM8998 in BWMON is corrected.
RPM master stats driver is corrected to check for the right return value
of devm_ioremap().

Support for socinfo version 18 and 19 are aded, and IPQ5300 is added to
the list of platforms.

* tag 'qcom-drivers-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer
dt-bindings: sram: qcom,imem: document qdu1000
soc: qcom: icc-bwmon: Fix MSM8998 count unit
dt-bindings: soc: qcom,rpmh-rsc: Require power-domains
soc: qcom: socinfo: Add Soc ID for IPQ5300
dt-bindings: arm: qcom,ids: add SoC ID for IPQ5300
soc: qcom: Fix a IS_ERR() vs NULL bug in probe
soc: qcom: socinfo: Add support for new fields in revision 19
soc: qcom: socinfo: Add support for new fields in revision 18
dt-bindings: firmware: scm: Add compatible for SDX75
soc: qcom: mdt_loader: Fix split image detection

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

+54 -36
+1
Documentation/devicetree/bindings/firmware/qcom,scm.yaml
··· 51 51 - qcom,scm-sdm845 52 52 - qcom,scm-sdx55 53 53 - qcom,scm-sdx65 54 + - qcom,scm-sdx75 54 55 - qcom,scm-sm6115 55 56 - qcom,scm-sm6125 56 57 - qcom,scm-sm6350
+2
Documentation/devicetree/bindings/soc/qcom/qcom,rpmh-rsc.yaml
··· 124 124 - qcom,tcs-offset 125 125 - reg 126 126 - reg-names 127 + - power-domains 127 128 128 129 additionalProperties: false 129 130 ··· 180 179 <SLEEP_TCS 1>, 181 180 <WAKE_TCS 1>, 182 181 <CONTROL_TCS 0>; 182 + power-domains = <&CLUSTER_PD>; 183 183 }; 184 184 185 185 - |
+1
Documentation/devicetree/bindings/sram/qcom,imem.yaml
··· 21 21 - qcom,msm8226-imem 22 22 - qcom,msm8974-imem 23 23 - qcom,qcs404-imem 24 + - qcom,qdu1000-imem 24 25 - qcom,sc7180-imem 25 26 - qcom,sc7280-imem 26 27 - qcom,sdm630-imem
+1 -1
drivers/soc/qcom/icc-bwmon.c
··· 806 806 807 807 static const struct icc_bwmon_data msm8998_bwmon_data = { 808 808 .sample_ms = 4, 809 - .count_unit_kb = 64, 809 + .count_unit_kb = 1024, 810 810 .default_highbw_kbps = 4800 * 1024, /* 4.8 GBps */ 811 811 .default_medbw_kbps = 512 * 1024, /* 512 MBps */ 812 812 .default_lowbw_kbps = 0,
+8
drivers/soc/qcom/mdt_loader.c
··· 275 275 phdrs = (struct elf32_phdr *)(ehdr + 1); 276 276 277 277 for (i = 0; i < ehdr->e_phnum; i++) { 278 + /* 279 + * The size of the MDT file is not padded to include any 280 + * zero-sized segments at the end. Ignore these, as they should 281 + * not affect the decision about image being split or not. 282 + */ 283 + if (!phdrs[i].p_filesz) 284 + continue; 285 + 278 286 seg_start = phdrs[i].p_offset; 279 287 seg_end = phdrs[i].p_offset + phdrs[i].p_filesz; 280 288 if (seg_start > fw->size || seg_end > fw->size)
+4 -24
drivers/soc/qcom/qcom-geni-se.c
··· 281 281 282 282 geni_se_irq_clear(se); 283 283 284 - /* 285 - * The RX path for the UART is asynchronous and so needs more 286 - * complex logic for enabling / disabling its interrupts. 287 - * 288 - * Specific notes: 289 - * - The done and TX-related interrupts are managed manually. 290 - * - We don't RX from the main sequencer (we use the secondary) so 291 - * we don't need the RX-related interrupts enabled in the main 292 - * sequencer for UART. 293 - */ 284 + /* UART driver manages enabling / disabling interrupts internally */ 294 285 if (proto != GENI_SE_UART) { 286 + /* Non-UART use only primary sequencer so dont bother about S_IRQ */ 295 287 val_old = val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN); 296 288 val |= M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN; 297 289 val |= M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN; 298 290 if (val != val_old) 299 291 writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN); 300 - 301 - val_old = val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN); 302 - val |= S_CMD_DONE_EN; 303 - if (val != val_old) 304 - writel_relaxed(val, se->base + SE_GENI_S_IRQ_EN); 305 292 } 306 293 307 294 val_old = val = readl_relaxed(se->base + SE_GENI_DMA_MODE_EN); ··· 304 317 305 318 geni_se_irq_clear(se); 306 319 320 + /* UART driver manages enabling / disabling interrupts internally */ 307 321 if (proto != GENI_SE_UART) { 322 + /* Non-UART use only primary sequencer so dont bother about S_IRQ */ 308 323 val_old = val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN); 309 324 val &= ~(M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN); 310 325 val &= ~(M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN); 311 326 if (val != val_old) 312 327 writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN); 313 - 314 - val_old = val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN); 315 - val &= ~S_CMD_DONE_EN; 316 - if (val != val_old) 317 - writel_relaxed(val, se->base + SE_GENI_S_IRQ_EN); 318 328 } 319 329 320 330 val_old = val = readl_relaxed(se->base + SE_GENI_DMA_MODE_EN); ··· 327 343 geni_se_irq_clear(se); 328 344 329 345 writel(0, se->base + SE_IRQ_EN); 330 - 331 - val = readl(se->base + SE_GENI_S_IRQ_EN); 332 - val &= ~S_CMD_DONE_EN; 333 - writel(val, se->base + SE_GENI_S_IRQ_EN); 334 346 335 347 val = readl(se->base + SE_GENI_M_IRQ_EN); 336 348 val &= ~(M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN |
+1 -1
drivers/soc/qcom/rpm_master_stats.c
··· 105 105 } 106 106 107 107 data[i].base = devm_ioremap(dev, res.start, resource_size(&res)); 108 - if (IS_ERR(data[i].base)) { 108 + if (!data[i].base) { 109 109 debugfs_remove_recursive(root); 110 110 return dev_err_probe(dev, -EINVAL, 111 111 "Could not map the MSG RAM slice idx %d!\n", i);
+26 -8
drivers/soc/qcom/socinfo.c
··· 133 133 u32 nproduct_id; 134 134 u32 num_clusters; 135 135 u32 ncluster_array_offset; 136 - u32 num_defective_parts; 137 - u32 ndefective_parts_array_offset; 136 + u32 num_subset_parts; 137 + u32 nsubset_parts_array_offset; 138 138 u32 nmodem_supported; 139 139 u32 feature_code; 140 140 u32 pcode; 141 141 u32 oem_variant; 142 + u32 num_func_clusters; 143 + u32 boot_cluster; 144 + u32 boot_core; 142 145 }; 143 146 144 147 struct smem_image_version { ··· 414 411 { qcom_board_id(IPQ5322) }, 415 412 { qcom_board_id(IPQ5312) }, 416 413 { qcom_board_id(IPQ5302) }, 414 + { qcom_board_id(IPQ5300) }, 417 415 }; 418 416 419 417 static const char *socinfo_machine(struct device *dev, unsigned int id) ··· 569 565 &qcom_socinfo->info.fmt); 570 566 571 567 switch (qcom_socinfo->info.fmt) { 568 + case SOCINFO_VERSION(0, 19): 569 + qcom_socinfo->info.num_func_clusters = __le32_to_cpu(info->num_func_clusters); 570 + qcom_socinfo->info.boot_cluster = __le32_to_cpu(info->boot_cluster); 571 + qcom_socinfo->info.boot_core = __le32_to_cpu(info->boot_core); 572 + 573 + debugfs_create_u32("num_func_clusters", 0444, qcom_socinfo->dbg_root, 574 + &qcom_socinfo->info.num_func_clusters); 575 + debugfs_create_u32("boot_cluster", 0444, qcom_socinfo->dbg_root, 576 + &qcom_socinfo->info.boot_cluster); 577 + debugfs_create_u32("boot_core", 0444, qcom_socinfo->dbg_root, 578 + &qcom_socinfo->info.boot_core); 579 + fallthrough; 580 + case SOCINFO_VERSION(0, 18): 572 581 case SOCINFO_VERSION(0, 17): 573 582 qcom_socinfo->info.oem_variant = __le32_to_cpu(info->oem_variant); 574 583 debugfs_create_u32("oem_variant", 0444, qcom_socinfo->dbg_root, ··· 605 588 case SOCINFO_VERSION(0, 14): 606 589 qcom_socinfo->info.num_clusters = __le32_to_cpu(info->num_clusters); 607 590 qcom_socinfo->info.ncluster_array_offset = __le32_to_cpu(info->ncluster_array_offset); 608 - qcom_socinfo->info.num_defective_parts = __le32_to_cpu(info->num_defective_parts); 609 - qcom_socinfo->info.ndefective_parts_array_offset = __le32_to_cpu(info->ndefective_parts_array_offset); 591 + qcom_socinfo->info.num_subset_parts = __le32_to_cpu(info->num_subset_parts); 592 + qcom_socinfo->info.nsubset_parts_array_offset = 593 + __le32_to_cpu(info->nsubset_parts_array_offset); 610 594 611 595 debugfs_create_u32("num_clusters", 0444, qcom_socinfo->dbg_root, 612 596 &qcom_socinfo->info.num_clusters); 613 597 debugfs_create_u32("ncluster_array_offset", 0444, qcom_socinfo->dbg_root, 614 598 &qcom_socinfo->info.ncluster_array_offset); 615 - debugfs_create_u32("num_defective_parts", 0444, qcom_socinfo->dbg_root, 616 - &qcom_socinfo->info.num_defective_parts); 617 - debugfs_create_u32("ndefective_parts_array_offset", 0444, qcom_socinfo->dbg_root, 618 - &qcom_socinfo->info.ndefective_parts_array_offset); 599 + debugfs_create_u32("num_subset_parts", 0444, qcom_socinfo->dbg_root, 600 + &qcom_socinfo->info.num_subset_parts); 601 + debugfs_create_u32("nsubset_parts_array_offset", 0444, qcom_socinfo->dbg_root, 602 + &qcom_socinfo->info.nsubset_parts_array_offset); 619 603 fallthrough; 620 604 case SOCINFO_VERSION(0, 13): 621 605 qcom_socinfo->info.nproduct_id = __le32_to_cpu(info->nproduct_id);
+1
include/dt-bindings/arm/qcom,ids.h
··· 258 258 #define QCOM_ID_IPQ5322 593 259 259 #define QCOM_ID_IPQ5312 594 260 260 #define QCOM_ID_IPQ5302 595 261 + #define QCOM_ID_IPQ5300 624 261 262 262 263 /* 263 264 * The board type and revision information, used by Qualcomm bootloaders and
+9 -2
include/linux/soc/qcom/socinfo.h
··· 54 54 /* Version 14 */ 55 55 __le32 num_clusters; 56 56 __le32 ncluster_array_offset; 57 - __le32 num_defective_parts; 58 - __le32 ndefective_parts_array_offset; 57 + __le32 num_subset_parts; 58 + __le32 nsubset_parts_array_offset; 59 59 /* Version 15 */ 60 60 __le32 nmodem_supported; 61 61 /* Version 16 */ ··· 65 65 __le32 nnum_partname_mapping; 66 66 /* Version 17 */ 67 67 __le32 oem_variant; 68 + /* Version 18 */ 69 + __le32 num_kvps; 70 + __le32 kvps_offset; 71 + /* Version 19 */ 72 + __le32 num_func_clusters; 73 + __le32 boot_cluster; 74 + __le32 boot_core; 68 75 }; 69 76 70 77 #endif