162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci#ifndef __ARCH_ASM_MACH_OMAP2_PRCM_COMMON_H
362306a36Sopenharmony_ci#define __ARCH_ASM_MACH_OMAP2_PRCM_COMMON_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * OMAP2/3 PRCM base and module definitions
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Copyright (C) 2007-2009, 2011 Texas Instruments, Inc.
962306a36Sopenharmony_ci * Copyright (C) 2007-2009 Nokia Corporation
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * Written by Paul Walmsley
1262306a36Sopenharmony_ci */
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/* Module offsets from both CM_BASE & PRM_BASE */
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci/*
1762306a36Sopenharmony_ci * Offsets that are the same on 24xx and 34xx
1862306a36Sopenharmony_ci *
1962306a36Sopenharmony_ci * Technically, in terms of the TRM, OCP_MOD is 34xx only; PLL_MOD is
2062306a36Sopenharmony_ci * CCR_MOD on 3430; and GFX_MOD only exists < 3430ES2.
2162306a36Sopenharmony_ci */
2262306a36Sopenharmony_ci#define OCP_MOD						0x000
2362306a36Sopenharmony_ci#define MPU_MOD						0x100
2462306a36Sopenharmony_ci#define CORE_MOD					0x200
2562306a36Sopenharmony_ci#define GFX_MOD						0x300
2662306a36Sopenharmony_ci#define WKUP_MOD					0x400
2762306a36Sopenharmony_ci#define PLL_MOD						0x500
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/* Chip-specific module offsets */
3162306a36Sopenharmony_ci#define OMAP24XX_GR_MOD					OCP_MOD
3262306a36Sopenharmony_ci#define OMAP24XX_DSP_MOD				0x800
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define OMAP2430_MDM_MOD				0xc00
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci/* IVA2 module is < base on 3430 */
3762306a36Sopenharmony_ci#define OMAP3430_IVA2_MOD				-0x800
3862306a36Sopenharmony_ci#define OMAP3430ES2_SGX_MOD				GFX_MOD
3962306a36Sopenharmony_ci#define OMAP3430_CCR_MOD				PLL_MOD
4062306a36Sopenharmony_ci#define OMAP3430_DSS_MOD				0x600
4162306a36Sopenharmony_ci#define OMAP3430_CAM_MOD				0x700
4262306a36Sopenharmony_ci#define OMAP3430_PER_MOD				0x800
4362306a36Sopenharmony_ci#define OMAP3430_EMU_MOD				0x900
4462306a36Sopenharmony_ci#define OMAP3430_GR_MOD					0xa00
4562306a36Sopenharmony_ci#define OMAP3430_NEON_MOD				0xb00
4662306a36Sopenharmony_ci#define OMAP3430ES2_USBHOST_MOD				0xc00
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/*
4962306a36Sopenharmony_ci * TI81XX PRM module offsets
5062306a36Sopenharmony_ci */
5162306a36Sopenharmony_ci#define TI814X_PRM_DSP_MOD				0x0a00
5262306a36Sopenharmony_ci#define TI814X_PRM_HDVICP_MOD				0x0c00
5362306a36Sopenharmony_ci#define TI814X_PRM_ISP_MOD				0x0d00
5462306a36Sopenharmony_ci#define TI814X_PRM_HDVPSS_MOD				0x0e00
5562306a36Sopenharmony_ci#define TI814X_PRM_GFX_MOD				0x0f00
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci#define TI81XX_PRM_DEVICE_MOD			0x0000
5862306a36Sopenharmony_ci#define TI816X_PRM_ACTIVE_MOD			0x0a00
5962306a36Sopenharmony_ci#define TI81XX_PRM_DEFAULT_MOD			0x0b00
6062306a36Sopenharmony_ci#define TI816X_PRM_IVAHD0_MOD			0x0c00
6162306a36Sopenharmony_ci#define TI816X_PRM_IVAHD1_MOD			0x0d00
6262306a36Sopenharmony_ci#define TI816X_PRM_IVAHD2_MOD			0x0e00
6362306a36Sopenharmony_ci#define TI816X_PRM_SGX_MOD				0x0f00
6462306a36Sopenharmony_ci#define TI81XX_PRM_ALWON_MOD			0x1800
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci/* 24XX register bits shared between CM & PRM registers */
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
6962306a36Sopenharmony_ci#define OMAP2420_EN_MMC_SHIFT				26
7062306a36Sopenharmony_ci#define OMAP2420_EN_MMC_MASK				(1 << 26)
7162306a36Sopenharmony_ci#define OMAP24XX_EN_UART2_SHIFT				22
7262306a36Sopenharmony_ci#define OMAP24XX_EN_UART2_MASK				(1 << 22)
7362306a36Sopenharmony_ci#define OMAP24XX_EN_UART1_SHIFT				21
7462306a36Sopenharmony_ci#define OMAP24XX_EN_UART1_MASK				(1 << 21)
7562306a36Sopenharmony_ci#define OMAP24XX_EN_MCSPI2_SHIFT			18
7662306a36Sopenharmony_ci#define OMAP24XX_EN_MCSPI2_MASK				(1 << 18)
7762306a36Sopenharmony_ci#define OMAP24XX_EN_MCSPI1_SHIFT			17
7862306a36Sopenharmony_ci#define OMAP24XX_EN_MCSPI1_MASK				(1 << 17)
7962306a36Sopenharmony_ci#define OMAP24XX_EN_MCBSP2_SHIFT			16
8062306a36Sopenharmony_ci#define OMAP24XX_EN_MCBSP2_MASK				(1 << 16)
8162306a36Sopenharmony_ci#define OMAP24XX_EN_MCBSP1_SHIFT			15
8262306a36Sopenharmony_ci#define OMAP24XX_EN_MCBSP1_MASK				(1 << 15)
8362306a36Sopenharmony_ci#define OMAP24XX_EN_GPT12_SHIFT				14
8462306a36Sopenharmony_ci#define OMAP24XX_EN_GPT12_MASK				(1 << 14)
8562306a36Sopenharmony_ci#define OMAP24XX_EN_GPT11_SHIFT				13
8662306a36Sopenharmony_ci#define OMAP24XX_EN_GPT11_MASK				(1 << 13)
8762306a36Sopenharmony_ci#define OMAP24XX_EN_GPT10_SHIFT				12
8862306a36Sopenharmony_ci#define OMAP24XX_EN_GPT10_MASK				(1 << 12)
8962306a36Sopenharmony_ci#define OMAP24XX_EN_GPT9_SHIFT				11
9062306a36Sopenharmony_ci#define OMAP24XX_EN_GPT9_MASK				(1 << 11)
9162306a36Sopenharmony_ci#define OMAP24XX_EN_GPT8_SHIFT				10
9262306a36Sopenharmony_ci#define OMAP24XX_EN_GPT8_MASK				(1 << 10)
9362306a36Sopenharmony_ci#define OMAP24XX_EN_GPT7_SHIFT				9
9462306a36Sopenharmony_ci#define OMAP24XX_EN_GPT7_MASK				(1 << 9)
9562306a36Sopenharmony_ci#define OMAP24XX_EN_GPT6_SHIFT				8
9662306a36Sopenharmony_ci#define OMAP24XX_EN_GPT6_MASK				(1 << 8)
9762306a36Sopenharmony_ci#define OMAP24XX_EN_GPT5_SHIFT				7
9862306a36Sopenharmony_ci#define OMAP24XX_EN_GPT5_MASK				(1 << 7)
9962306a36Sopenharmony_ci#define OMAP24XX_EN_GPT4_SHIFT				6
10062306a36Sopenharmony_ci#define OMAP24XX_EN_GPT4_MASK				(1 << 6)
10162306a36Sopenharmony_ci#define OMAP24XX_EN_GPT3_SHIFT				5
10262306a36Sopenharmony_ci#define OMAP24XX_EN_GPT3_MASK				(1 << 5)
10362306a36Sopenharmony_ci#define OMAP24XX_EN_GPT2_SHIFT				4
10462306a36Sopenharmony_ci#define OMAP24XX_EN_GPT2_MASK				(1 << 4)
10562306a36Sopenharmony_ci#define OMAP2420_EN_VLYNQ_SHIFT				3
10662306a36Sopenharmony_ci#define OMAP2420_EN_VLYNQ_MASK				(1 << 3)
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci/* CM_FCLKEN2_CORE, CM_ICLKEN2_CORE, PM_WKEN2_CORE shared bits */
10962306a36Sopenharmony_ci#define OMAP2430_EN_GPIO5_SHIFT				10
11062306a36Sopenharmony_ci#define OMAP2430_EN_GPIO5_MASK				(1 << 10)
11162306a36Sopenharmony_ci#define OMAP2430_EN_MCSPI3_SHIFT			9
11262306a36Sopenharmony_ci#define OMAP2430_EN_MCSPI3_MASK				(1 << 9)
11362306a36Sopenharmony_ci#define OMAP2430_EN_MMCHS2_SHIFT			8
11462306a36Sopenharmony_ci#define OMAP2430_EN_MMCHS2_MASK				(1 << 8)
11562306a36Sopenharmony_ci#define OMAP2430_EN_MMCHS1_SHIFT			7
11662306a36Sopenharmony_ci#define OMAP2430_EN_MMCHS1_MASK				(1 << 7)
11762306a36Sopenharmony_ci#define OMAP24XX_EN_UART3_SHIFT				2
11862306a36Sopenharmony_ci#define OMAP24XX_EN_UART3_MASK				(1 << 2)
11962306a36Sopenharmony_ci#define OMAP24XX_EN_USB_SHIFT				0
12062306a36Sopenharmony_ci#define OMAP24XX_EN_USB_MASK				(1 << 0)
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci/* CM_ICLKEN2_CORE, PM_WKEN2_CORE shared bits */
12362306a36Sopenharmony_ci#define OMAP2430_EN_MDM_INTC_SHIFT			11
12462306a36Sopenharmony_ci#define OMAP2430_EN_MDM_INTC_MASK			(1 << 11)
12562306a36Sopenharmony_ci#define OMAP2430_EN_USBHS_SHIFT				6
12662306a36Sopenharmony_ci#define OMAP2430_EN_USBHS_MASK				(1 << 6)
12762306a36Sopenharmony_ci#define OMAP24XX_EN_GPMC_SHIFT				1
12862306a36Sopenharmony_ci#define OMAP24XX_EN_GPMC_MASK				(1 << 1)
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */
13162306a36Sopenharmony_ci#define OMAP2420_ST_MMC_SHIFT				26
13262306a36Sopenharmony_ci#define OMAP2420_ST_MMC_MASK				(1 << 26)
13362306a36Sopenharmony_ci#define OMAP24XX_ST_UART2_SHIFT				22
13462306a36Sopenharmony_ci#define OMAP24XX_ST_UART2_MASK				(1 << 22)
13562306a36Sopenharmony_ci#define OMAP24XX_ST_UART1_SHIFT				21
13662306a36Sopenharmony_ci#define OMAP24XX_ST_UART1_MASK				(1 << 21)
13762306a36Sopenharmony_ci#define OMAP24XX_ST_MCSPI2_SHIFT			18
13862306a36Sopenharmony_ci#define OMAP24XX_ST_MCSPI2_MASK				(1 << 18)
13962306a36Sopenharmony_ci#define OMAP24XX_ST_MCSPI1_SHIFT			17
14062306a36Sopenharmony_ci#define OMAP24XX_ST_MCSPI1_MASK				(1 << 17)
14162306a36Sopenharmony_ci#define OMAP24XX_ST_MCBSP2_SHIFT			16
14262306a36Sopenharmony_ci#define OMAP24XX_ST_MCBSP2_MASK				(1 << 16)
14362306a36Sopenharmony_ci#define OMAP24XX_ST_MCBSP1_SHIFT			15
14462306a36Sopenharmony_ci#define OMAP24XX_ST_MCBSP1_MASK				(1 << 15)
14562306a36Sopenharmony_ci#define OMAP24XX_ST_GPT12_SHIFT				14
14662306a36Sopenharmony_ci#define OMAP24XX_ST_GPT12_MASK				(1 << 14)
14762306a36Sopenharmony_ci#define OMAP24XX_ST_GPT11_SHIFT				13
14862306a36Sopenharmony_ci#define OMAP24XX_ST_GPT11_MASK				(1 << 13)
14962306a36Sopenharmony_ci#define OMAP24XX_ST_GPT10_SHIFT				12
15062306a36Sopenharmony_ci#define OMAP24XX_ST_GPT10_MASK				(1 << 12)
15162306a36Sopenharmony_ci#define OMAP24XX_ST_GPT9_SHIFT				11
15262306a36Sopenharmony_ci#define OMAP24XX_ST_GPT9_MASK				(1 << 11)
15362306a36Sopenharmony_ci#define OMAP24XX_ST_GPT8_SHIFT				10
15462306a36Sopenharmony_ci#define OMAP24XX_ST_GPT8_MASK				(1 << 10)
15562306a36Sopenharmony_ci#define OMAP24XX_ST_GPT7_SHIFT				9
15662306a36Sopenharmony_ci#define OMAP24XX_ST_GPT7_MASK				(1 << 9)
15762306a36Sopenharmony_ci#define OMAP24XX_ST_GPT6_SHIFT				8
15862306a36Sopenharmony_ci#define OMAP24XX_ST_GPT6_MASK				(1 << 8)
15962306a36Sopenharmony_ci#define OMAP24XX_ST_GPT5_SHIFT				7
16062306a36Sopenharmony_ci#define OMAP24XX_ST_GPT5_MASK				(1 << 7)
16162306a36Sopenharmony_ci#define OMAP24XX_ST_GPT4_SHIFT				6
16262306a36Sopenharmony_ci#define OMAP24XX_ST_GPT4_MASK				(1 << 6)
16362306a36Sopenharmony_ci#define OMAP24XX_ST_GPT3_SHIFT				5
16462306a36Sopenharmony_ci#define OMAP24XX_ST_GPT3_MASK				(1 << 5)
16562306a36Sopenharmony_ci#define OMAP24XX_ST_GPT2_SHIFT				4
16662306a36Sopenharmony_ci#define OMAP24XX_ST_GPT2_MASK				(1 << 4)
16762306a36Sopenharmony_ci#define OMAP2420_ST_VLYNQ_SHIFT				3
16862306a36Sopenharmony_ci#define OMAP2420_ST_VLYNQ_MASK				(1 << 3)
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci/* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */
17162306a36Sopenharmony_ci#define OMAP2430_ST_MDM_INTC_SHIFT			11
17262306a36Sopenharmony_ci#define OMAP2430_ST_MDM_INTC_MASK			(1 << 11)
17362306a36Sopenharmony_ci#define OMAP2430_ST_GPIO5_SHIFT				10
17462306a36Sopenharmony_ci#define OMAP2430_ST_GPIO5_MASK				(1 << 10)
17562306a36Sopenharmony_ci#define OMAP2430_ST_MCSPI3_SHIFT			9
17662306a36Sopenharmony_ci#define OMAP2430_ST_MCSPI3_MASK				(1 << 9)
17762306a36Sopenharmony_ci#define OMAP2430_ST_MMCHS2_SHIFT			8
17862306a36Sopenharmony_ci#define OMAP2430_ST_MMCHS2_MASK				(1 << 8)
17962306a36Sopenharmony_ci#define OMAP2430_ST_MMCHS1_SHIFT			7
18062306a36Sopenharmony_ci#define OMAP2430_ST_MMCHS1_MASK				(1 << 7)
18162306a36Sopenharmony_ci#define OMAP2430_ST_USBHS_SHIFT				6
18262306a36Sopenharmony_ci#define OMAP2430_ST_USBHS_MASK				(1 << 6)
18362306a36Sopenharmony_ci#define OMAP24XX_ST_UART3_SHIFT				2
18462306a36Sopenharmony_ci#define OMAP24XX_ST_UART3_MASK				(1 << 2)
18562306a36Sopenharmony_ci#define OMAP24XX_ST_USB_SHIFT				0
18662306a36Sopenharmony_ci#define OMAP24XX_ST_USB_MASK				(1 << 0)
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
18962306a36Sopenharmony_ci#define OMAP24XX_EN_GPIOS_SHIFT				2
19062306a36Sopenharmony_ci#define OMAP24XX_EN_GPIOS_MASK				(1 << 2)
19162306a36Sopenharmony_ci#define OMAP24XX_EN_GPT1_SHIFT				0
19262306a36Sopenharmony_ci#define OMAP24XX_EN_GPT1_MASK				(1 << 0)
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ci/* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */
19562306a36Sopenharmony_ci#define OMAP24XX_ST_GPIOS_SHIFT				2
19662306a36Sopenharmony_ci#define OMAP24XX_ST_GPIOS_MASK				(1 << 2)
19762306a36Sopenharmony_ci#define OMAP24XX_ST_32KSYNC_SHIFT			1
19862306a36Sopenharmony_ci#define OMAP24XX_ST_32KSYNC_MASK			(1 << 1)
19962306a36Sopenharmony_ci#define OMAP24XX_ST_GPT1_SHIFT				0
20062306a36Sopenharmony_ci#define OMAP24XX_ST_GPT1_MASK				(1 << 0)
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_ci/* CM_IDLEST_MDM and PM_WKST_MDM shared bits */
20362306a36Sopenharmony_ci#define OMAP2430_ST_MDM_SHIFT				0
20462306a36Sopenharmony_ci#define OMAP2430_ST_MDM_MASK				(1 << 0)
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci/* 3430 register bits shared between CM & PRM registers */
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci/* CM_REVISION, PRM_REVISION shared bits */
21062306a36Sopenharmony_ci#define OMAP3430_REV_SHIFT				0
21162306a36Sopenharmony_ci#define OMAP3430_REV_MASK				(0xff << 0)
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ci/* CM_SYSCONFIG, PRM_SYSCONFIG shared bits */
21462306a36Sopenharmony_ci#define OMAP3430_AUTOIDLE_MASK				(1 << 0)
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
21762306a36Sopenharmony_ci#define OMAP3430_EN_MMC3_MASK				(1 << 30)
21862306a36Sopenharmony_ci#define OMAP3430_EN_MMC3_SHIFT				30
21962306a36Sopenharmony_ci#define OMAP3430_EN_MMC2_MASK				(1 << 25)
22062306a36Sopenharmony_ci#define OMAP3430_EN_MMC2_SHIFT				25
22162306a36Sopenharmony_ci#define OMAP3430_EN_MMC1_MASK				(1 << 24)
22262306a36Sopenharmony_ci#define OMAP3430_EN_MMC1_SHIFT				24
22362306a36Sopenharmony_ci#define AM35XX_EN_UART4_MASK				(1 << 23)
22462306a36Sopenharmony_ci#define AM35XX_EN_UART4_SHIFT				23
22562306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI4_MASK				(1 << 21)
22662306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI4_SHIFT			21
22762306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI3_MASK				(1 << 20)
22862306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI3_SHIFT			20
22962306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI2_MASK				(1 << 19)
23062306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI2_SHIFT			19
23162306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI1_MASK				(1 << 18)
23262306a36Sopenharmony_ci#define OMAP3430_EN_MCSPI1_SHIFT			18
23362306a36Sopenharmony_ci#define OMAP3430_EN_I2C3_MASK				(1 << 17)
23462306a36Sopenharmony_ci#define OMAP3430_EN_I2C3_SHIFT				17
23562306a36Sopenharmony_ci#define OMAP3430_EN_I2C2_MASK				(1 << 16)
23662306a36Sopenharmony_ci#define OMAP3430_EN_I2C2_SHIFT				16
23762306a36Sopenharmony_ci#define OMAP3430_EN_I2C1_MASK				(1 << 15)
23862306a36Sopenharmony_ci#define OMAP3430_EN_I2C1_SHIFT				15
23962306a36Sopenharmony_ci#define OMAP3430_EN_UART2_MASK				(1 << 14)
24062306a36Sopenharmony_ci#define OMAP3430_EN_UART2_SHIFT				14
24162306a36Sopenharmony_ci#define OMAP3430_EN_UART1_MASK				(1 << 13)
24262306a36Sopenharmony_ci#define OMAP3430_EN_UART1_SHIFT				13
24362306a36Sopenharmony_ci#define OMAP3430_EN_GPT11_MASK				(1 << 12)
24462306a36Sopenharmony_ci#define OMAP3430_EN_GPT11_SHIFT				12
24562306a36Sopenharmony_ci#define OMAP3430_EN_GPT10_MASK				(1 << 11)
24662306a36Sopenharmony_ci#define OMAP3430_EN_GPT10_SHIFT				11
24762306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP5_MASK				(1 << 10)
24862306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP5_SHIFT			10
24962306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP1_MASK				(1 << 9)
25062306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP1_SHIFT			9
25162306a36Sopenharmony_ci#define OMAP3430_EN_FSHOSTUSB_MASK			(1 << 5)
25262306a36Sopenharmony_ci#define OMAP3430_EN_FSHOSTUSB_SHIFT			5
25362306a36Sopenharmony_ci#define OMAP3430_EN_D2D_MASK				(1 << 3)
25462306a36Sopenharmony_ci#define OMAP3430_EN_D2D_SHIFT				3
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci/* CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
25762306a36Sopenharmony_ci#define OMAP3430_EN_HSOTGUSB_MASK			(1 << 4)
25862306a36Sopenharmony_ci#define OMAP3430_EN_HSOTGUSB_SHIFT			4
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */
26162306a36Sopenharmony_ci#define OMAP3430_ST_MMC3_SHIFT				30
26262306a36Sopenharmony_ci#define OMAP3430_ST_MMC3_MASK				(1 << 30)
26362306a36Sopenharmony_ci#define OMAP3430_ST_MMC2_SHIFT				25
26462306a36Sopenharmony_ci#define OMAP3430_ST_MMC2_MASK				(1 << 25)
26562306a36Sopenharmony_ci#define OMAP3430_ST_MMC1_SHIFT				24
26662306a36Sopenharmony_ci#define OMAP3430_ST_MMC1_MASK				(1 << 24)
26762306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI4_SHIFT			21
26862306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI4_MASK				(1 << 21)
26962306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI3_SHIFT			20
27062306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI3_MASK				(1 << 20)
27162306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI2_SHIFT			19
27262306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI2_MASK				(1 << 19)
27362306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI1_SHIFT			18
27462306a36Sopenharmony_ci#define OMAP3430_ST_MCSPI1_MASK				(1 << 18)
27562306a36Sopenharmony_ci#define OMAP3430_ST_I2C3_SHIFT				17
27662306a36Sopenharmony_ci#define OMAP3430_ST_I2C3_MASK				(1 << 17)
27762306a36Sopenharmony_ci#define OMAP3430_ST_I2C2_SHIFT				16
27862306a36Sopenharmony_ci#define OMAP3430_ST_I2C2_MASK				(1 << 16)
27962306a36Sopenharmony_ci#define OMAP3430_ST_I2C1_SHIFT				15
28062306a36Sopenharmony_ci#define OMAP3430_ST_I2C1_MASK				(1 << 15)
28162306a36Sopenharmony_ci#define OMAP3430_ST_UART2_SHIFT				14
28262306a36Sopenharmony_ci#define OMAP3430_ST_UART2_MASK				(1 << 14)
28362306a36Sopenharmony_ci#define OMAP3430_ST_UART1_SHIFT				13
28462306a36Sopenharmony_ci#define OMAP3430_ST_UART1_MASK				(1 << 13)
28562306a36Sopenharmony_ci#define OMAP3430_ST_GPT11_SHIFT				12
28662306a36Sopenharmony_ci#define OMAP3430_ST_GPT11_MASK				(1 << 12)
28762306a36Sopenharmony_ci#define OMAP3430_ST_GPT10_SHIFT				11
28862306a36Sopenharmony_ci#define OMAP3430_ST_GPT10_MASK				(1 << 11)
28962306a36Sopenharmony_ci#define OMAP3430_ST_MCBSP5_SHIFT			10
29062306a36Sopenharmony_ci#define OMAP3430_ST_MCBSP5_MASK				(1 << 10)
29162306a36Sopenharmony_ci#define OMAP3430_ST_MCBSP1_SHIFT			9
29262306a36Sopenharmony_ci#define OMAP3430_ST_MCBSP1_MASK				(1 << 9)
29362306a36Sopenharmony_ci#define OMAP3430ES1_ST_FSHOSTUSB_SHIFT			5
29462306a36Sopenharmony_ci#define OMAP3430ES1_ST_FSHOSTUSB_MASK			(1 << 5)
29562306a36Sopenharmony_ci#define OMAP3430ES1_ST_HSOTGUSB_SHIFT			4
29662306a36Sopenharmony_ci#define OMAP3430ES1_ST_HSOTGUSB_MASK			(1 << 4)
29762306a36Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT		5
29862306a36Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_IDLE_MASK		(1 << 5)
29962306a36Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT		4
30062306a36Sopenharmony_ci#define OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK		(1 << 4)
30162306a36Sopenharmony_ci#define OMAP3430_ST_D2D_SHIFT				3
30262306a36Sopenharmony_ci#define OMAP3430_ST_D2D_MASK				(1 << 3)
30362306a36Sopenharmony_ci
30462306a36Sopenharmony_ci/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
30562306a36Sopenharmony_ci#define OMAP3430_EN_GPIO1_MASK				(1 << 3)
30662306a36Sopenharmony_ci#define OMAP3430_EN_GPIO1_SHIFT				3
30762306a36Sopenharmony_ci#define OMAP3430_EN_GPT12_MASK				(1 << 1)
30862306a36Sopenharmony_ci#define OMAP3430_EN_GPT12_SHIFT				1
30962306a36Sopenharmony_ci#define OMAP3430_EN_GPT1_MASK				(1 << 0)
31062306a36Sopenharmony_ci#define OMAP3430_EN_GPT1_SHIFT				0
31162306a36Sopenharmony_ci
31262306a36Sopenharmony_ci/* CM_FCLKEN_WKUP, PM_WKEN_WKUP shared bits */
31362306a36Sopenharmony_ci#define OMAP3430_EN_SR2_MASK				(1 << 7)
31462306a36Sopenharmony_ci#define OMAP3430_EN_SR2_SHIFT				7
31562306a36Sopenharmony_ci#define OMAP3430_EN_SR1_MASK				(1 << 6)
31662306a36Sopenharmony_ci#define OMAP3430_EN_SR1_SHIFT				6
31762306a36Sopenharmony_ci
31862306a36Sopenharmony_ci/* CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
31962306a36Sopenharmony_ci#define OMAP3430_EN_GPT12_MASK				(1 << 1)
32062306a36Sopenharmony_ci#define OMAP3430_EN_GPT12_SHIFT				1
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci/* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */
32362306a36Sopenharmony_ci#define OMAP3430_ST_SR2_SHIFT				7
32462306a36Sopenharmony_ci#define OMAP3430_ST_SR2_MASK				(1 << 7)
32562306a36Sopenharmony_ci#define OMAP3430_ST_SR1_SHIFT				6
32662306a36Sopenharmony_ci#define OMAP3430_ST_SR1_MASK				(1 << 6)
32762306a36Sopenharmony_ci#define OMAP3430_ST_GPIO1_SHIFT				3
32862306a36Sopenharmony_ci#define OMAP3430_ST_GPIO1_MASK				(1 << 3)
32962306a36Sopenharmony_ci#define OMAP3430_ST_32KSYNC_SHIFT			2
33062306a36Sopenharmony_ci#define OMAP3430_ST_32KSYNC_MASK			(1 << 2)
33162306a36Sopenharmony_ci#define OMAP3430_ST_GPT12_SHIFT				1
33262306a36Sopenharmony_ci#define OMAP3430_ST_GPT12_MASK				(1 << 1)
33362306a36Sopenharmony_ci#define OMAP3430_ST_GPT1_SHIFT				0
33462306a36Sopenharmony_ci#define OMAP3430_ST_GPT1_MASK				(1 << 0)
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_ci/*
33762306a36Sopenharmony_ci * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM,
33862306a36Sopenharmony_ci * CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_GFX,
33962306a36Sopenharmony_ci * PM_WKDEP_DSS, PM_WKDEP_CAM, PM_WKDEP_PER, PM_WKDEP_NEON shared bits
34062306a36Sopenharmony_ci */
34162306a36Sopenharmony_ci#define OMAP3430_EN_MPU_MASK				(1 << 1)
34262306a36Sopenharmony_ci#define OMAP3430_EN_MPU_SHIFT				1
34362306a36Sopenharmony_ci
34462306a36Sopenharmony_ci/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER shared bits */
34562306a36Sopenharmony_ci
34662306a36Sopenharmony_ci#define OMAP3630_EN_UART4_MASK				(1 << 18)
34762306a36Sopenharmony_ci#define OMAP3630_EN_UART4_SHIFT				18
34862306a36Sopenharmony_ci#define OMAP3430_EN_GPIO6_MASK				(1 << 17)
34962306a36Sopenharmony_ci#define OMAP3430_EN_GPIO6_SHIFT				17
35062306a36Sopenharmony_ci#define OMAP3430_EN_GPIO5_MASK				(1 << 16)
35162306a36Sopenharmony_ci#define OMAP3430_EN_GPIO5_SHIFT				16
35262306a36Sopenharmony_ci#define OMAP3430_EN_GPIO4_MASK				(1 << 15)
35362306a36Sopenharmony_ci#define OMAP3430_EN_GPIO4_SHIFT				15
35462306a36Sopenharmony_ci#define OMAP3430_EN_GPIO3_MASK				(1 << 14)
35562306a36Sopenharmony_ci#define OMAP3430_EN_GPIO3_SHIFT				14
35662306a36Sopenharmony_ci#define OMAP3430_EN_GPIO2_MASK				(1 << 13)
35762306a36Sopenharmony_ci#define OMAP3430_EN_GPIO2_SHIFT				13
35862306a36Sopenharmony_ci#define OMAP3430_EN_UART3_MASK				(1 << 11)
35962306a36Sopenharmony_ci#define OMAP3430_EN_UART3_SHIFT				11
36062306a36Sopenharmony_ci#define OMAP3430_EN_GPT9_MASK				(1 << 10)
36162306a36Sopenharmony_ci#define OMAP3430_EN_GPT9_SHIFT				10
36262306a36Sopenharmony_ci#define OMAP3430_EN_GPT8_MASK				(1 << 9)
36362306a36Sopenharmony_ci#define OMAP3430_EN_GPT8_SHIFT				9
36462306a36Sopenharmony_ci#define OMAP3430_EN_GPT7_MASK				(1 << 8)
36562306a36Sopenharmony_ci#define OMAP3430_EN_GPT7_SHIFT				8
36662306a36Sopenharmony_ci#define OMAP3430_EN_GPT6_MASK				(1 << 7)
36762306a36Sopenharmony_ci#define OMAP3430_EN_GPT6_SHIFT				7
36862306a36Sopenharmony_ci#define OMAP3430_EN_GPT5_MASK				(1 << 6)
36962306a36Sopenharmony_ci#define OMAP3430_EN_GPT5_SHIFT				6
37062306a36Sopenharmony_ci#define OMAP3430_EN_GPT4_MASK				(1 << 5)
37162306a36Sopenharmony_ci#define OMAP3430_EN_GPT4_SHIFT				5
37262306a36Sopenharmony_ci#define OMAP3430_EN_GPT3_MASK				(1 << 4)
37362306a36Sopenharmony_ci#define OMAP3430_EN_GPT3_SHIFT				4
37462306a36Sopenharmony_ci#define OMAP3430_EN_GPT2_MASK				(1 << 3)
37562306a36Sopenharmony_ci#define OMAP3430_EN_GPT2_SHIFT				3
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ci/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER, PM_WKST_PER shared bits */
37862306a36Sopenharmony_ci/* XXX Possible TI documentation bug: should the PM_WKST_PER EN_* bits
37962306a36Sopenharmony_ci * be ST_* bits instead? */
38062306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP4_MASK				(1 << 2)
38162306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP4_SHIFT			2
38262306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP3_MASK				(1 << 1)
38362306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP3_SHIFT			1
38462306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP2_MASK				(1 << 0)
38562306a36Sopenharmony_ci#define OMAP3430_EN_MCBSP2_SHIFT			0
38662306a36Sopenharmony_ci
38762306a36Sopenharmony_ci/* CM_IDLEST_PER, PM_WKST_PER shared bits */
38862306a36Sopenharmony_ci#define OMAP3630_ST_UART4_SHIFT				18
38962306a36Sopenharmony_ci#define OMAP3630_ST_UART4_MASK				(1 << 18)
39062306a36Sopenharmony_ci#define OMAP3430_ST_GPIO6_SHIFT				17
39162306a36Sopenharmony_ci#define OMAP3430_ST_GPIO6_MASK				(1 << 17)
39262306a36Sopenharmony_ci#define OMAP3430_ST_GPIO5_SHIFT				16
39362306a36Sopenharmony_ci#define OMAP3430_ST_GPIO5_MASK				(1 << 16)
39462306a36Sopenharmony_ci#define OMAP3430_ST_GPIO4_SHIFT				15
39562306a36Sopenharmony_ci#define OMAP3430_ST_GPIO4_MASK				(1 << 15)
39662306a36Sopenharmony_ci#define OMAP3430_ST_GPIO3_SHIFT				14
39762306a36Sopenharmony_ci#define OMAP3430_ST_GPIO3_MASK				(1 << 14)
39862306a36Sopenharmony_ci#define OMAP3430_ST_GPIO2_SHIFT				13
39962306a36Sopenharmony_ci#define OMAP3430_ST_GPIO2_MASK				(1 << 13)
40062306a36Sopenharmony_ci#define OMAP3430_ST_UART3_SHIFT				11
40162306a36Sopenharmony_ci#define OMAP3430_ST_UART3_MASK				(1 << 11)
40262306a36Sopenharmony_ci#define OMAP3430_ST_GPT9_SHIFT				10
40362306a36Sopenharmony_ci#define OMAP3430_ST_GPT9_MASK				(1 << 10)
40462306a36Sopenharmony_ci#define OMAP3430_ST_GPT8_SHIFT				9
40562306a36Sopenharmony_ci#define OMAP3430_ST_GPT8_MASK				(1 << 9)
40662306a36Sopenharmony_ci#define OMAP3430_ST_GPT7_SHIFT				8
40762306a36Sopenharmony_ci#define OMAP3430_ST_GPT7_MASK				(1 << 8)
40862306a36Sopenharmony_ci#define OMAP3430_ST_GPT6_SHIFT				7
40962306a36Sopenharmony_ci#define OMAP3430_ST_GPT6_MASK				(1 << 7)
41062306a36Sopenharmony_ci#define OMAP3430_ST_GPT5_SHIFT				6
41162306a36Sopenharmony_ci#define OMAP3430_ST_GPT5_MASK				(1 << 6)
41262306a36Sopenharmony_ci#define OMAP3430_ST_GPT4_SHIFT				5
41362306a36Sopenharmony_ci#define OMAP3430_ST_GPT4_MASK				(1 << 5)
41462306a36Sopenharmony_ci#define OMAP3430_ST_GPT3_SHIFT				4
41562306a36Sopenharmony_ci#define OMAP3430_ST_GPT3_MASK				(1 << 4)
41662306a36Sopenharmony_ci#define OMAP3430_ST_GPT2_SHIFT				3
41762306a36Sopenharmony_ci#define OMAP3430_ST_GPT2_MASK				(1 << 3)
41862306a36Sopenharmony_ci
41962306a36Sopenharmony_ci/* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */
42062306a36Sopenharmony_ci#define OMAP3430_EN_CORE_SHIFT				0
42162306a36Sopenharmony_ci#define OMAP3430_EN_CORE_MASK				(1 << 0)
42262306a36Sopenharmony_ci
42362306a36Sopenharmony_ci
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci/*
42662306a36Sopenharmony_ci * Maximum time(us) it takes to output the signal WUCLKOUT of the last
42762306a36Sopenharmony_ci * pad of the I/O ring after asserting WUCLKIN high.  Tero measured
42862306a36Sopenharmony_ci * the actual time at 7 to 8 microseconds on OMAP3 and 2 to 4
42962306a36Sopenharmony_ci * microseconds on OMAP4, so this timeout may be too high.
43062306a36Sopenharmony_ci */
43162306a36Sopenharmony_ci#define MAX_IOPAD_LATCH_TIME			100
43262306a36Sopenharmony_ci# ifndef __ASSEMBLER__
43362306a36Sopenharmony_ci
43462306a36Sopenharmony_ci#include <linux/delay.h>
43562306a36Sopenharmony_ci
43662306a36Sopenharmony_ci/**
43762306a36Sopenharmony_ci * omap_test_timeout - busy-loop, testing a condition
43862306a36Sopenharmony_ci * @cond: condition to test until it evaluates to true
43962306a36Sopenharmony_ci * @timeout: maximum number of microseconds in the timeout
44062306a36Sopenharmony_ci * @index: loop index (integer)
44162306a36Sopenharmony_ci *
44262306a36Sopenharmony_ci * Loop waiting for @cond to become true or until at least @timeout
44362306a36Sopenharmony_ci * microseconds have passed.  To use, define some integer @index in the
44462306a36Sopenharmony_ci * calling code.  After running, if @index == @timeout, then the loop has
44562306a36Sopenharmony_ci * timed out.
44662306a36Sopenharmony_ci */
44762306a36Sopenharmony_ci#define omap_test_timeout(cond, timeout, index)			\
44862306a36Sopenharmony_ci({								\
44962306a36Sopenharmony_ci	for (index = 0; index < timeout; index++) {		\
45062306a36Sopenharmony_ci		if (cond)					\
45162306a36Sopenharmony_ci			break;					\
45262306a36Sopenharmony_ci		udelay(1);					\
45362306a36Sopenharmony_ci	}							\
45462306a36Sopenharmony_ci})
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_ci/**
45762306a36Sopenharmony_ci * struct omap_prcm_irq - describes a PRCM interrupt bit
45862306a36Sopenharmony_ci * @name: a short name describing the interrupt type, e.g. "wkup" or "io"
45962306a36Sopenharmony_ci * @offset: the bit shift of the interrupt inside the IRQ{ENABLE,STATUS} regs
46062306a36Sopenharmony_ci * @priority: should this interrupt be handled before @priority=false IRQs?
46162306a36Sopenharmony_ci *
46262306a36Sopenharmony_ci * Describes interrupt bits inside the PRM_IRQ{ENABLE,STATUS}_MPU* registers.
46362306a36Sopenharmony_ci * On systems with multiple PRM MPU IRQ registers, the bitfields read from
46462306a36Sopenharmony_ci * the registers are concatenated, so @offset could be > 31 on these systems -
46562306a36Sopenharmony_ci * see omap_prm_irq_handler() for more details.  I/O ring interrupts should
46662306a36Sopenharmony_ci * have @priority set to true.
46762306a36Sopenharmony_ci */
46862306a36Sopenharmony_cistruct omap_prcm_irq {
46962306a36Sopenharmony_ci	const char *name;
47062306a36Sopenharmony_ci	unsigned int offset;
47162306a36Sopenharmony_ci	bool priority;
47262306a36Sopenharmony_ci};
47362306a36Sopenharmony_ci
47462306a36Sopenharmony_ci/**
47562306a36Sopenharmony_ci * struct omap_prcm_irq_setup - PRCM interrupt controller details
47662306a36Sopenharmony_ci * @ack: PRM register offset for the first PRM_IRQSTATUS_MPU register
47762306a36Sopenharmony_ci * @mask: PRM register offset for the first PRM_IRQENABLE_MPU register
47862306a36Sopenharmony_ci * @pm_ctrl: PRM register offset for the PRM_IO_PMCTRL register
47962306a36Sopenharmony_ci * @nr_regs: number of PRM_IRQ{STATUS,ENABLE}_MPU* registers
48062306a36Sopenharmony_ci * @nr_irqs: number of entries in the @irqs array
48162306a36Sopenharmony_ci * @irqs: ptr to an array of PRCM interrupt bits (see @nr_irqs)
48262306a36Sopenharmony_ci * @irq: MPU IRQ asserted when a PRCM interrupt arrives
48362306a36Sopenharmony_ci * @read_pending_irqs: fn ptr to determine if any PRCM IRQs are pending
48462306a36Sopenharmony_ci * @ocp_barrier: fn ptr to force buffered PRM writes to complete
48562306a36Sopenharmony_ci * @save_and_clear_irqen: fn ptr to save and clear IRQENABLE regs
48662306a36Sopenharmony_ci * @restore_irqen: fn ptr to save and clear IRQENABLE regs
48762306a36Sopenharmony_ci * @reconfigure_io_chain: fn ptr to reconfigure IO chain
48862306a36Sopenharmony_ci * @saved_mask: IRQENABLE regs are saved here during suspend
48962306a36Sopenharmony_ci * @priority_mask: 1 bit per IRQ, set to 1 if omap_prcm_irq.priority = true
49062306a36Sopenharmony_ci * @base_irq: base dynamic IRQ number, returned from irq_alloc_descs() in init
49162306a36Sopenharmony_ci * @suspended: set to true after Linux suspend code has called our ->prepare()
49262306a36Sopenharmony_ci * @suspend_save_flag: set to true after IRQ masks have been saved and disabled
49362306a36Sopenharmony_ci *
49462306a36Sopenharmony_ci * @saved_mask, @priority_mask, @base_irq, @suspended, and
49562306a36Sopenharmony_ci * @suspend_save_flag are populated dynamically, and are not to be
49662306a36Sopenharmony_ci * specified in static initializers.
49762306a36Sopenharmony_ci */
49862306a36Sopenharmony_cistruct omap_prcm_irq_setup {
49962306a36Sopenharmony_ci	u16 ack;
50062306a36Sopenharmony_ci	u16 mask;
50162306a36Sopenharmony_ci	u16 pm_ctrl;
50262306a36Sopenharmony_ci	u8 nr_regs;
50362306a36Sopenharmony_ci	u8 nr_irqs;
50462306a36Sopenharmony_ci	const struct omap_prcm_irq *irqs;
50562306a36Sopenharmony_ci	int irq;
50662306a36Sopenharmony_ci	void (*read_pending_irqs)(unsigned long *events);
50762306a36Sopenharmony_ci	void (*ocp_barrier)(void);
50862306a36Sopenharmony_ci	void (*save_and_clear_irqen)(u32 *saved_mask);
50962306a36Sopenharmony_ci	void (*restore_irqen)(u32 *saved_mask);
51062306a36Sopenharmony_ci	void (*reconfigure_io_chain)(void);
51162306a36Sopenharmony_ci	u32 *saved_mask;
51262306a36Sopenharmony_ci	u32 *priority_mask;
51362306a36Sopenharmony_ci	int base_irq;
51462306a36Sopenharmony_ci	bool suspended;
51562306a36Sopenharmony_ci	bool suspend_save_flag;
51662306a36Sopenharmony_ci};
51762306a36Sopenharmony_ci
51862306a36Sopenharmony_ci/* OMAP_PRCM_IRQ: convenience macro for creating struct omap_prcm_irq records */
51962306a36Sopenharmony_ci#define OMAP_PRCM_IRQ(_name, _offset, _priority) {	\
52062306a36Sopenharmony_ci	.name = _name,					\
52162306a36Sopenharmony_ci	.offset = _offset,				\
52262306a36Sopenharmony_ci	.priority = _priority				\
52362306a36Sopenharmony_ci	}
52462306a36Sopenharmony_ci
52562306a36Sopenharmony_cistruct omap_domain_base {
52662306a36Sopenharmony_ci	u32 pa;
52762306a36Sopenharmony_ci	void __iomem *va;
52862306a36Sopenharmony_ci	s16 offset;
52962306a36Sopenharmony_ci};
53062306a36Sopenharmony_ci
53162306a36Sopenharmony_ci/**
53262306a36Sopenharmony_ci * struct omap_prcm_init_data - PRCM driver init data
53362306a36Sopenharmony_ci * @index: clock memory mapping index to be used
53462306a36Sopenharmony_ci * @mem: IO mem pointer for this module
53562306a36Sopenharmony_ci * @phys: IO mem physical base address for this module
53662306a36Sopenharmony_ci * @offset: module base address offset from the IO base
53762306a36Sopenharmony_ci * @flags: PRCM module init flags
53862306a36Sopenharmony_ci * @device_inst_offset: device instance offset within the module address space
53962306a36Sopenharmony_ci * @init: low level PRCM init function for this module
54062306a36Sopenharmony_ci * @np: device node for this PRCM module
54162306a36Sopenharmony_ci */
54262306a36Sopenharmony_cistruct omap_prcm_init_data {
54362306a36Sopenharmony_ci	int index;
54462306a36Sopenharmony_ci	void __iomem *mem;
54562306a36Sopenharmony_ci	u32 phys;
54662306a36Sopenharmony_ci	s16 offset;
54762306a36Sopenharmony_ci	u16 flags;
54862306a36Sopenharmony_ci	s32 device_inst_offset;
54962306a36Sopenharmony_ci	int (*init)(const struct omap_prcm_init_data *data);
55062306a36Sopenharmony_ci	struct device_node *np;
55162306a36Sopenharmony_ci};
55262306a36Sopenharmony_ci
55362306a36Sopenharmony_ciextern int omap_prcm_register_chain_handler(
55462306a36Sopenharmony_ci	struct omap_prcm_irq_setup *irq_setup);
55562306a36Sopenharmony_ciextern int omap_prcm_event_to_irq(const char *event);
55662306a36Sopenharmony_ciextern void omap_prcm_irq_prepare(void);
55762306a36Sopenharmony_ciextern void omap_prcm_irq_complete(void);
55862306a36Sopenharmony_ci
55962306a36Sopenharmony_ci# endif
56062306a36Sopenharmony_ci
56162306a36Sopenharmony_ci#endif
56262306a36Sopenharmony_ci
563