diff options
Diffstat (limited to 'arch/powerpc/platforms/85xx/mpc85xx_ds.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ds.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 53d5851a6c97..849c0ac0025f 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <linux/lmb.h> | ||
23 | 24 | ||
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
25 | #include <asm/time.h> | 26 | #include <asm/time.h> |
@@ -30,6 +31,7 @@ | |||
30 | #include <asm/udbg.h> | 31 | #include <asm/udbg.h> |
31 | #include <asm/mpic.h> | 32 | #include <asm/mpic.h> |
32 | #include <asm/i8259.h> | 33 | #include <asm/i8259.h> |
34 | #include <asm/swiotlb.h> | ||
33 | 35 | ||
34 | #include <sysdev/fsl_soc.h> | 36 | #include <sysdev/fsl_soc.h> |
35 | #include <sysdev/fsl_pci.h> | 37 | #include <sysdev/fsl_pci.h> |
@@ -155,7 +157,9 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
155 | { | 157 | { |
156 | #ifdef CONFIG_PCI | 158 | #ifdef CONFIG_PCI |
157 | struct device_node *np; | 159 | struct device_node *np; |
160 | struct pci_controller *hose; | ||
158 | #endif | 161 | #endif |
162 | dma_addr_t max = 0xffffffff; | ||
159 | 163 | ||
160 | if (ppc_md.progress) | 164 | if (ppc_md.progress) |
161 | ppc_md.progress("mpc85xx_ds_setup_arch()", 0); | 165 | ppc_md.progress("mpc85xx_ds_setup_arch()", 0); |
@@ -171,6 +175,10 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
171 | fsl_add_bridge(np, 1); | 175 | fsl_add_bridge(np, 1); |
172 | else | 176 | else |
173 | fsl_add_bridge(np, 0); | 177 | fsl_add_bridge(np, 0); |
178 | |||
179 | hose = pci_find_hose_for_OF_device(np); | ||
180 | max = min(max, hose->dma_window_base_cur + | ||
181 | hose->dma_window_size); | ||
174 | } | 182 | } |
175 | } | 183 | } |
176 | 184 | ||
@@ -181,6 +189,13 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
181 | mpc85xx_smp_init(); | 189 | mpc85xx_smp_init(); |
182 | #endif | 190 | #endif |
183 | 191 | ||
192 | #ifdef CONFIG_SWIOTLB | ||
193 | if (lmb_end_of_DRAM() > max) { | ||
194 | ppc_swiotlb_enable = 1; | ||
195 | set_pci_dma_ops(&swiotlb_pci_dma_ops); | ||
196 | } | ||
197 | #endif | ||
198 | |||
184 | printk("MPC85xx DS board from Freescale Semiconductor\n"); | 199 | printk("MPC85xx DS board from Freescale Semiconductor\n"); |
185 | } | 200 | } |
186 | 201 | ||
@@ -217,6 +232,10 @@ machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices); | |||
217 | machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices); | 232 | machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices); |
218 | machine_device_initcall(p2020_ds, mpc85xxds_publish_devices); | 233 | machine_device_initcall(p2020_ds, mpc85xxds_publish_devices); |
219 | 234 | ||
235 | machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier); | ||
236 | machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier); | ||
237 | machine_arch_initcall(p2020_ds, swiotlb_setup_bus_notifier); | ||
238 | |||
220 | /* | 239 | /* |
221 | * Called very early, device-tree isn't unflattened | 240 | * Called very early, device-tree isn't unflattened |
222 | */ | 241 | */ |