File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 19
19
#include <linux/jump_label.h>
20
20
#include <linux/pci.h>
21
21
#include <linux/printk.h>
22
+ #include <linux/dma-direct.h>
22
23
23
24
#include <asm/pci_clp.h>
24
25
#include <asm/pci_dma.h>
@@ -283,10 +284,34 @@ static struct zpci_bus *zpci_bus_alloc(int topo, bool topo_is_tid)
283
284
return zbus ;
284
285
}
285
286
287
+ static void pci_dma_range_setup (struct pci_dev * pdev )
288
+ {
289
+ struct zpci_dev * zdev = to_zpci (pdev );
290
+ struct bus_dma_region * map ;
291
+ u64 aligned_end ;
292
+
293
+ map = kzalloc (sizeof (* map ), GFP_KERNEL );
294
+ if (!map )
295
+ return ;
296
+
297
+ map -> cpu_start = 0 ;
298
+ map -> dma_start = PAGE_ALIGN (zdev -> start_dma );
299
+ aligned_end = PAGE_ALIGN_DOWN (zdev -> end_dma + 1 );
300
+ if (aligned_end >= map -> dma_start )
301
+ map -> size = aligned_end - map -> dma_start ;
302
+ else
303
+ map -> size = 0 ;
304
+ WARN_ON_ONCE (map -> size == 0 );
305
+
306
+ pdev -> dev .dma_range_map = map ;
307
+ }
308
+
286
309
void pcibios_bus_add_device (struct pci_dev * pdev )
287
310
{
288
311
struct zpci_dev * zdev = to_zpci (pdev );
289
312
313
+ pci_dma_range_setup (pdev );
314
+
290
315
/*
291
316
* With pdev->no_vf_scan the common PCI probing code does not
292
317
* perform PF/VF linking.
You can’t perform that action at this time.
0 commit comments