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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'grab-ipa-imem-slice-through-dt'

Konrad Dybcio says:

====================
Grab IPA IMEM slice through DT

This adds the necessary driver change to migrate over from
hardcoded-per-IPA-version-but-varying-per-implementation numbers, while
unfortunately keeping them in there for backwards compatibility.

The DT changes will be submitted in a separate series, this one is OK
to merge independently.
====================

Link: https://patch.msgid.link/20260302-topic-ipa_imem-v6-0-c0ebbf3eae9f@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+51 -3
+7
Documentation/devicetree/bindings/net/qcom,ipa.yaml
··· 165 165 initializing IPA hardware. Optional, and only used when 166 166 Trust Zone performs early initialization. 167 167 168 + sram: 169 + maxItems: 1 170 + description: 171 + A reference to an additional region residing in IMEM (special 172 + on-chip SRAM), which is accessed by the IPA firmware and needs 173 + to be IOMMU-mapped from the OS. 174 + 168 175 required: 169 176 - compatible 170 177 - iommus
+14
Documentation/devicetree/bindings/sram/qcom,imem.yaml
··· 67 67 $ref: /schemas/power/reset/syscon-reboot-mode.yaml# 68 68 69 69 patternProperties: 70 + "^modem-tables@[0-9a-f]+$": 71 + type: object 72 + description: 73 + Region containing packet processing configuration for the IP Accelerator. 74 + 75 + properties: 76 + reg: 77 + maxItems: 1 78 + 79 + required: 80 + - reg 81 + 82 + additionalProperties: false 83 + 70 84 "^pil-reloc@[0-9a-f]+$": 71 85 $ref: /schemas/remoteproc/qcom,pil-info.yaml# 72 86 description: Peripheral image loader relocation region
+7 -2
drivers/net/ipa/ipa_data.h
··· 185 185 struct ipa_mem_data { 186 186 u32 local_count; 187 187 const struct ipa_mem *local; 188 - u32 imem_addr; 189 - u32 imem_size; 188 + 189 + /* These values are now passed via DT, but to support 190 + * older systems we must allow this to be specified here. 191 + */ 192 + u32 imem_addr; /* DEPRECATED */ 193 + u32 imem_size; /* DEPRECATED */ 194 + 190 195 u32 smem_size; 191 196 }; 192 197
+23 -1
drivers/net/ipa/ipa_mem.c
··· 7 7 #include <linux/dma-mapping.h> 8 8 #include <linux/io.h> 9 9 #include <linux/iommu.h> 10 + #include <linux/of_address.h> 10 11 #include <linux/platform_device.h> 11 12 #include <linux/types.h> 12 13 ··· 618 617 int ipa_mem_init(struct ipa *ipa, struct platform_device *pdev, 619 618 const struct ipa_mem_data *mem_data) 620 619 { 620 + struct device_node *ipa_slice_np; 621 621 struct device *dev = &pdev->dev; 622 + u32 imem_base, imem_size; 622 623 struct resource *res; 623 624 int ret; 624 625 ··· 659 656 ipa->mem_addr = res->start; 660 657 ipa->mem_size = resource_size(res); 661 658 662 - ret = ipa_imem_init(ipa, mem_data->imem_addr, mem_data->imem_size); 659 + ipa_slice_np = of_parse_phandle(dev->of_node, "sram", 0); 660 + if (ipa_slice_np) { 661 + struct resource sram_res; 662 + 663 + ret = of_address_to_resource(ipa_slice_np, 0, &sram_res); 664 + of_node_put(ipa_slice_np); 665 + if (ret) 666 + goto err_unmap; 667 + 668 + imem_base = sram_res.start; 669 + imem_size = resource_size(&sram_res); 670 + } else { 671 + /* Backwards compatibility for DTs lacking 672 + * an explicit reference 673 + */ 674 + imem_base = mem_data->imem_addr; 675 + imem_size = mem_data->imem_size; 676 + } 677 + 678 + ret = ipa_imem_init(ipa, imem_base, imem_size); 663 679 if (ret) 664 680 goto err_unmap; 665 681