blob: 8584cdd1c827687e2f0c5c067944e9688fcbf66b [file] [log] [blame]
Daniel Tang9851ca52013-06-11 18:40:17 +10001/*
2 * linux/arch/arm/mach-nspire/nspire.c
3 *
4 * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 */
11#include <linux/init.h>
12#include <linux/of_irq.h>
13#include <linux/of_address.h>
14#include <linux/of_platform.h>
15#include <linux/irqchip.h>
16#include <linux/irqchip/arm-vic.h>
Daniel Tang9851ca52013-06-11 18:40:17 +100017#include <linux/clkdev.h>
18#include <linux/amba/bus.h>
19#include <linux/amba/clcd.h>
Daniel Tang9851ca52013-06-11 18:40:17 +100020
21#include <asm/mach/arch.h>
22#include <asm/mach-types.h>
23#include <asm/mach/map.h>
24
Daniel Tang9851ca52013-06-11 18:40:17 +100025#include "mmio.h"
26#include "clcd.h"
27
Uwe Kleine-König543c5042015-02-18 21:01:45 +010028static const char *const nspire_dt_match[] __initconst = {
Daniel Tang9851ca52013-06-11 18:40:17 +100029 "ti,nspire",
30 "ti,nspire-cx",
31 "ti,nspire-tp",
32 "ti,nspire-clp",
33 NULL,
34};
35
Daniel Tang9851ca52013-06-11 18:40:17 +100036static struct clcd_board nspire_clcd_data = {
37 .name = "LCD",
38 .caps = CLCD_CAP_5551 | CLCD_CAP_565,
39 .check = clcdfb_check,
40 .decode = clcdfb_decode,
41 .setup = nspire_clcd_setup,
42 .mmap = nspire_clcd_mmap,
43 .remove = nspire_clcd_remove,
44};
45
46
47static struct of_dev_auxdata nspire_auxdata[] __initdata = {
48 OF_DEV_AUXDATA("arm,pl111", NSPIRE_LCD_PHYS_BASE,
49 NULL, &nspire_clcd_data),
50 { }
51};
52
53static void __init nspire_init(void)
54{
Kefeng Wang435ebcb2016-06-01 14:53:05 +080055 of_platform_default_populate(NULL, nspire_auxdata, NULL);
Daniel Tang9851ca52013-06-11 18:40:17 +100056}
57
Alexander Shiyan27addb92014-03-20 22:25:11 +040058static void nspire_restart(enum reboot_mode mode, const char *cmd)
Daniel Tang9851ca52013-06-11 18:40:17 +100059{
60 void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K);
61 if (!base)
62 return;
63
64 writel(2, base + NSPIRE_MISC_HWRESET);
65}
66
67DT_MACHINE_START(NSPIRE, "TI-NSPIRE")
68 .dt_compat = nspire_dt_match,
Daniel Tang9851ca52013-06-11 18:40:17 +100069 .init_machine = nspire_init,
70 .restart = nspire_restart,
71MACHINE_END