aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index b8f411451647..382e7ecf4c82 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -33,6 +33,7 @@ struct sh7786_pcie_port {
33 33
34static struct sh7786_pcie_port *sh7786_pcie_ports; 34static struct sh7786_pcie_port *sh7786_pcie_ports;
35static unsigned int nr_ports; 35static unsigned int nr_ports;
36static unsigned long dma_pfn_offset;
36 37
37static struct sh7786_pcie_hwops { 38static struct sh7786_pcie_hwops {
38 int (*core_init)(void); 39 int (*core_init)(void);
@@ -370,6 +371,8 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
370 memstart = ALIGN_DOWN(memstart, memsize); 371 memstart = ALIGN_DOWN(memstart, memsize);
371 memsize = roundup_pow_of_two(memend - memstart); 372 memsize = roundup_pow_of_two(memend - memstart);
372 373
374 dma_pfn_offset = memstart >> PAGE_SHIFT;
375
373 /* 376 /*
374 * If there's more than 512MB of memory, we need to roll over to 377 * If there's more than 512MB of memory, we need to roll over to
375 * LAR1/LAMR1. 378 * LAR1/LAMR1.
@@ -485,6 +488,11 @@ int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
485 return evt2irq(0xae0); 488 return evt2irq(0xae0);
486} 489}
487 490
491void pcibios_bus_add_device(struct pci_dev *pdev)
492{
493 pdev->dev.dma_pfn_offset = dma_pfn_offset;
494}
495
488static int __init sh7786_pcie_core_init(void) 496static int __init sh7786_pcie_core_init(void)
489{ 497{
490 /* Return the number of ports */ 498 /* Return the number of ports */