blob: 60dfe3c287f10a1854693f9033fc77fc435e558f [file] [log] [blame]
Rohit Vaswani3fc60342012-04-23 18:55:15 -07001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2 *
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.
11 */
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/irqdomain.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
20#include <linux/of_platform.h>
21#include <linux/of_irq.h>
22#include <linux/memory.h>
23#include <asm/mach/map.h>
24#include <asm/hardware/gic.h>
25#include <asm/arch_timer.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/time.h>
28#include <mach/socinfo.h>
29#include <mach/board.h>
30#include <mach/gpio.h>
31#include "clock.h"
32
33static struct clk_lookup msm_clocks_dummy[] = {
Jin Hong8d328582012-05-01 15:45:29 -070034 CLK_DUMMY("core_clk", BLSP1_UART_CLK, "msm_serial_hsl.0", OFF),
35 CLK_DUMMY("iface_clk", BLSP1_UART_CLK, "msm_serial_hsl.0", OFF),
Rohit Vaswani3fc60342012-04-23 18:55:15 -070036 CLK_DUMMY("phy_clk", NULL, "msm_otg", OFF),
37 CLK_DUMMY("core_clk", NULL, "msm_otg", OFF),
38 CLK_DUMMY("alt_core_clk", NULL, "msm_otg", OFF),
39 CLK_DUMMY("iface_clk", NULL, "msm_otg", OFF),
40 CLK_DUMMY("xo", NULL, "msm_otg", OFF),
41 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
42 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
43 CLK_DUMMY("mem_clk", NULL, NULL, 0),
44 CLK_DUMMY("core_clk", NULL, "spi_qsd.1", OFF),
45 CLK_DUMMY("iface_clk", NULL, "spi_qsd.1", OFF),
46 CLK_DUMMY("core_clk", NULL, "f9966000.i2c", 0),
47 CLK_DUMMY("iface_clk", NULL, "f9966000.i2c", 0),
48 CLK_DUMMY("core_clk", NULL, "fe12f000.slim", OFF),
49};
50
51struct clock_init_data msm_dummy_clock_init_data __initdata = {
52 .table = msm_clocks_dummy,
53 .size = ARRAY_SIZE(msm_clocks_dummy),
54};
55
56static struct of_device_id irq_match[] __initdata = {
57 { .compatible = "qcom,msm-qgic2", .data = gic_of_init, },
58 { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, },
59 {}
60};
61
62static const char *msm9625_dt_match[] __initconst = {
63 "qcom,msm9625",
64 NULL
65};
66
67static struct of_dev_auxdata msm9625_auxdata_lookup[] __initdata = {
Jin Hong8d328582012-05-01 15:45:29 -070068 OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \
69 "msm_serial_hsl.0", NULL),
Rohit Vaswani3fc60342012-04-23 18:55:15 -070070 {}
71};
72
73void __init msm9625_init_irq(void)
74{
75 of_irq_init(irq_match);
76}
77
78static void __init msm_dt_timer_init(void)
79{
80 arch_timer_of_register();
81}
82
83static struct sys_timer msm_dt_timer = {
84 .init = msm_dt_timer_init
85};
86
87void __init msm9625_init(void)
88{
89 if (socinfo_init() < 0)
90 pr_err("%s: socinfo_init() failed\n", __func__);
91 msm_clock_init(&msm_dummy_clock_init_data);
92 of_platform_populate(NULL, of_default_bus_match_table,
93 msm9625_auxdata_lookup, NULL);
94}
95
96DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
97 .map_io = msm_map_msm9625_io,
98 .init_irq = msm9625_init_irq,
99 .init_machine = msm9625_init,
100 .handle_irq = gic_handle_irq,
101 .timer = &msm_dt_timer,
102 .dt_compat = msm9625_dt_match,
103 .nr_irqs = -1,
104MACHINE_END