2 * arch/blackfin/kernel/reboot.c - handle shutdown/reboot
4 * Copyright 2004-2007 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
9 #include <linux/interrupt.h>
10 #include <asm/bfin-global.h>
11 #include <asm/reboot.h>
12 #include <asm/system.h>
14 #if defined(BF537_FAMILY) || defined(BF533_FAMILY) || defined(BF527_FAMILY)
16 #elif defined(BF561_FAMILY)
17 #define SYSCR_VAL 0x20
18 #elif defined(BF548_FAMILY)
19 #define SYSCR_VAL 0x10
22 /* A system soft reset makes external memory unusable
23 * so force this function into L1.
25 __attribute__((l1_text))
28 /* force BMODE and disable Core B (as needed) */
29 bfin_write_SYSCR(SYSCR_VAL);
31 /* we use asm ssync here because it's save and we save some L1 */
35 /* initiate system soft reset with magic 0x7 */
36 bfin_write_SWRST(0x7);
39 /* clear system soft reset */
43 /* issue core reset */
49 void native_machine_restart(char *cmd)
53 void machine_restart(char *cmd)
55 native_machine_restart(cmd);
61 void native_machine_halt(void)
63 idle_with_irq_disabled();
66 void machine_halt(void)
68 native_machine_halt();
72 void native_machine_power_off(void)
74 idle_with_irq_disabled();
77 void machine_power_off(void)
79 native_machine_power_off();