blob: c89aee5027e4ee74808935b25efc5a102a3cf3aa [file] [log] [blame]
Michael Bohan0425f6f2012-01-17 14:36:39 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Sathish Ambleyc58afc22011-10-09 21:55:39 -07002 *
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>
Michael Bohanc7224532012-01-06 16:02:52 -080021#include <linux/of_irq.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070022#include <asm/mach/map.h>
23#include <asm/hardware/gic.h>
24#include <mach/board.h>
25#include <mach/gpio.h>
26#include <mach/gpiomux.h>
27#include <mach/msm_iomap.h>
28#include "clock.h"
29
30static int __init gpiomux_init(void)
31{
32 int rc;
33
34 rc = msm_gpiomux_init(NR_GPIO_IRQS);
35 if (rc) {
36 pr_err("%s: msm_gpiomux_init failed %d\n", __func__, rc);
37 return rc;
38 }
39
40 return 0;
41}
42
43void __init msm_copper_add_devices(void)
44{
45}
46
Michael Bohanc7224532012-01-06 16:02:52 -080047static struct of_device_id irq_match[] __initdata = {
48 { .compatible = "qcom,msm-qgic2", .data = gic_of_init, },
Michael Bohan0425f6f2012-01-17 14:36:39 -080049 { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, },
Sathish Ambleyc58afc22011-10-09 21:55:39 -070050 {}
51};
52
53void __init msm_copper_init_irq(void)
54{
Sathish Ambleyc58afc22011-10-09 21:55:39 -070055 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
56 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
57
58 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
59 mb();
60
Michael Bohanc7224532012-01-06 16:02:52 -080061 of_irq_init(irq_match);
Sathish Ambleyc58afc22011-10-09 21:55:39 -070062}
63
64static struct clk_lookup msm_clocks_dummy[] = {
Sathish Ambley3d50c762011-10-25 15:26:00 -070065 CLK_DUMMY("core_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
66 CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
Sujit Reddy Thumma1a4a79e2011-11-04 09:44:32 +053067 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
68 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
69 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
70 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +053071 CLK_DUMMY("phy_clk", NULL, "msm_otg", OFF),
72 CLK_DUMMY("core_clk", NULL, "msm_otg", OFF),
73 CLK_DUMMY("alt_core_clk", NULL, "msm_otg", OFF),
74 CLK_DUMMY("iface_clk", NULL, "msm_otg", OFF),
Yan He1466daa2011-11-30 17:25:38 -080075 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
76 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
77 CLK_DUMMY("mem_clk", NULL, NULL, 0),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -070078 CLK_DUMMY("core_clk", SPI_CLK, "spi_qsd.1", OFF),
79 CLK_DUMMY("iface_clk", SPI_P_CLK, "spi_qsd.1", OFF),
Sathish Ambleyc58afc22011-10-09 21:55:39 -070080};
81
82struct clock_init_data msm_dummy_clock_init_data __initdata = {
83 .table = msm_clocks_dummy,
84 .size = ARRAY_SIZE(msm_clocks_dummy),
85};
86
87static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = {
Sathish Ambleyab783ab2011-11-27 22:21:48 -080088 OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \
Sathish Ambley3d50c762011-10-25 15:26:00 -070089 "msm_serial_hsl.0", NULL),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +053090 OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \
91 "msm_otg", NULL),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -070092 OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \
93 "spi_qsd.1", NULL),
Sathish Ambleyc58afc22011-10-09 21:55:39 -070094 {}
95};
96
97void __init msm_copper_init(struct of_dev_auxdata **adata)
98{
99 if (gpiomux_init())
100 pr_err("%s: gpiomux_init() failed\n", __func__);
101 msm_clock_init(&msm_dummy_clock_init_data);
102
103 *adata = msm_copper_auxdata_lookup;
104}