drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / mips / lantiq / falcon / reset.c
blob261996c230cf653c0a143510aeaf53175247ce37
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
4 * Copyright (C) 2012 Thomas Langer <thomas.langer@lantiq.com>
5 * Copyright (C) 2012 John Crispin <john@phrozen.org>
6 */
8 #include <linux/init.h>
9 #include <linux/io.h>
10 #include <linux/pm.h>
11 #include <asm/reboot.h>
12 #include <linux/export.h>
14 #include <lantiq_soc.h>
17 * Dummy implementation. Used to allow platform code to find out what
18 * source was booted from
20 unsigned char ltq_boot_select(void)
22 return BS_SPI;
25 #define BOOT_REG_BASE (KSEG1 | 0x1F200000)
26 #define BOOT_PW1_REG (BOOT_REG_BASE | 0x20)
27 #define BOOT_PW2_REG (BOOT_REG_BASE | 0x24)
28 #define BOOT_PW1 0x4C545100
29 #define BOOT_PW2 0x0051544C
31 #define WDT_REG_BASE (KSEG1 | 0x1F8803F0)
32 #define WDT_PW1 0x00BE0000
33 #define WDT_PW2 0x00DC0000
35 static void machine_restart(char *command)
37 local_irq_disable();
39 /* reboot magic */
40 ltq_w32(BOOT_PW1, (void *)BOOT_PW1_REG); /* 'LTQ\0' */
41 ltq_w32(BOOT_PW2, (void *)BOOT_PW2_REG); /* '\0QTL' */
42 ltq_w32(0, (void *)BOOT_REG_BASE); /* reset Bootreg RVEC */
44 /* watchdog magic */
45 ltq_w32(WDT_PW1, (void *)WDT_REG_BASE);
46 ltq_w32(WDT_PW2 |
47 (0x3 << 26) | /* PWL */
48 (0x2 << 24) | /* CLKDIV */
49 (0x1 << 31) | /* enable */
50 (1), /* reload */
51 (void *)WDT_REG_BASE);
52 unreachable();
55 static void machine_halt(void)
57 local_irq_disable();
58 unreachable();
61 static void machine_power_off(void)
63 local_irq_disable();
64 unreachable();
67 static int __init mips_reboot_setup(void)
69 _machine_restart = machine_restart;
70 _machine_halt = machine_halt;
71 pm_power_off = machine_power_off;
72 return 0;
75 arch_initcall(mips_reboot_setup);