| /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| * |
| * This program is free software; you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License version 2 and |
| * only version 2 as published by the Free Software Foundation. |
| * |
| * This program is distributed in the hope that it will be useful, |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| * GNU General Public License for more details. |
| */ |
| |
| #include <linux/kernel.h> |
| #include <linux/platform_device.h> |
| #include <linux/io.h> |
| #include <linux/irq.h> |
| #include <linux/irqdomain.h> |
| #include <linux/of.h> |
| #include <linux/of_address.h> |
| #include <linux/of_platform.h> |
| #include <asm/mach/map.h> |
| #include <asm/hardware/gic.h> |
| #include <mach/board.h> |
| #include <mach/gpio.h> |
| #include <mach/gpiomux.h> |
| #include <mach/msm_iomap.h> |
| #include "clock.h" |
| |
| static int __init gpiomux_init(void) |
| { |
| int rc; |
| |
| rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| if (rc) { |
| pr_err("%s: msm_gpiomux_init failed %d\n", __func__, rc); |
| return rc; |
| } |
| |
| return 0; |
| } |
| |
| void __init msm_copper_add_devices(void) |
| { |
| } |
| |
| static struct of_device_id msm_copper_gic_match[] __initdata = { |
| { .compatible = "qcom,msm-qgic2", }, |
| {} |
| }; |
| |
| void __init msm_copper_init_irq(void) |
| { |
| unsigned int i; |
| |
| gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| (void *)MSM_QGIC_CPU_BASE); |
| |
| /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| |
| writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| mb(); |
| |
| /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet |
| * as they are configured as level, which does not play nice with |
| * handle_percpu_irq. |
| */ |
| for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { |
| if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) |
| irq_set_handler(i, handle_percpu_irq); |
| } |
| irq_domain_generate_simple(msm_copper_gic_match, |
| COPPER_QGIC_DIST_PHYS, GIC_SPI_START); |
| } |
| |
| static struct clk_lookup msm_clocks_dummy[] = { |
| CLK_DUMMY("core_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF), |
| CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF), |
| CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF), |
| CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF), |
| CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF), |
| CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF), |
| CLK_DUMMY("usb_phy_clk", NULL, NULL, OFF), |
| CLK_DUMMY("usb_hs_clk", NULL, NULL, OFF), |
| CLK_DUMMY("usb_hs_pclk", NULL, NULL, OFF), |
| CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0), |
| CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0), |
| CLK_DUMMY("mem_clk", NULL, NULL, 0), |
| }; |
| |
| struct clock_init_data msm_dummy_clock_init_data __initdata = { |
| .table = msm_clocks_dummy, |
| .size = ARRAY_SIZE(msm_clocks_dummy), |
| }; |
| |
| static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = { |
| OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \ |
| "msm_serial_hsl.0", NULL), |
| {} |
| }; |
| |
| void __init msm_copper_init(struct of_dev_auxdata **adata) |
| { |
| if (gpiomux_init()) |
| pr_err("%s: gpiomux_init() failed\n", __func__); |
| msm_clock_init(&msm_dummy_clock_init_data); |
| |
| *adata = msm_copper_auxdata_lookup; |
| } |