Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 1 | /* 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 | |
| 29 | static 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 | |
| 42 | void __init msm_copper_add_devices(void) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | static struct of_device_id msm_copper_gic_match[] __initdata = { |
| 47 | { .compatible = "qcom,msm-qgic2", }, |
| 48 | {} |
| 49 | }; |
| 50 | |
| 51 | void __init msm_copper_init_irq(void) |
| 52 | { |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 53 | 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 Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 62 | irq_domain_generate_simple(msm_copper_gic_match, |
| 63 | COPPER_QGIC_DIST_PHYS, GIC_SPI_START); |
| 64 | } |
| 65 | |
| 66 | static struct clk_lookup msm_clocks_dummy[] = { |
Sathish Ambley | 3d50c76 | 2011-10-25 15:26:00 -0700 | [diff] [blame] | 67 | 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 Thumma | 1a4a79e | 2011-11-04 09:44:32 +0530 | [diff] [blame] | 69 | 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 Kondeti | 7e6b4d6 | 2011-10-27 15:00:34 +0530 | [diff] [blame] | 73 | 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 He | 1466daa | 2011-11-30 17:25:38 -0800 | [diff] [blame] | 76 | 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 Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | struct clock_init_data msm_dummy_clock_init_data __initdata = { |
| 82 | .table = msm_clocks_dummy, |
| 83 | .size = ARRAY_SIZE(msm_clocks_dummy), |
| 84 | }; |
| 85 | |
| 86 | static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = { |
Sathish Ambley | ab783ab | 2011-11-27 22:21:48 -0800 | [diff] [blame] | 87 | OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \ |
Sathish Ambley | 3d50c76 | 2011-10-25 15:26:00 -0700 | [diff] [blame] | 88 | "msm_serial_hsl.0", NULL), |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 89 | {} |
| 90 | }; |
| 91 | |
| 92 | void __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 | } |