@@ -237,7 +237,8 @@ static int bcm2712_iommu_attach_dev(struct iommu_domain *domain, struct device *
237
237
}
238
238
239
239
static int bcm2712_iommu_map (struct iommu_domain * domain , unsigned long iova ,
240
- phys_addr_t pa , size_t bytes , int prot , gfp_t gfp )
240
+ phys_addr_t pa , size_t bytes , size_t count ,
241
+ int prot , gfp_t gfp , size_t * mapped )
241
242
{
242
243
struct bcm2712_iommu * mmu = domain_to_mmu (domain );
243
244
@@ -276,12 +277,14 @@ static int bcm2712_iommu_map(struct iommu_domain *domain, unsigned long iova,
276
277
(unsigned long long )pa , (unsigned long long )bytes );
277
278
return - EINVAL ;
278
279
}
280
+ * mapped = bytes ;
279
281
280
282
return 0 ;
281
283
}
282
284
283
285
static size_t bcm2712_iommu_unmap (struct iommu_domain * domain , unsigned long iova ,
284
- size_t bytes , struct iommu_iotlb_gather * gather )
286
+ size_t bytes , size_t count ,
287
+ struct iommu_iotlb_gather * gather )
285
288
{
286
289
struct bcm2712_iommu * mmu = domain_to_mmu (domain );
287
290
@@ -318,15 +321,15 @@ static size_t bcm2712_iommu_unmap(struct iommu_domain *domain, unsigned long iov
318
321
return bytes ;
319
322
}
320
323
321
- static void bcm2712_iommu_sync_range (struct iommu_domain * domain ,
324
+ static int bcm2712_iommu_sync_range (struct iommu_domain * domain ,
322
325
unsigned long iova , size_t size )
323
326
{
324
327
struct bcm2712_iommu * mmu = domain_to_mmu (domain );
325
328
unsigned long iova_end ;
326
329
unsigned int i , p4 ;
327
330
328
331
if (!mmu || !mmu -> dirty )
329
- return ;
332
+ return 0 ;
330
333
331
334
/* Ensure tables are cleaned from CPU cache or write-buffer */
332
335
dma_sync_sgtable_for_device (mmu -> dev , mmu -> sgt , DMA_TO_DEVICE );
@@ -371,6 +374,8 @@ static void bcm2712_iommu_sync_range(struct iommu_domain *domain,
371
374
}
372
375
}
373
376
}
377
+
378
+ return 0 ;
374
379
}
375
380
376
381
static void bcm2712_iommu_sync (struct iommu_domain * domain ,
@@ -412,8 +417,8 @@ static void bcm2712_iommu_domain_free(struct iommu_domain *domain)
412
417
413
418
static const struct iommu_domain_ops bcm2712_iommu_domain_ops = {
414
419
.attach_dev = bcm2712_iommu_attach_dev ,
415
- .map = bcm2712_iommu_map ,
416
- .unmap = bcm2712_iommu_unmap ,
420
+ .map_pages = bcm2712_iommu_map ,
421
+ .unmap_pages = bcm2712_iommu_unmap ,
417
422
.iotlb_sync = bcm2712_iommu_sync ,
418
423
.iotlb_sync_map = bcm2712_iommu_sync_range ,
419
424
.flush_iotlb_all = bcm2712_iommu_sync_all ,
0 commit comments