* [PATCH v2 1/3] add machine-specific hook to machine_kexec
@ 2011-02-02 22:16 Eric Cooper
2011-02-02 22:16 ` [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register Eric Cooper
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Eric Cooper @ 2011-02-02 22:16 UTC (permalink / raw)
To: linux-arm-kernel
Provide the option to call a machine-specific function
before kexec'ing a new kernel.
Signed-off-by: Eric Cooper <ecc@cmu.edu>
---
arch/arm/kernel/machine_kexec.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 30ead13..e59bbd4 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -75,6 +75,11 @@ void machine_crash_shutdown(struct pt_regs *regs)
printk(KERN_INFO "Loading crashdump kernel...\n");
}
+/*
+ * Function pointer to optional machine-specific reinitialization
+ */
+void (*kexec_reinit)(void);
+
void machine_kexec(struct kimage *image)
{
unsigned long page_list;
@@ -104,6 +109,8 @@ void machine_kexec(struct kimage *image)
(unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
printk(KERN_INFO "Bye!\n");
+ if (kexec_reinit)
+ kexec_reinit();
local_irq_disable();
local_fiq_disable();
setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register
2011-02-02 22:16 [PATCH v2 1/3] add machine-specific hook to machine_kexec Eric Cooper
@ 2011-02-02 22:16 ` Eric Cooper
2011-02-04 13:16 ` Sergei Shtylyov
2011-02-02 22:16 ` [PATCH v2 3/3] Kirkwood: enable PCIe for kexec Eric Cooper
2011-02-02 22:22 ` [PATCH v2 1/3] add machine-specific hook to machine_kexec Nicolas Pitre
2 siblings, 1 reply; 5+ messages in thread
From: Eric Cooper @ 2011-02-02 22:16 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
arch/arm/mach-kirkwood/common.h | 1 +
arch/arm/mach-kirkwood/pcie.c | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 95bb0a7..a35b862 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -32,6 +32,7 @@ void kirkwood_init_irq(void);
extern struct mbus_dram_target_info kirkwood_mbus_dram_info;
void kirkwood_setup_cpu_mbus(void);
+void kirkwood_enable_pcie(void);
void kirkwood_pcie_id(u32 *dev, u32 *rev);
void kirkwood_ehci_init(void);
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 513ad31..ca294ff 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -18,8 +18,16 @@
#include <mach/bridge-regs.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)
{
+ kirkwood_enable_pcie();
*dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE);
*rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register
2011-02-02 22:16 ` [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register Eric Cooper
@ 2011-02-04 13:16 ` Sergei Shtylyov
0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2011-02-04 13:16 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 03-02-2011 1:16, Eric Cooper wrote:
> 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>
[...]
> diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
> index 513ad31..ca294ff 100644
> --- a/arch/arm/mach-kirkwood/pcie.c
> +++ b/arch/arm/mach-kirkwood/pcie.c
> @@ -18,8 +18,16 @@
> #include<mach/bridge-regs.h>
> #include "common.h"
>
> +void kirkwood_enable_pcie(void)
> +{
> + u32 curr = readl(CLOCK_GATING_CTRL);
An empty line wouldn't hurt here...
> + if (!(curr& CGC_PEX0))
> + writel(curr | CGC_PEX0, CLOCK_GATING_CTRL);
> +}
> +
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] Kirkwood: enable PCIe for kexec
2011-02-02 22:16 [PATCH v2 1/3] add machine-specific hook to machine_kexec Eric Cooper
2011-02-02 22:16 ` [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register Eric Cooper
@ 2011-02-02 22:16 ` Eric Cooper
2011-02-02 22:22 ` [PATCH v2 1/3] add machine-specific hook to machine_kexec Nicolas Pitre
2 siblings, 0 replies; 5+ messages in thread
From: Eric Cooper @ 2011-02-02 22:16 UTC (permalink / raw)
To: linux-arm-kernel
Use the machine-specific kexec_reinit hook to make sure
PCIe is enabled before starting a new kernel.
Signed-off-by: Eric Cooper <ecc@cmu.edu>
---
arch/arm/mach-kirkwood/common.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 3688123..78eeb63 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -974,6 +974,8 @@ static void __init kirkwood_l2_init(void)
void __init kirkwood_init(void)
{
+ extern void (*kexec_reinit)(void);
+
printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
kirkwood_id(), kirkwood_tclk);
kirkwood_ge00_shared_data.t_clk = kirkwood_tclk;
@@ -1003,6 +1005,8 @@ void __init kirkwood_init(void)
kirkwood_xor0_init();
kirkwood_xor1_init();
kirkwood_crypto_init();
+
+ kexec_reinit = kirkwood_enable_pcie;
}
static int __init kirkwood_clock_gate(void)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 1/3] add machine-specific hook to machine_kexec
2011-02-02 22:16 [PATCH v2 1/3] add machine-specific hook to machine_kexec Eric Cooper
2011-02-02 22:16 ` [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register Eric Cooper
2011-02-02 22:16 ` [PATCH v2 3/3] Kirkwood: enable PCIe for kexec Eric Cooper
@ 2011-02-02 22:22 ` Nicolas Pitre
2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Pitre @ 2011-02-02 22:22 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, 2 Feb 2011, Eric Cooper wrote:
> Provide the option to call a machine-specific function
> before kexec'ing a new kernel.
>
> Signed-off-by: Eric Cooper <ecc@cmu.edu>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Russell: if you agree I can carry this in the kirkwood git tree as the
following kirkwood specific patches depend on this.
> ---
> arch/arm/kernel/machine_kexec.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
> index 30ead13..e59bbd4 100644
> --- a/arch/arm/kernel/machine_kexec.c
> +++ b/arch/arm/kernel/machine_kexec.c
> @@ -75,6 +75,11 @@ void machine_crash_shutdown(struct pt_regs *regs)
> printk(KERN_INFO "Loading crashdump kernel...\n");
> }
>
> +/*
> + * Function pointer to optional machine-specific reinitialization
> + */
> +void (*kexec_reinit)(void);
> +
> void machine_kexec(struct kimage *image)
> {
> unsigned long page_list;
> @@ -104,6 +109,8 @@ void machine_kexec(struct kimage *image)
> (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
> printk(KERN_INFO "Bye!\n");
>
> + if (kexec_reinit)
> + kexec_reinit();
> local_irq_disable();
> local_fiq_disable();
> setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
> --
> 1.7.2.3
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-04 13:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 22:16 [PATCH v2 1/3] add machine-specific hook to machine_kexec Eric Cooper
2011-02-02 22:16 ` [PATCH v2 2/3] Kirkwood: enable PCIe before reading device ID register Eric Cooper
2011-02-04 13:16 ` Sergei Shtylyov
2011-02-02 22:16 ` [PATCH v2 3/3] Kirkwood: enable PCIe for kexec Eric Cooper
2011-02-02 22:22 ` [PATCH v2 1/3] add machine-specific hook to machine_kexec Nicolas Pitre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).