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