ARM: shmobile: r8a7740: add A4S pm domain support
This patch adds basic A4S pm domain support.
Now, below devices can be controled by PM
Common-SHwy, Common-HPB, BSC, MFI, MMFROM, HS-SHwy,
SYS-HPB, INTCA, DBSC, DDRPHY (Logic),
ATAPI, GbEther, AXI-bus
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:25:58 +04:00
|
|
|
/*
|
|
|
|
* r8a7740 power management support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Renesas Solutions Corp.
|
|
|
|
* Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
ARM: shmobile: r8a7740: add A3SP pm domain support
This patch adds basic A3SP pm domain support.
Now, below devices can be controled by PM
DMAC1/2/3, IPMMU, DDM, FLCTL, SYS-HPB, BBIF1, MSIOF1/2,
SCIFA,SCIFB, IIC1, IrDA, USBH, USBDMAC, SDHI0/1/2, TPU,
DREQPAK (Sys), MMCIF, RSPI, SIM, USBF
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:26:31 +04:00
|
|
|
#include <linux/console.h>
|
2014-12-03 16:41:44 +03:00
|
|
|
#include <linux/io.h>
|
2012-12-05 16:13:07 +04:00
|
|
|
#include <linux/suspend.h>
|
2014-12-03 16:41:44 +03:00
|
|
|
|
2014-06-17 11:47:37 +04:00
|
|
|
#include "common.h"
|
2014-06-17 11:47:45 +04:00
|
|
|
#include "pm-rmobile.h"
|
ARM: shmobile: r8a7740: add A4S pm domain support
This patch adds basic A4S pm domain support.
Now, below devices can be controled by PM
Common-SHwy, Common-HPB, BSC, MFI, MMFROM, HS-SHwy,
SYS-HPB, INTCA, DBSC, DDRPHY (Logic),
ATAPI, GbEther, AXI-bus
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:25:58 +04:00
|
|
|
|
2014-12-03 16:41:44 +03:00
|
|
|
#define SYSC_BASE IOMEM(0xe6180000)
|
|
|
|
|
2014-08-25 07:36:53 +04:00
|
|
|
#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
|
2014-10-23 15:19:01 +04:00
|
|
|
static int r8a7740_pd_a3sm_suspend(void)
|
ARM: shmobile: r8a7740: add A4S pm domain support
This patch adds basic A4S pm domain support.
Now, below devices can be controled by PM
Common-SHwy, Common-HPB, BSC, MFI, MMFROM, HS-SHwy,
SYS-HPB, INTCA, DBSC, DDRPHY (Logic),
ATAPI, GbEther, AXI-bus
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:25:58 +04:00
|
|
|
{
|
|
|
|
/*
|
2014-10-23 15:19:01 +04:00
|
|
|
* The A3SM domain contains the CPU core and therefore it should
|
2014-09-16 23:58:03 +04:00
|
|
|
* only be turned off if the CPU is not in use.
|
ARM: shmobile: r8a7740: add A4S pm domain support
This patch adds basic A4S pm domain support.
Now, below devices can be controled by PM
Common-SHwy, Common-HPB, BSC, MFI, MMFROM, HS-SHwy,
SYS-HPB, INTCA, DBSC, DDRPHY (Logic),
ATAPI, GbEther, AXI-bus
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:25:58 +04:00
|
|
|
*/
|
|
|
|
return -EBUSY;
|
|
|
|
}
|
|
|
|
|
ARM: shmobile: r8a7740: add A3SP pm domain support
This patch adds basic A3SP pm domain support.
Now, below devices can be controled by PM
DMAC1/2/3, IPMMU, DDM, FLCTL, SYS-HPB, BBIF1, MSIOF1/2,
SCIFA,SCIFB, IIC1, IrDA, USBH, USBDMAC, SDHI0/1/2, TPU,
DREQPAK (Sys), MMCIF, RSPI, SIM, USBF
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:26:31 +04:00
|
|
|
static int r8a7740_pd_a3sp_suspend(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Serial consoles make use of SCIF hardware located in A3SP,
|
|
|
|
* keep such power domain on if "no_console_suspend" is set.
|
|
|
|
*/
|
|
|
|
return console_suspend_enabled ? 0 : -EBUSY;
|
|
|
|
}
|
|
|
|
|
2014-10-23 15:18:58 +04:00
|
|
|
static int r8a7740_pd_d4_suspend(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* The D4 domain contains the Coresight-ETM hardware block and
|
|
|
|
* therefore it should only be turned off if the debug module is
|
|
|
|
* not in use.
|
|
|
|
*/
|
|
|
|
return -EBUSY;
|
|
|
|
}
|
|
|
|
|
2012-08-07 03:13:37 +04:00
|
|
|
static struct rmobile_pm_domain r8a7740_pm_domains[] = {
|
|
|
|
{
|
2014-08-29 17:26:22 +04:00
|
|
|
.genpd.name = "A4LC",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-08-29 17:26:22 +04:00
|
|
|
.bit_shift = 1,
|
2014-10-23 15:18:57 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "A4MP",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-10-23 15:18:57 +04:00
|
|
|
.bit_shift = 2,
|
2014-10-23 15:18:58 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "D4",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-10-23 15:18:58 +04:00
|
|
|
.bit_shift = 3,
|
|
|
|
.gov = &pm_domain_always_on_gov,
|
|
|
|
.suspend = r8a7740_pd_d4_suspend,
|
ARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support
Add support for the A4R power domain, and hook up the A3RV subdomain,
and the CEU0, TMU0, and IIC0 hardware blocks.
This domain also contains the Realtime CPU (SH-4A), Realtime CPU debug
modules, H-UDI, RT-SHwy, INTCS, RT-HPB, VIO6C, JPU, RTDMAC1/2, SSP,
MSIOF0, CMT0, ICB, DREQPAK (RT), 2DDMAC, IPMMUI, and 2DG hardware
blocks, but these are currently not used by any driver.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-10-23 15:18:59 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "A4R",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
ARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support
Add support for the A4R power domain, and hook up the A3RV subdomain,
and the CEU0, TMU0, and IIC0 hardware blocks.
This domain also contains the Realtime CPU (SH-4A), Realtime CPU debug
modules, H-UDI, RT-SHwy, INTCS, RT-HPB, VIO6C, JPU, RTDMAC1/2, SSP,
MSIOF0, CMT0, ICB, DREQPAK (RT), 2DDMAC, IPMMUI, and 2DG hardware
blocks, but these are currently not used by any driver.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-10-23 15:18:59 +04:00
|
|
|
.bit_shift = 5,
|
2014-10-23 15:18:55 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "A3RV",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-10-23 15:18:55 +04:00
|
|
|
.bit_shift = 6,
|
2014-08-29 17:26:22 +04:00
|
|
|
}, {
|
2012-08-07 03:13:37 +04:00
|
|
|
.genpd.name = "A4S",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2012-08-07 03:13:37 +04:00
|
|
|
.bit_shift = 10,
|
|
|
|
.no_debug = true,
|
2014-08-29 17:26:22 +04:00
|
|
|
}, {
|
2012-08-07 03:13:37 +04:00
|
|
|
.genpd.name = "A3SP",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2012-08-07 03:13:37 +04:00
|
|
|
.bit_shift = 11,
|
|
|
|
.gov = &pm_domain_always_on_gov,
|
|
|
|
.no_debug = true,
|
|
|
|
.suspend = r8a7740_pd_a3sp_suspend,
|
2014-10-23 15:19:01 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "A3SM",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-10-23 15:19:01 +04:00
|
|
|
.bit_shift = 12,
|
|
|
|
.gov = &pm_domain_always_on_gov,
|
|
|
|
.suspend = r8a7740_pd_a3sm_suspend,
|
2014-10-23 15:18:56 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "A3SG",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-10-23 15:18:56 +04:00
|
|
|
.bit_shift = 13,
|
2014-10-23 15:19:00 +04:00
|
|
|
}, {
|
|
|
|
.genpd.name = "A4SU",
|
2014-12-03 16:41:44 +03:00
|
|
|
.base = SYSC_BASE,
|
2014-10-23 15:19:00 +04:00
|
|
|
.bit_shift = 20,
|
2012-08-07 03:13:37 +04:00
|
|
|
},
|
ARM: shmobile: r8a7740: add A3SP pm domain support
This patch adds basic A3SP pm domain support.
Now, below devices can be controled by PM
DMAC1/2/3, IPMMU, DDM, FLCTL, SYS-HPB, BBIF1, MSIOF1/2,
SCIFA,SCIFB, IIC1, IrDA, USBH, USBDMAC, SDHI0/1/2, TPU,
DREQPAK (Sys), MMCIF, RSPI, SIM, USBF
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-05 12:26:31 +04:00
|
|
|
};
|
|
|
|
|
2012-08-07 03:13:37 +04:00
|
|
|
void __init r8a7740_init_pm_domains(void)
|
|
|
|
{
|
|
|
|
rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
|
ARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support
Add support for the A4R power domain, and hook up the A3RV subdomain,
and the CEU0, TMU0, and IIC0 hardware blocks.
This domain also contains the Realtime CPU (SH-4A), Realtime CPU debug
modules, H-UDI, RT-SHwy, INTCS, RT-HPB, VIO6C, JPU, RTDMAC1/2, SSP,
MSIOF0, CMT0, ICB, DREQPAK (RT), 2DDMAC, IPMMUI, and 2DG hardware
blocks, but these are currently not used by any driver.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-10-23 15:18:59 +04:00
|
|
|
pm_genpd_add_subdomain_names("A4R", "A3RV");
|
2012-08-07 03:13:37 +04:00
|
|
|
pm_genpd_add_subdomain_names("A4S", "A3SP");
|
2014-10-23 15:19:01 +04:00
|
|
|
pm_genpd_add_subdomain_names("A4S", "A3SM");
|
2014-10-23 15:18:56 +04:00
|
|
|
pm_genpd_add_subdomain_names("A4S", "A3SG");
|
2012-08-07 03:13:37 +04:00
|
|
|
}
|
2014-08-25 07:36:53 +04:00
|
|
|
#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
|
2012-12-05 16:13:07 +04:00
|
|
|
|
|
|
|
#ifdef CONFIG_SUSPEND
|
|
|
|
static int r8a7740_enter_suspend(suspend_state_t suspend_state)
|
|
|
|
{
|
|
|
|
cpu_do_idle();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void r8a7740_suspend_init(void)
|
|
|
|
{
|
|
|
|
shmobile_suspend_ops.enter = r8a7740_enter_suspend;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static void r8a7740_suspend_init(void) {}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void __init r8a7740_pm_init(void)
|
|
|
|
{
|
|
|
|
r8a7740_suspend_init();
|
|
|
|
}
|