diff options
author | Per Andersson <avtobiff@gmail.com> | 2008-08-11 06:00:52 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-08-21 22:15:17 -0400 |
commit | 7a6bb2622692495d1b7445a3e8c257601b803b02 (patch) | |
tree | 5735707076af1295aa6ef9be2413dfab291bd6da /arch/arm | |
parent | 6a55617ed5d1aa62b850de2cf66f5ede2eef4825 (diff) |
[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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-orion5x/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/kurobox_pro-setup.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/pci.c | 13 |
3 files changed, 14 insertions, 4 deletions
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index e75bd7004b94..0bd195551a27 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -41,6 +41,7 @@ struct pci_bus; | |||
41 | struct pci_sys_data; | 41 | struct pci_sys_data; |
42 | 42 | ||
43 | void orion5x_pcie_id(u32 *dev, u32 *rev); | 43 | void orion5x_pcie_id(u32 *dev, u32 *rev); |
44 | void orion5x_pci_disable(void); | ||
44 | void orion5x_pci_set_cardbus_mode(void); | 45 | void orion5x_pci_set_cardbus_mode(void); |
45 | int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys); | 46 | 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); | 47 | struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys); |
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c index cb72f1bb9cb7..e321ec331839 100644 --- a/arch/arm/mach-orion5x/kurobox_pro-setup.c +++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c | |||
@@ -146,8 +146,10 @@ static struct hw_pci kurobox_pro_pci __initdata = { | |||
146 | 146 | ||
147 | static int __init kurobox_pro_pci_init(void) | 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 | pci_common_init(&kurobox_pro_pci); | 151 | pci_common_init(&kurobox_pro_pci); |
152 | } | ||
151 | 153 | ||
152 | return 0; | 154 | return 0; |
153 | } | 155 | } |
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index fbceecc4b7ec..a7b7d77b1b09 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c | |||
@@ -541,6 +541,13 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev) | |||
541 | } | 541 | } |
542 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup); | 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 | void __init orion5x_pci_set_cardbus_mode(void) | 551 | void __init orion5x_pci_set_cardbus_mode(void) |
545 | { | 552 | { |
546 | orion5x_pci_cardbus_mode = 1; | 553 | orion5x_pci_cardbus_mode = 1; |
@@ -553,7 +560,7 @@ int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys) | |||
553 | if (nr == 0) { | 560 | if (nr == 0) { |
554 | orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); | 561 | orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); |
555 | ret = pcie_setup(sys); | 562 | ret = pcie_setup(sys); |
556 | } else if (nr == 1) { | 563 | } else if (nr == 1 && !orion5x_pci_disabled) { |
557 | orion5x_pci_set_bus_nr(sys->busnr); | 564 | orion5x_pci_set_bus_nr(sys->busnr); |
558 | ret = pci_setup(sys); | 565 | ret = pci_setup(sys); |
559 | } | 566 | } |
@@ -567,7 +574,7 @@ struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys | |||
567 | 574 | ||
568 | if (nr == 0) { | 575 | if (nr == 0) { |
569 | bus = pci_scan_bus(sys->busnr, &pcie_ops, sys); | 576 | bus = pci_scan_bus(sys->busnr, &pcie_ops, sys); |
570 | } else if (nr == 1) { | 577 | } else if (nr == 1 && !orion5x_pci_disabled) { |
571 | bus = pci_scan_bus(sys->busnr, &pci_ops, sys); | 578 | bus = pci_scan_bus(sys->busnr, &pci_ops, sys); |
572 | } else { | 579 | } else { |
573 | bus = NULL; | 580 | bus = NULL; |
@@ -584,7 +591,7 @@ int __init orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | |||
584 | /* | 591 | /* |
585 | * PCIe endpoint? | 592 | * PCIe endpoint? |
586 | */ | 593 | */ |
587 | if (bus < orion5x_pci_local_bus_nr()) | 594 | if (orion5x_pci_disabled || bus < orion5x_pci_local_bus_nr()) |
588 | return IRQ_ORION5X_PCIE0_INT; | 595 | return IRQ_ORION5X_PCIE0_INT; |
589 | 596 | ||
590 | return -1; | 597 | return -1; |