Commit 7a6bb262 authored by Per Andersson's avatar Per Andersson Committed by Nicolas Pitre

[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: default avatarPer Andersson <avtobiff@gmail.com>
Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
parent 6a55617e
...@@ -41,6 +41,7 @@ struct pci_bus; ...@@ -41,6 +41,7 @@ struct pci_bus;
struct pci_sys_data; struct pci_sys_data;
void orion5x_pcie_id(u32 *dev, u32 *rev); void orion5x_pcie_id(u32 *dev, u32 *rev);
void orion5x_pci_disable(void);
void orion5x_pci_set_cardbus_mode(void); void orion5x_pci_set_cardbus_mode(void);
int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys); int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys); struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
......
...@@ -146,8 +146,10 @@ static struct hw_pci kurobox_pro_pci __initdata = { ...@@ -146,8 +146,10 @@ static struct hw_pci kurobox_pro_pci __initdata = {
static int __init kurobox_pro_pci_init(void) static int __init kurobox_pro_pci_init(void)
{ {
if (machine_is_kurobox_pro()) if (machine_is_kurobox_pro()) {
orion5x_pci_disable();
pci_common_init(&kurobox_pro_pci); pci_common_init(&kurobox_pro_pci);
}
return 0; return 0;
} }
......
...@@ -541,6 +541,13 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev) ...@@ -541,6 +541,13 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev)
} }
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
static int orion5x_pci_disabled __initdata;
void __init orion5x_pci_disable(void)
{
orion5x_pci_disabled = 1;
}
void __init orion5x_pci_set_cardbus_mode(void) void __init orion5x_pci_set_cardbus_mode(void)
{ {
orion5x_pci_cardbus_mode = 1; orion5x_pci_cardbus_mode = 1;
...@@ -553,7 +560,7 @@ int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys) ...@@ -553,7 +560,7 @@ int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
if (nr == 0) { if (nr == 0) {
orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
ret = pcie_setup(sys); ret = pcie_setup(sys);
} else if (nr == 1) { } else if (nr == 1 && !orion5x_pci_disabled) {
orion5x_pci_set_bus_nr(sys->busnr); orion5x_pci_set_bus_nr(sys->busnr);
ret = pci_setup(sys); ret = pci_setup(sys);
} }
...@@ -567,7 +574,7 @@ struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys ...@@ -567,7 +574,7 @@ struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys
if (nr == 0) { if (nr == 0) {
bus = pci_scan_bus(sys->busnr, &pcie_ops, sys); bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
} else if (nr == 1) { } else if (nr == 1 && !orion5x_pci_disabled) {
bus = pci_scan_bus(sys->busnr, &pci_ops, sys); bus = pci_scan_bus(sys->busnr, &pci_ops, sys);
} else { } else {
bus = NULL; bus = NULL;
...@@ -584,7 +591,7 @@ int __init orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) ...@@ -584,7 +591,7 @@ int __init orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
/* /*
* PCIe endpoint? * PCIe endpoint?
*/ */
if (bus < orion5x_pci_local_bus_nr()) if (orion5x_pci_disabled || bus < orion5x_pci_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT; return IRQ_ORION5X_PCIE0_INT;
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment