18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * PXA910 Power Management Routines
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * (C) Copyright 2009 Marvell International Ltd.
68c2ecf20Sopenharmony_ci * All Rights Reserved
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __PXA910_PM_H__
108c2ecf20Sopenharmony_ci#define __PXA910_PM_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG			APMU_REG(0x0018)
138c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_IDLE		(1 << 1)
148c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_PWRDWN		(1 << 5)
158c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_SRAM_PWRDWN	(1 << 6)
168c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_PWR_SW(x)		(((x) & 0x3) << 16)
178c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_L2_PWR_SW(x)	(((x) & 0x3) << 18)
188c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_DIS_MC_SW_REQ	(1 << 21)
198c2ecf20Sopenharmony_ci#define APMU_MOH_IDLE_CFG_MOH_MC_WAKE_EN	(1 << 20)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define APMU_SQU_CLK_GATE_CTRL			APMU_REG(0x001c)
228c2ecf20Sopenharmony_ci#define APMU_MC_HW_SLP_TYPE			APMU_REG(0x00b0)
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define MPMU_FCCR				MPMU_REG(0x0008)
258c2ecf20Sopenharmony_ci#define MPMU_APCR				MPMU_REG(0x1000)
268c2ecf20Sopenharmony_ci#define MPMU_APCR_AXISD				(1 << 31)
278c2ecf20Sopenharmony_ci#define MPMU_APCR_DSPSD				(1 << 30)
288c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPEN				(1 << 29)
298c2ecf20Sopenharmony_ci#define MPMU_APCR_DTCMSD			(1 << 28)
308c2ecf20Sopenharmony_ci#define MPMU_APCR_DDRCORSD			(1 << 27)
318c2ecf20Sopenharmony_ci#define MPMU_APCR_APBSD				(1 << 26)
328c2ecf20Sopenharmony_ci#define MPMU_APCR_BBSD				(1 << 25)
338c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP0			(1 << 23)
348c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP1			(1 << 22)
358c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP2			(1 << 21)
368c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP3			(1 << 20)
378c2ecf20Sopenharmony_ci#define MPMU_APCR_VCTCXOSD			(1 << 19)
388c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP4			(1 << 18)
398c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP5			(1 << 17)
408c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP6			(1 << 16)
418c2ecf20Sopenharmony_ci#define MPMU_APCR_SLPWP7			(1 << 15)
428c2ecf20Sopenharmony_ci#define MPMU_APCR_MSASLPEN			(1 << 14)
438c2ecf20Sopenharmony_ci#define MPMU_APCR_STBYEN			(1 << 13)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define MPMU_AWUCRM				MPMU_REG(0x104c)
468c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP_ASYNC_INT		(1 << 25)
478c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP_FULL_IDLE		(1 << 24)
488c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_SDH1			(1 << 23)
498c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_SDH2			(1 << 22)
508c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_KEYPRESS			(1 << 21)
518c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_TRACKBALL			(1 << 20)
528c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_NEWROTARY			(1 << 19)
538c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_RTC_ALARM			(1 << 17)
548c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP2_TIMER_3			(1 << 13)
558c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP2_TIMER_2			(1 << 12)
568c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP2_TIMER_1			(1 << 11)
578c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP1_TIMER_3			(1 << 10)
588c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP1_TIMER_2			(1 << 9)
598c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_AP1_TIMER_1			(1 << 8)
608c2ecf20Sopenharmony_ci#define MPMU_AWUCRM_WAKEUP(x)			(1 << ((x) & 0x7))
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_cienum {
638c2ecf20Sopenharmony_ci	POWER_MODE_ACTIVE = 0,
648c2ecf20Sopenharmony_ci	POWER_MODE_CORE_INTIDLE,
658c2ecf20Sopenharmony_ci	POWER_MODE_CORE_EXTIDLE,
668c2ecf20Sopenharmony_ci	POWER_MODE_APPS_IDLE,
678c2ecf20Sopenharmony_ci	POWER_MODE_APPS_SLEEP,
688c2ecf20Sopenharmony_ci	POWER_MODE_SYS_SLEEP,
698c2ecf20Sopenharmony_ci	POWER_MODE_HIBERNATE,
708c2ecf20Sopenharmony_ci	POWER_MODE_UDR,
718c2ecf20Sopenharmony_ci};
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ciextern int pxa910_set_wake(struct irq_data *data, unsigned int on);
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#endif
76