blob: 6e85ecee0752df88ce3594a6054dbfba103bd38c [file] [log] [blame]
Rohit Vaswani833772c2013-03-20 19:14:06 -07001/* Copyright (c) 2013, The Linux Foundation. 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/err.h>
14#include <linux/kernel.h>
15#include <linux/of.h>
16#include <linux/of_address.h>
17#include <linux/of_platform.h>
18#include <linux/memory.h>
19#include <asm/hardware/gic.h>
20#include <asm/mach/map.h>
21#include <asm/mach/arch.h>
22#include <mach/board.h>
23#include <mach/gpiomux.h>
24#include <mach/msm_iomap.h>
25#include <mach/msm_smd.h>
26#include <mach/restart.h>
27#include <mach/socinfo.h>
28#include <mach/clk-provider.h>
29#include "board-dt.h"
30#include "clock.h"
31#include "devices.h"
32#include "platsmp.h"
33
34void __init fsm9900_reserve(void)
35{
36}
37
38static void __init fsm9900_early_memory(void)
39{
40}
41
42static struct clk_lookup msm_clocks_dummy[] = {
43 CLK_DUMMY("core_clk", BLSP2_UART_CLK, "f9960000.serial", OFF),
44 CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "f9960000.serial", OFF),
45 CLK_DUMMY("core_clk", BLSP1_UART_CLK, "f991f000.serial", OFF),
46 CLK_DUMMY("iface_clk", BLSP1_UART_CLK, "f991f000.serial", OFF),
Rohit Vaswani8d22ed52013-04-28 17:52:59 -070047 CLK_DUMMY("core_clk", BLSP2_I2C_CLK, "f9966000.i2c", OFF),
48 CLK_DUMMY("iface_clk", BLSP2_I2C_CLK, "f9966000.i2c", OFF),
49 CLK_DUMMY("core_clk", BLSP1_I2C_CLK, "f9924000.i2c", OFF),
50 CLK_DUMMY("iface_clk", BLSP1_I2C_CLK, "f9924000.i2c", OFF),
51 CLK_DUMMY("core_clk", NULL, "f9a55000.usb", OFF),
52 CLK_DUMMY("iface_clk", NULL, "f9a55000.usb", OFF),
53 CLK_DUMMY("phy_clk", NULL, "f9a55000.usb", OFF),
54 CLK_DUMMY("xo", NULL, "f9a55000.usb", OFF),
55 CLK_DUMMY("core_clk", NULL, "msm_ehci_host", OFF),
56 CLK_DUMMY("iface_clk", NULL, "msm_ehci_host", OFF),
57 CLK_DUMMY("sleep_clk", NULL, "msm_ehci_host", OFF),
58 CLK_DUMMY("xo", NULL, "msm_ehci_host", OFF),
59 CLK_DUMMY("core_clk", NULL, "f9824900.sdhci_msm", OFF),
60 CLK_DUMMY("iface_clk", NULL, "f9824900.sdhci_msm", OFF),
61 CLK_DUMMY("core_clk", NULL, "f98a4900.sdhci_msm", OFF),
62 CLK_DUMMY("iface_clk", NULL, "f98a4900.sdhci_msm", OFF),
Rohit Vaswani833772c2013-03-20 19:14:06 -070063};
64
65static struct clock_init_data msm_dummy_clock_init_data __initdata = {
66 .table = msm_clocks_dummy,
67 .size = ARRAY_SIZE(msm_clocks_dummy),
68};
69
70/*
71 * Used to satisfy dependencies for devices that need to be
72 * run early or in a particular order. Most likely your device doesn't fall
73 * into this category, and thus the driver should not be added here. The
74 * EPROBE_DEFER can satisfy most dependency problems.
75 */
76void __init fsm9900_add_drivers(void)
77{
78 msm_smd_init();
79 msm_clock_init(&msm_dummy_clock_init_data);
80}
81
82static void __init fsm9900_map_io(void)
83{
84 msm_map_fsm9900_io();
85}
86
87void __init fsm9900_init(void)
88{
89 if (socinfo_init() < 0)
90 pr_err("%s: socinfo_init() failed\n", __func__);
91
92 fsm9900_init_gpiomux();
93 board_dt_populate(NULL);
94 fsm9900_add_drivers();
95}
96
97void __init fsm9900_init_very_early(void)
98{
99 fsm9900_early_memory();
100}
101
102static const char *fsm9900_dt_match[] __initconst = {
103 "qcom,fsm9900",
104 NULL
105};
106
107DT_MACHINE_START(FSM9900_DT, "Qualcomm FSM 9900 (Flattened Device Tree)")
108 .map_io = fsm9900_map_io,
109 .init_irq = msm_dt_init_irq,
110 .init_machine = fsm9900_init,
111 .handle_irq = gic_handle_irq,
112 .timer = &msm_dt_timer,
113 .dt_compat = fsm9900_dt_match,
114 .reserve = fsm9900_reserve,
115 .init_very_early = fsm9900_init_very_early,
116 .restart = msm_restart,
117 .smp = &msm8974_smp_ops,
118MACHINE_END