blob: 033cc31b3c7256834f7a00040b452d299c6601d8 [file] [log] [blame]
Haojian Zhuang5d489762012-03-01 13:25:09 +08001/*
2 * linux/arch/arm/mach-mmp/mmp-dt.c
3 *
4 * Copyright (C) 2012 Marvell Technology Group Ltd.
5 * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * publishhed by the Free Software Foundation.
10 */
11
12#include <linux/irq.h>
13#include <linux/irqdomain.h>
14#include <linux/of_irq.h>
15#include <linux/of_platform.h>
16#include <asm/mach/arch.h>
Haojian Zhuang641f4d52012-04-19 18:36:31 +080017#include <asm/mach/time.h>
Haojian Zhuang5d489762012-03-01 13:25:09 +080018#include <mach/irqs.h>
19
20#include "common.h"
21
Haojian Zhuang641f4d52012-04-19 18:36:31 +080022extern void __init mmp_dt_irq_init(void);
23extern void __init mmp_dt_init_timer(void);
Haojian Zhuang5d489762012-03-01 13:25:09 +080024
Haojian Zhuang641f4d52012-04-19 18:36:31 +080025static struct sys_timer mmp_dt_timer = {
26 .init = mmp_dt_init_timer,
27};
28
29static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
Haojian Zhuang5d489762012-03-01 13:25:09 +080030 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
31 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
32 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL),
33 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
34 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL),
35 OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
36 OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
37 {}
38};
39
Haojian Zhuang641f4d52012-04-19 18:36:31 +080040static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = {
41 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
42 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
43 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL),
44 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
45 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL),
46 OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
47 OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
48 {}
49};
Haojian Zhuang5d489762012-03-01 13:25:09 +080050
Haojian Zhuang641f4d52012-04-19 18:36:31 +080051static void __init pxa168_dt_init(void)
52{
Haojian Zhuang5d489762012-03-01 13:25:09 +080053 of_platform_populate(NULL, of_default_bus_match_table,
Haojian Zhuang641f4d52012-04-19 18:36:31 +080054 pxa168_auxdata_lookup, NULL);
Haojian Zhuang5d489762012-03-01 13:25:09 +080055}
56
Haojian Zhuang641f4d52012-04-19 18:36:31 +080057static void __init pxa910_dt_init(void)
58{
59 of_platform_populate(NULL, of_default_bus_match_table,
60 pxa910_auxdata_lookup, NULL);
61}
62
63static const char *mmp_dt_board_compat[] __initdata = {
Haojian Zhuang5d489762012-03-01 13:25:09 +080064 "mrvl,pxa168-aspenite",
Haojian Zhuang641f4d52012-04-19 18:36:31 +080065 "mrvl,pxa910-dkb",
Haojian Zhuang5d489762012-03-01 13:25:09 +080066 NULL,
67};
68
69DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
70 .map_io = mmp_map_io,
Haojian Zhuang641f4d52012-04-19 18:36:31 +080071 .init_irq = mmp_dt_irq_init,
72 .timer = &mmp_dt_timer,
73 .init_machine = pxa168_dt_init,
74 .dt_compat = mmp_dt_board_compat,
75MACHINE_END
76
77DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)")
78 .map_io = mmp_map_io,
79 .init_irq = mmp_dt_irq_init,
80 .timer = &mmp_dt_timer,
81 .init_machine = pxa910_dt_init,
82 .dt_compat = mmp_dt_board_compat,
Haojian Zhuang5d489762012-03-01 13:25:09 +080083MACHINE_END