2 * r8a7790 Power management support
4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2011 Renesas Solutions Corp.
6 * Copyright (C) 2011 Magnus Damm
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
13 #include <linux/kernel.h>
14 #include <linux/smp.h>
21 #define RST 0xe6160000
22 #define CA15BAR 0x0020
24 #define CA15RESCNT 0x0040
25 #define CA7RESCNT 0x0044
28 #define MERAM 0xe8080000
34 #if defined(CONFIG_SMP)
36 static void __init r8a7790_sysc_init(void)
38 void __iomem *base = rcar_sysc_init(0xe6180000);
40 /* enable all interrupt sources, but do not use interrupt handler */
41 iowrite32(0x0131000e, base + SYSCIER);
42 iowrite32(0, base + SYSCIMR);
45 #else /* CONFIG_SMP */
47 static inline void r8a7790_sysc_init(void) {}
49 #endif /* CONFIG_SMP */
51 void __init r8a7790_pm_init(void)
60 /* MERAM for jump stub, because BAR requires 256KB aligned address */
61 p = ioremap_nocache(MERAM, shmobile_boot_size);
62 memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
65 /* setup reset vectors */
66 p = ioremap_nocache(RST, 0x63);
67 bar = (MERAM >> 8) & 0xfffffc00;
68 writel_relaxed(bar, p + CA15BAR);
69 writel_relaxed(bar, p + CA7BAR);
70 writel_relaxed(bar | 0x10, p + CA15BAR);
71 writel_relaxed(bar | 0x10, p + CA7BAR);
73 /* de-assert reset for all CPUs */
74 writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
76 writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
81 shmobile_smp_apmu_suspend_init();