blob: fdbed439855a42098e9649cf61dcbb4c848db9ea [file] [log] [blame]
Stephen Boyd5b67bfb2012-09-05 12:28:55 -07001/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
Steve Mucklea55df6e2010-01-07 12:43:24 -08002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
Steve Mucklea55df6e2010-01-07 12:43:24 -080011 */
12
Stephen Boyd5b67bfb2012-09-05 12:28:55 -070013#include <linux/init.h>
David Brown56e2d8a2011-08-04 02:01:02 -070014#include <linux/of.h>
David Brown2b7b9a72012-04-23 15:34:20 -070015#include <linux/of_irq.h>
David Brown56e2d8a2011-08-04 02:01:02 -070016#include <linux/of_platform.h>
Steve Mucklea55df6e2010-01-07 12:43:24 -080017
Steve Mucklea55df6e2010-01-07 12:43:24 -080018#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20
21#include <mach/board.h>
22#include <mach/msm_iomap.h>
Stephen Boyd4312a7e2012-09-05 12:28:52 -070023#include "common.h"
Steve Mucklea55df6e2010-01-07 12:43:24 -080024
Stephen Boyd5b67bfb2012-09-05 12:28:55 -070025static const struct of_device_id msm_dt_gic_match[] __initconst = {
David Brown2b7b9a72012-04-23 15:34:20 -070026 { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
27 {}
28};
David Brown2b7b9a72012-04-23 15:34:20 -070029
Steve Mucklea55df6e2010-01-07 12:43:24 -080030static void __init msm8x60_init_irq(void)
31{
Stephen Boyd5b67bfb2012-09-05 12:28:55 -070032 of_irq_init(msm_dt_gic_match);
Steve Mucklea55df6e2010-01-07 12:43:24 -080033}
34
Shawn Guoc633c532012-05-02 15:53:20 +080035static void __init msm8x60_init_late(void)
36{
37 smd_debugfs_init();
38}
39
David Brown56e2d8a2011-08-04 02:01:02 -070040static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
41 {}
42};
43
David Brown56e2d8a2011-08-04 02:01:02 -070044static void __init msm8x60_dt_init(void)
45{
David Brown56e2d8a2011-08-04 02:01:02 -070046 if (of_machine_is_compatible("qcom,msm8660-surf")) {
47 printk(KERN_INFO "Init surf UART registers\n");
48 msm8x60_init_uart12dm();
49 }
50
51 of_platform_populate(NULL, of_default_bus_match_table,
52 msm_auxdata_lookup, NULL);
53}
54
55static const char *msm8x60_fluid_match[] __initdata = {
56 "qcom,msm8660-fluid",
57 "qcom,msm8660-surf",
58 NULL
59};
David Brown56e2d8a2011-08-04 02:01:02 -070060
David Brown56e2d8a2011-08-04 02:01:02 -070061DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
Stephen Boyd5b67bfb2012-09-05 12:28:55 -070062 .map_io = msm_map_msm8x60_io,
David Brown56e2d8a2011-08-04 02:01:02 -070063 .init_irq = msm8x60_init_irq,
Stephen Boyd63c86c92012-08-22 16:00:13 -070064 .handle_irq = gic_handle_irq,
David Brown56e2d8a2011-08-04 02:01:02 -070065 .init_machine = msm8x60_dt_init,
Shawn Guoc633c532012-05-02 15:53:20 +080066 .init_late = msm8x60_init_late,
Stephen Boyd84071162012-09-05 12:28:54 -070067 .timer = &msm_dt_timer,
David Brown56e2d8a2011-08-04 02:01:02 -070068 .dt_compat = msm8x60_fluid_match,
69MACHINE_END