Rohit Vaswani | 3fc6034 | 2012-04-23 18:55:15 -0700 | [diff] [blame^] | 1 | /* 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 | |
| 33 | static struct clk_lookup msm_clocks_dummy[] = { |
| 34 | CLK_DUMMY("phy_clk", NULL, "msm_otg", OFF), |
| 35 | CLK_DUMMY("core_clk", NULL, "msm_otg", OFF), |
| 36 | CLK_DUMMY("alt_core_clk", NULL, "msm_otg", OFF), |
| 37 | CLK_DUMMY("iface_clk", NULL, "msm_otg", OFF), |
| 38 | CLK_DUMMY("xo", NULL, "msm_otg", OFF), |
| 39 | CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0), |
| 40 | CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0), |
| 41 | CLK_DUMMY("mem_clk", NULL, NULL, 0), |
| 42 | CLK_DUMMY("core_clk", NULL, "spi_qsd.1", OFF), |
| 43 | CLK_DUMMY("iface_clk", NULL, "spi_qsd.1", OFF), |
| 44 | CLK_DUMMY("core_clk", NULL, "f9966000.i2c", 0), |
| 45 | CLK_DUMMY("iface_clk", NULL, "f9966000.i2c", 0), |
| 46 | CLK_DUMMY("core_clk", NULL, "fe12f000.slim", OFF), |
| 47 | }; |
| 48 | |
| 49 | struct clock_init_data msm_dummy_clock_init_data __initdata = { |
| 50 | .table = msm_clocks_dummy, |
| 51 | .size = ARRAY_SIZE(msm_clocks_dummy), |
| 52 | }; |
| 53 | |
| 54 | static struct of_device_id irq_match[] __initdata = { |
| 55 | { .compatible = "qcom,msm-qgic2", .data = gic_of_init, }, |
| 56 | { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, }, |
| 57 | {} |
| 58 | }; |
| 59 | |
| 60 | static const char *msm9625_dt_match[] __initconst = { |
| 61 | "qcom,msm9625", |
| 62 | NULL |
| 63 | }; |
| 64 | |
| 65 | static struct of_dev_auxdata msm9625_auxdata_lookup[] __initdata = { |
| 66 | {} |
| 67 | }; |
| 68 | |
| 69 | void __init msm9625_init_irq(void) |
| 70 | { |
| 71 | of_irq_init(irq_match); |
| 72 | } |
| 73 | |
| 74 | static void __init msm_dt_timer_init(void) |
| 75 | { |
| 76 | arch_timer_of_register(); |
| 77 | } |
| 78 | |
| 79 | static struct sys_timer msm_dt_timer = { |
| 80 | .init = msm_dt_timer_init |
| 81 | }; |
| 82 | |
| 83 | void __init msm9625_init(void) |
| 84 | { |
| 85 | if (socinfo_init() < 0) |
| 86 | pr_err("%s: socinfo_init() failed\n", __func__); |
| 87 | msm_clock_init(&msm_dummy_clock_init_data); |
| 88 | of_platform_populate(NULL, of_default_bus_match_table, |
| 89 | msm9625_auxdata_lookup, NULL); |
| 90 | } |
| 91 | |
| 92 | DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") |
| 93 | .map_io = msm_map_msm9625_io, |
| 94 | .init_irq = msm9625_init_irq, |
| 95 | .init_machine = msm9625_init, |
| 96 | .handle_irq = gic_handle_irq, |
| 97 | .timer = &msm_dt_timer, |
| 98 | .dt_compat = msm9625_dt_match, |
| 99 | .nr_irqs = -1, |
| 100 | MACHINE_END |