diff options
Diffstat (limited to 'arch/arm/mach-kirkwood/pcie.c')
-rw-r--r-- | arch/arm/mach-kirkwood/pcie.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index ec544918b12c..1e9f90ee0f5c 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -26,7 +26,7 @@ static void kirkwood_enable_pcie_clk(const char *port) | |||
26 | 26 | ||
27 | clk = clk_get_sys("pcie", port); | 27 | clk = clk_get_sys("pcie", port); |
28 | if (IS_ERR(clk)) { | 28 | if (IS_ERR(clk)) { |
29 | printk(KERN_ERR "PCIE clock %s missing\n", port); | 29 | pr_err("PCIE clock %s missing\n", port); |
30 | return; | 30 | return; |
31 | } | 31 | } |
32 | clk_prepare_enable(clk); | 32 | clk_prepare_enable(clk); |
@@ -168,7 +168,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) | |||
168 | return 0; | 168 | return 0; |
169 | 169 | ||
170 | index = pcie_port_map[nr]; | 170 | index = pcie_port_map[nr]; |
171 | printk(KERN_INFO "PCI: bus%d uses PCIe port %d\n", sys->busnr, index); | 171 | pr_info("PCI: bus%d uses PCIe port %d\n", sys->busnr, index); |
172 | 172 | ||
173 | pp = kzalloc(sizeof(*pp), GFP_KERNEL); | 173 | pp = kzalloc(sizeof(*pp), GFP_KERNEL); |
174 | if (!pp) | 174 | if (!pp) |
@@ -186,7 +186,8 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) | |||
186 | case 1: | 186 | case 1: |
187 | kirkwood_enable_pcie_clk("1"); | 187 | kirkwood_enable_pcie_clk("1"); |
188 | pcie1_ioresources_init(pp); | 188 | pcie1_ioresources_init(pp); |
189 | pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE1_IO_PHYS_BASE); | 189 | pci_ioremap_io(SZ_64K * sys->busnr, |
190 | KIRKWOOD_PCIE1_IO_PHYS_BASE); | ||
190 | break; | 191 | break; |
191 | default: | 192 | default: |
192 | panic("PCIe setup: invalid controller %d", index); | 193 | panic("PCIe setup: invalid controller %d", index); |
@@ -224,22 +225,6 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev) | |||
224 | } | 225 | } |
225 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup); | 226 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup); |
226 | 227 | ||
227 | static struct pci_bus __init * | ||
228 | kirkwood_pcie_scan_bus(int nr, struct pci_sys_data *sys) | ||
229 | { | ||
230 | struct pci_bus *bus; | ||
231 | |||
232 | if (nr < num_pcie_ports) { | ||
233 | bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys, | ||
234 | &sys->resources); | ||
235 | } else { | ||
236 | bus = NULL; | ||
237 | BUG(); | ||
238 | } | ||
239 | |||
240 | return bus; | ||
241 | } | ||
242 | |||
243 | static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot, | 228 | static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot, |
244 | u8 pin) | 229 | u8 pin) |
245 | { | 230 | { |
@@ -251,19 +236,19 @@ static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot, | |||
251 | 236 | ||
252 | static struct hw_pci kirkwood_pci __initdata = { | 237 | static struct hw_pci kirkwood_pci __initdata = { |
253 | .setup = kirkwood_pcie_setup, | 238 | .setup = kirkwood_pcie_setup, |
254 | .scan = kirkwood_pcie_scan_bus, | ||
255 | .map_irq = kirkwood_pcie_map_irq, | 239 | .map_irq = kirkwood_pcie_map_irq, |
240 | .ops = &pcie_ops, | ||
256 | }; | 241 | }; |
257 | 242 | ||
258 | static void __init add_pcie_port(int index, void __iomem *base) | 243 | static void __init add_pcie_port(int index, void __iomem *base) |
259 | { | 244 | { |
260 | printk(KERN_INFO "Kirkwood PCIe port %d: ", index); | 245 | pr_info("Kirkwood PCIe port %d: ", index); |
261 | 246 | ||
262 | if (orion_pcie_link_up(base)) { | 247 | if (orion_pcie_link_up(base)) { |
263 | printk(KERN_INFO "link up\n"); | 248 | pr_info("link up\n"); |
264 | pcie_port_map[num_pcie_ports++] = index; | 249 | pcie_port_map[num_pcie_ports++] = index; |
265 | } else | 250 | } else |
266 | printk(KERN_INFO "link down, ignoring\n"); | 251 | pr_info("link down, ignoring\n"); |
267 | } | 252 | } |
268 | 253 | ||
269 | void __init kirkwood_pcie_init(unsigned int portmask) | 254 | void __init kirkwood_pcie_init(unsigned int portmask) |