blob: 14c42a1bdf1ef20d506f47d8fe013be7e71254b9 [file] [log] [blame]
Magnus Damma662c082012-01-10 15:50:01 +09001/*
2 * r8a7779 Power management support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
Magnus Damma662c082012-01-10 15:50:01 +090012#include <asm/io.h>
Geert Uytterhoeven1b553532014-06-20 18:53:05 +020013
Magnus Damm585c09d2014-06-17 16:47:53 +090014#include "pm-rcar.h"
Geert Uytterhoeven1b553532014-06-20 18:53:05 +020015#include "r8a7779.h"
Magnus Damma662c082012-01-10 15:50:01 +090016
Magnus Damma662c082012-01-10 15:50:01 +090017/* SYSC */
Magnus Damma662c082012-01-10 15:50:01 +090018#define SYSCIER 0x0c
19#define SYSCIMR 0x10
Magnus Damma662c082012-01-10 15:50:01 +090020
Magnus Dammf40aaf62012-01-10 17:44:39 +090021#if defined(CONFIG_PM) || defined(CONFIG_SMP)
22
Magnus Damma662c082012-01-10 15:50:01 +090023static void __init r8a7779_sysc_init(void)
24{
Magnus Damma6557eb2014-01-15 16:43:08 +090025 void __iomem *base = rcar_sysc_init(0xffd85000);
Magnus Damma662c082012-01-10 15:50:01 +090026
27 /* enable all interrupt sources, but do not use interrupt handler */
Magnus Damma6557eb2014-01-15 16:43:08 +090028 iowrite32(0x0131000e, base + SYSCIER);
29 iowrite32(0, base + SYSCIMR);
Magnus Damma662c082012-01-10 15:50:01 +090030}
31
Magnus Dammf40aaf62012-01-10 17:44:39 +090032#else /* CONFIG_PM || CONFIG_SMP */
33
34static inline void r8a7779_sysc_init(void) {}
35
36#endif /* CONFIG_PM || CONFIG_SMP */
37
Magnus Damma662c082012-01-10 15:50:01 +090038void __init r8a7779_pm_init(void)
39{
Magnus Dammf40aaf62012-01-10 17:44:39 +090040 static int once;
41
42 if (!once++)
43 r8a7779_sysc_init();
Magnus Damma662c082012-01-10 15:50:01 +090044}