2 * Joshua Henderson <joshua.henderson@microchip.com>
3 * Copyright (C) 2015 Microchip Technology Inc. All rights reserved.
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 #include <linux/init.h>
16 #include <asm/reboot.h>
17 #include <asm/mach-pic32/pic32.h>
19 #define PIC32_RSWRST 0x10
21 static void pic32_halt(void)
24 __asm__(".set push;\n"
32 static void pic32_machine_restart(char *command
)
35 ioremap(PIC32_BASE_RESET
+ PIC32_RSWRST
, sizeof(u32
));
37 pic32_syskey_unlock();
39 /* magic write/read */
41 (void)__raw_readl(reg
);
46 static void pic32_machine_halt(void)
53 static int __init
mips_reboot_setup(void)
55 _machine_restart
= pic32_machine_restart
;
56 _machine_halt
= pic32_machine_halt
;
57 pm_power_off
= pic32_machine_halt
;
62 arch_initcall(mips_reboot_setup
);