Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -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 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/irq.h> |
| 17 | #include <linux/io.h> |
| 18 | #include <asm/hardware/gic.h> |
| 19 | #include <mach/board.h> |
| 20 | #include <mach/msm_iomap.h> |
| 21 | #include <mach/irqs.h> |
| 22 | #include <mach/socinfo.h> |
| 23 | #include "devices.h" |
| 24 | |
| 25 | void __init msm9615_device_init(void) |
| 26 | { |
| 27 | if (socinfo_init() < 0) |
| 28 | pr_err("socinfo_init() failed!\n"); |
| 29 | |
| 30 | } |
| 31 | |
| 32 | void __init msm9615_map_io(void) |
| 33 | { |
| 34 | msm_map_msm9615_io(); |
| 35 | } |
| 36 | |
| 37 | void __init msm9615_init_irq(void) |
| 38 | { |
| 39 | unsigned int i; |
| 40 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 41 | (void *)MSM_QGIC_CPU_BASE); |
| 42 | |
| 43 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| 44 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| 45 | |
| 46 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 47 | mb(); |
| 48 | |
| 49 | /* |
| 50 | * FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet |
| 51 | * as they are configured as level, which does not play nice with |
| 52 | * handle_percpu_irq. |
| 53 | */ |
| 54 | for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { |
| 55 | if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) |
| 56 | irq_set_handler(i, handle_percpu_irq); |
| 57 | } |
| 58 | } |