|
22 | 22 | #include <linux/seq_file.h> |
23 | 23 | #include <linux/interrupt.h> |
24 | 24 | #include <linux/of_platform.h> |
25 | | -#include <linux/memblock.h> |
26 | 25 |
|
27 | 26 | #include <asm/time.h> |
28 | 27 | #include <asm/machdep.h> |
@@ -84,53 +83,39 @@ void __init ge_imp3a_pic_init(void) |
84 | 83 | of_node_put(cascade_node); |
85 | 84 | } |
86 | 85 |
|
87 | | -#ifdef CONFIG_PCI |
88 | | -static int primary_phb_addr; |
89 | | -#endif /* CONFIG_PCI */ |
90 | | - |
91 | | -/* |
92 | | - * Setup the architecture |
93 | | - */ |
94 | | -static void __init ge_imp3a_setup_arch(void) |
| 86 | +static void ge_imp3a_pci_assign_primary(void) |
95 | 87 | { |
96 | | - struct device_node *regs; |
97 | 88 | #ifdef CONFIG_PCI |
98 | 89 | struct device_node *np; |
99 | | - struct pci_controller *hose; |
100 | | -#endif |
101 | | - dma_addr_t max = 0xffffffff; |
| 90 | + struct resource rsrc; |
102 | 91 |
|
103 | | - if (ppc_md.progress) |
104 | | - ppc_md.progress("ge_imp3a_setup_arch()", 0); |
105 | | - |
106 | | -#ifdef CONFIG_PCI |
107 | 92 | for_each_node_by_type(np, "pci") { |
108 | 93 | if (of_device_is_compatible(np, "fsl,mpc8540-pci") || |
109 | 94 | of_device_is_compatible(np, "fsl,mpc8548-pcie") || |
110 | 95 | of_device_is_compatible(np, "fsl,p2020-pcie")) { |
111 | | - struct resource rsrc; |
112 | 96 | of_address_to_resource(np, 0, &rsrc); |
113 | | - if ((rsrc.start & 0xfffff) == primary_phb_addr) |
114 | | - fsl_add_bridge(np, 1); |
115 | | - else |
116 | | - fsl_add_bridge(np, 0); |
117 | | - |
118 | | - hose = pci_find_hose_for_OF_device(np); |
119 | | - max = min(max, hose->dma_window_base_cur + |
120 | | - hose->dma_window_size); |
| 97 | + if ((rsrc.start & 0xfffff) == 0x9000) |
| 98 | + fsl_pci_primary = np; |
121 | 99 | } |
122 | 100 | } |
123 | 101 | #endif |
| 102 | +} |
| 103 | + |
| 104 | +/* |
| 105 | + * Setup the architecture |
| 106 | + */ |
| 107 | +static void __init ge_imp3a_setup_arch(void) |
| 108 | +{ |
| 109 | + struct device_node *regs; |
| 110 | + |
| 111 | + if (ppc_md.progress) |
| 112 | + ppc_md.progress("ge_imp3a_setup_arch()", 0); |
124 | 113 |
|
125 | 114 | mpc85xx_smp_init(); |
126 | 115 |
|
127 | | -#ifdef CONFIG_SWIOTLB |
128 | | - if ((memblock_end_of_DRAM() - 1) > max) { |
129 | | - ppc_swiotlb_enable = 1; |
130 | | - set_pci_dma_ops(&swiotlb_dma_ops); |
131 | | - ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
132 | | - } |
133 | | -#endif |
| 116 | + ge_imp3a_pci_assign_primary(); |
| 117 | + |
| 118 | + swiotlb_detect_4g(); |
134 | 119 |
|
135 | 120 | /* Remap basic board registers */ |
136 | 121 | regs = of_find_compatible_node(NULL, NULL, "ge,imp3a-fpga-regs"); |
@@ -215,17 +200,10 @@ static int __init ge_imp3a_probe(void) |
215 | 200 | { |
216 | 201 | unsigned long root = of_get_flat_dt_root(); |
217 | 202 |
|
218 | | - if (of_flat_dt_is_compatible(root, "ge,IMP3A")) { |
219 | | -#ifdef CONFIG_PCI |
220 | | - primary_phb_addr = 0x9000; |
221 | | -#endif |
222 | | - return 1; |
223 | | - } |
224 | | - |
225 | | - return 0; |
| 203 | + return of_flat_dt_is_compatible(root, "ge,IMP3A"); |
226 | 204 | } |
227 | 205 |
|
228 | | -machine_device_initcall(ge_imp3a, mpc85xx_common_publish_devices); |
| 206 | +machine_arch_initcall(ge_imp3a, mpc85xx_common_publish_devices); |
229 | 207 |
|
230 | 208 | machine_arch_initcall(ge_imp3a, swiotlb_setup_bus_notifier); |
231 | 209 |
|
|
0 commit comments