diff options
author | Chanho Park <chanho61.park@samsung.com> | 2012-12-12 00:03:54 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-08 12:47:45 -0400 |
commit | b7bbdbeebd94d63728d6caf12f2c4a670c5f3105 (patch) | |
tree | 0375888c8af59f71e71bcfd007c2482735e8b022 | |
parent | 4e164dc5fa512ad66355b583f1f70c602e4717d6 (diff) |
ARM: EXYNOS: Enable PMUs for exynos4
This patch defines irq numbers of ARM performance monitoring unit for exynos4.
Firs of all, we need to fix IRQ_PMU correctly and to split pmu initialization
of exynos from plat-samsung for easily defining it.
The number of CPU cores and PMU irq numbers are vary according to soc types.
So, we need to identify each soc type using soc_is_xxx function and to define
the pmu irqs dynamically. For example, the exynos4412 has 4 cpu cores and pmus.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-exynos/common.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/irqs.h | 8 | ||||
-rw-r--r-- | arch/arm/plat-samsung/devs.c | 2 |
3 files changed, 35 insertions, 3 deletions
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 02e35abd136b..603fedb80b0c 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <mach/regs-irq.h> | 39 | #include <mach/regs-irq.h> |
40 | #include <mach/regs-pmu.h> | 40 | #include <mach/regs-pmu.h> |
41 | #include <mach/regs-gpio.h> | 41 | #include <mach/regs-gpio.h> |
42 | #include <mach/irqs.h> | ||
42 | 43 | ||
43 | #include <plat/cpu.h> | 44 | #include <plat/cpu.h> |
44 | #include <plat/devs.h> | 45 | #include <plat/devs.h> |
@@ -850,3 +851,30 @@ static int __init exynos_init_irq_eint(void) | |||
850 | return 0; | 851 | return 0; |
851 | } | 852 | } |
852 | arch_initcall(exynos_init_irq_eint); | 853 | arch_initcall(exynos_init_irq_eint); |
854 | |||
855 | static struct resource exynos4_pmu_resource[] = { | ||
856 | DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU), | ||
857 | DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU1), | ||
858 | #if defined(CONFIG_SOC_EXYNOS4412) | ||
859 | DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU2), | ||
860 | DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU3), | ||
861 | #endif | ||
862 | }; | ||
863 | |||
864 | static struct platform_device exynos4_device_pmu = { | ||
865 | .name = "arm-pmu", | ||
866 | .num_resources = ARRAY_SIZE(exynos4_pmu_resource), | ||
867 | .resource = exynos4_pmu_resource, | ||
868 | }; | ||
869 | |||
870 | static int __init exynos_armpmu_init(void) | ||
871 | { | ||
872 | if (!of_have_populated_dt()) { | ||
873 | if (soc_is_exynos4210() || soc_is_exynos4212()) | ||
874 | exynos4_device_pmu.num_resources = 2; | ||
875 | platform_device_register(&exynos4_device_pmu); | ||
876 | } | ||
877 | |||
878 | return 0; | ||
879 | } | ||
880 | arch_initcall(exynos_armpmu_init); | ||
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h index 387490661403..35fe6d52d230 100644 --- a/arch/arm/mach-exynos/include/mach/irqs.h +++ b/arch/arm/mach-exynos/include/mach/irqs.h | |||
@@ -126,7 +126,7 @@ | |||
126 | #define EXYNOS4_IRQ_ADC1 IRQ_SPI(107) | 126 | #define EXYNOS4_IRQ_ADC1 IRQ_SPI(107) |
127 | #define EXYNOS4_IRQ_PEN1 IRQ_SPI(108) | 127 | #define EXYNOS4_IRQ_PEN1 IRQ_SPI(108) |
128 | #define EXYNOS4_IRQ_KEYPAD IRQ_SPI(109) | 128 | #define EXYNOS4_IRQ_KEYPAD IRQ_SPI(109) |
129 | #define EXYNOS4_IRQ_PMU IRQ_SPI(110) | 129 | #define EXYNOS4_IRQ_POWER_PMU IRQ_SPI(110) |
130 | #define EXYNOS4_IRQ_GPS IRQ_SPI(111) | 130 | #define EXYNOS4_IRQ_GPS IRQ_SPI(111) |
131 | #define EXYNOS4_IRQ_INTFEEDCTRL_SSS IRQ_SPI(112) | 131 | #define EXYNOS4_IRQ_INTFEEDCTRL_SSS IRQ_SPI(112) |
132 | #define EXYNOS4_IRQ_SLIMBUS IRQ_SPI(113) | 132 | #define EXYNOS4_IRQ_SLIMBUS IRQ_SPI(113) |
@@ -134,6 +134,11 @@ | |||
134 | #define EXYNOS4_IRQ_TSI IRQ_SPI(115) | 134 | #define EXYNOS4_IRQ_TSI IRQ_SPI(115) |
135 | #define EXYNOS4_IRQ_SATA IRQ_SPI(116) | 135 | #define EXYNOS4_IRQ_SATA IRQ_SPI(116) |
136 | 136 | ||
137 | #define EXYNOS4_IRQ_PMU COMBINER_IRQ(2, 2) | ||
138 | #define EXYNOS4_IRQ_PMU_CPU1 COMBINER_IRQ(3, 2) | ||
139 | #define EXYNOS4_IRQ_PMU_CPU2 COMBINER_IRQ(18, 2) | ||
140 | #define EXYNOS4_IRQ_PMU_CPU3 COMBINER_IRQ(19, 2) | ||
141 | |||
137 | #define EXYNOS4_IRQ_TMU_TRIG0 COMBINER_IRQ(2, 4) | 142 | #define EXYNOS4_IRQ_TMU_TRIG0 COMBINER_IRQ(2, 4) |
138 | #define EXYNOS4_IRQ_TMU_TRIG1 COMBINER_IRQ(3, 4) | 143 | #define EXYNOS4_IRQ_TMU_TRIG1 COMBINER_IRQ(3, 4) |
139 | 144 | ||
@@ -234,7 +239,6 @@ | |||
234 | #define IRQ_TC EXYNOS4_IRQ_PEN0 | 239 | #define IRQ_TC EXYNOS4_IRQ_PEN0 |
235 | 240 | ||
236 | #define IRQ_KEYPAD EXYNOS4_IRQ_KEYPAD | 241 | #define IRQ_KEYPAD EXYNOS4_IRQ_KEYPAD |
237 | #define IRQ_PMU EXYNOS4_IRQ_PMU | ||
238 | 242 | ||
239 | #define IRQ_FIMD0_FIFO EXYNOS4_IRQ_FIMD0_FIFO | 243 | #define IRQ_FIMD0_FIFO EXYNOS4_IRQ_FIMD0_FIFO |
240 | #define IRQ_FIMD0_VSYNC EXYNOS4_IRQ_FIMD0_VSYNC | 244 | #define IRQ_FIMD0_VSYNC EXYNOS4_IRQ_FIMD0_VSYNC |
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 51afedda9ab6..e1124d9fd2b0 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -1113,7 +1113,7 @@ struct platform_device s5p_device_onenand = { | |||
1113 | 1113 | ||
1114 | /* PMU */ | 1114 | /* PMU */ |
1115 | 1115 | ||
1116 | #ifdef CONFIG_PLAT_S5P | 1116 | #if defined(CONFIG_PLAT_S5P) && !defined(CONFIG_ARCH_EXYNOS) |
1117 | static struct resource s5p_pmu_resource[] = { | 1117 | static struct resource s5p_pmu_resource[] = { |
1118 | DEFINE_RES_IRQ(IRQ_PMU) | 1118 | DEFINE_RES_IRQ(IRQ_PMU) |
1119 | }; | 1119 | }; |