162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci//
362306a36Sopenharmony_ci// Copyright (c) 2011-2015 Samsung Electronics Co., Ltd.
462306a36Sopenharmony_ci//		http://www.samsung.com/
562306a36Sopenharmony_ci//
662306a36Sopenharmony_ci// Exynos5420 - CPU PMU (Power Management Unit) support
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <linux/pm.h>
962306a36Sopenharmony_ci#include <linux/soc/samsung/exynos-regs-pmu.h>
1062306a36Sopenharmony_ci#include <linux/soc/samsung/exynos-pmu.h>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <asm/cputype.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#include "exynos-pmu.h"
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_cistatic const struct exynos_pmu_conf exynos5420_pmu_config[] = {
1762306a36Sopenharmony_ci	/* { .offset = offset, .val = { AFTR, LPA, SLEEP } */
1862306a36Sopenharmony_ci	{ EXYNOS5_ARM_CORE0_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
1962306a36Sopenharmony_ci	{ EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
2062306a36Sopenharmony_ci	{ EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
2162306a36Sopenharmony_ci	{ EXYNOS5_ARM_CORE1_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
2262306a36Sopenharmony_ci	{ EXYNOS5_DIS_IRQ_ARM_CORE1_LOCAL_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
2362306a36Sopenharmony_ci	{ EXYNOS5_DIS_IRQ_ARM_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
2462306a36Sopenharmony_ci	{ EXYNOS5420_ARM_CORE2_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
2562306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_ARM_CORE2_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
2662306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_ARM_CORE2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
2762306a36Sopenharmony_ci	{ EXYNOS5420_ARM_CORE3_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
2862306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_ARM_CORE3_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
2962306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_ARM_CORE3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3062306a36Sopenharmony_ci	{ EXYNOS5420_KFC_CORE0_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
3162306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE0_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3262306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3362306a36Sopenharmony_ci	{ EXYNOS5420_KFC_CORE1_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
3462306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE1_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3562306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3662306a36Sopenharmony_ci	{ EXYNOS5420_KFC_CORE2_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
3762306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE2_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3862306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
3962306a36Sopenharmony_ci	{ EXYNOS5420_KFC_CORE3_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
4062306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE3_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
4162306a36Sopenharmony_ci	{ EXYNOS5420_DIS_IRQ_KFC_CORE3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
4262306a36Sopenharmony_ci	{ EXYNOS5_ISP_ARM_SYS_PWR_REG,			{ 0x1, 0x0, 0x0} },
4362306a36Sopenharmony_ci	{ EXYNOS5_DIS_IRQ_ISP_ARM_LOCAL_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
4462306a36Sopenharmony_ci	{ EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
4562306a36Sopenharmony_ci	{ EXYNOS5420_ARM_COMMON_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
4662306a36Sopenharmony_ci	{ EXYNOS5420_KFC_COMMON_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
4762306a36Sopenharmony_ci	{ EXYNOS5_ARM_L2_SYS_PWR_REG,			{ 0x0, 0x0, 0x0} },
4862306a36Sopenharmony_ci	{ EXYNOS5420_KFC_L2_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
4962306a36Sopenharmony_ci	{ EXYNOS5_CMU_ACLKSTOP_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
5062306a36Sopenharmony_ci	{ EXYNOS5_CMU_SCLKSTOP_SYS_PWR_REG,		{ 0x1, 0x0, 0x1} },
5162306a36Sopenharmony_ci	{ EXYNOS5_CMU_RESET_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
5262306a36Sopenharmony_ci	{ EXYNOS5_CMU_ACLKSTOP_SYSMEM_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
5362306a36Sopenharmony_ci	{ EXYNOS5_CMU_SCLKSTOP_SYSMEM_SYS_PWR_REG,	{ 0x1, 0x0, 0x1} },
5462306a36Sopenharmony_ci	{ EXYNOS5_CMU_RESET_SYSMEM_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
5562306a36Sopenharmony_ci	{ EXYNOS5_DRAM_FREQ_DOWN_SYS_PWR_REG,		{ 0x1, 0x0, 0x1} },
5662306a36Sopenharmony_ci	{ EXYNOS5_DDRPHY_DLLOFF_SYS_PWR_REG,		{ 0x1, 0x1, 0x1} },
5762306a36Sopenharmony_ci	{ EXYNOS5_DDRPHY_DLLLOCK_SYS_PWR_REG,		{ 0x1, 0x0, 0x1} },
5862306a36Sopenharmony_ci	{ EXYNOS5_APLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
5962306a36Sopenharmony_ci	{ EXYNOS5_MPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6062306a36Sopenharmony_ci	{ EXYNOS5_VPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6162306a36Sopenharmony_ci	{ EXYNOS5_EPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
6262306a36Sopenharmony_ci	{ EXYNOS5_BPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6362306a36Sopenharmony_ci	{ EXYNOS5_CPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6462306a36Sopenharmony_ci	{ EXYNOS5420_DPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6562306a36Sopenharmony_ci	{ EXYNOS5420_IPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6662306a36Sopenharmony_ci	{ EXYNOS5420_KPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6762306a36Sopenharmony_ci	{ EXYNOS5_MPLLUSER_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6862306a36Sopenharmony_ci	{ EXYNOS5_BPLLUSER_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
6962306a36Sopenharmony_ci	{ EXYNOS5420_RPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
7062306a36Sopenharmony_ci	{ EXYNOS5420_SPLL_SYSCLK_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
7162306a36Sopenharmony_ci	{ EXYNOS5_TOP_BUS_SYS_PWR_REG,			{ 0x3, 0x0, 0x0} },
7262306a36Sopenharmony_ci	{ EXYNOS5_TOP_RETENTION_SYS_PWR_REG,		{ 0x1, 0x1, 0x1} },
7362306a36Sopenharmony_ci	{ EXYNOS5_TOP_PWR_SYS_PWR_REG,			{ 0x3, 0x3, 0x0} },
7462306a36Sopenharmony_ci	{ EXYNOS5_TOP_BUS_SYSMEM_SYS_PWR_REG,		{ 0x3, 0x0, 0x0} },
7562306a36Sopenharmony_ci	{ EXYNOS5_TOP_RETENTION_SYSMEM_SYS_PWR_REG,	{ 0x1, 0x0, 0x1} },
7662306a36Sopenharmony_ci	{ EXYNOS5_TOP_PWR_SYSMEM_SYS_PWR_REG,		{ 0x3, 0x0, 0x0} },
7762306a36Sopenharmony_ci	{ EXYNOS5_LOGIC_RESET_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
7862306a36Sopenharmony_ci	{ EXYNOS5_OSCCLK_GATE_SYS_PWR_REG,		{ 0x1, 0x0, 0x1} },
7962306a36Sopenharmony_ci	{ EXYNOS5_LOGIC_RESET_SYSMEM_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
8062306a36Sopenharmony_ci	{ EXYNOS5_OSCCLK_GATE_SYSMEM_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
8162306a36Sopenharmony_ci	{ EXYNOS5420_INTRAM_MEM_SYS_PWR_REG,		{ 0x3, 0x0, 0x3} },
8262306a36Sopenharmony_ci	{ EXYNOS5420_INTROM_MEM_SYS_PWR_REG,		{ 0x3, 0x0, 0x3} },
8362306a36Sopenharmony_ci	{ EXYNOS5_PAD_RETENTION_DRAM_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
8462306a36Sopenharmony_ci	{ EXYNOS5_PAD_RETENTION_MAU_SYS_PWR_REG,	{ 0x1, 0x1, 0x0} },
8562306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_JTAG_SYS_PWR_REG,	{ 0x1, 0x1, 0x0} },
8662306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_DRAM_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
8762306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_UART_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
8862306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_MMC0_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
8962306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_MMC1_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9062306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_MMC2_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9162306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_HSI_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9262306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_EBIA_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9362306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_EBIB_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9462306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_SPI_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9562306a36Sopenharmony_ci	{ EXYNOS5420_PAD_RETENTION_DRAM_COREBLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
9662306a36Sopenharmony_ci	{ EXYNOS5_PAD_ISOLATION_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
9762306a36Sopenharmony_ci	{ EXYNOS5_PAD_ISOLATION_SYSMEM_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
9862306a36Sopenharmony_ci	{ EXYNOS5_PAD_ALV_SEL_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
9962306a36Sopenharmony_ci	{ EXYNOS5_XUSBXTI_SYS_PWR_REG,			{ 0x1, 0x1, 0x0} },
10062306a36Sopenharmony_ci	{ EXYNOS5_XXTI_SYS_PWR_REG,			{ 0x1, 0x1, 0x0} },
10162306a36Sopenharmony_ci	{ EXYNOS5_EXT_REGULATOR_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
10262306a36Sopenharmony_ci	{ EXYNOS5_GPIO_MODE_SYS_PWR_REG,		{ 0x1, 0x0, 0x0} },
10362306a36Sopenharmony_ci	{ EXYNOS5_GPIO_MODE_SYSMEM_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
10462306a36Sopenharmony_ci	{ EXYNOS5_GPIO_MODE_MAU_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
10562306a36Sopenharmony_ci	{ EXYNOS5_TOP_ASB_RESET_SYS_PWR_REG,		{ 0x1, 0x1, 0x0} },
10662306a36Sopenharmony_ci	{ EXYNOS5_TOP_ASB_ISOLATION_SYS_PWR_REG,	{ 0x1, 0x0, 0x0} },
10762306a36Sopenharmony_ci	{ EXYNOS5_GSCL_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
10862306a36Sopenharmony_ci	{ EXYNOS5_ISP_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
10962306a36Sopenharmony_ci	{ EXYNOS5_MFC_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11062306a36Sopenharmony_ci	{ EXYNOS5_G3D_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11162306a36Sopenharmony_ci	{ EXYNOS5420_DISP1_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11262306a36Sopenharmony_ci	{ EXYNOS5420_MAU_SYS_PWR_REG,			{ 0x7, 0x7, 0x0} },
11362306a36Sopenharmony_ci	{ EXYNOS5420_G2D_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11462306a36Sopenharmony_ci	{ EXYNOS5420_MSC_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11562306a36Sopenharmony_ci	{ EXYNOS5420_FSYS_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11662306a36Sopenharmony_ci	{ EXYNOS5420_FSYS2_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11762306a36Sopenharmony_ci	{ EXYNOS5420_PSGEN_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11862306a36Sopenharmony_ci	{ EXYNOS5420_PERIC_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
11962306a36Sopenharmony_ci	{ EXYNOS5420_WCORE_SYS_PWR_REG,			{ 0x7, 0x0, 0x0} },
12062306a36Sopenharmony_ci	{ EXYNOS5_CMU_CLKSTOP_GSCL_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
12162306a36Sopenharmony_ci	{ EXYNOS5_CMU_CLKSTOP_ISP_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
12262306a36Sopenharmony_ci	{ EXYNOS5_CMU_CLKSTOP_MFC_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
12362306a36Sopenharmony_ci	{ EXYNOS5_CMU_CLKSTOP_G3D_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
12462306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_DISP1_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
12562306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_MAU_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
12662306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_G2D_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
12762306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_MSC_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
12862306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_FSYS_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
12962306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_PSGEN_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
13062306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_PERIC_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
13162306a36Sopenharmony_ci	{ EXYNOS5420_CMU_CLKSTOP_WCORE_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
13262306a36Sopenharmony_ci	{ EXYNOS5_CMU_SYSCLK_GSCL_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
13362306a36Sopenharmony_ci	{ EXYNOS5_CMU_SYSCLK_ISP_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
13462306a36Sopenharmony_ci	{ EXYNOS5_CMU_SYSCLK_MFC_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
13562306a36Sopenharmony_ci	{ EXYNOS5_CMU_SYSCLK_G3D_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
13662306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_DISP1_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
13762306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_MAU_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
13862306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_G2D_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
13962306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_MSC_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14062306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_FSYS_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14162306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_FSYS2_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14262306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_PSGEN_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14362306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_PERIC_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14462306a36Sopenharmony_ci	{ EXYNOS5420_CMU_SYSCLK_WCORE_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14562306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_FSYS2_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14662306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_PSGEN_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14762306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_PERIC_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14862306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_WCORE_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
14962306a36Sopenharmony_ci	{ EXYNOS5_CMU_RESET_GSCL_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15062306a36Sopenharmony_ci	{ EXYNOS5_CMU_RESET_ISP_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15162306a36Sopenharmony_ci	{ EXYNOS5_CMU_RESET_MFC_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15262306a36Sopenharmony_ci	{ EXYNOS5_CMU_RESET_G3D_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15362306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_DISP1_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
15462306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_MAU_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15562306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_G2D_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15662306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_MSC_SYS_PWR_REG,		{ 0x0, 0x0, 0x0} },
15762306a36Sopenharmony_ci	{ EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG,	{ 0x0, 0x0, 0x0} },
15862306a36Sopenharmony_ci	{ PMU_TABLE_END,},
15962306a36Sopenharmony_ci};
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_cistatic unsigned int const exynos5420_list_disable_pmu_reg[] = {
16262306a36Sopenharmony_ci	EXYNOS5_CMU_CLKSTOP_GSCL_SYS_PWR_REG,
16362306a36Sopenharmony_ci	EXYNOS5_CMU_CLKSTOP_ISP_SYS_PWR_REG,
16462306a36Sopenharmony_ci	EXYNOS5_CMU_CLKSTOP_G3D_SYS_PWR_REG,
16562306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_DISP1_SYS_PWR_REG,
16662306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_MAU_SYS_PWR_REG,
16762306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_G2D_SYS_PWR_REG,
16862306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_MSC_SYS_PWR_REG,
16962306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_FSYS_SYS_PWR_REG,
17062306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_PSGEN_SYS_PWR_REG,
17162306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_PERIC_SYS_PWR_REG,
17262306a36Sopenharmony_ci	EXYNOS5420_CMU_CLKSTOP_WCORE_SYS_PWR_REG,
17362306a36Sopenharmony_ci	EXYNOS5_CMU_SYSCLK_GSCL_SYS_PWR_REG,
17462306a36Sopenharmony_ci	EXYNOS5_CMU_SYSCLK_ISP_SYS_PWR_REG,
17562306a36Sopenharmony_ci	EXYNOS5_CMU_SYSCLK_G3D_SYS_PWR_REG,
17662306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_DISP1_SYS_PWR_REG,
17762306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_MAU_SYS_PWR_REG,
17862306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_G2D_SYS_PWR_REG,
17962306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_MSC_SYS_PWR_REG,
18062306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_FSYS_SYS_PWR_REG,
18162306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_FSYS2_SYS_PWR_REG,
18262306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_PSGEN_SYS_PWR_REG,
18362306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_PERIC_SYS_PWR_REG,
18462306a36Sopenharmony_ci	EXYNOS5420_CMU_SYSCLK_WCORE_SYS_PWR_REG,
18562306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_FSYS2_SYS_PWR_REG,
18662306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_PSGEN_SYS_PWR_REG,
18762306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_PERIC_SYS_PWR_REG,
18862306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_WCORE_SYS_PWR_REG,
18962306a36Sopenharmony_ci	EXYNOS5_CMU_RESET_GSCL_SYS_PWR_REG,
19062306a36Sopenharmony_ci	EXYNOS5_CMU_RESET_ISP_SYS_PWR_REG,
19162306a36Sopenharmony_ci	EXYNOS5_CMU_RESET_G3D_SYS_PWR_REG,
19262306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_DISP1_SYS_PWR_REG,
19362306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_MAU_SYS_PWR_REG,
19462306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_G2D_SYS_PWR_REG,
19562306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_MSC_SYS_PWR_REG,
19662306a36Sopenharmony_ci	EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG,
19762306a36Sopenharmony_ci};
19862306a36Sopenharmony_ci
19962306a36Sopenharmony_cistatic void exynos5420_powerdown_conf(enum sys_powerdown mode)
20062306a36Sopenharmony_ci{
20162306a36Sopenharmony_ci	u32 this_cluster;
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci	this_cluster = MPIDR_AFFINITY_LEVEL(read_cpuid_mpidr(), 1);
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci	/*
20662306a36Sopenharmony_ci	 * set the cluster id to IROM register to ensure that we wake
20762306a36Sopenharmony_ci	 * up with the current cluster.
20862306a36Sopenharmony_ci	 */
20962306a36Sopenharmony_ci	pmu_raw_writel(this_cluster, EXYNOS_IROM_DATA2);
21062306a36Sopenharmony_ci}
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_cistatic void exynos5420_pmu_init(void)
21362306a36Sopenharmony_ci{
21462306a36Sopenharmony_ci	unsigned int value;
21562306a36Sopenharmony_ci	int i;
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ci	/*
21862306a36Sopenharmony_ci	 * Set the CMU_RESET, CMU_SYSCLK and CMU_CLKSTOP registers
21962306a36Sopenharmony_ci	 * for local power blocks to Low initially as per Table 8-4:
22062306a36Sopenharmony_ci	 * "System-Level Power-Down Configuration Registers".
22162306a36Sopenharmony_ci	 */
22262306a36Sopenharmony_ci	for (i = 0; i < ARRAY_SIZE(exynos5420_list_disable_pmu_reg); i++)
22362306a36Sopenharmony_ci		pmu_raw_writel(0, exynos5420_list_disable_pmu_reg[i]);
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci	/* Enable USE_STANDBY_WFI for all CORE */
22662306a36Sopenharmony_ci	pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION);
22762306a36Sopenharmony_ci
22862306a36Sopenharmony_ci	value  = pmu_raw_readl(EXYNOS_L2_OPTION(0));
22962306a36Sopenharmony_ci	value &= ~EXYNOS_L2_USE_RETENTION;
23062306a36Sopenharmony_ci	pmu_raw_writel(value, EXYNOS_L2_OPTION(0));
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci	value = pmu_raw_readl(EXYNOS_L2_OPTION(1));
23362306a36Sopenharmony_ci	value &= ~EXYNOS_L2_USE_RETENTION;
23462306a36Sopenharmony_ci	pmu_raw_writel(value, EXYNOS_L2_OPTION(1));
23562306a36Sopenharmony_ci
23662306a36Sopenharmony_ci	/*
23762306a36Sopenharmony_ci	 * If L2_COMMON is turned off, clocks related to ATB async
23862306a36Sopenharmony_ci	 * bridge are gated. Thus, when ISP power is gated, LPI
23962306a36Sopenharmony_ci	 * may get stuck.
24062306a36Sopenharmony_ci	 */
24162306a36Sopenharmony_ci	value = pmu_raw_readl(EXYNOS5420_LPI_MASK);
24262306a36Sopenharmony_ci	value |= EXYNOS5420_ATB_ISP_ARM;
24362306a36Sopenharmony_ci	pmu_raw_writel(value, EXYNOS5420_LPI_MASK);
24462306a36Sopenharmony_ci
24562306a36Sopenharmony_ci	value  = pmu_raw_readl(EXYNOS5420_LPI_MASK1);
24662306a36Sopenharmony_ci	value |= EXYNOS5420_ATB_KFC;
24762306a36Sopenharmony_ci	pmu_raw_writel(value, EXYNOS5420_LPI_MASK1);
24862306a36Sopenharmony_ci
24962306a36Sopenharmony_ci	/* Prevent issue of new bus request from L2 memory */
25062306a36Sopenharmony_ci	value = pmu_raw_readl(EXYNOS5420_ARM_COMMON_OPTION);
25162306a36Sopenharmony_ci	value |= EXYNOS5_SKIP_DEACTIVATE_ACEACP_IN_PWDN;
25262306a36Sopenharmony_ci	pmu_raw_writel(value, EXYNOS5420_ARM_COMMON_OPTION);
25362306a36Sopenharmony_ci
25462306a36Sopenharmony_ci	value = pmu_raw_readl(EXYNOS5420_KFC_COMMON_OPTION);
25562306a36Sopenharmony_ci	value |= EXYNOS5_SKIP_DEACTIVATE_ACEACP_IN_PWDN;
25662306a36Sopenharmony_ci	pmu_raw_writel(value, EXYNOS5420_KFC_COMMON_OPTION);
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci	/* This setting is to reduce suspend/resume time */
25962306a36Sopenharmony_ci	pmu_raw_writel(DUR_WAIT_RESET, EXYNOS5420_LOGIC_RESET_DURATION3);
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci	/* Serialized CPU wakeup of Eagle */
26262306a36Sopenharmony_ci	pmu_raw_writel(SPREAD_ENABLE, EXYNOS5420_ARM_INTR_SPREAD_ENABLE);
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci	pmu_raw_writel(SPREAD_USE_STANDWFI,
26562306a36Sopenharmony_ci			EXYNOS5420_ARM_INTR_SPREAD_USE_STANDBYWFI);
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci	pmu_raw_writel(0x1, EXYNOS5420_UP_SCHEDULER);
26862306a36Sopenharmony_ci
26962306a36Sopenharmony_ci	pr_info("EXYNOS5420 PMU initialized\n");
27062306a36Sopenharmony_ci}
27162306a36Sopenharmony_ci
27262306a36Sopenharmony_ciconst struct exynos_pmu_data exynos5420_pmu_data = {
27362306a36Sopenharmony_ci	.pmu_config	= exynos5420_pmu_config,
27462306a36Sopenharmony_ci	.pmu_init	= exynos5420_pmu_init,
27562306a36Sopenharmony_ci	.powerdown_conf	= exynos5420_powerdown_conf,
27662306a36Sopenharmony_ci};
277