diff options
Diffstat (limited to 'arch/powerpc/platforms/86xx/mpc86xx_hpcn.c')
-rw-r--r-- | arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index 817245bc021..e8bf3fae560 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
21 | #include <linux/of_platform.h> | 21 | #include <linux/of_platform.h> |
22 | #include <linux/memblock.h> | ||
23 | 22 | ||
24 | #include <asm/time.h> | 23 | #include <asm/time.h> |
25 | #include <asm/machdep.h> | 24 | #include <asm/machdep.h> |
@@ -51,15 +50,8 @@ extern int uli_exclude_device(struct pci_controller *hose, | |||
51 | static int mpc86xx_exclude_device(struct pci_controller *hose, | 50 | static int mpc86xx_exclude_device(struct pci_controller *hose, |
52 | u_char bus, u_char devfn) | 51 | u_char bus, u_char devfn) |
53 | { | 52 | { |
54 | struct device_node* node; | 53 | if (hose->dn == fsl_pci_primary) |
55 | struct resource rsrc; | ||
56 | |||
57 | node = hose->dn; | ||
58 | of_address_to_resource(node, 0, &rsrc); | ||
59 | |||
60 | if ((rsrc.start & 0xfffff) == 0x8000) { | ||
61 | return uli_exclude_device(hose, bus, devfn); | 54 | return uli_exclude_device(hose, bus, devfn); |
62 | } | ||
63 | 55 | ||
64 | return PCIBIOS_SUCCESSFUL; | 56 | return PCIBIOS_SUCCESSFUL; |
65 | } | 57 | } |
@@ -69,30 +61,11 @@ static int mpc86xx_exclude_device(struct pci_controller *hose, | |||
69 | static void __init | 61 | static void __init |
70 | mpc86xx_hpcn_setup_arch(void) | 62 | mpc86xx_hpcn_setup_arch(void) |
71 | { | 63 | { |
72 | #ifdef CONFIG_PCI | ||
73 | struct device_node *np; | ||
74 | struct pci_controller *hose; | ||
75 | #endif | ||
76 | dma_addr_t max = 0xffffffff; | ||
77 | |||
78 | if (ppc_md.progress) | 64 | if (ppc_md.progress) |
79 | ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0); | 65 | ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0); |
80 | 66 | ||
81 | #ifdef CONFIG_PCI | 67 | #ifdef CONFIG_PCI |
82 | for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") { | ||
83 | struct resource rsrc; | ||
84 | of_address_to_resource(np, 0, &rsrc); | ||
85 | if ((rsrc.start & 0xfffff) == 0x8000) | ||
86 | fsl_add_bridge(np, 1); | ||
87 | else | ||
88 | fsl_add_bridge(np, 0); | ||
89 | hose = pci_find_hose_for_OF_device(np); | ||
90 | max = min(max, hose->dma_window_base_cur + | ||
91 | hose->dma_window_size); | ||
92 | } | ||
93 | |||
94 | ppc_md.pci_exclude_device = mpc86xx_exclude_device; | 68 | ppc_md.pci_exclude_device = mpc86xx_exclude_device; |
95 | |||
96 | #endif | 69 | #endif |
97 | 70 | ||
98 | printk("MPC86xx HPCN board from Freescale Semiconductor\n"); | 71 | printk("MPC86xx HPCN board from Freescale Semiconductor\n"); |
@@ -101,13 +74,9 @@ mpc86xx_hpcn_setup_arch(void) | |||
101 | mpc86xx_smp_init(); | 74 | mpc86xx_smp_init(); |
102 | #endif | 75 | #endif |
103 | 76 | ||
104 | #ifdef CONFIG_SWIOTLB | 77 | fsl_pci_assign_primary(); |
105 | if ((memblock_end_of_DRAM() - 1) > max) { | 78 | |
106 | ppc_swiotlb_enable = 1; | 79 | swiotlb_detect_4g(); |
107 | set_pci_dma_ops(&swiotlb_dma_ops); | ||
108 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | ||
109 | } | ||
110 | #endif | ||
111 | } | 80 | } |
112 | 81 | ||
113 | 82 | ||
@@ -162,6 +131,7 @@ static __initdata struct of_device_id of_bus_ids[] = { | |||
162 | { .compatible = "simple-bus", }, | 131 | { .compatible = "simple-bus", }, |
163 | { .compatible = "fsl,srio", }, | 132 | { .compatible = "fsl,srio", }, |
164 | { .compatible = "gianfar", }, | 133 | { .compatible = "gianfar", }, |
134 | { .compatible = "fsl,mpc8641-pcie", }, | ||
165 | {}, | 135 | {}, |
166 | }; | 136 | }; |
167 | 137 | ||
@@ -171,7 +141,7 @@ static int __init declare_of_platform_devices(void) | |||
171 | 141 | ||
172 | return 0; | 142 | return 0; |
173 | } | 143 | } |
174 | machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices); | 144 | machine_arch_initcall(mpc86xx_hpcn, declare_of_platform_devices); |
175 | machine_arch_initcall(mpc86xx_hpcn, swiotlb_setup_bus_notifier); | 145 | machine_arch_initcall(mpc86xx_hpcn, swiotlb_setup_bus_notifier); |
176 | 146 | ||
177 | define_machine(mpc86xx_hpcn) { | 147 | define_machine(mpc86xx_hpcn) { |