blob: f4fcb753541f59d0f21b158f3c7b31ad793c481e [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>
21#include <asm/mach/map.h>
22#include <asm/hardware/gic.h>
23#include <mach/board.h>
24#include <mach/gpio.h>
25#include <mach/gpiomux.h>
26#include <mach/msm_iomap.h>
27#include "clock.h"
28
29static int __init gpiomux_init(void)
30{
31 int rc;
32
33 rc = msm_gpiomux_init(NR_GPIO_IRQS);
34 if (rc) {
35 pr_err("%s: msm_gpiomux_init failed %d\n", __func__, rc);
36 return rc;
37 }
38
39 return 0;
40}
41
42void __init msm_copper_add_devices(void)
43{
44}
45
46static struct of_device_id msm_copper_gic_match[] __initdata = {
47 { .compatible = "qcom,msm-qgic2", },
48 {}
49};
50
51void __init msm_copper_init_irq(void)
52{
Sathish Ambleyc58afc22011-10-09 21:55:39 -070053 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
54 (void *)MSM_QGIC_CPU_BASE);
55
56 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
57 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
58
59 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
60 mb();
61
Sathish Ambleyc58afc22011-10-09 21:55:39 -070062 irq_domain_generate_simple(msm_copper_gic_match,
63 COPPER_QGIC_DIST_PHYS, GIC_SPI_START);
64}
65
66static struct clk_lookup msm_clocks_dummy[] = {
Sathish Ambley3d50c762011-10-25 15:26:00 -070067 CLK_DUMMY("core_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
68 CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
Sujit Reddy Thumma1a4a79e2011-11-04 09:44:32 +053069 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
70 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
71 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
72 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
Pavankumar Kondeti7e6b4d62011-10-27 15:00:34 +053073 CLK_DUMMY("usb_phy_clk", NULL, NULL, OFF),
74 CLK_DUMMY("usb_hs_clk", NULL, NULL, OFF),
75 CLK_DUMMY("usb_hs_pclk", NULL, NULL, OFF),
Yan He1466daa2011-11-30 17:25:38 -080076 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
77 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
78 CLK_DUMMY("mem_clk", NULL, NULL, 0),
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),
Sathish Ambleyc58afc22011-10-09 21:55:39 -070089 {}
90};
91
92void __init msm_copper_init(struct of_dev_auxdata **adata)
93{
94 if (gpiomux_init())
95 pr_err("%s: gpiomux_init() failed\n", __func__);
96 msm_clock_init(&msm_dummy_clock_init_data);
97
98 *adata = msm_copper_auxdata_lookup;
99}