Skip to content

Commit 09be4c4

Browse files
committed
Merge branch 'net-ipa-I-O-map-SMEM-and-IMEM'
Alex Elder says: ==================== net: ipa: I/O map SMEM and IMEM This series adds the definition of two memory regions that must be mapped for IPA to access through an SMMU. It requires the SMMU to be defined in the IPA node in the SoC's Device Tree file. There is no change since version 1 to the content of the code in these patches, *however* this time the first patch is an update to the binding definition rather than an update to a DTS file. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents cad5eaf + a0036bb commit 09be4c4

File tree

8 files changed

+263
-22
lines changed

8 files changed

+263
-22
lines changed

Documentation/devicetree/bindings/net/qcom,ipa.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ description:
2020
The GSI is an integral part of the IPA, but it is logically isolated
2121
and has a distinct interrupt and a separately-defined address space.
2222

23-
See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt.
23+
See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt. See
24+
iommu/iommu.txt and iommu/arm,smmu.yaml for more information about SMMU
25+
bindings.
26+
2427

2528
- |
2629
-------- ---------
@@ -54,6 +57,9 @@ properties:
5457
- const: ipa-shared
5558
- const: gsi
5659

60+
iommus:
61+
maxItems: 1
62+
5763
clocks:
5864
maxItems: 1
5965

@@ -126,6 +132,7 @@ properties:
126132

127133
required:
128134
- compatible
135+
- iommus
129136
- reg
130137
- clocks
131138
- interrupts
@@ -164,6 +171,7 @@ examples:
164171
modem-init;
165172
modem-remoteproc = <&mss_pil>;
166173
174+
iommus = <&apps_smmu 0x720 0x3>;
167175
reg = <0 0x1e40000 0 0x7000>,
168176
<0 0x1e47000 0 0x2000>,
169177
<0 0x1e04000 0 0x2c000>;

drivers/net/ipa/ipa.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ struct ipa_interrupt;
4747
* @mem_offset: Offset from @mem_virt used for access to IPA memory
4848
* @mem_size: Total size (bytes) of memory at @mem_virt
4949
* @mem: Array of IPA-local memory region descriptors
50+
* @imem_iova: I/O virtual address of IPA region in IMEM
51+
* @imem_size; Size of IMEM region
52+
* @smem_iova: I/O virtual address of IPA region in SMEM
53+
* @smem_size; Size of SMEM region
5054
* @zero_addr: DMA address of preallocated zero-filled memory
5155
* @zero_virt: Virtual address of preallocated zero-filled memory
5256
* @zero_size: Size (bytes) of preallocated zero-filled memory
@@ -88,6 +92,12 @@ struct ipa {
8892
u32 mem_size;
8993
const struct ipa_mem *mem;
9094

95+
unsigned long imem_iova;
96+
size_t imem_size;
97+
98+
unsigned long smem_iova;
99+
size_t smem_size;
100+
91101
dma_addr_t zero_addr;
92102
void *zero_virt;
93103
size_t zero_size;

drivers/net/ipa/ipa_data-sc7180.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static const struct ipa_resource_data ipa_resource_data = {
193193
};
194194

195195
/* IPA-resident memory region configuration for the SC7180 SoC. */
196-
static const struct ipa_mem ipa_mem_data[] = {
196+
static const struct ipa_mem ipa_mem_local_data[] = {
197197
[IPA_MEM_UC_SHARED] = {
198198
.offset = 0x0000,
199199
.size = 0x0080,
@@ -296,12 +296,20 @@ static const struct ipa_mem ipa_mem_data[] = {
296296
},
297297
};
298298

299+
static struct ipa_mem_data ipa_mem_data = {
300+
.local_count = ARRAY_SIZE(ipa_mem_local_data),
301+
.local = ipa_mem_local_data,
302+
.imem_addr = 0x146a8000,
303+
.imem_size = 0x00002000,
304+
.smem_id = 497,
305+
.smem_size = 0x00002000,
306+
};
307+
299308
/* Configuration data for the SC7180 SoC. */
300309
const struct ipa_data ipa_data_sc7180 = {
301310
.version = IPA_VERSION_4_2,
302311
.endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data),
303312
.endpoint_data = ipa_gsi_endpoint_data,
304313
.resource_data = &ipa_resource_data,
305-
.mem_count = ARRAY_SIZE(ipa_mem_data),
306-
.mem_data = ipa_mem_data,
314+
.mem_data = &ipa_mem_data,
307315
};

drivers/net/ipa/ipa_data-sdm845.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static const struct ipa_resource_data ipa_resource_data = {
235235
};
236236

237237
/* IPA-resident memory region configuration for the SDM845 SoC. */
238-
static const struct ipa_mem ipa_mem_data[] = {
238+
static const struct ipa_mem ipa_mem_local_data[] = {
239239
[IPA_MEM_UC_SHARED] = {
240240
.offset = 0x0000,
241241
.size = 0x0080,
@@ -318,12 +318,20 @@ static const struct ipa_mem ipa_mem_data[] = {
318318
},
319319
};
320320

321+
static struct ipa_mem_data ipa_mem_data = {
322+
.local_count = ARRAY_SIZE(ipa_mem_local_data),
323+
.local = ipa_mem_local_data,
324+
.imem_addr = 0x146bd000,
325+
.imem_size = 0x00002000,
326+
.smem_id = 497,
327+
.smem_size = 0x00002000,
328+
};
329+
321330
/* Configuration data for the SDM845 SoC. */
322331
const struct ipa_data ipa_data_sdm845 = {
323332
.version = IPA_VERSION_3_5_1,
324333
.endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data),
325334
.endpoint_data = ipa_gsi_endpoint_data,
326335
.resource_data = &ipa_resource_data,
327-
.mem_count = ARRAY_SIZE(ipa_mem_data),
328-
.mem_data = ipa_mem_data,
336+
.mem_data = &ipa_mem_data,
329337
};

drivers/net/ipa/ipa_data.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,21 @@ struct ipa_resource_data {
245245
};
246246

247247
/**
248-
* struct ipa_mem - IPA-local memory region description
249-
* @offset: offset in IPA memory space to base of the region
250-
* @size: size in bytes base of the region
251-
* @canary_count: number of 32-bit "canary" values that precede region
248+
* struct ipa_mem - description of IPA memory regions
249+
* @local_count: number of regions defined in the local[] array
250+
* @local: array of IPA-local memory region descriptors
251+
* @imem_addr: physical address of IPA region within IMEM
252+
* @imem_size: size in bytes of IPA IMEM region
253+
* @smem_id: item identifier for IPA region within SMEM memory
254+
* @imem_size: size in bytes of the IPA SMEM region
252255
*/
253256
struct ipa_mem_data {
254-
u32 offset;
255-
u16 size;
256-
u16 canary_count;
257+
u32 local_count;
258+
const struct ipa_mem *local;
259+
u32 imem_addr;
260+
u32 imem_size;
261+
u32 smem_id;
262+
u32 smem_size;
257263
};
258264

259265
/**
@@ -270,8 +276,7 @@ struct ipa_data {
270276
u32 endpoint_count; /* # entries in endpoint_data[] */
271277
const struct ipa_gsi_endpoint_data *endpoint_data;
272278
const struct ipa_resource_data *resource_data;
273-
u32 mem_count; /* # entries in mem_data[] */
274-
const struct ipa_mem *mem_data;
279+
const struct ipa_mem_data *mem_data;
275280
};
276281

277282
extern const struct ipa_data ipa_data_sdm845;

drivers/net/ipa/ipa_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ static int ipa_probe(struct platform_device *pdev)
778778
if (ret)
779779
goto err_kfree_ipa;
780780

781-
ret = ipa_mem_init(ipa, data->mem_count, data->mem_data);
781+
ret = ipa_mem_init(ipa, data->mem_data);
782782
if (ret)
783783
goto err_reg_exit;
784784

0 commit comments

Comments
 (0)