2 * r8a7791 Power management support
4 * Copyright (C) 2014 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>
20 #define RST 0xe6160000
21 #define CA15BAR 0x0020
22 #define CA15RESCNT 0x0040
23 #define RAM 0xe6300000
29 #if defined(CONFIG_SMP)
31 static void __init r8a7791_sysc_init(void)
33 void __iomem *base = rcar_sysc_init(0xe6180000);
35 /* enable all interrupt sources, but do not use interrupt handler */
36 iowrite32(0x0131000e, base + SYSCIER);
37 iowrite32(0, base + SYSCIMR);
40 #else /* CONFIG_SMP */
42 static inline void r8a7791_sysc_init(void) {}
44 #endif /* CONFIG_SMP */
46 void __init r8a7791_pm_init(void)
55 /* RAM for jump stub, because BAR requires 256KB aligned address */
56 p = ioremap_nocache(RAM, shmobile_boot_size);
57 memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
60 /* setup reset vectors */
61 p = ioremap_nocache(RST, 0x63);
62 bar = (RAM >> 8) & 0xfffffc00;
63 writel_relaxed(bar, p + CA15BAR);
64 writel_relaxed(bar | 0x10, p + CA15BAR);
66 /* enable clocks to all CPUs */
67 writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
72 shmobile_smp_apmu_suspend_init();