2012-01-10 13:50:01 +07:00
|
|
|
/*
|
|
|
|
* r8a7779 Power management support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Renesas Solutions Corp.
|
|
|
|
* Copyright (C) 2011 Magnus Damm
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
2016-04-20 19:02:36 +07:00
|
|
|
#include <linux/soc/renesas/rcar-sysc.h>
|
|
|
|
|
2012-01-10 13:50:01 +07:00
|
|
|
#include <asm/io.h>
|
2014-06-20 23:53:05 +07:00
|
|
|
|
|
|
|
#include "r8a7779.h"
|
2012-01-10 13:50:01 +07:00
|
|
|
|
|
|
|
/* SYSC */
|
|
|
|
#define SYSCIER 0x0c
|
|
|
|
#define SYSCIMR 0x10
|
|
|
|
|
2012-01-10 15:44:39 +07:00
|
|
|
#if defined(CONFIG_PM) || defined(CONFIG_SMP)
|
|
|
|
|
2012-01-10 13:50:01 +07:00
|
|
|
static void __init r8a7779_sysc_init(void)
|
|
|
|
{
|
2014-01-15 14:43:08 +07:00
|
|
|
void __iomem *base = rcar_sysc_init(0xffd85000);
|
2012-01-10 13:50:01 +07:00
|
|
|
|
|
|
|
/* enable all interrupt sources, but do not use interrupt handler */
|
2014-01-15 14:43:08 +07:00
|
|
|
iowrite32(0x0131000e, base + SYSCIER);
|
|
|
|
iowrite32(0, base + SYSCIMR);
|
2012-01-10 13:50:01 +07:00
|
|
|
}
|
|
|
|
|
2012-01-10 15:44:39 +07:00
|
|
|
#else /* CONFIG_PM || CONFIG_SMP */
|
|
|
|
|
|
|
|
static inline void r8a7779_sysc_init(void) {}
|
|
|
|
|
|
|
|
#endif /* CONFIG_PM || CONFIG_SMP */
|
|
|
|
|
2012-01-10 13:50:01 +07:00
|
|
|
void __init r8a7779_pm_init(void)
|
|
|
|
{
|
2012-01-10 15:44:39 +07:00
|
|
|
static int once;
|
|
|
|
|
|
|
|
if (!once++)
|
|
|
|
r8a7779_sysc_init();
|
2012-01-10 13:50:01 +07:00
|
|
|
}
|