diff options
| -rw-r--r-- | arch/powerpc/include/asm/swiotlb.h | 6 | ||||
| -rw-r--r-- | arch/powerpc/kernel/dma-swiotlb.c | 20 | ||||
| -rw-r--r-- | arch/powerpc/mm/mem.c | 3 | ||||
| -rw-r--r-- | arch/powerpc/platforms/44x/currituck.c | 10 | ||||
| -rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ds.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/platforms/85xx/qemu_e500.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 5 |
7 files changed, 32 insertions, 14 deletions
diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h index 8979d4cd3d70..de99d6e29430 100644 --- a/arch/powerpc/include/asm/swiotlb.h +++ b/arch/powerpc/include/asm/swiotlb.h | |||
| @@ -22,4 +22,10 @@ int __init swiotlb_setup_bus_notifier(void); | |||
| 22 | 22 | ||
| 23 | extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev); | 23 | extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev); |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_SWIOTLB | ||
| 26 | void swiotlb_detect_4g(void); | ||
| 27 | #else | ||
| 28 | static inline void swiotlb_detect_4g(void) {} | ||
| 29 | #endif | ||
| 30 | |||
| 25 | #endif /* __ASM_SWIOTLB_H */ | 31 | #endif /* __ASM_SWIOTLB_H */ |
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index a720b54b971c..bd1a2aba599f 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c | |||
| @@ -105,3 +105,23 @@ int __init swiotlb_setup_bus_notifier(void) | |||
| 105 | &ppc_swiotlb_plat_bus_notifier); | 105 | &ppc_swiotlb_plat_bus_notifier); |
| 106 | return 0; | 106 | return 0; |
| 107 | } | 107 | } |
| 108 | |||
| 109 | void swiotlb_detect_4g(void) | ||
| 110 | { | ||
| 111 | if ((memblock_end_of_DRAM() - 1) > 0xffffffff) | ||
| 112 | ppc_swiotlb_enable = 1; | ||
| 113 | } | ||
| 114 | |||
| 115 | static int __init swiotlb_late_init(void) | ||
| 116 | { | ||
| 117 | if (ppc_swiotlb_enable) { | ||
| 118 | swiotlb_print_info(); | ||
| 119 | set_pci_dma_ops(&swiotlb_dma_ops); | ||
| 120 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
| 121 | } else { | ||
| 122 | swiotlb_free(); | ||
| 123 | } | ||
| 124 | |||
| 125 | return 0; | ||
| 126 | } | ||
| 127 | subsys_initcall(swiotlb_late_init); | ||
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 44cf2b20503d..0dba5066c22a 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
| @@ -300,8 +300,7 @@ void __init mem_init(void) | |||
| 300 | unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize; | 300 | unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize; |
| 301 | 301 | ||
| 302 | #ifdef CONFIG_SWIOTLB | 302 | #ifdef CONFIG_SWIOTLB |
| 303 | if (ppc_swiotlb_enable) | 303 | swiotlb_init(0); |
| 304 | swiotlb_init(1); | ||
| 305 | #endif | 304 | #endif |
| 306 | 305 | ||
| 307 | num_physpages = memblock_phys_mem_size() >> PAGE_SHIFT; | 306 | num_physpages = memblock_phys_mem_size() >> PAGE_SHIFT; |
diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c index 9f6c33d63a42..6bd89a0e0dea 100644 --- a/arch/powerpc/platforms/44x/currituck.c +++ b/arch/powerpc/platforms/44x/currituck.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/memblock.h> | ||
| 25 | #include <linux/of.h> | 24 | #include <linux/of.h> |
| 26 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
| 27 | #include <linux/rtc.h> | 26 | #include <linux/rtc.h> |
| @@ -159,13 +158,8 @@ static void __init ppc47x_setup_arch(void) | |||
| 159 | 158 | ||
| 160 | /* No need to check the DMA config as we /know/ our windows are all of | 159 | /* No need to check the DMA config as we /know/ our windows are all of |
| 161 | * RAM. Lets hope that doesn't change */ | 160 | * RAM. Lets hope that doesn't change */ |
| 162 | #ifdef CONFIG_SWIOTLB | 161 | swiotlb_detect_4g(); |
| 163 | if ((memblock_end_of_DRAM() - 1) > 0xffffffff) { | 162 | |
| 164 | ppc_swiotlb_enable = 1; | ||
| 165 | set_pci_dma_ops(&swiotlb_dma_ops); | ||
| 166 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
| 167 | } | ||
| 168 | #endif | ||
| 169 | ppc47x_smp_init(); | 163 | ppc47x_smp_init(); |
| 170 | } | 164 | } |
| 171 | 165 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 6d3265fe7718..56f8c8f674df 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
| @@ -159,6 +159,7 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
| 159 | if (ppc_md.progress) | 159 | if (ppc_md.progress) |
| 160 | ppc_md.progress("mpc85xx_ds_setup_arch()", 0); | 160 | ppc_md.progress("mpc85xx_ds_setup_arch()", 0); |
| 161 | 161 | ||
| 162 | swiotlb_detect_4g(); | ||
| 162 | mpc85xx_ds_pci_init(); | 163 | mpc85xx_ds_pci_init(); |
| 163 | mpc85xx_smp_init(); | 164 | mpc85xx_smp_init(); |
| 164 | 165 | ||
diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c index 95a2e53af71b..3c5490c8423f 100644 --- a/arch/powerpc/platforms/85xx/qemu_e500.c +++ b/arch/powerpc/platforms/85xx/qemu_e500.c | |||
| @@ -42,6 +42,7 @@ static void __init qemu_e500_setup_arch(void) | |||
| 42 | ppc_md.progress("qemu_e500_setup_arch()", 0); | 42 | ppc_md.progress("qemu_e500_setup_arch()", 0); |
| 43 | 43 | ||
| 44 | fsl_pci_init(); | 44 | fsl_pci_init(); |
| 45 | swiotlb_detect_4g(); | ||
| 45 | mpc85xx_smp_init(); | 46 | mpc85xx_smp_init(); |
| 46 | } | 47 | } |
| 47 | 48 | ||
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 6938792ccfd9..da7a3d7f54cc 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
| @@ -872,11 +872,8 @@ void __devinit fsl_pci_init(void) | |||
| 872 | * we need SWIOTLB to handle buffers located outside of | 872 | * we need SWIOTLB to handle buffers located outside of |
| 873 | * dma capable memory region | 873 | * dma capable memory region |
| 874 | */ | 874 | */ |
| 875 | if (memblock_end_of_DRAM() - 1 > max) { | 875 | if (memblock_end_of_DRAM() - 1 > max) |
| 876 | ppc_swiotlb_enable = 1; | 876 | ppc_swiotlb_enable = 1; |
| 877 | set_pci_dma_ops(&swiotlb_dma_ops); | ||
| 878 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
| 879 | } | ||
| 880 | #endif | 877 | #endif |
| 881 | } | 878 | } |
| 882 | #endif | 879 | #endif |
