blob: 5f31f882c459ccd5fcdd862c62181345b24620a6 [file] [log] [blame]
Sathish Ambleyc58afc22011-10-09 21:55:39 -07001/* Copyright (c) 2011, 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>
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, },
Sathish Ambleyc58afc22011-10-09 21:55:39 -070049 {}
50};
51
52void __init msm_copper_init_irq(void)
53{
Sathish Ambleyc58afc22011-10-09 21:55:39 -070054 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
55 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
56
57 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
58 mb();
59
Michael Bohanc7224532012-01-06 16:02:52 -080060 of_irq_init(irq_match);
Sathish Ambleyc58afc22011-10-09 21:55:39 -070061}
62
63static struct clk_lookup msm_clocks_dummy[] = {
Sathish Ambley3d50c762011-10-25 15:26:00 -070064 CLK_DUMMY("core_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
65 CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
Sujit Reddy Thumma1a4a79e2011-11-04 09:44:32 +053066 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
67 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
68 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
69 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +053070 CLK_DUMMY("phy_clk", NULL, "msm_otg", OFF),
71 CLK_DUMMY("core_clk", NULL, "msm_otg", OFF),
72 CLK_DUMMY("alt_core_clk", NULL, "msm_otg", OFF),
73 CLK_DUMMY("iface_clk", NULL, "msm_otg", OFF),
Yan He1466daa2011-11-30 17:25:38 -080074 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
75 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
76 CLK_DUMMY("mem_clk", NULL, NULL, 0),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -070077 CLK_DUMMY("core_clk", SPI_CLK, "spi_qsd.1", OFF),
78 CLK_DUMMY("iface_clk", SPI_P_CLK, "spi_qsd.1", OFF),
Sathish Ambleyc58afc22011-10-09 21:55:39 -070079};
80
81struct clock_init_data msm_dummy_clock_init_data __initdata = {
82 .table = msm_clocks_dummy,
83 .size = ARRAY_SIZE(msm_clocks_dummy),
84};
85
86static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = {
Sathish Ambleyab783ab2011-11-27 22:21:48 -080087 OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \
Sathish Ambley3d50c762011-10-25 15:26:00 -070088 "msm_serial_hsl.0", NULL),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +053089 OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \
90 "msm_otg", NULL),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -070091 OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \
92 "spi_qsd.1", NULL),
Sathish Ambleyc58afc22011-10-09 21:55:39 -070093 {}
94};
95
96void __init msm_copper_init(struct of_dev_auxdata **adata)
97{
98 if (gpiomux_init())
99 pr_err("%s: gpiomux_init() failed\n", __func__);
100 msm_clock_init(&msm_dummy_clock_init_data);
101
102 *adata = msm_copper_auxdata_lookup;
103}