blob: cca529ceecb758101f0120faa547c2790b004e80 [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
Haojian Zhuang0f374562013-04-21 16:53:02 +080012#include <linux/irqchip.h>
Haojian Zhuang5d489762012-03-01 13:25:09 +080013#include <linux/of_platform.h>
14#include <asm/mach/arch.h>
Haojian Zhuang641f4d52012-04-19 18:36:31 +080015#include <asm/mach/time.h>
Haojian Zhuang5d489762012-03-01 13:25:09 +080016
17#include "common.h"
18
Haojian Zhuang641f4d52012-04-19 18:36:31 +080019extern void __init mmp_dt_init_timer(void);
Haojian Zhuang5d489762012-03-01 13:25:09 +080020
Haojian Zhuang641f4d52012-04-19 18:36:31 +080021static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
Haojian Zhuang5d489762012-03-01 13:25:09 +080022 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
23 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
24 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL),
25 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
26 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL),
Haojian Zhuangf8731172013-04-09 22:27:50 +080027 OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL),
Haojian Zhuang5d489762012-03-01 13:25:09 +080028 OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
29 {}
30};
31
Haojian Zhuang641f4d52012-04-19 18:36:31 +080032static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = {
33 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
34 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
35 OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL),
36 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
37 OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL),
Haojian Zhuangf8731172013-04-09 22:27:50 +080038 OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL),
Haojian Zhuang641f4d52012-04-19 18:36:31 +080039 OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
40 {}
41};
Haojian Zhuang5d489762012-03-01 13:25:09 +080042
Haojian Zhuang641f4d52012-04-19 18:36:31 +080043static void __init pxa168_dt_init(void)
44{
Haojian Zhuang5d489762012-03-01 13:25:09 +080045 of_platform_populate(NULL, of_default_bus_match_table,
Haojian Zhuang641f4d52012-04-19 18:36:31 +080046 pxa168_auxdata_lookup, NULL);
Haojian Zhuang5d489762012-03-01 13:25:09 +080047}
48
Haojian Zhuang641f4d52012-04-19 18:36:31 +080049static void __init pxa910_dt_init(void)
50{
51 of_platform_populate(NULL, of_default_bus_match_table,
52 pxa910_auxdata_lookup, NULL);
53}
54
55static const char *mmp_dt_board_compat[] __initdata = {
Haojian Zhuang5d489762012-03-01 13:25:09 +080056 "mrvl,pxa168-aspenite",
Haojian Zhuang641f4d52012-04-19 18:36:31 +080057 "mrvl,pxa910-dkb",
Haojian Zhuang5d489762012-03-01 13:25:09 +080058 NULL,
59};
60
61DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
62 .map_io = mmp_map_io,
Stephen Warren6bb27d72012-11-08 12:40:59 -070063 .init_time = mmp_dt_init_timer,
Haojian Zhuang641f4d52012-04-19 18:36:31 +080064 .init_machine = pxa168_dt_init,
65 .dt_compat = mmp_dt_board_compat,
66MACHINE_END
67
68DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)")
69 .map_io = mmp_map_io,
Stephen Warren6bb27d72012-11-08 12:40:59 -070070 .init_time = mmp_dt_init_timer,
Haojian Zhuang641f4d52012-04-19 18:36:31 +080071 .init_machine = pxa910_dt_init,
72 .dt_compat = mmp_dt_board_compat,
Haojian Zhuang5d489762012-03-01 13:25:09 +080073MACHINE_END