aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 17:58:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 17:58:40 -0500
commitb274776c54c320763bc12eb035c0e244f76ccb43 (patch)
treec75b70d0824a7ae029229b19d61884039abf2127 /arch/arm/mach-exynos
parentb24174b0cbbe383c5bb6097aeb24480b8fd2d338 (diff)
parent3b1209e7994c4d31ff9932a7f566ae1c96b3c443 (diff)
Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC cleanups from Arnd Bergmann: "A large number of cleanups, all over the platforms. This is dominated largely by the Samsung platforms (s3c, s5p, exynos) and a few of the others moving code out of arch/arm into more appropriate subsystems. The clocksource and irqchip drivers are now abstracted to the point where platforms that are already cleaned up do not need to even specify the driver they use, it can all get configured from the device tree as we do for normal device drivers. The clocksource changes basically touch every single platform in the process. We further clean up the use of platform specific header files here, with the goal of turning more of the platforms over to being "multiplatform" enabled, which implies that they cannot expose their headers to architecture independent code any more. It is expected that no functional changes are part of the cleanup. The overall reduction in total code lines is mostly the result of removing broken and obsolete code." * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (133 commits) ARM: mvebu: correct gated clock documentation ARM: kirkwood: add missing include for nsa310 ARM: exynos: move exynos4210-combiner to drivers/irqchip mfd: db8500-prcmu: update resource passing drivers/db8500-cpufreq: delete dangling include ARM: at91: remove NEOCORE 926 board sunxi: Cleanup the reset code and add meaningful registers defines ARM: S3C24XX: header mach/regs-mem.h local ARM: S3C24XX: header mach/regs-power.h local ARM: S3C24XX: header mach/regs-s3c2412-mem.h local ARM: S3C24XX: Remove plat-s3c24xx directory in arch/arm/ ARM: S3C24XX: transform s3c2443 subirqs into new structure ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs ARM: S3C24XX: move s3c2443 irq code to irq.c ARM: S3C24XX: transform s3c2416 irqs into new structure ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs ARM: S3C24XX: move s3c2416 irq init to common irq code ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property ARM: S3C24XX: Move irq syscore-ops to irq-pm clocksource: always define CLOCKSOURCE_OF_DECLARE ...
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r--arch/arm/mach-exynos/common.c223
-rw-r--r--arch/arm/mach-exynos/common.h25
-rw-r--r--arch/arm/mach-exynos/cpuidle.c3
-rw-r--r--arch/arm/mach-exynos/dev-audio.c3
-rw-r--r--arch/arm/mach-exynos/include/mach/cpufreq.h49
-rw-r--r--arch/arm/mach-exynos/include/mach/pmu.h34
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-audss.h18
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-irq.h2
-rw-r--r--arch/arm/mach-exynos/mach-armlex4210.c4
-rw-r--r--arch/arm/mach-exynos/mach-exynos4-dt.c4
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c4
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c4
-rw-r--r--arch/arm/mach-exynos/mach-origen.c4
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c7
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c7
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c4
-rw-r--r--arch/arm/mach-exynos/mct.c25
-rw-r--r--arch/arm/mach-exynos/platsmp.c6
-rw-r--r--arch/arm/mach-exynos/pm.c3
-rw-r--r--arch/arm/mach-exynos/pmu.c3
20 files changed, 55 insertions, 377 deletions
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 0c7e3ad7ba93..d63d399c7bae 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/irqchip.h>
15#include <linux/io.h> 16#include <linux/io.h>
16#include <linux/device.h> 17#include <linux/device.h>
17#include <linux/gpio.h> 18#include <linux/gpio.h>
@@ -22,12 +23,13 @@
22#include <linux/of_irq.h> 23#include <linux/of_irq.h>
23#include <linux/export.h> 24#include <linux/export.h>
24#include <linux/irqdomain.h> 25#include <linux/irqdomain.h>
26#include <linux/irqchip.h>
25#include <linux/of_address.h> 27#include <linux/of_address.h>
28#include <linux/irqchip/arm-gic.h>
26 29
27#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
28#include <asm/exception.h> 31#include <asm/exception.h>
29#include <asm/hardware/cache-l2x0.h> 32#include <asm/hardware/cache-l2x0.h>
30#include <asm/hardware/gic.h>
31#include <asm/mach/map.h> 33#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
33#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
@@ -35,7 +37,6 @@
35#include <mach/regs-irq.h> 37#include <mach/regs-irq.h>
36#include <mach/regs-pmu.h> 38#include <mach/regs-pmu.h>
37#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
38#include <mach/pmu.h>
39 40
40#include <plat/cpu.h> 41#include <plat/cpu.h>
41#include <plat/clock.h> 42#include <plat/clock.h>
@@ -440,220 +441,6 @@ static void __init exynos5_init_clocks(int xtal)
440#endif 441#endif
441} 442}
442 443
443#define COMBINER_ENABLE_SET 0x0
444#define COMBINER_ENABLE_CLEAR 0x4
445#define COMBINER_INT_STATUS 0xC
446
447static DEFINE_SPINLOCK(irq_controller_lock);
448
449struct combiner_chip_data {
450 unsigned int irq_offset;
451 unsigned int irq_mask;
452 void __iomem *base;
453};
454
455static struct irq_domain *combiner_irq_domain;
456static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
457
458static inline void __iomem *combiner_base(struct irq_data *data)
459{
460 struct combiner_chip_data *combiner_data =
461 irq_data_get_irq_chip_data(data);
462
463 return combiner_data->base;
464}
465
466static void combiner_mask_irq(struct irq_data *data)
467{
468 u32 mask = 1 << (data->hwirq % 32);
469
470 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
471}
472
473static void combiner_unmask_irq(struct irq_data *data)
474{
475 u32 mask = 1 << (data->hwirq % 32);
476
477 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
478}
479
480static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
481{
482 struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
483 struct irq_chip *chip = irq_get_chip(irq);
484 unsigned int cascade_irq, combiner_irq;
485 unsigned long status;
486
487 chained_irq_enter(chip, desc);
488
489 spin_lock(&irq_controller_lock);
490 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
491 spin_unlock(&irq_controller_lock);
492 status &= chip_data->irq_mask;
493
494 if (status == 0)
495 goto out;
496
497 combiner_irq = __ffs(status);
498
499 cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
500 if (unlikely(cascade_irq >= NR_IRQS))
501 do_bad_IRQ(cascade_irq, desc);
502 else
503 generic_handle_irq(cascade_irq);
504
505 out:
506 chained_irq_exit(chip, desc);
507}
508
509static struct irq_chip combiner_chip = {
510 .name = "COMBINER",
511 .irq_mask = combiner_mask_irq,
512 .irq_unmask = combiner_unmask_irq,
513};
514
515static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
516{
517 unsigned int max_nr;
518
519 if (soc_is_exynos5250())
520 max_nr = EXYNOS5_MAX_COMBINER_NR;
521 else
522 max_nr = EXYNOS4_MAX_COMBINER_NR;
523
524 if (combiner_nr >= max_nr)
525 BUG();
526 if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
527 BUG();
528 irq_set_chained_handler(irq, combiner_handle_cascade_irq);
529}
530
531static void __init combiner_init_one(unsigned int combiner_nr,
532 void __iomem *base)
533{
534 combiner_data[combiner_nr].base = base;
535 combiner_data[combiner_nr].irq_offset = irq_find_mapping(
536 combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
537 combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
538
539 /* Disable all interrupts */
540 __raw_writel(combiner_data[combiner_nr].irq_mask,
541 base + COMBINER_ENABLE_CLEAR);
542}
543
544#ifdef CONFIG_OF
545static int combiner_irq_domain_xlate(struct irq_domain *d,
546 struct device_node *controller,
547 const u32 *intspec, unsigned int intsize,
548 unsigned long *out_hwirq,
549 unsigned int *out_type)
550{
551 if (d->of_node != controller)
552 return -EINVAL;
553
554 if (intsize < 2)
555 return -EINVAL;
556
557 *out_hwirq = intspec[0] * MAX_IRQ_IN_COMBINER + intspec[1];
558 *out_type = 0;
559
560 return 0;
561}
562#else
563static int combiner_irq_domain_xlate(struct irq_domain *d,
564 struct device_node *controller,
565 const u32 *intspec, unsigned int intsize,
566 unsigned long *out_hwirq,
567 unsigned int *out_type)
568{
569 return -EINVAL;
570}
571#endif
572
573static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
574 irq_hw_number_t hw)
575{
576 irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq);
577 irq_set_chip_data(irq, &combiner_data[hw >> 3]);
578 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
579
580 return 0;
581}
582
583static struct irq_domain_ops combiner_irq_domain_ops = {
584 .xlate = combiner_irq_domain_xlate,
585 .map = combiner_irq_domain_map,
586};
587
588static void __init combiner_init(void __iomem *combiner_base,
589 struct device_node *np)
590{
591 int i, irq, irq_base;
592 unsigned int max_nr, nr_irq;
593
594 if (np) {
595 if (of_property_read_u32(np, "samsung,combiner-nr", &max_nr)) {
596 pr_warning("%s: number of combiners not specified, "
597 "setting default as %d.\n",
598 __func__, EXYNOS4_MAX_COMBINER_NR);
599 max_nr = EXYNOS4_MAX_COMBINER_NR;
600 }
601 } else {
602 max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
603 EXYNOS4_MAX_COMBINER_NR;
604 }
605 nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
606
607 irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
608 if (IS_ERR_VALUE(irq_base)) {
609 irq_base = COMBINER_IRQ(0, 0);
610 pr_warning("%s: irq desc alloc failed. Continuing with %d as linux irq base\n", __func__, irq_base);
611 }
612
613 combiner_irq_domain = irq_domain_add_legacy(np, nr_irq, irq_base, 0,
614 &combiner_irq_domain_ops, &combiner_data);
615 if (WARN_ON(!combiner_irq_domain)) {
616 pr_warning("%s: irq domain init failed\n", __func__);
617 return;
618 }
619
620 for (i = 0; i < max_nr; i++) {
621 combiner_init_one(i, combiner_base + (i >> 2) * 0x10);
622 irq = IRQ_SPI(i);
623#ifdef CONFIG_OF
624 if (np)
625 irq = irq_of_parse_and_map(np, i);
626#endif
627 combiner_cascade_irq(i, irq);
628 }
629}
630
631#ifdef CONFIG_OF
632static int __init combiner_of_init(struct device_node *np,
633 struct device_node *parent)
634{
635 void __iomem *combiner_base;
636
637 combiner_base = of_iomap(np, 0);
638 if (!combiner_base) {
639 pr_err("%s: failed to map combiner registers\n", __func__);
640 return -ENXIO;
641 }
642
643 combiner_init(combiner_base, np);
644
645 return 0;
646}
647
648static const struct of_device_id exynos_dt_irq_match[] = {
649 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
650 { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
651 { .compatible = "samsung,exynos4210-combiner",
652 .data = combiner_of_init, },
653 {},
654};
655#endif
656
657void __init exynos4_init_irq(void) 444void __init exynos4_init_irq(void)
658{ 445{
659 unsigned int gic_bank_offset; 446 unsigned int gic_bank_offset;
@@ -664,7 +451,7 @@ void __init exynos4_init_irq(void)
664 gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL); 451 gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);
665#ifdef CONFIG_OF 452#ifdef CONFIG_OF
666 else 453 else
667 of_irq_init(exynos_dt_irq_match); 454 irqchip_init();
668#endif 455#endif
669 456
670 if (!of_have_populated_dt()) 457 if (!of_have_populated_dt())
@@ -681,7 +468,7 @@ void __init exynos4_init_irq(void)
681void __init exynos5_init_irq(void) 468void __init exynos5_init_irq(void)
682{ 469{
683#ifdef CONFIG_OF 470#ifdef CONFIG_OF
684 of_irq_init(exynos_dt_irq_match); 471 irqchip_init();
685#endif 472#endif
686 /* 473 /*
687 * The parameters of s5p_init_irq() are for VIC init. 474 * The parameters of s5p_init_irq() are for VIC init.
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 04744f9c120f..9339bb8954be 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -12,7 +12,7 @@
12#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H 12#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
13#define __ARCH_ARM_MACH_EXYNOS_COMMON_H 13#define __ARCH_ARM_MACH_EXYNOS_COMMON_H
14 14
15extern struct sys_timer exynos4_timer; 15extern void exynos4_timer_init(void);
16 16
17struct map_desc; 17struct map_desc;
18void exynos_init_io(struct map_desc *mach_desc, int size); 18void exynos_init_io(struct map_desc *mach_desc, int size);
@@ -60,8 +60,31 @@ void exynos4212_register_clocks(void);
60#define exynos4212_register_clocks() 60#define exynos4212_register_clocks()
61#endif 61#endif
62 62
63struct device_node;
64void combiner_init(void __iomem *combiner_base, struct device_node *np);
65
63extern struct smp_operations exynos_smp_ops; 66extern struct smp_operations exynos_smp_ops;
64 67
65extern void exynos_cpu_die(unsigned int cpu); 68extern void exynos_cpu_die(unsigned int cpu);
66 69
70/* PMU(Power Management Unit) support */
71
72#define PMU_TABLE_END NULL
73
74enum sys_powerdown {
75 SYS_AFTR,
76 SYS_LPA,
77 SYS_SLEEP,
78 NUM_SYS_POWERDOWN,
79};
80
81extern unsigned long l2x0_regs_phys;
82struct exynos_pmu_conf {
83 void __iomem *reg;
84 unsigned int val[NUM_SYS_POWERDOWN];
85};
86
87extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
88extern void s3c_cpu_resume(void);
89
67#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ 90#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 050924152776..fcfe0251aa3e 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -23,10 +23,11 @@
23#include <asm/cpuidle.h> 23#include <asm/cpuidle.h>
24#include <mach/regs-clock.h> 24#include <mach/regs-clock.h>
25#include <mach/regs-pmu.h> 25#include <mach/regs-pmu.h>
26#include <mach/pmu.h>
27 26
28#include <plat/cpu.h> 27#include <plat/cpu.h>
29 28
29#include "common.h"
30
30#define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \ 31#define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \
31 S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ 32 S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \
32 (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0)) 33 (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0))
diff --git a/arch/arm/mach-exynos/dev-audio.c b/arch/arm/mach-exynos/dev-audio.c
index 9d1a60951d7b..c662c89794b2 100644
--- a/arch/arm/mach-exynos/dev-audio.c
+++ b/arch/arm/mach-exynos/dev-audio.c
@@ -21,7 +21,8 @@
21#include <mach/map.h> 21#include <mach/map.h>
22#include <mach/dma.h> 22#include <mach/dma.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24#include <mach/regs-audss.h> 24
25#define EXYNOS4_AUDSS_INT_MEM (0x03000000)
25 26
26static int exynos4_cfg_i2s(struct platform_device *pdev) 27static int exynos4_cfg_i2s(struct platform_device *pdev)
27{ 28{
diff --git a/arch/arm/mach-exynos/include/mach/cpufreq.h b/arch/arm/mach-exynos/include/mach/cpufreq.h
deleted file mode 100644
index b5d39dd03b2a..000000000000
--- a/arch/arm/mach-exynos/include/mach/cpufreq.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* linux/arch/arm/mach-exynos/include/mach/cpufreq.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS - CPUFreq support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13enum cpufreq_level_index {
14 L0, L1, L2, L3, L4,
15 L5, L6, L7, L8, L9,
16 L10, L11, L12, L13, L14,
17 L15, L16, L17, L18, L19,
18 L20,
19};
20
21#define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \
22 { \
23 .freq = (f) * 1000, \
24 .clk_div_cpu0 = ((a0) | (a1) << 4 | (a2) << 8 | (a3) << 12 | \
25 (a4) << 16 | (a5) << 20 | (a6) << 24 | (a7) << 28), \
26 .clk_div_cpu1 = (b0 << 0 | b1 << 4 | b2 << 8), \
27 .mps = ((m) << 16 | (p) << 8 | (s)), \
28 }
29
30struct apll_freq {
31 unsigned int freq;
32 u32 clk_div_cpu0;
33 u32 clk_div_cpu1;
34 u32 mps;
35};
36
37struct exynos_dvfs_info {
38 unsigned long mpll_freq_khz;
39 unsigned int pll_safe_idx;
40 struct clk *cpu_clk;
41 unsigned int *volt_table;
42 struct cpufreq_frequency_table *freq_table;
43 void (*set_freq)(unsigned int, unsigned int);
44 bool (*need_apll_change)(unsigned int, unsigned int);
45};
46
47extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *);
48extern int exynos4x12_cpufreq_init(struct exynos_dvfs_info *);
49extern int exynos5250_cpufreq_init(struct exynos_dvfs_info *);
diff --git a/arch/arm/mach-exynos/include/mach/pmu.h b/arch/arm/mach-exynos/include/mach/pmu.h
deleted file mode 100644
index 7c27c2d4bf44..000000000000
--- a/arch/arm/mach-exynos/include/mach/pmu.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/pmu.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * EXYNOS4210 - PMU(Power Management Unit) support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_PMU_H
14#define __ASM_ARCH_PMU_H __FILE__
15
16#define PMU_TABLE_END NULL
17
18enum sys_powerdown {
19 SYS_AFTR,
20 SYS_LPA,
21 SYS_SLEEP,
22 NUM_SYS_POWERDOWN,
23};
24
25extern unsigned long l2x0_regs_phys;
26struct exynos_pmu_conf {
27 void __iomem *reg;
28 unsigned int val[NUM_SYS_POWERDOWN];
29};
30
31extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
32extern void s3c_cpu_resume(void);
33
34#endif /* __ASM_ARCH_PMU_H */
diff --git a/arch/arm/mach-exynos/include/mach/regs-audss.h b/arch/arm/mach-exynos/include/mach/regs-audss.h
deleted file mode 100644
index ca5a8b64218a..000000000000
--- a/arch/arm/mach-exynos/include/mach/regs-audss.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* arch/arm/mach-exynos4/include/mach/regs-audss.h
2 *
3 * Copyright (c) 2011 Samsung Electronics
4 * http://www.samsung.com
5 *
6 * Exynos4 Audio SubSystem clock register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __PLAT_REGS_AUDSS_H
14#define __PLAT_REGS_AUDSS_H __FILE__
15
16#define EXYNOS4_AUDSS_INT_MEM (0x03000000)
17
18#endif /* _PLAT_REGS_AUDSS_H */
diff --git a/arch/arm/mach-exynos/include/mach/regs-irq.h b/arch/arm/mach-exynos/include/mach/regs-irq.h
index 9c7b4bfd546f..f2b50506b9f6 100644
--- a/arch/arm/mach-exynos/include/mach/regs-irq.h
+++ b/arch/arm/mach-exynos/include/mach/regs-irq.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_REGS_IRQ_H 13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__ 14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15 15
16#include <asm/hardware/gic.h> 16#include <linux/irqchip/arm-gic.h>
17#include <mach/map.h> 17#include <mach/map.h>
18 18
19#endif /* __ASM_ARCH_REGS_IRQ_H */ 19#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c
index b938f9fc1dd1..685f29173afa 100644
--- a/arch/arm/mach-exynos/mach-armlex4210.c
+++ b/arch/arm/mach-exynos/mach-armlex4210.c
@@ -16,7 +16,6 @@
16#include <linux/smsc911x.h> 16#include <linux/smsc911x.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20#include <asm/mach-types.h> 19#include <asm/mach-types.h>
21 20
22#include <plat/cpu.h> 21#include <plat/cpu.h>
@@ -201,9 +200,8 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
201 .smp = smp_ops(exynos_smp_ops), 200 .smp = smp_ops(exynos_smp_ops),
202 .init_irq = exynos4_init_irq, 201 .init_irq = exynos4_init_irq,
203 .map_io = armlex4210_map_io, 202 .map_io = armlex4210_map_io,
204 .handle_irq = gic_handle_irq,
205 .init_machine = armlex4210_machine_init, 203 .init_machine = armlex4210_machine_init,
206 .init_late = exynos_init_late, 204 .init_late = exynos_init_late,
207 .timer = &exynos4_timer, 205 .init_time = exynos4_timer_init,
208 .restart = exynos4_restart, 206 .restart = exynos4_restart,
209MACHINE_END 207MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index 92757ff817ae..112d10e53d20 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -15,7 +15,6 @@
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16 16
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18#include <asm/hardware/gic.h>
19#include <mach/map.h> 18#include <mach/map.h>
20 19
21#include <plat/cpu.h> 20#include <plat/cpu.h>
@@ -107,10 +106,9 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
107 .smp = smp_ops(exynos_smp_ops), 106 .smp = smp_ops(exynos_smp_ops),
108 .init_irq = exynos4_init_irq, 107 .init_irq = exynos4_init_irq,
109 .map_io = exynos4_dt_map_io, 108 .map_io = exynos4_dt_map_io,
110 .handle_irq = gic_handle_irq,
111 .init_machine = exynos4_dt_machine_init, 109 .init_machine = exynos4_dt_machine_init,
112 .init_late = exynos_init_late, 110 .init_late = exynos_init_late,
113 .timer = &exynos4_timer, 111 .init_time = exynos4_timer_init,
114 .dt_compat = exynos4_dt_compat, 112 .dt_compat = exynos4_dt_compat,
115 .restart = exynos4_restart, 113 .restart = exynos4_restart,
116MACHINE_END 114MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index ea9e3020972d..973a06637572 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -16,7 +16,6 @@
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20#include <mach/map.h> 19#include <mach/map.h>
21#include <mach/regs-pmu.h> 20#include <mach/regs-pmu.h>
22 21
@@ -185,10 +184,9 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
185 .init_irq = exynos5_init_irq, 184 .init_irq = exynos5_init_irq,
186 .smp = smp_ops(exynos_smp_ops), 185 .smp = smp_ops(exynos_smp_ops),
187 .map_io = exynos5_dt_map_io, 186 .map_io = exynos5_dt_map_io,
188 .handle_irq = gic_handle_irq,
189 .init_machine = exynos5_dt_machine_init, 187 .init_machine = exynos5_dt_machine_init,
190 .init_late = exynos_init_late, 188 .init_late = exynos_init_late,
191 .timer = &exynos4_timer, 189 .init_time = exynos4_timer_init,
192 .dt_compat = exynos5_dt_compat, 190 .dt_compat = exynos5_dt_compat,
193 .restart = exynos5_restart, 191 .restart = exynos5_restart,
194 .reserve = exynos5_reserve, 192 .reserve = exynos5_reserve,
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 27d4ed8b116e..b8b3fbf0bae7 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -39,7 +39,6 @@
39#include <media/v4l2-mediabus.h> 39#include <media/v4l2-mediabus.h>
40 40
41#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
42#include <asm/hardware/gic.h>
43#include <asm/mach-types.h> 42#include <asm/mach-types.h>
44 43
45#include <plat/adc.h> 44#include <plat/adc.h>
@@ -1379,10 +1378,9 @@ MACHINE_START(NURI, "NURI")
1379 .smp = smp_ops(exynos_smp_ops), 1378 .smp = smp_ops(exynos_smp_ops),
1380 .init_irq = exynos4_init_irq, 1379 .init_irq = exynos4_init_irq,
1381 .map_io = nuri_map_io, 1380 .map_io = nuri_map_io,
1382 .handle_irq = gic_handle_irq,
1383 .init_machine = nuri_machine_init, 1381 .init_machine = nuri_machine_init,
1384 .init_late = exynos_init_late, 1382 .init_late = exynos_init_late,
1385 .timer = &exynos4_timer, 1383 .init_time = exynos4_timer_init,
1386 .reserve = &nuri_reserve, 1384 .reserve = &nuri_reserve,
1387 .restart = exynos4_restart, 1385 .restart = exynos4_restart,
1388MACHINE_END 1386MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 5e34b9c16196..579d2d171daa 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -29,7 +29,6 @@
29#include <linux/platform_data/usb-exynos.h> 29#include <linux/platform_data/usb-exynos.h>
30 30
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/hardware/gic.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34 33
35#include <video/platform_lcd.h> 34#include <video/platform_lcd.h>
@@ -814,10 +813,9 @@ MACHINE_START(ORIGEN, "ORIGEN")
814 .smp = smp_ops(exynos_smp_ops), 813 .smp = smp_ops(exynos_smp_ops),
815 .init_irq = exynos4_init_irq, 814 .init_irq = exynos4_init_irq,
816 .map_io = origen_map_io, 815 .map_io = origen_map_io,
817 .handle_irq = gic_handle_irq,
818 .init_machine = origen_machine_init, 816 .init_machine = origen_machine_init,
819 .init_late = exynos_init_late, 817 .init_late = exynos_init_late,
820 .timer = &exynos4_timer, 818 .init_time = exynos4_timer_init,
821 .reserve = &origen_reserve, 819 .reserve = &origen_reserve,
822 .restart = exynos4_restart, 820 .restart = exynos4_restart,
823MACHINE_END 821MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index ae6da40c2aa9..fe6149624b84 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -25,7 +25,6 @@
25#include <linux/platform_data/s3c-hsotg.h> 25#include <linux/platform_data/s3c-hsotg.h>
26 26
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/hardware/gic.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30 29
31#include <video/samsung_fimd.h> 30#include <video/samsung_fimd.h>
@@ -376,9 +375,8 @@ MACHINE_START(SMDK4212, "SMDK4212")
376 .smp = smp_ops(exynos_smp_ops), 375 .smp = smp_ops(exynos_smp_ops),
377 .init_irq = exynos4_init_irq, 376 .init_irq = exynos4_init_irq,
378 .map_io = smdk4x12_map_io, 377 .map_io = smdk4x12_map_io,
379 .handle_irq = gic_handle_irq,
380 .init_machine = smdk4x12_machine_init, 378 .init_machine = smdk4x12_machine_init,
381 .timer = &exynos4_timer, 379 .init_time = exynos4_timer_init,
382 .restart = exynos4_restart, 380 .restart = exynos4_restart,
383 .reserve = &smdk4x12_reserve, 381 .reserve = &smdk4x12_reserve,
384MACHINE_END 382MACHINE_END
@@ -390,10 +388,9 @@ MACHINE_START(SMDK4412, "SMDK4412")
390 .smp = smp_ops(exynos_smp_ops), 388 .smp = smp_ops(exynos_smp_ops),
391 .init_irq = exynos4_init_irq, 389 .init_irq = exynos4_init_irq,
392 .map_io = smdk4x12_map_io, 390 .map_io = smdk4x12_map_io,
393 .handle_irq = gic_handle_irq,
394 .init_machine = smdk4x12_machine_init, 391 .init_machine = smdk4x12_machine_init,
395 .init_late = exynos_init_late, 392 .init_late = exynos_init_late,
396 .timer = &exynos4_timer, 393 .init_time = exynos4_timer_init,
397 .restart = exynos4_restart, 394 .restart = exynos4_restart,
398 .reserve = &smdk4x12_reserve, 395 .reserve = &smdk4x12_reserve,
399MACHINE_END 396MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index 35548e3c097d..d71672922b19 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -26,7 +26,6 @@
26#include <linux/platform_data/usb-exynos.h> 26#include <linux/platform_data/usb-exynos.h>
27 27
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/hardware/gic.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31 30
32#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
@@ -423,9 +422,8 @@ MACHINE_START(SMDKV310, "SMDKV310")
423 .smp = smp_ops(exynos_smp_ops), 422 .smp = smp_ops(exynos_smp_ops),
424 .init_irq = exynos4_init_irq, 423 .init_irq = exynos4_init_irq,
425 .map_io = smdkv310_map_io, 424 .map_io = smdkv310_map_io,
426 .handle_irq = gic_handle_irq,
427 .init_machine = smdkv310_machine_init, 425 .init_machine = smdkv310_machine_init,
428 .timer = &exynos4_timer, 426 .init_time = exynos4_timer_init,
429 .reserve = &smdkv310_reserve, 427 .reserve = &smdkv310_reserve,
430 .restart = exynos4_restart, 428 .restart = exynos4_restart,
431MACHINE_END 429MACHINE_END
@@ -436,10 +434,9 @@ MACHINE_START(SMDKC210, "SMDKC210")
436 .smp = smp_ops(exynos_smp_ops), 434 .smp = smp_ops(exynos_smp_ops),
437 .init_irq = exynos4_init_irq, 435 .init_irq = exynos4_init_irq,
438 .map_io = smdkv310_map_io, 436 .map_io = smdkv310_map_io,
439 .handle_irq = gic_handle_irq,
440 .init_machine = smdkv310_machine_init, 437 .init_machine = smdkv310_machine_init,
441 .init_late = exynos_init_late, 438 .init_late = exynos_init_late,
442 .timer = &exynos4_timer, 439 .init_time = exynos4_timer_init,
443 .reserve = &smdkv310_reserve, 440 .reserve = &smdkv310_reserve,
444 .restart = exynos4_restart, 441 .restart = exynos4_restart,
445MACHINE_END 442MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 9e3340f18950..c9d33a43103e 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -29,7 +29,6 @@
29#include <drm/exynos_drm.h> 29#include <drm/exynos_drm.h>
30 30
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/hardware/gic.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34 33
35#include <video/samsung_fimd.h> 34#include <video/samsung_fimd.h>
@@ -1151,10 +1150,9 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1151 .smp = smp_ops(exynos_smp_ops), 1150 .smp = smp_ops(exynos_smp_ops),
1152 .init_irq = exynos4_init_irq, 1151 .init_irq = exynos4_init_irq,
1153 .map_io = universal_map_io, 1152 .map_io = universal_map_io,
1154 .handle_irq = gic_handle_irq,
1155 .init_machine = universal_machine_init, 1153 .init_machine = universal_machine_init,
1156 .init_late = exynos_init_late, 1154 .init_late = exynos_init_late,
1157 .timer = &s5p_timer, 1155 .init_time = s5p_timer_init,
1158 .reserve = &universal_reserve, 1156 .reserve = &universal_reserve,
1159 .restart = exynos4_restart, 1157 .restart = exynos4_restart,
1160MACHINE_END 1158MACHINE_END
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
index 57668eb68e75..c9d6650f9b5d 100644
--- a/arch/arm/mach-exynos/mct.c
+++ b/arch/arm/mach-exynos/mct.c
@@ -22,7 +22,6 @@
22#include <linux/of.h> 22#include <linux/of.h>
23 23
24#include <asm/arch_timer.h> 24#include <asm/arch_timer.h>
25#include <asm/hardware/gic.h>
26#include <asm/localtimer.h> 25#include <asm/localtimer.h>
27 26
28#include <plat/cpu.h> 27#include <plat/cpu.h>
@@ -255,13 +254,9 @@ static struct irqaction mct_comp_event_irq = {
255 254
256static void exynos4_clockevent_init(void) 255static void exynos4_clockevent_init(void)
257{ 256{
258 clockevents_calc_mult_shift(&mct_comp_device, clk_rate, 5);
259 mct_comp_device.max_delta_ns =
260 clockevent_delta2ns(0xffffffff, &mct_comp_device);
261 mct_comp_device.min_delta_ns =
262 clockevent_delta2ns(0xf, &mct_comp_device);
263 mct_comp_device.cpumask = cpumask_of(0); 257 mct_comp_device.cpumask = cpumask_of(0);
264 clockevents_register_device(&mct_comp_device); 258 clockevents_config_and_register(&mct_comp_device, clk_rate,
259 0xf, 0xffffffff);
265 260
266 if (soc_is_exynos5250()) 261 if (soc_is_exynos5250())
267 setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq); 262 setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq);
@@ -404,14 +399,8 @@ static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt)
404 evt->set_mode = exynos4_tick_set_mode; 399 evt->set_mode = exynos4_tick_set_mode;
405 evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; 400 evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
406 evt->rating = 450; 401 evt->rating = 450;
407 402 clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
408 clockevents_calc_mult_shift(evt, clk_rate / (TICK_BASE_CNT + 1), 5); 403 0xf, 0x7fffffff);
409 evt->max_delta_ns =
410 clockevent_delta2ns(0x7fffffff, evt);
411 evt->min_delta_ns =
412 clockevent_delta2ns(0xf, evt);
413
414 clockevents_register_device(evt);
415 404
416 exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); 405 exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
417 406
@@ -478,7 +467,7 @@ static void __init exynos4_timer_resources(void)
478#endif /* CONFIG_LOCAL_TIMERS */ 467#endif /* CONFIG_LOCAL_TIMERS */
479} 468}
480 469
481static void __init exynos_timer_init(void) 470void __init exynos4_timer_init(void)
482{ 471{
483 if (soc_is_exynos5440()) { 472 if (soc_is_exynos5440()) {
484 arch_timer_of_register(); 473 arch_timer_of_register();
@@ -494,7 +483,3 @@ static void __init exynos_timer_init(void)
494 exynos4_clocksource_init(); 483 exynos4_clocksource_init();
495 exynos4_clockevent_init(); 484 exynos4_clockevent_init();
496} 485}
497
498struct sys_timer exynos4_timer = {
499 .init = exynos_timer_init,
500};
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index c5c840e947b8..60f7c5be057d 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -20,9 +20,9 @@
20#include <linux/jiffies.h> 20#include <linux/jiffies.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/irqchip/arm-gic.h>
23 24
24#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
25#include <asm/hardware/gic.h>
26#include <asm/smp_plat.h> 26#include <asm/smp_plat.h>
27#include <asm/smp_scu.h> 27#include <asm/smp_scu.h>
28 28
@@ -149,7 +149,7 @@ static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct
149 149
150 __raw_writel(virt_to_phys(exynos4_secondary_startup), 150 __raw_writel(virt_to_phys(exynos4_secondary_startup),
151 cpu_boot_reg(phys_cpu)); 151 cpu_boot_reg(phys_cpu));
152 gic_raise_softirq(cpumask_of(cpu), 0); 152 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
153 153
154 if (pen_release == -1) 154 if (pen_release == -1)
155 break; 155 break;
@@ -190,8 +190,6 @@ static void __init exynos_smp_init_cpus(void)
190 190
191 for (i = 0; i < ncores; i++) 191 for (i = 0; i < ncores; i++)
192 set_cpu_possible(i, true); 192 set_cpu_possible(i, true);
193
194 set_smp_cross_call(gic_raise_softirq);
195} 193}
196 194
197static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) 195static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 5106ab83e593..e3faaa812016 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -34,7 +34,8 @@
34#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
35#include <mach/regs-pmu.h> 35#include <mach/regs-pmu.h>
36#include <mach/pm-core.h> 36#include <mach/pm-core.h>
37#include <mach/pmu.h> 37
38#include "common.h"
38 39
39static struct sleep_save exynos4_set_clksrc[] = { 40static struct sleep_save exynos4_set_clksrc[] = {
40 { .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, }, 41 { .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, },
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 3a48c852be6c..daebc1abc966 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -14,7 +14,8 @@
14#include <linux/bug.h> 14#include <linux/bug.h>
15 15
16#include <mach/regs-clock.h> 16#include <mach/regs-clock.h>
17#include <mach/pmu.h> 17
18#include "common.h"
18 19
19static struct exynos_pmu_conf *exynos_pmu_config; 20static struct exynos_pmu_conf *exynos_pmu_config;
20 21