[ARM] Orion: Fix boot crash on Kurobox Pro

The Kurobox Pro crashes when any of the PCI controller registers
are accessed. This patch adds a function to the Orion PCI handling
code that board support code can call to disable enumerating the
PCI bus entirely, and makes the Kurobox Pro PCI-related init code
call this function.

Signed-off-by: Per Andersson <avtobiff@gmail.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>

authored by Per Andersson and committed by Nicolas Pitre 7a6bb262 6a55617e

+14 -4
+1
arch/arm/mach-orion5x/common.h
··· 41 41 struct pci_sys_data; 42 42 43 43 void orion5x_pcie_id(u32 *dev, u32 *rev); 44 + void orion5x_pci_disable(void); 44 45 void orion5x_pci_set_cardbus_mode(void); 45 46 int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys); 46 47 struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
+3 -1
arch/arm/mach-orion5x/kurobox_pro-setup.c
··· 146 146 147 147 static int __init kurobox_pro_pci_init(void) 148 148 { 149 - if (machine_is_kurobox_pro()) 149 + if (machine_is_kurobox_pro()) { 150 + orion5x_pci_disable(); 150 151 pci_common_init(&kurobox_pro_pci); 152 + } 151 153 152 154 return 0; 153 155 }
+10 -3
arch/arm/mach-orion5x/pci.c
··· 541 541 } 542 542 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup); 543 543 544 + static int orion5x_pci_disabled __initdata; 545 + 546 + void __init orion5x_pci_disable(void) 547 + { 548 + orion5x_pci_disabled = 1; 549 + } 550 + 544 551 void __init orion5x_pci_set_cardbus_mode(void) 545 552 { 546 553 orion5x_pci_cardbus_mode = 1; ··· 560 553 if (nr == 0) { 561 554 orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); 562 555 ret = pcie_setup(sys); 563 - } else if (nr == 1) { 556 + } else if (nr == 1 && !orion5x_pci_disabled) { 564 557 orion5x_pci_set_bus_nr(sys->busnr); 565 558 ret = pci_setup(sys); 566 559 } ··· 574 567 575 568 if (nr == 0) { 576 569 bus = pci_scan_bus(sys->busnr, &pcie_ops, sys); 577 - } else if (nr == 1) { 570 + } else if (nr == 1 && !orion5x_pci_disabled) { 578 571 bus = pci_scan_bus(sys->busnr, &pci_ops, sys); 579 572 } else { 580 573 bus = NULL; ··· 591 584 /* 592 585 * PCIe endpoint? 593 586 */ 594 - if (bus < orion5x_pci_local_bus_nr()) 587 + if (orion5x_pci_disabled || bus < orion5x_pci_local_bus_nr()) 595 588 return IRQ_ORION5X_PCIE0_INT; 596 589 597 590 return -1;