Commit 0e0cdd37 authored by Eric Cooper's avatar Eric Cooper Committed by Nicolas Pitre
Browse files

[ARM] Kirkwood: enable PCIe before reading device ID register

PCIe may have been disabled (by kirkwood_clock_gate)
if this kernel was started by kexec.  Make sure PCIe
is enabled before attempting to access the device ID
register, otherwise the system will hang.
Signed-off-by: default avatarEric Cooper <>
Signed-off-by: default avatarNicolas Pitre <>
parent 868d172b
...@@ -32,6 +32,7 @@ void kirkwood_init_irq(void); ...@@ -32,6 +32,7 @@ void kirkwood_init_irq(void);
extern struct mbus_dram_target_info kirkwood_mbus_dram_info; extern struct mbus_dram_target_info kirkwood_mbus_dram_info;
void kirkwood_setup_cpu_mbus(void); void kirkwood_setup_cpu_mbus(void);
void kirkwood_enable_pcie(void);
void kirkwood_pcie_id(u32 *dev, u32 *rev); void kirkwood_pcie_id(u32 *dev, u32 *rev);
void kirkwood_ehci_init(void); void kirkwood_ehci_init(void);
...@@ -18,8 +18,16 @@ ...@@ -18,8 +18,16 @@
#include <mach/bridge-regs.h> #include <mach/bridge-regs.h>
#include "common.h" #include "common.h"
void kirkwood_enable_pcie(void)
u32 curr = readl(CLOCK_GATING_CTRL);
if (!(curr & CGC_PEX0))
writel(curr | CGC_PEX0, CLOCK_GATING_CTRL);
void __init kirkwood_pcie_id(u32 *dev, u32 *rev) void __init kirkwood_pcie_id(u32 *dev, u32 *rev)
{ {
*dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE); *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE);
*rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE); *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE);
} }
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