David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/mach-nspire/nspire.c |
| 4 | * |
| 5 | * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | */ |
| 7 | #include <linux/init.h> |
| 8 | #include <linux/of_irq.h> |
| 9 | #include <linux/of_address.h> |
| 10 | #include <linux/of_platform.h> |
| 11 | #include <linux/irqchip.h> |
| 12 | #include <linux/irqchip/arm-vic.h> |
| 13 | #include <linux/clkdev.h> |
| 14 | #include <linux/amba/bus.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 15 | |
| 16 | #include <asm/mach/arch.h> |
| 17 | #include <asm/mach-types.h> |
| 18 | #include <asm/mach/map.h> |
| 19 | |
| 20 | #include "mmio.h" |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 21 | |
| 22 | static const char *const nspire_dt_match[] __initconst = { |
| 23 | "ti,nspire", |
| 24 | "ti,nspire-cx", |
| 25 | "ti,nspire-tp", |
| 26 | "ti,nspire-clp", |
| 27 | NULL, |
| 28 | }; |
| 29 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 30 | static void nspire_restart(enum reboot_mode mode, const char *cmd) |
| 31 | { |
| 32 | void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K); |
| 33 | if (!base) |
| 34 | return; |
| 35 | |
| 36 | writel(2, base + NSPIRE_MISC_HWRESET); |
| 37 | } |
| 38 | |
| 39 | DT_MACHINE_START(NSPIRE, "TI-NSPIRE") |
| 40 | .dt_compat = nspire_dt_match, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 41 | .restart = nspire_restart, |
| 42 | MACHINE_END |