diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:55 +0200 |
commit | 67e0a30e77c0dadfb225eef7e9bdcccdcae4d679 (patch) | |
tree | aa1887ec66dc1e48eaeacca93ac38b55a49a3f99 /arch/ppc | |
parent | b7ab2081b1f1f13f0823bb6e8e33884510e105d7 (diff) | |
parent | ce36b4a05e275dcc12e74e96ddae99c21faad466 (diff) | |
download | barebox-67e0a30e77c0dadfb225eef7e9bdcccdcae4d679.tar.gz barebox-67e0a30e77c0dadfb225eef7e9bdcccdcae4d679.tar.xz |
Merge branch 'for-next/restart'
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/lib/ppclinux.c | 3 | ||||
-rw-r--r-- | arch/ppc/mach-mpc5xxx/cpu.c | 11 | ||||
-rw-r--r-- | arch/ppc/mach-mpc85xx/cpu.c | 14 |
3 files changed, 22 insertions, 6 deletions
diff --git a/arch/ppc/lib/ppclinux.c b/arch/ppc/lib/ppclinux.c index e25efecd43..409c0cf261 100644 --- a/arch/ppc/lib/ppclinux.c +++ b/arch/ppc/lib/ppclinux.c @@ -10,6 +10,7 @@ #include <asm/processor.h> #include <boot.h> #include <errno.h> +#include <restart.h> #include <fs.h> static int bootm_relocate_fdt(void *addr, struct image_data *data) @@ -87,7 +88,7 @@ static int do_bootm_linux(struct image_data *data) */ kernel(data->oftree, kernel, 0, 0, 0); - reset_cpu(0); + restart_machine(); error: return -1; diff --git a/arch/ppc/mach-mpc5xxx/cpu.c b/arch/ppc/mach-mpc5xxx/cpu.c index 3f826e4994..33835e7060 100644 --- a/arch/ppc/mach-mpc5xxx/cpu.c +++ b/arch/ppc/mach-mpc5xxx/cpu.c @@ -31,6 +31,7 @@ #include <types.h> #include <errno.h> #include <of.h> +#include <restart.h> #include <mach/clock.h> int checkcpu (void) @@ -59,7 +60,7 @@ int checkcpu (void) /* ------------------------------------------------------------------------- */ -void __noreturn reset_cpu (unsigned long addr) +static void __noreturn mpc5xxx_restart_soc(struct restart_handler *rst) { ulong msr; /* Interrupts and MMU off */ @@ -71,9 +72,15 @@ void __noreturn reset_cpu (unsigned long addr) /* Charge the watchdog timer */ *(vu_long *)(MPC5XXX_GPT0_COUNTER) = 0x0001000f; *(vu_long *)(MPC5XXX_GPT0_ENABLE) = 0x9004; /* wden|ce|timer_ms */ - while(1); + hang(); } +static int restart_register_feature(void) +{ + restart_handler_register_fn(mpc5xxx_restart_soc); +} +coredevice_initcall(restart_register_feature); + /* ------------------------------------------------------------------------- */ #ifdef CONFIG_OFTREE diff --git a/arch/ppc/mach-mpc85xx/cpu.c b/arch/ppc/mach-mpc85xx/cpu.c index 7c183c1b5e..42464e810c 100644 --- a/arch/ppc/mach-mpc85xx/cpu.c +++ b/arch/ppc/mach-mpc85xx/cpu.c @@ -26,12 +26,13 @@ #include <common.h> #include <memory.h> #include <init.h> +#include <restart.h> #include <asm/fsl_ddr_sdram.h> #include <asm-generic/memory_layout.h> #include <mach/mmu.h> #include <mach/immap_85xx.h> -void __noreturn reset_cpu(unsigned long addr) +static void __noreturn mpc85xx_restart_soc(struct restart_handler *rst) { void __iomem *regs = (void __iomem *)MPC85xx_GUTS_ADDR; @@ -39,10 +40,17 @@ void __noreturn reset_cpu(unsigned long addr) out_be32(regs + MPC85xx_GUTS_RSTCR_OFFSET, 0x2); /* HRESET_REQ */ udelay(100); - while (1) - ; + hang(); } +static int restart_register_feature(void) +{ + restart_handler_register_fn(mpc85xx_restart_soc); + + return 0; +} +coredevice_initcall(restart_register_feature); + long int initdram(int board_type) { phys_size_t dram_size = 0; |