|
19 | 19 | #include <linux/of_platform.h>
|
20 | 20 | #include <linux/platform_device.h>
|
21 | 21 | #include <linux/pm_domain.h>
|
| 22 | +#include <linux/irqchip.h> |
22 | 23 |
|
23 | 24 | #include <asm/cacheflush.h>
|
24 | 25 | #include <asm/hardware/cache-l2x0.h>
|
|
31 | 32 | #include "regs-pmu.h"
|
32 | 33 | #include "regs-sys.h"
|
33 | 34 |
|
| 35 | +void __iomem *pmu_base_addr; |
| 36 | + |
34 | 37 | static struct map_desc exynos4_iodesc[] __initdata = {
|
35 | 38 | {
|
36 | 39 | .virtual = (unsigned long)S3C_VA_SYS,
|
@@ -264,6 +267,39 @@ static void __init exynos_init_io(void)
|
264 | 267 | exynos_map_io();
|
265 | 268 | }
|
266 | 269 |
|
| 270 | +static const struct of_device_id exynos_dt_pmu_match[] = { |
| 271 | + { .compatible = "samsung,exynos3250-pmu" }, |
| 272 | + { .compatible = "samsung,exynos4210-pmu" }, |
| 273 | + { .compatible = "samsung,exynos4212-pmu" }, |
| 274 | + { .compatible = "samsung,exynos4412-pmu" }, |
| 275 | + { .compatible = "samsung,exynos5250-pmu" }, |
| 276 | + { .compatible = "samsung,exynos5420-pmu" }, |
| 277 | + { /*sentinel*/ }, |
| 278 | +}; |
| 279 | + |
| 280 | +static void exynos_map_pmu(void) |
| 281 | +{ |
| 282 | + struct device_node *np; |
| 283 | + |
| 284 | + np = of_find_matching_node(NULL, exynos_dt_pmu_match); |
| 285 | + if (np) |
| 286 | + pmu_base_addr = of_iomap(np, 0); |
| 287 | + |
| 288 | + if (!pmu_base_addr) |
| 289 | + panic("failed to find exynos pmu register\n"); |
| 290 | +} |
| 291 | + |
| 292 | +static void __init exynos_init_irq(void) |
| 293 | +{ |
| 294 | + irqchip_init(); |
| 295 | + /* |
| 296 | + * Since platsmp.c needs pmu base address by the time |
| 297 | + * DT is not unflatten so we can't use DT APIs before |
| 298 | + * init_irq |
| 299 | + */ |
| 300 | + exynos_map_pmu(); |
| 301 | +} |
| 302 | + |
267 | 303 | static void __init exynos_dt_machine_init(void)
|
268 | 304 | {
|
269 | 305 | struct device_node *i2c_np;
|
@@ -344,6 +380,7 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
|
344 | 380 | .smp = smp_ops(exynos_smp_ops),
|
345 | 381 | .map_io = exynos_init_io,
|
346 | 382 | .init_early = exynos_firmware_init,
|
| 383 | + .init_irq = exynos_init_irq, |
347 | 384 | .init_machine = exynos_dt_machine_init,
|
348 | 385 | .init_late = exynos_init_late,
|
349 | 386 | .dt_compat = exynos_dt_compat,
|
|
0 commit comments