1 // SPDX-License-Identifier: GPL-2.0+
3 * (c) 2015 Purna Chandra Mandal <purna.mandal@microchip.com>
9 #include <mach/pic32.h>
12 #define UNLOCK_KEY1 0xaa996655
13 #define UNLOCK_KEY2 0x556699aa
18 void _machine_restart(void)
22 base = pic32_get_syscfg_base();
25 writel(LOCK_KEY, base + SYSKEY);
26 writel(UNLOCK_KEY1, base + SYSKEY);
27 writel(UNLOCK_KEY2, base + SYSKEY);
30 writel(0x1, base + RSWRST);
31 (void) readl(base + RSWRST);