xref: /openbmc/linux/arch/arm/mach-nspire/nspire.c (revision 2169e6da)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  *	linux/arch/arm/mach-nspire/nspire.c
4  *
5  *	Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
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>
15 #include <linux/amba/clcd.h>
16 
17 #include <asm/mach/arch.h>
18 #include <asm/mach-types.h>
19 #include <asm/mach/map.h>
20 
21 #include "mmio.h"
22 #include "clcd.h"
23 
24 static const char *const nspire_dt_match[] __initconst = {
25 	"ti,nspire",
26 	"ti,nspire-cx",
27 	"ti,nspire-tp",
28 	"ti,nspire-clp",
29 	NULL,
30 };
31 
32 static struct clcd_board nspire_clcd_data = {
33 	.name		= "LCD",
34 	.caps		= CLCD_CAP_5551 | CLCD_CAP_565,
35 	.check		= clcdfb_check,
36 	.decode		= clcdfb_decode,
37 	.setup		= nspire_clcd_setup,
38 	.mmap		= nspire_clcd_mmap,
39 	.remove		= nspire_clcd_remove,
40 };
41 
42 
43 static struct of_dev_auxdata nspire_auxdata[] __initdata = {
44 	OF_DEV_AUXDATA("arm,pl111", NSPIRE_LCD_PHYS_BASE,
45 			NULL, &nspire_clcd_data),
46 	{ }
47 };
48 
49 static void __init nspire_init(void)
50 {
51 	of_platform_default_populate(NULL, nspire_auxdata, NULL);
52 }
53 
54 static void nspire_restart(enum reboot_mode mode, const char *cmd)
55 {
56 	void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K);
57 	if (!base)
58 		return;
59 
60 	writel(2, base + NSPIRE_MISC_HWRESET);
61 }
62 
63 DT_MACHINE_START(NSPIRE, "TI-NSPIRE")
64 	.dt_compat	= nspire_dt_match,
65 	.init_machine	= nspire_init,
66 	.restart	= nspire_restart,
67 MACHINE_END
68