diff options
author | Eric Cooper <ecc@cmu.edu> | 2011-02-02 17:16:10 -0500 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-03-03 16:26:56 -0500 |
commit | 0e0cdd37709ba7ac9f0bff5de1b22f1b7987b04c (patch) | |
tree | 10fedbe7429bbb9afddd01215aef3cd490c31bdd /arch/arm/mach-kirkwood/pcie.c | |
parent | 868d172b8ac23070418ec6265195e88e8d5dbe92 (diff) |
[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: Eric Cooper <ecc@cmu.edu>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-kirkwood/pcie.c')
-rw-r--r-- | arch/arm/mach-kirkwood/pcie.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 513ad3102d7c..ca294ff6d5be 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -18,8 +18,16 @@ | |||
18 | #include <mach/bridge-regs.h> | 18 | #include <mach/bridge-regs.h> |
19 | #include "common.h" | 19 | #include "common.h" |
20 | 20 | ||
21 | void kirkwood_enable_pcie(void) | ||
22 | { | ||
23 | u32 curr = readl(CLOCK_GATING_CTRL); | ||
24 | if (!(curr & CGC_PEX0)) | ||
25 | writel(curr | CGC_PEX0, CLOCK_GATING_CTRL); | ||
26 | } | ||
27 | |||
21 | void __init kirkwood_pcie_id(u32 *dev, u32 *rev) | 28 | void __init kirkwood_pcie_id(u32 *dev, u32 *rev) |
22 | { | 29 | { |
30 | kirkwood_enable_pcie(); | ||
23 | *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE); | 31 | *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE); |
24 | *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE); | 32 | *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE); |
25 | } | 33 | } |