18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci#ifndef __ARCH_ASM_MACH_OMAP2_PRCM_COMMON_H
38c2ecf20Sopenharmony_ci#define __ARCH_ASM_MACH_OMAP2_PRCM_COMMON_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * OMAP2/3 PRCM base and module definitions
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 2007-2009, 2011 Texas Instruments, Inc.
98c2ecf20Sopenharmony_ci * Copyright (C) 2007-2009 Nokia Corporation
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * Written by Paul Walmsley
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* Module offsets from both CM_BASE & PRM_BASE */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci * Offsets that are the same on 24xx and 34xx
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * Technically, in terms of the TRM, OCP_MOD is 34xx only; PLL_MOD is
208c2ecf20Sopenharmony_ci * CCR_MOD on 3430; and GFX_MOD only exists < 3430ES2.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci#define OCP_MOD						0x000
238c2ecf20Sopenharmony_ci#define MPU_MOD						0x100
248c2ecf20Sopenharmony_ci#define CORE_MOD					0x200
258c2ecf20Sopenharmony_ci#define GFX_MOD						0x300
268c2ecf20Sopenharmony_ci#define WKUP_MOD					0x400
278c2ecf20Sopenharmony_ci#define PLL_MOD						0x500
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* Chip-specific module offsets */
318c2ecf20Sopenharmony_ci#define OMAP24XX_GR_MOD					OCP_MOD
328c2ecf20Sopenharmony_ci#define OMAP24XX_DSP_MOD				0x800
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define OMAP2430_MDM_MOD				0xc00
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/* IVA2 module is < base on 3430 */
378c2ecf20Sopenharmony_ci#define OMAP3430_IVA2_MOD				-0x800
388c2ecf20Sopenharmony_ci#define OMAP3430ES2_SGX_MOD				GFX_MOD
398c2ecf20Sopenharmony_ci#define OMAP3430_CCR_MOD				PLL_MOD
408c2ecf20Sopenharmony_ci#define OMAP3430_DSS_MOD				0x600
418c2ecf20Sopenharmony_ci#define OMAP3430_CAM_MOD				0x700
428c2ecf20Sopenharmony_ci#define OMAP3430_PER_MOD				0x800
438c2ecf20Sopenharmony_ci#define OMAP3430_EMU_MOD				0x900
448c2ecf20Sopenharmony_ci#define OMAP3430_GR_MOD					0xa00
458c2ecf20Sopenharmony_ci#define OMAP3430_NEON_MOD				0xb00
468c2ecf20Sopenharmony_ci#define OMAP3430ES2_USBHOST_MOD				0xc00
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/*
498c2ecf20Sopenharmony_ci * TI81XX PRM module offsets
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_ci#define TI814X_PRM_DSP_MOD				0x0a00
528c2ecf20Sopenharmony_ci#define TI814X_PRM_HDVICP_MOD				0x0c00
538c2ecf20Sopenharmony_ci#define TI814X_PRM_ISP_MOD				0x0d00
548c2ecf20Sopenharmony_ci#define TI814X_PRM_HDVPSS_MOD				0x0e00
558c2ecf20Sopenharmony_ci#define TI814X_PRM_GFX_MOD				0x0f00
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define TI81XX_PRM_DEVICE_MOD			0x0000
588c2ecf20Sopenharmony_ci#define TI816X_PRM_ACTIVE_MOD			0x0a00
598c2ecf20Sopenharmony_ci#define TI81XX_PRM_DEFAULT_MOD			0x0b00
608c2ecf20Sopenharmony_ci#define TI816X_PRM_IVAHD0_MOD			0x0c00
618c2ecf20Sopenharmony_ci#define TI816X_PRM_IVAHD1_MOD			0x0d00
628c2ecf20Sopenharmony_ci#define TI816X_PRM_IVAHD2_MOD			0x0e00
638c2ecf20Sopenharmony_ci#define TI816X_PRM_SGX_MOD				0x0f00
648c2ecf20Sopenharmony_ci#define TI81XX_PRM_ALWON_MOD			0x1800
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* 24XX register bits shared between CM & PRM registers */
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
698c2ecf20Sopenharmony_ci#define OMAP2420_EN_MMC_SHIFT				26
708c2ecf20Sopenharmony_ci#define OMAP2420_EN_MMC_MASK				(1 << 26)
718c2ecf20Sopenharmony_ci#define OMAP24XX_EN_UART2_SHIFT				22
728c2ecf20Sopenharmony_ci#define OMAP24XX_EN_UART2_MASK				(1 << 22)
738c2ecf20Sopenharmony_ci#define OMAP24XX_EN_UART1_SHIFT				21
748c2ecf20Sopenharmony_ci#define OMAP24XX_EN_UART1_MASK				(1 << 21)
758c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCSPI2_SHIFT			18
768c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCSPI2_MASK				(1 << 18)
778c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCSPI1_SHIFT			17
788c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCSPI1_MASK				(1 << 17)
798c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCBSP2_SHIFT			16
808c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCBSP2_MASK				(1 << 16)
818c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCBSP1_SHIFT			15
828c2ecf20Sopenharmony_ci#define OMAP24XX_EN_MCBSP1_MASK				(1 << 15)
838c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT12_SHIFT				14
848c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT12_MASK				(1 << 14)
858c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT11_SHIFT				13
868c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT11_MASK				(1 << 13)
878c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT10_SHIFT				12
888c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT10_MASK				(1 << 12)
898c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT9_SHIFT				11
908c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT9_MASK				(1 << 11)
918c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT8_SHIFT				10
928c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT8_MASK				(1 << 10)
938c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT7_SHIFT				9
948c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT7_MASK				(1 << 9)
958c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT6_SHIFT				8
968c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT6_MASK				(1 << 8)
978c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT5_SHIFT				7
988c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT5_MASK				(1 << 7)
998c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT4_SHIFT				6
1008c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT4_MASK				(1 << 6)
1018c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT3_SHIFT				5
1028c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT3_MASK				(1 << 5)
1038c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT2_SHIFT				4
1048c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT2_MASK				(1 << 4)
1058c2ecf20Sopenharmony_ci#define OMAP2420_EN_VLYNQ_SHIFT				3
1068c2ecf20Sopenharmony_ci#define OMAP2420_EN_VLYNQ_MASK				(1 << 3)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* CM_FCLKEN2_CORE, CM_ICLKEN2_CORE, PM_WKEN2_CORE shared bits */
1098c2ecf20Sopenharmony_ci#define OMAP2430_EN_GPIO5_SHIFT				10
1108c2ecf20Sopenharmony_ci#define OMAP2430_EN_GPIO5_MASK				(1 << 10)
1118c2ecf20Sopenharmony_ci#define OMAP2430_EN_MCSPI3_SHIFT			9
1128c2ecf20Sopenharmony_ci#define OMAP2430_EN_MCSPI3_MASK				(1 << 9)
1138c2ecf20Sopenharmony_ci#define OMAP2430_EN_MMCHS2_SHIFT			8
1148c2ecf20Sopenharmony_ci#define OMAP2430_EN_MMCHS2_MASK				(1 << 8)
1158c2ecf20Sopenharmony_ci#define OMAP2430_EN_MMCHS1_SHIFT			7
1168c2ecf20Sopenharmony_ci#define OMAP2430_EN_MMCHS1_MASK				(1 << 7)
1178c2ecf20Sopenharmony_ci#define OMAP24XX_EN_UART3_SHIFT				2
1188c2ecf20Sopenharmony_ci#define OMAP24XX_EN_UART3_MASK				(1 << 2)
1198c2ecf20Sopenharmony_ci#define OMAP24XX_EN_USB_SHIFT				0
1208c2ecf20Sopenharmony_ci#define OMAP24XX_EN_USB_MASK				(1 << 0)
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci/* CM_ICLKEN2_CORE, PM_WKEN2_CORE shared bits */
1238c2ecf20Sopenharmony_ci#define OMAP2430_EN_MDM_INTC_SHIFT			11
1248c2ecf20Sopenharmony_ci#define OMAP2430_EN_MDM_INTC_MASK			(1 << 11)
1258c2ecf20Sopenharmony_ci#define OMAP2430_EN_USBHS_SHIFT				6
1268c2ecf20Sopenharmony_ci#define OMAP2430_EN_USBHS_MASK				(1 << 6)
1278c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPMC_SHIFT				1
1288c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPMC_MASK				(1 << 1)
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */
1318c2ecf20Sopenharmony_ci#define OMAP2420_ST_MMC_SHIFT				26
1328c2ecf20Sopenharmony_ci#define OMAP2420_ST_MMC_MASK				(1 << 26)
1338c2ecf20Sopenharmony_ci#define OMAP24XX_ST_UART2_SHIFT				22
1348c2ecf20Sopenharmony_ci#define OMAP24XX_ST_UART2_MASK				(1 << 22)
1358c2ecf20Sopenharmony_ci#define OMAP24XX_ST_UART1_SHIFT				21
1368c2ecf20Sopenharmony_ci#define OMAP24XX_ST_UART1_MASK				(1 << 21)
1378c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCSPI2_SHIFT			18
1388c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCSPI2_MASK				(1 << 18)
1398c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCSPI1_SHIFT			17
1408c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCSPI1_MASK				(1 << 17)
1418c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCBSP2_SHIFT			16
1428c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCBSP2_MASK				(1 << 16)
1438c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCBSP1_SHIFT			15
1448c2ecf20Sopenharmony_ci#define OMAP24XX_ST_MCBSP1_MASK				(1 << 15)
1458c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT12_SHIFT				14
1468c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT12_MASK				(1 << 14)
1478c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT11_SHIFT				13
1488c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT11_MASK				(1 << 13)
1498c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT10_SHIFT				12
1508c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT10_MASK				(1 << 12)
1518c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT9_SHIFT				11
1528c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT9_MASK				(1 << 11)
1538c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT8_SHIFT				10
1548c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT8_MASK				(1 << 10)
1558c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT7_SHIFT				9
1568c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT7_MASK				(1 << 9)
1578c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT6_SHIFT				8
1588c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT6_MASK				(1 << 8)
1598c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT5_SHIFT				7
1608c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT5_MASK				(1 << 7)
1618c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT4_SHIFT				6
1628c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT4_MASK				(1 << 6)
1638c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT3_SHIFT				5
1648c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT3_MASK				(1 << 5)
1658c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT2_SHIFT				4
1668c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT2_MASK				(1 << 4)
1678c2ecf20Sopenharmony_ci#define OMAP2420_ST_VLYNQ_SHIFT				3
1688c2ecf20Sopenharmony_ci#define OMAP2420_ST_VLYNQ_MASK				(1 << 3)
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci/* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */
1718c2ecf20Sopenharmony_ci#define OMAP2430_ST_MDM_INTC_SHIFT			11
1728c2ecf20Sopenharmony_ci#define OMAP2430_ST_MDM_INTC_MASK			(1 << 11)
1738c2ecf20Sopenharmony_ci#define OMAP2430_ST_GPIO5_SHIFT				10
1748c2ecf20Sopenharmony_ci#define OMAP2430_ST_GPIO5_MASK				(1 << 10)
1758c2ecf20Sopenharmony_ci#define OMAP2430_ST_MCSPI3_SHIFT			9
1768c2ecf20Sopenharmony_ci#define OMAP2430_ST_MCSPI3_MASK				(1 << 9)
1778c2ecf20Sopenharmony_ci#define OMAP2430_ST_MMCHS2_SHIFT			8
1788c2ecf20Sopenharmony_ci#define OMAP2430_ST_MMCHS2_MASK				(1 << 8)
1798c2ecf20Sopenharmony_ci#define OMAP2430_ST_MMCHS1_SHIFT			7
1808c2ecf20Sopenharmony_ci#define OMAP2430_ST_MMCHS1_MASK				(1 << 7)
1818c2ecf20Sopenharmony_ci#define OMAP2430_ST_USBHS_SHIFT				6
1828c2ecf20Sopenharmony_ci#define OMAP2430_ST_USBHS_MASK				(1 << 6)
1838c2ecf20Sopenharmony_ci#define OMAP24XX_ST_UART3_SHIFT				2
1848c2ecf20Sopenharmony_ci#define OMAP24XX_ST_UART3_MASK				(1 << 2)
1858c2ecf20Sopenharmony_ci#define OMAP24XX_ST_USB_SHIFT				0
1868c2ecf20Sopenharmony_ci#define OMAP24XX_ST_USB_MASK				(1 << 0)
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
1898c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPIOS_SHIFT				2
1908c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPIOS_MASK				(1 << 2)
1918c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT1_SHIFT				0
1928c2ecf20Sopenharmony_ci#define OMAP24XX_EN_GPT1_MASK				(1 << 0)
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci/* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */
1958c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPIOS_SHIFT				2
1968c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPIOS_MASK				(1 << 2)
1978c2ecf20Sopenharmony_ci#define OMAP24XX_ST_32KSYNC_SHIFT			1
1988c2ecf20Sopenharmony_ci#define OMAP24XX_ST_32KSYNC_MASK			(1 << 1)
1998c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT1_SHIFT				0
2008c2ecf20Sopenharmony_ci#define OMAP24XX_ST_GPT1_MASK				(1 << 0)
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci/* CM_IDLEST_MDM and PM_WKST_MDM shared bits */
2038c2ecf20Sopenharmony_ci#define OMAP2430_ST_MDM_SHIFT				0
2048c2ecf20Sopenharmony_ci#define OMAP2430_ST_MDM_MASK				(1 << 0)
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/* 3430 register bits shared between CM & PRM registers */
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci/* CM_REVISION, PRM_REVISION shared bits */
2108c2ecf20Sopenharmony_ci#define OMAP3430_REV_SHIFT				0
2118c2ecf20Sopenharmony_ci#define OMAP3430_REV_MASK				(0xff << 0)
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci/* CM_SYSCONFIG, PRM_SYSCONFIG shared bits */
2148c2ecf20Sopenharmony_ci#define OMAP3430_AUTOIDLE_MASK				(1 << 0)
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
2178c2ecf20Sopenharmony_ci#define OMAP3430_EN_MMC3_MASK				(1 << 30)
2188c2ecf20Sopenharmony_ci#define OMAP3430_EN_MMC3_SHIFT				30
2198c2ecf20Sopenharmony_ci#define OMAP3430_EN_MMC2_MASK				(1 << 25)
2208c2ecf20Sopenharmony_ci#define OMAP3430_EN_MMC2_SHIFT				25
2218c2ecf20Sopenharmony_ci#define OMAP3430_EN_MMC1_MASK				(1 << 24)
2228c2ecf20Sopenharmony_ci#define OMAP3430_EN_MMC1_SHIFT				24
2238c2ecf20Sopenharmony_ci#define AM35XX_EN_UART4_MASK				(1 << 23)
2248c2ecf20Sopenharmony_ci#define AM35XX_EN_UART4_SHIFT				23
2258c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI4_MASK				(1 << 21)
2268c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI4_SHIFT			21
2278c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI3_MASK				(1 << 20)
2288c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI3_SHIFT			20
2298c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI2_MASK				(1 << 19)
2308c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI2_SHIFT			19
2318c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI1_MASK				(1 << 18)
2328c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCSPI1_SHIFT			18
2338c2ecf20Sopenharmony_ci#define OMAP3430_EN_I2C3_MASK				(1 << 17)
2348c2ecf20Sopenharmony_ci#define OMAP3430_EN_I2C3_SHIFT				17
2358c2ecf20Sopenharmony_ci#define OMAP3430_EN_I2C2_MASK				(1 << 16)
2368c2ecf20Sopenharmony_ci#define OMAP3430_EN_I2C2_SHIFT				16
2378c2ecf20Sopenharmony_ci#define OMAP3430_EN_I2C1_MASK				(1 << 15)
2388c2ecf20Sopenharmony_ci#define OMAP3430_EN_I2C1_SHIFT				15
2398c2ecf20Sopenharmony_ci#define OMAP3430_EN_UART2_MASK				(1 << 14)
2408c2ecf20Sopenharmony_ci#define OMAP3430_EN_UART2_SHIFT				14
2418c2ecf20Sopenharmony_ci#define OMAP3430_EN_UART1_MASK				(1 << 13)
2428c2ecf20Sopenharmony_ci#define OMAP3430_EN_UART1_SHIFT				13
2438c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT11_MASK				(1 << 12)
2448c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT11_SHIFT				12
2458c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT10_MASK				(1 << 11)
2468c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT10_SHIFT				11
2478c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP5_MASK				(1 << 10)
2488c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP5_SHIFT			10
2498c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP1_MASK				(1 << 9)
2508c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP1_SHIFT			9
2518c2ecf20Sopenharmony_ci#define OMAP3430_EN_FSHOSTUSB_MASK			(1 << 5)
2528c2ecf20Sopenharmony_ci#define OMAP3430_EN_FSHOSTUSB_SHIFT			5
2538c2ecf20Sopenharmony_ci#define OMAP3430_EN_D2D_MASK				(1 << 3)
2548c2ecf20Sopenharmony_ci#define OMAP3430_EN_D2D_SHIFT				3
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci/* CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
2578c2ecf20Sopenharmony_ci#define OMAP3430_EN_HSOTGUSB_MASK			(1 << 4)
2588c2ecf20Sopenharmony_ci#define OMAP3430_EN_HSOTGUSB_SHIFT			4
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */
2618c2ecf20Sopenharmony_ci#define OMAP3430_ST_MMC3_SHIFT				30
2628c2ecf20Sopenharmony_ci#define OMAP3430_ST_MMC3_MASK				(1 << 30)
2638c2ecf20Sopenharmony_ci#define OMAP3430_ST_MMC2_SHIFT				25
2648c2ecf20Sopenharmony_ci#define OMAP3430_ST_MMC2_MASK				(1 << 25)
2658c2ecf20Sopenharmony_ci#define OMAP3430_ST_MMC1_SHIFT				24
2668c2ecf20Sopenharmony_ci#define OMAP3430_ST_MMC1_MASK				(1 << 24)
2678c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI4_SHIFT			21
2688c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI4_MASK				(1 << 21)
2698c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI3_SHIFT			20
2708c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI3_MASK				(1 << 20)
2718c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI2_SHIFT			19
2728c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI2_MASK				(1 << 19)
2738c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI1_SHIFT			18
2748c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCSPI1_MASK				(1 << 18)
2758c2ecf20Sopenharmony_ci#define OMAP3430_ST_I2C3_SHIFT				17
2768c2ecf20Sopenharmony_ci#define OMAP3430_ST_I2C3_MASK				(1 << 17)
2778c2ecf20Sopenharmony_ci#define OMAP3430_ST_I2C2_SHIFT				16
2788c2ecf20Sopenharmony_ci#define OMAP3430_ST_I2C2_MASK				(1 << 16)
2798c2ecf20Sopenharmony_ci#define OMAP3430_ST_I2C1_SHIFT				15
2808c2ecf20Sopenharmony_ci#define OMAP3430_ST_I2C1_MASK				(1 << 15)
2818c2ecf20Sopenharmony_ci#define OMAP3430_ST_UART2_SHIFT				14
2828c2ecf20Sopenharmony_ci#define OMAP3430_ST_UART2_MASK				(1 << 14)
2838c2ecf20Sopenharmony_ci#define OMAP3430_ST_UART1_SHIFT				13
2848c2ecf20Sopenharmony_ci#define OMAP3430_ST_UART1_MASK				(1 << 13)
2858c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT11_SHIFT				12
2868c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT11_MASK				(1 << 12)
2878c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT10_SHIFT				11
2888c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT10_MASK				(1 << 11)
2898c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCBSP5_SHIFT			10
2908c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCBSP5_MASK				(1 << 10)
2918c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCBSP1_SHIFT			9
2928c2ecf20Sopenharmony_ci#define OMAP3430_ST_MCBSP1_MASK				(1 << 9)
2938c2ecf20Sopenharmony_ci#define OMAP3430ES1_ST_FSHOSTUSB_SHIFT			5
2948c2ecf20Sopenharmony_ci#define OMAP3430ES1_ST_FSHOSTUSB_MASK			(1 << 5)
2958c2ecf20Sopenharmony_ci#define OMAP3430ES1_ST_HSOTGUSB_SHIFT			4
2968c2ecf20Sopenharmony_ci#define OMAP3430ES1_ST_HSOTGUSB_MASK			(1 << 4)
2978c2ecf20Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT		5
2988c2ecf20Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_IDLE_MASK		(1 << 5)
2998c2ecf20Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT		4
3008c2ecf20Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK		(1 << 4)
3018c2ecf20Sopenharmony_ci#define OMAP3430_ST_D2D_SHIFT				3
3028c2ecf20Sopenharmony_ci#define OMAP3430_ST_D2D_MASK				(1 << 3)
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
3058c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO1_MASK				(1 << 3)
3068c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO1_SHIFT				3
3078c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT12_MASK				(1 << 1)
3088c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT12_SHIFT				1
3098c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT1_MASK				(1 << 0)
3108c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT1_SHIFT				0
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci/* CM_FCLKEN_WKUP, PM_WKEN_WKUP shared bits */
3138c2ecf20Sopenharmony_ci#define OMAP3430_EN_SR2_MASK				(1 << 7)
3148c2ecf20Sopenharmony_ci#define OMAP3430_EN_SR2_SHIFT				7
3158c2ecf20Sopenharmony_ci#define OMAP3430_EN_SR1_MASK				(1 << 6)
3168c2ecf20Sopenharmony_ci#define OMAP3430_EN_SR1_SHIFT				6
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci/* CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
3198c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT12_MASK				(1 << 1)
3208c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT12_SHIFT				1
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_ci/* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */
3238c2ecf20Sopenharmony_ci#define OMAP3430_ST_SR2_SHIFT				7
3248c2ecf20Sopenharmony_ci#define OMAP3430_ST_SR2_MASK				(1 << 7)
3258c2ecf20Sopenharmony_ci#define OMAP3430_ST_SR1_SHIFT				6
3268c2ecf20Sopenharmony_ci#define OMAP3430_ST_SR1_MASK				(1 << 6)
3278c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO1_SHIFT				3
3288c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO1_MASK				(1 << 3)
3298c2ecf20Sopenharmony_ci#define OMAP3430_ST_32KSYNC_SHIFT			2
3308c2ecf20Sopenharmony_ci#define OMAP3430_ST_32KSYNC_MASK			(1 << 2)
3318c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT12_SHIFT				1
3328c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT12_MASK				(1 << 1)
3338c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT1_SHIFT				0
3348c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT1_MASK				(1 << 0)
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci/*
3378c2ecf20Sopenharmony_ci * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM,
3388c2ecf20Sopenharmony_ci * CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_GFX,
3398c2ecf20Sopenharmony_ci * PM_WKDEP_DSS, PM_WKDEP_CAM, PM_WKDEP_PER, PM_WKDEP_NEON shared bits
3408c2ecf20Sopenharmony_ci */
3418c2ecf20Sopenharmony_ci#define OMAP3430_EN_MPU_MASK				(1 << 1)
3428c2ecf20Sopenharmony_ci#define OMAP3430_EN_MPU_SHIFT				1
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER shared bits */
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci#define OMAP3630_EN_UART4_MASK				(1 << 18)
3478c2ecf20Sopenharmony_ci#define OMAP3630_EN_UART4_SHIFT				18
3488c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO6_MASK				(1 << 17)
3498c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO6_SHIFT				17
3508c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO5_MASK				(1 << 16)
3518c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO5_SHIFT				16
3528c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO4_MASK				(1 << 15)
3538c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO4_SHIFT				15
3548c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO3_MASK				(1 << 14)
3558c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO3_SHIFT				14
3568c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO2_MASK				(1 << 13)
3578c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPIO2_SHIFT				13
3588c2ecf20Sopenharmony_ci#define OMAP3430_EN_UART3_MASK				(1 << 11)
3598c2ecf20Sopenharmony_ci#define OMAP3430_EN_UART3_SHIFT				11
3608c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT9_MASK				(1 << 10)
3618c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT9_SHIFT				10
3628c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT8_MASK				(1 << 9)
3638c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT8_SHIFT				9
3648c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT7_MASK				(1 << 8)
3658c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT7_SHIFT				8
3668c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT6_MASK				(1 << 7)
3678c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT6_SHIFT				7
3688c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT5_MASK				(1 << 6)
3698c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT5_SHIFT				6
3708c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT4_MASK				(1 << 5)
3718c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT4_SHIFT				5
3728c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT3_MASK				(1 << 4)
3738c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT3_SHIFT				4
3748c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT2_MASK				(1 << 3)
3758c2ecf20Sopenharmony_ci#define OMAP3430_EN_GPT2_SHIFT				3
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER, PM_WKST_PER shared bits */
3788c2ecf20Sopenharmony_ci/* XXX Possible TI documentation bug: should the PM_WKST_PER EN_* bits
3798c2ecf20Sopenharmony_ci * be ST_* bits instead? */
3808c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP4_MASK				(1 << 2)
3818c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP4_SHIFT			2
3828c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP3_MASK				(1 << 1)
3838c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP3_SHIFT			1
3848c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP2_MASK				(1 << 0)
3858c2ecf20Sopenharmony_ci#define OMAP3430_EN_MCBSP2_SHIFT			0
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ci/* CM_IDLEST_PER, PM_WKST_PER shared bits */
3888c2ecf20Sopenharmony_ci#define OMAP3630_ST_UART4_SHIFT				18
3898c2ecf20Sopenharmony_ci#define OMAP3630_ST_UART4_MASK				(1 << 18)
3908c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO6_SHIFT				17
3918c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO6_MASK				(1 << 17)
3928c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO5_SHIFT				16
3938c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO5_MASK				(1 << 16)
3948c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO4_SHIFT				15
3958c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO4_MASK				(1 << 15)
3968c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO3_SHIFT				14
3978c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO3_MASK				(1 << 14)
3988c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO2_SHIFT				13
3998c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPIO2_MASK				(1 << 13)
4008c2ecf20Sopenharmony_ci#define OMAP3430_ST_UART3_SHIFT				11
4018c2ecf20Sopenharmony_ci#define OMAP3430_ST_UART3_MASK				(1 << 11)
4028c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT9_SHIFT				10
4038c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT9_MASK				(1 << 10)
4048c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT8_SHIFT				9
4058c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT8_MASK				(1 << 9)
4068c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT7_SHIFT				8
4078c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT7_MASK				(1 << 8)
4088c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT6_SHIFT				7
4098c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT6_MASK				(1 << 7)
4108c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT5_SHIFT				6
4118c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT5_MASK				(1 << 6)
4128c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT4_SHIFT				5
4138c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT4_MASK				(1 << 5)
4148c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT3_SHIFT				4
4158c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT3_MASK				(1 << 4)
4168c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT2_SHIFT				3
4178c2ecf20Sopenharmony_ci#define OMAP3430_ST_GPT2_MASK				(1 << 3)
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci/* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */
4208c2ecf20Sopenharmony_ci#define OMAP3430_EN_CORE_SHIFT				0
4218c2ecf20Sopenharmony_ci#define OMAP3430_EN_CORE_MASK				(1 << 0)
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_ci/*
4268c2ecf20Sopenharmony_ci * Maximum time(us) it takes to output the signal WUCLKOUT of the last
4278c2ecf20Sopenharmony_ci * pad of the I/O ring after asserting WUCLKIN high.  Tero measured
4288c2ecf20Sopenharmony_ci * the actual time at 7 to 8 microseconds on OMAP3 and 2 to 4
4298c2ecf20Sopenharmony_ci * microseconds on OMAP4, so this timeout may be too high.
4308c2ecf20Sopenharmony_ci */
4318c2ecf20Sopenharmony_ci#define MAX_IOPAD_LATCH_TIME			100
4328c2ecf20Sopenharmony_ci# ifndef __ASSEMBLER__
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci#include <linux/delay.h>
4358c2ecf20Sopenharmony_ci
4368c2ecf20Sopenharmony_ci/**
4378c2ecf20Sopenharmony_ci * omap_test_timeout - busy-loop, testing a condition
4388c2ecf20Sopenharmony_ci * @cond: condition to test until it evaluates to true
4398c2ecf20Sopenharmony_ci * @timeout: maximum number of microseconds in the timeout
4408c2ecf20Sopenharmony_ci * @index: loop index (integer)
4418c2ecf20Sopenharmony_ci *
4428c2ecf20Sopenharmony_ci * Loop waiting for @cond to become true or until at least @timeout
4438c2ecf20Sopenharmony_ci * microseconds have passed.  To use, define some integer @index in the
4448c2ecf20Sopenharmony_ci * calling code.  After running, if @index == @timeout, then the loop has
4458c2ecf20Sopenharmony_ci * timed out.
4468c2ecf20Sopenharmony_ci */
4478c2ecf20Sopenharmony_ci#define omap_test_timeout(cond, timeout, index)			\
4488c2ecf20Sopenharmony_ci({								\
4498c2ecf20Sopenharmony_ci	for (index = 0; index < timeout; index++) {		\
4508c2ecf20Sopenharmony_ci		if (cond)					\
4518c2ecf20Sopenharmony_ci			break;					\
4528c2ecf20Sopenharmony_ci		udelay(1);					\
4538c2ecf20Sopenharmony_ci	}							\
4548c2ecf20Sopenharmony_ci})
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_ci/**
4578c2ecf20Sopenharmony_ci * struct omap_prcm_irq - describes a PRCM interrupt bit
4588c2ecf20Sopenharmony_ci * @name: a short name describing the interrupt type, e.g. "wkup" or "io"
4598c2ecf20Sopenharmony_ci * @offset: the bit shift of the interrupt inside the IRQ{ENABLE,STATUS} regs
4608c2ecf20Sopenharmony_ci * @priority: should this interrupt be handled before @priority=false IRQs?
4618c2ecf20Sopenharmony_ci *
4628c2ecf20Sopenharmony_ci * Describes interrupt bits inside the PRM_IRQ{ENABLE,STATUS}_MPU* registers.
4638c2ecf20Sopenharmony_ci * On systems with multiple PRM MPU IRQ registers, the bitfields read from
4648c2ecf20Sopenharmony_ci * the registers are concatenated, so @offset could be > 31 on these systems -
4658c2ecf20Sopenharmony_ci * see omap_prm_irq_handler() for more details.  I/O ring interrupts should
4668c2ecf20Sopenharmony_ci * have @priority set to true.
4678c2ecf20Sopenharmony_ci */
4688c2ecf20Sopenharmony_cistruct omap_prcm_irq {
4698c2ecf20Sopenharmony_ci	const char *name;
4708c2ecf20Sopenharmony_ci	unsigned int offset;
4718c2ecf20Sopenharmony_ci	bool priority;
4728c2ecf20Sopenharmony_ci};
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ci/**
4758c2ecf20Sopenharmony_ci * struct omap_prcm_irq_setup - PRCM interrupt controller details
4768c2ecf20Sopenharmony_ci * @ack: PRM register offset for the first PRM_IRQSTATUS_MPU register
4778c2ecf20Sopenharmony_ci * @mask: PRM register offset for the first PRM_IRQENABLE_MPU register
4788c2ecf20Sopenharmony_ci * @pm_ctrl: PRM register offset for the PRM_IO_PMCTRL register
4798c2ecf20Sopenharmony_ci * @nr_regs: number of PRM_IRQ{STATUS,ENABLE}_MPU* registers
4808c2ecf20Sopenharmony_ci * @nr_irqs: number of entries in the @irqs array
4818c2ecf20Sopenharmony_ci * @irqs: ptr to an array of PRCM interrupt bits (see @nr_irqs)
4828c2ecf20Sopenharmony_ci * @irq: MPU IRQ asserted when a PRCM interrupt arrives
4838c2ecf20Sopenharmony_ci * @read_pending_irqs: fn ptr to determine if any PRCM IRQs are pending
4848c2ecf20Sopenharmony_ci * @ocp_barrier: fn ptr to force buffered PRM writes to complete
4858c2ecf20Sopenharmony_ci * @save_and_clear_irqen: fn ptr to save and clear IRQENABLE regs
4868c2ecf20Sopenharmony_ci * @restore_irqen: fn ptr to save and clear IRQENABLE regs
4878c2ecf20Sopenharmony_ci * @reconfigure_io_chain: fn ptr to reconfigure IO chain
4888c2ecf20Sopenharmony_ci * @saved_mask: IRQENABLE regs are saved here during suspend
4898c2ecf20Sopenharmony_ci * @priority_mask: 1 bit per IRQ, set to 1 if omap_prcm_irq.priority = true
4908c2ecf20Sopenharmony_ci * @base_irq: base dynamic IRQ number, returned from irq_alloc_descs() in init
4918c2ecf20Sopenharmony_ci * @suspended: set to true after Linux suspend code has called our ->prepare()
4928c2ecf20Sopenharmony_ci * @suspend_save_flag: set to true after IRQ masks have been saved and disabled
4938c2ecf20Sopenharmony_ci *
4948c2ecf20Sopenharmony_ci * @saved_mask, @priority_mask, @base_irq, @suspended, and
4958c2ecf20Sopenharmony_ci * @suspend_save_flag are populated dynamically, and are not to be
4968c2ecf20Sopenharmony_ci * specified in static initializers.
4978c2ecf20Sopenharmony_ci */
4988c2ecf20Sopenharmony_cistruct omap_prcm_irq_setup {
4998c2ecf20Sopenharmony_ci	u16 ack;
5008c2ecf20Sopenharmony_ci	u16 mask;
5018c2ecf20Sopenharmony_ci	u16 pm_ctrl;
5028c2ecf20Sopenharmony_ci	u8 nr_regs;
5038c2ecf20Sopenharmony_ci	u8 nr_irqs;
5048c2ecf20Sopenharmony_ci	const struct omap_prcm_irq *irqs;
5058c2ecf20Sopenharmony_ci	int irq;
5068c2ecf20Sopenharmony_ci	void (*read_pending_irqs)(unsigned long *events);
5078c2ecf20Sopenharmony_ci	void (*ocp_barrier)(void);
5088c2ecf20Sopenharmony_ci	void (*save_and_clear_irqen)(u32 *saved_mask);
5098c2ecf20Sopenharmony_ci	void (*restore_irqen)(u32 *saved_mask);
5108c2ecf20Sopenharmony_ci	void (*reconfigure_io_chain)(void);
5118c2ecf20Sopenharmony_ci	u32 *saved_mask;
5128c2ecf20Sopenharmony_ci	u32 *priority_mask;
5138c2ecf20Sopenharmony_ci	int base_irq;
5148c2ecf20Sopenharmony_ci	bool suspended;
5158c2ecf20Sopenharmony_ci	bool suspend_save_flag;
5168c2ecf20Sopenharmony_ci};
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_ci/* OMAP_PRCM_IRQ: convenience macro for creating struct omap_prcm_irq records */
5198c2ecf20Sopenharmony_ci#define OMAP_PRCM_IRQ(_name, _offset, _priority) {	\
5208c2ecf20Sopenharmony_ci	.name = _name,					\
5218c2ecf20Sopenharmony_ci	.offset = _offset,				\
5228c2ecf20Sopenharmony_ci	.priority = _priority				\
5238c2ecf20Sopenharmony_ci	}
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_cistruct omap_domain_base {
5268c2ecf20Sopenharmony_ci	u32 pa;
5278c2ecf20Sopenharmony_ci	void __iomem *va;
5288c2ecf20Sopenharmony_ci	s16 offset;
5298c2ecf20Sopenharmony_ci};
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci/**
5328c2ecf20Sopenharmony_ci * struct omap_prcm_init_data - PRCM driver init data
5338c2ecf20Sopenharmony_ci * @index: clock memory mapping index to be used
5348c2ecf20Sopenharmony_ci * @mem: IO mem pointer for this module
5358c2ecf20Sopenharmony_ci * @phys: IO mem physical base address for this module
5368c2ecf20Sopenharmony_ci * @offset: module base address offset from the IO base
5378c2ecf20Sopenharmony_ci * @flags: PRCM module init flags
5388c2ecf20Sopenharmony_ci * @device_inst_offset: device instance offset within the module address space
5398c2ecf20Sopenharmony_ci * @init: low level PRCM init function for this module
5408c2ecf20Sopenharmony_ci * @np: device node for this PRCM module
5418c2ecf20Sopenharmony_ci */
5428c2ecf20Sopenharmony_cistruct omap_prcm_init_data {
5438c2ecf20Sopenharmony_ci	int index;
5448c2ecf20Sopenharmony_ci	void __iomem *mem;
5458c2ecf20Sopenharmony_ci	u32 phys;
5468c2ecf20Sopenharmony_ci	s16 offset;
5478c2ecf20Sopenharmony_ci	u16 flags;
5488c2ecf20Sopenharmony_ci	s32 device_inst_offset;
5498c2ecf20Sopenharmony_ci	int (*init)(const struct omap_prcm_init_data *data);
5508c2ecf20Sopenharmony_ci	struct device_node *np;
5518c2ecf20Sopenharmony_ci};
5528c2ecf20Sopenharmony_ci
5538c2ecf20Sopenharmony_ciextern void omap_prcm_irq_cleanup(void);
5548c2ecf20Sopenharmony_ciextern int omap_prcm_register_chain_handler(
5558c2ecf20Sopenharmony_ci	struct omap_prcm_irq_setup *irq_setup);
5568c2ecf20Sopenharmony_ciextern int omap_prcm_event_to_irq(const char *event);
5578c2ecf20Sopenharmony_ciextern void omap_prcm_irq_prepare(void);
5588c2ecf20Sopenharmony_ciextern void omap_prcm_irq_complete(void);
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci# endif
5618c2ecf20Sopenharmony_ci
5628c2ecf20Sopenharmony_ci#endif
5638c2ecf20Sopenharmony_ci
564