162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2017 Impinj, Inc
462306a36Sopenharmony_ci * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Based on the code of analogus driver:
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Copyright 2015-2017 Pengutronix, Lucas Stach <kernel@pengutronix.de>
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#include <linux/clk.h>
1262306a36Sopenharmony_ci#include <linux/of.h>
1362306a36Sopenharmony_ci#include <linux/platform_device.h>
1462306a36Sopenharmony_ci#include <linux/pm_domain.h>
1562306a36Sopenharmony_ci#include <linux/pm_runtime.h>
1662306a36Sopenharmony_ci#include <linux/regmap.h>
1762306a36Sopenharmony_ci#include <linux/regulator/consumer.h>
1862306a36Sopenharmony_ci#include <linux/reset.h>
1962306a36Sopenharmony_ci#include <linux/sizes.h>
2062306a36Sopenharmony_ci#include <dt-bindings/power/imx7-power.h>
2162306a36Sopenharmony_ci#include <dt-bindings/power/imx8mq-power.h>
2262306a36Sopenharmony_ci#include <dt-bindings/power/imx8mm-power.h>
2362306a36Sopenharmony_ci#include <dt-bindings/power/imx8mn-power.h>
2462306a36Sopenharmony_ci#include <dt-bindings/power/imx8mp-power.h>
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#define GPC_LPCR_A_CORE_BSC			0x000
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define GPC_PGC_CPU_MAPPING		0x0ec
2962306a36Sopenharmony_ci#define IMX8MP_GPC_PGC_CPU_MAPPING	0x1cc
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define IMX7_USB_HSIC_PHY_A_CORE_DOMAIN		BIT(6)
3262306a36Sopenharmony_ci#define IMX7_USB_OTG2_PHY_A_CORE_DOMAIN		BIT(5)
3362306a36Sopenharmony_ci#define IMX7_USB_OTG1_PHY_A_CORE_DOMAIN		BIT(4)
3462306a36Sopenharmony_ci#define IMX7_PCIE_PHY_A_CORE_DOMAIN		BIT(3)
3562306a36Sopenharmony_ci#define IMX7_MIPI_PHY_A_CORE_DOMAIN		BIT(2)
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#define IMX8M_PCIE2_A53_DOMAIN			BIT(15)
3862306a36Sopenharmony_ci#define IMX8M_MIPI_CSI2_A53_DOMAIN		BIT(14)
3962306a36Sopenharmony_ci#define IMX8M_MIPI_CSI1_A53_DOMAIN		BIT(13)
4062306a36Sopenharmony_ci#define IMX8M_DISP_A53_DOMAIN			BIT(12)
4162306a36Sopenharmony_ci#define IMX8M_HDMI_A53_DOMAIN			BIT(11)
4262306a36Sopenharmony_ci#define IMX8M_VPU_A53_DOMAIN			BIT(10)
4362306a36Sopenharmony_ci#define IMX8M_GPU_A53_DOMAIN			BIT(9)
4462306a36Sopenharmony_ci#define IMX8M_DDR2_A53_DOMAIN			BIT(8)
4562306a36Sopenharmony_ci#define IMX8M_DDR1_A53_DOMAIN			BIT(7)
4662306a36Sopenharmony_ci#define IMX8M_OTG2_A53_DOMAIN			BIT(5)
4762306a36Sopenharmony_ci#define IMX8M_OTG1_A53_DOMAIN			BIT(4)
4862306a36Sopenharmony_ci#define IMX8M_PCIE1_A53_DOMAIN			BIT(3)
4962306a36Sopenharmony_ci#define IMX8M_MIPI_A53_DOMAIN			BIT(2)
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci#define IMX8MM_VPUH1_A53_DOMAIN			BIT(15)
5262306a36Sopenharmony_ci#define IMX8MM_VPUG2_A53_DOMAIN			BIT(14)
5362306a36Sopenharmony_ci#define IMX8MM_VPUG1_A53_DOMAIN			BIT(13)
5462306a36Sopenharmony_ci#define IMX8MM_DISPMIX_A53_DOMAIN		BIT(12)
5562306a36Sopenharmony_ci#define IMX8MM_VPUMIX_A53_DOMAIN		BIT(10)
5662306a36Sopenharmony_ci#define IMX8MM_GPUMIX_A53_DOMAIN		BIT(9)
5762306a36Sopenharmony_ci#define IMX8MM_GPU_A53_DOMAIN			(BIT(8) | BIT(11))
5862306a36Sopenharmony_ci#define IMX8MM_DDR1_A53_DOMAIN			BIT(7)
5962306a36Sopenharmony_ci#define IMX8MM_OTG2_A53_DOMAIN			BIT(5)
6062306a36Sopenharmony_ci#define IMX8MM_OTG1_A53_DOMAIN			BIT(4)
6162306a36Sopenharmony_ci#define IMX8MM_PCIE_A53_DOMAIN			BIT(3)
6262306a36Sopenharmony_ci#define IMX8MM_MIPI_A53_DOMAIN			BIT(2)
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#define IMX8MN_DISPMIX_A53_DOMAIN		BIT(12)
6562306a36Sopenharmony_ci#define IMX8MN_GPUMIX_A53_DOMAIN		BIT(9)
6662306a36Sopenharmony_ci#define IMX8MN_DDR1_A53_DOMAIN		BIT(7)
6762306a36Sopenharmony_ci#define IMX8MN_OTG1_A53_DOMAIN		BIT(4)
6862306a36Sopenharmony_ci#define IMX8MN_MIPI_A53_DOMAIN		BIT(2)
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define IMX8MP_MEDIA_ISPDWP_A53_DOMAIN	BIT(20)
7162306a36Sopenharmony_ci#define IMX8MP_HSIOMIX_A53_DOMAIN		BIT(19)
7262306a36Sopenharmony_ci#define IMX8MP_MIPI_PHY2_A53_DOMAIN		BIT(18)
7362306a36Sopenharmony_ci#define IMX8MP_HDMI_PHY_A53_DOMAIN		BIT(17)
7462306a36Sopenharmony_ci#define IMX8MP_HDMIMIX_A53_DOMAIN		BIT(16)
7562306a36Sopenharmony_ci#define IMX8MP_VPU_VC8000E_A53_DOMAIN		BIT(15)
7662306a36Sopenharmony_ci#define IMX8MP_VPU_G2_A53_DOMAIN		BIT(14)
7762306a36Sopenharmony_ci#define IMX8MP_VPU_G1_A53_DOMAIN		BIT(13)
7862306a36Sopenharmony_ci#define IMX8MP_MEDIAMIX_A53_DOMAIN		BIT(12)
7962306a36Sopenharmony_ci#define IMX8MP_GPU3D_A53_DOMAIN			BIT(11)
8062306a36Sopenharmony_ci#define IMX8MP_VPUMIX_A53_DOMAIN		BIT(10)
8162306a36Sopenharmony_ci#define IMX8MP_GPUMIX_A53_DOMAIN		BIT(9)
8262306a36Sopenharmony_ci#define IMX8MP_GPU2D_A53_DOMAIN			BIT(8)
8362306a36Sopenharmony_ci#define IMX8MP_AUDIOMIX_A53_DOMAIN		BIT(7)
8462306a36Sopenharmony_ci#define IMX8MP_MLMIX_A53_DOMAIN			BIT(6)
8562306a36Sopenharmony_ci#define IMX8MP_USB2_PHY_A53_DOMAIN		BIT(5)
8662306a36Sopenharmony_ci#define IMX8MP_USB1_PHY_A53_DOMAIN		BIT(4)
8762306a36Sopenharmony_ci#define IMX8MP_PCIE_PHY_A53_DOMAIN		BIT(3)
8862306a36Sopenharmony_ci#define IMX8MP_MIPI_PHY1_A53_DOMAIN		BIT(2)
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#define IMX8MP_GPC_PU_PGC_SW_PUP_REQ	0x0d8
9162306a36Sopenharmony_ci#define IMX8MP_GPC_PU_PGC_SW_PDN_REQ	0x0e4
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define GPC_PU_PGC_SW_PUP_REQ		0x0f8
9462306a36Sopenharmony_ci#define GPC_PU_PGC_SW_PDN_REQ		0x104
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define IMX7_USB_HSIC_PHY_SW_Pxx_REQ		BIT(4)
9762306a36Sopenharmony_ci#define IMX7_USB_OTG2_PHY_SW_Pxx_REQ		BIT(3)
9862306a36Sopenharmony_ci#define IMX7_USB_OTG1_PHY_SW_Pxx_REQ		BIT(2)
9962306a36Sopenharmony_ci#define IMX7_PCIE_PHY_SW_Pxx_REQ		BIT(1)
10062306a36Sopenharmony_ci#define IMX7_MIPI_PHY_SW_Pxx_REQ		BIT(0)
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci#define IMX8M_PCIE2_SW_Pxx_REQ			BIT(13)
10362306a36Sopenharmony_ci#define IMX8M_MIPI_CSI2_SW_Pxx_REQ		BIT(12)
10462306a36Sopenharmony_ci#define IMX8M_MIPI_CSI1_SW_Pxx_REQ		BIT(11)
10562306a36Sopenharmony_ci#define IMX8M_DISP_SW_Pxx_REQ			BIT(10)
10662306a36Sopenharmony_ci#define IMX8M_HDMI_SW_Pxx_REQ			BIT(9)
10762306a36Sopenharmony_ci#define IMX8M_VPU_SW_Pxx_REQ			BIT(8)
10862306a36Sopenharmony_ci#define IMX8M_GPU_SW_Pxx_REQ			BIT(7)
10962306a36Sopenharmony_ci#define IMX8M_DDR2_SW_Pxx_REQ			BIT(6)
11062306a36Sopenharmony_ci#define IMX8M_DDR1_SW_Pxx_REQ			BIT(5)
11162306a36Sopenharmony_ci#define IMX8M_OTG2_SW_Pxx_REQ			BIT(3)
11262306a36Sopenharmony_ci#define IMX8M_OTG1_SW_Pxx_REQ			BIT(2)
11362306a36Sopenharmony_ci#define IMX8M_PCIE1_SW_Pxx_REQ			BIT(1)
11462306a36Sopenharmony_ci#define IMX8M_MIPI_SW_Pxx_REQ			BIT(0)
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci#define IMX8MM_VPUH1_SW_Pxx_REQ			BIT(13)
11762306a36Sopenharmony_ci#define IMX8MM_VPUG2_SW_Pxx_REQ			BIT(12)
11862306a36Sopenharmony_ci#define IMX8MM_VPUG1_SW_Pxx_REQ			BIT(11)
11962306a36Sopenharmony_ci#define IMX8MM_DISPMIX_SW_Pxx_REQ		BIT(10)
12062306a36Sopenharmony_ci#define IMX8MM_VPUMIX_SW_Pxx_REQ		BIT(8)
12162306a36Sopenharmony_ci#define IMX8MM_GPUMIX_SW_Pxx_REQ		BIT(7)
12262306a36Sopenharmony_ci#define IMX8MM_GPU_SW_Pxx_REQ			(BIT(6) | BIT(9))
12362306a36Sopenharmony_ci#define IMX8MM_DDR1_SW_Pxx_REQ			BIT(5)
12462306a36Sopenharmony_ci#define IMX8MM_OTG2_SW_Pxx_REQ			BIT(3)
12562306a36Sopenharmony_ci#define IMX8MM_OTG1_SW_Pxx_REQ			BIT(2)
12662306a36Sopenharmony_ci#define IMX8MM_PCIE_SW_Pxx_REQ			BIT(1)
12762306a36Sopenharmony_ci#define IMX8MM_MIPI_SW_Pxx_REQ			BIT(0)
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define IMX8MN_DISPMIX_SW_Pxx_REQ		BIT(10)
13062306a36Sopenharmony_ci#define IMX8MN_GPUMIX_SW_Pxx_REQ		BIT(7)
13162306a36Sopenharmony_ci#define IMX8MN_DDR1_SW_Pxx_REQ		BIT(5)
13262306a36Sopenharmony_ci#define IMX8MN_OTG1_SW_Pxx_REQ		BIT(2)
13362306a36Sopenharmony_ci#define IMX8MN_MIPI_SW_Pxx_REQ		BIT(0)
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci#define IMX8MP_DDRMIX_Pxx_REQ			BIT(19)
13662306a36Sopenharmony_ci#define IMX8MP_MEDIA_ISP_DWP_Pxx_REQ		BIT(18)
13762306a36Sopenharmony_ci#define IMX8MP_HSIOMIX_Pxx_REQ			BIT(17)
13862306a36Sopenharmony_ci#define IMX8MP_MIPI_PHY2_Pxx_REQ		BIT(16)
13962306a36Sopenharmony_ci#define IMX8MP_HDMI_PHY_Pxx_REQ			BIT(15)
14062306a36Sopenharmony_ci#define IMX8MP_HDMIMIX_Pxx_REQ			BIT(14)
14162306a36Sopenharmony_ci#define IMX8MP_VPU_VC8K_Pxx_REQ			BIT(13)
14262306a36Sopenharmony_ci#define IMX8MP_VPU_G2_Pxx_REQ			BIT(12)
14362306a36Sopenharmony_ci#define IMX8MP_VPU_G1_Pxx_REQ			BIT(11)
14462306a36Sopenharmony_ci#define IMX8MP_MEDIMIX_Pxx_REQ			BIT(10)
14562306a36Sopenharmony_ci#define IMX8MP_GPU_3D_Pxx_REQ			BIT(9)
14662306a36Sopenharmony_ci#define IMX8MP_VPU_MIX_SHARE_LOGIC_Pxx_REQ	BIT(8)
14762306a36Sopenharmony_ci#define IMX8MP_GPU_SHARE_LOGIC_Pxx_REQ		BIT(7)
14862306a36Sopenharmony_ci#define IMX8MP_GPU_2D_Pxx_REQ			BIT(6)
14962306a36Sopenharmony_ci#define IMX8MP_AUDIOMIX_Pxx_REQ			BIT(5)
15062306a36Sopenharmony_ci#define IMX8MP_MLMIX_Pxx_REQ			BIT(4)
15162306a36Sopenharmony_ci#define IMX8MP_USB2_PHY_Pxx_REQ			BIT(3)
15262306a36Sopenharmony_ci#define IMX8MP_USB1_PHY_Pxx_REQ			BIT(2)
15362306a36Sopenharmony_ci#define IMX8MP_PCIE_PHY_SW_Pxx_REQ		BIT(1)
15462306a36Sopenharmony_ci#define IMX8MP_MIPI_PHY1_SW_Pxx_REQ		BIT(0)
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#define GPC_M4_PU_PDN_FLG		0x1bc
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci#define IMX8MP_GPC_PU_PWRHSK		0x190
15962306a36Sopenharmony_ci#define GPC_PU_PWRHSK			0x1fc
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define IMX8M_GPU_HSK_PWRDNACKN			BIT(26)
16262306a36Sopenharmony_ci#define IMX8M_VPU_HSK_PWRDNACKN			BIT(25)
16362306a36Sopenharmony_ci#define IMX8M_DISP_HSK_PWRDNACKN		BIT(24)
16462306a36Sopenharmony_ci#define IMX8M_GPU_HSK_PWRDNREQN			BIT(6)
16562306a36Sopenharmony_ci#define IMX8M_VPU_HSK_PWRDNREQN			BIT(5)
16662306a36Sopenharmony_ci#define IMX8M_DISP_HSK_PWRDNREQN		BIT(4)
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci#define IMX8MM_GPUMIX_HSK_PWRDNACKN		BIT(29)
16962306a36Sopenharmony_ci#define IMX8MM_GPU_HSK_PWRDNACKN		(BIT(27) | BIT(28))
17062306a36Sopenharmony_ci#define IMX8MM_VPUMIX_HSK_PWRDNACKN		BIT(26)
17162306a36Sopenharmony_ci#define IMX8MM_DISPMIX_HSK_PWRDNACKN		BIT(25)
17262306a36Sopenharmony_ci#define IMX8MM_HSIO_HSK_PWRDNACKN		(BIT(23) | BIT(24))
17362306a36Sopenharmony_ci#define IMX8MM_GPUMIX_HSK_PWRDNREQN		BIT(11)
17462306a36Sopenharmony_ci#define IMX8MM_GPU_HSK_PWRDNREQN		(BIT(9) | BIT(10))
17562306a36Sopenharmony_ci#define IMX8MM_VPUMIX_HSK_PWRDNREQN		BIT(8)
17662306a36Sopenharmony_ci#define IMX8MM_DISPMIX_HSK_PWRDNREQN		BIT(7)
17762306a36Sopenharmony_ci#define IMX8MM_HSIO_HSK_PWRDNREQN		(BIT(5) | BIT(6))
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci#define IMX8MN_GPUMIX_HSK_PWRDNACKN		(BIT(29) | BIT(27))
18062306a36Sopenharmony_ci#define IMX8MN_DISPMIX_HSK_PWRDNACKN		BIT(25)
18162306a36Sopenharmony_ci#define IMX8MN_HSIO_HSK_PWRDNACKN		BIT(23)
18262306a36Sopenharmony_ci#define IMX8MN_GPUMIX_HSK_PWRDNREQN		(BIT(11) | BIT(9))
18362306a36Sopenharmony_ci#define IMX8MN_DISPMIX_HSK_PWRDNREQN		BIT(7)
18462306a36Sopenharmony_ci#define IMX8MN_HSIO_HSK_PWRDNREQN		BIT(5)
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci#define IMX8MP_MEDIAMIX_PWRDNACKN		BIT(30)
18762306a36Sopenharmony_ci#define IMX8MP_HDMIMIX_PWRDNACKN		BIT(29)
18862306a36Sopenharmony_ci#define IMX8MP_HSIOMIX_PWRDNACKN		BIT(28)
18962306a36Sopenharmony_ci#define IMX8MP_VPUMIX_PWRDNACKN			BIT(26)
19062306a36Sopenharmony_ci#define IMX8MP_GPUMIX_PWRDNACKN			BIT(25)
19162306a36Sopenharmony_ci#define IMX8MP_MLMIX_PWRDNACKN			(BIT(23) | BIT(24))
19262306a36Sopenharmony_ci#define IMX8MP_AUDIOMIX_PWRDNACKN		(BIT(20) | BIT(31))
19362306a36Sopenharmony_ci#define IMX8MP_MEDIAMIX_PWRDNREQN		BIT(14)
19462306a36Sopenharmony_ci#define IMX8MP_HDMIMIX_PWRDNREQN		BIT(13)
19562306a36Sopenharmony_ci#define IMX8MP_HSIOMIX_PWRDNREQN		BIT(12)
19662306a36Sopenharmony_ci#define IMX8MP_VPUMIX_PWRDNREQN			BIT(10)
19762306a36Sopenharmony_ci#define IMX8MP_GPUMIX_PWRDNREQN			BIT(9)
19862306a36Sopenharmony_ci#define IMX8MP_MLMIX_PWRDNREQN			(BIT(7) | BIT(8))
19962306a36Sopenharmony_ci#define IMX8MP_AUDIOMIX_PWRDNREQN		(BIT(4) | BIT(15))
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ci/*
20262306a36Sopenharmony_ci * The PGC offset values in Reference Manual
20362306a36Sopenharmony_ci * (Rev. 1, 01/2018 and the older ones) GPC chapter's
20462306a36Sopenharmony_ci * GPC_PGC memory map are incorrect, below offset
20562306a36Sopenharmony_ci * values are from design RTL.
20662306a36Sopenharmony_ci */
20762306a36Sopenharmony_ci#define IMX7_PGC_MIPI			16
20862306a36Sopenharmony_ci#define IMX7_PGC_PCIE			17
20962306a36Sopenharmony_ci#define IMX7_PGC_USB_HSIC		20
21062306a36Sopenharmony_ci
21162306a36Sopenharmony_ci#define IMX8M_PGC_MIPI			16
21262306a36Sopenharmony_ci#define IMX8M_PGC_PCIE1			17
21362306a36Sopenharmony_ci#define IMX8M_PGC_OTG1			18
21462306a36Sopenharmony_ci#define IMX8M_PGC_OTG2			19
21562306a36Sopenharmony_ci#define IMX8M_PGC_DDR1			21
21662306a36Sopenharmony_ci#define IMX8M_PGC_GPU			23
21762306a36Sopenharmony_ci#define IMX8M_PGC_VPU			24
21862306a36Sopenharmony_ci#define IMX8M_PGC_DISP			26
21962306a36Sopenharmony_ci#define IMX8M_PGC_MIPI_CSI1		27
22062306a36Sopenharmony_ci#define IMX8M_PGC_MIPI_CSI2		28
22162306a36Sopenharmony_ci#define IMX8M_PGC_PCIE2			29
22262306a36Sopenharmony_ci
22362306a36Sopenharmony_ci#define IMX8MM_PGC_MIPI			16
22462306a36Sopenharmony_ci#define IMX8MM_PGC_PCIE			17
22562306a36Sopenharmony_ci#define IMX8MM_PGC_OTG1			18
22662306a36Sopenharmony_ci#define IMX8MM_PGC_OTG2			19
22762306a36Sopenharmony_ci#define IMX8MM_PGC_DDR1			21
22862306a36Sopenharmony_ci#define IMX8MM_PGC_GPU2D		22
22962306a36Sopenharmony_ci#define IMX8MM_PGC_GPUMIX		23
23062306a36Sopenharmony_ci#define IMX8MM_PGC_VPUMIX		24
23162306a36Sopenharmony_ci#define IMX8MM_PGC_GPU3D		25
23262306a36Sopenharmony_ci#define IMX8MM_PGC_DISPMIX		26
23362306a36Sopenharmony_ci#define IMX8MM_PGC_VPUG1		27
23462306a36Sopenharmony_ci#define IMX8MM_PGC_VPUG2		28
23562306a36Sopenharmony_ci#define IMX8MM_PGC_VPUH1		29
23662306a36Sopenharmony_ci
23762306a36Sopenharmony_ci#define IMX8MN_PGC_MIPI		16
23862306a36Sopenharmony_ci#define IMX8MN_PGC_OTG1		18
23962306a36Sopenharmony_ci#define IMX8MN_PGC_DDR1		21
24062306a36Sopenharmony_ci#define IMX8MN_PGC_GPUMIX		23
24162306a36Sopenharmony_ci#define IMX8MN_PGC_DISPMIX		26
24262306a36Sopenharmony_ci
24362306a36Sopenharmony_ci#define IMX8MP_PGC_NOC			9
24462306a36Sopenharmony_ci#define IMX8MP_PGC_MIPI1		12
24562306a36Sopenharmony_ci#define IMX8MP_PGC_PCIE			13
24662306a36Sopenharmony_ci#define IMX8MP_PGC_USB1			14
24762306a36Sopenharmony_ci#define IMX8MP_PGC_USB2			15
24862306a36Sopenharmony_ci#define IMX8MP_PGC_MLMIX		16
24962306a36Sopenharmony_ci#define IMX8MP_PGC_AUDIOMIX		17
25062306a36Sopenharmony_ci#define IMX8MP_PGC_GPU2D		18
25162306a36Sopenharmony_ci#define IMX8MP_PGC_GPUMIX		19
25262306a36Sopenharmony_ci#define IMX8MP_PGC_VPUMIX		20
25362306a36Sopenharmony_ci#define IMX8MP_PGC_GPU3D		21
25462306a36Sopenharmony_ci#define IMX8MP_PGC_MEDIAMIX		22
25562306a36Sopenharmony_ci#define IMX8MP_PGC_VPU_G1		23
25662306a36Sopenharmony_ci#define IMX8MP_PGC_VPU_G2		24
25762306a36Sopenharmony_ci#define IMX8MP_PGC_VPU_VC8000E		25
25862306a36Sopenharmony_ci#define IMX8MP_PGC_HDMIMIX		26
25962306a36Sopenharmony_ci#define IMX8MP_PGC_HDMI			27
26062306a36Sopenharmony_ci#define IMX8MP_PGC_MIPI2		28
26162306a36Sopenharmony_ci#define IMX8MP_PGC_HSIOMIX		29
26262306a36Sopenharmony_ci#define IMX8MP_PGC_MEDIA_ISP_DWP	30
26362306a36Sopenharmony_ci#define IMX8MP_PGC_DDRMIX		31
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ci#define GPC_PGC_CTRL(n)			(0x800 + (n) * 0x40)
26662306a36Sopenharmony_ci#define GPC_PGC_SR(n)			(GPC_PGC_CTRL(n) + 0xc)
26762306a36Sopenharmony_ci
26862306a36Sopenharmony_ci#define GPC_PGC_CTRL_PCR		BIT(0)
26962306a36Sopenharmony_ci
27062306a36Sopenharmony_cistruct imx_pgc_regs {
27162306a36Sopenharmony_ci	u16 map;
27262306a36Sopenharmony_ci	u16 pup;
27362306a36Sopenharmony_ci	u16 pdn;
27462306a36Sopenharmony_ci	u16 hsk;
27562306a36Sopenharmony_ci};
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_cistruct imx_pgc_domain {
27862306a36Sopenharmony_ci	struct generic_pm_domain genpd;
27962306a36Sopenharmony_ci	struct regmap *regmap;
28062306a36Sopenharmony_ci	const struct imx_pgc_regs *regs;
28162306a36Sopenharmony_ci	struct regulator *regulator;
28262306a36Sopenharmony_ci	struct reset_control *reset;
28362306a36Sopenharmony_ci	struct clk_bulk_data *clks;
28462306a36Sopenharmony_ci	int num_clks;
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_ci	unsigned long pgc;
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_ci	const struct {
28962306a36Sopenharmony_ci		u32 pxx;
29062306a36Sopenharmony_ci		u32 map;
29162306a36Sopenharmony_ci		u32 hskreq;
29262306a36Sopenharmony_ci		u32 hskack;
29362306a36Sopenharmony_ci	} bits;
29462306a36Sopenharmony_ci
29562306a36Sopenharmony_ci	const int voltage;
29662306a36Sopenharmony_ci	const bool keep_clocks;
29762306a36Sopenharmony_ci	struct device *dev;
29862306a36Sopenharmony_ci
29962306a36Sopenharmony_ci	unsigned int pgc_sw_pup_reg;
30062306a36Sopenharmony_ci	unsigned int pgc_sw_pdn_reg;
30162306a36Sopenharmony_ci};
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_cistruct imx_pgc_domain_data {
30462306a36Sopenharmony_ci	const struct imx_pgc_domain *domains;
30562306a36Sopenharmony_ci	size_t domains_num;
30662306a36Sopenharmony_ci	const struct regmap_access_table *reg_access_table;
30762306a36Sopenharmony_ci	const struct imx_pgc_regs *pgc_regs;
30862306a36Sopenharmony_ci};
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_cistatic inline struct imx_pgc_domain *
31162306a36Sopenharmony_cito_imx_pgc_domain(struct generic_pm_domain *genpd)
31262306a36Sopenharmony_ci{
31362306a36Sopenharmony_ci	return container_of(genpd, struct imx_pgc_domain, genpd);
31462306a36Sopenharmony_ci}
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_cistatic int imx_pgc_power_up(struct generic_pm_domain *genpd)
31762306a36Sopenharmony_ci{
31862306a36Sopenharmony_ci	struct imx_pgc_domain *domain = to_imx_pgc_domain(genpd);
31962306a36Sopenharmony_ci	u32 reg_val, pgc;
32062306a36Sopenharmony_ci	int ret;
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci	ret = pm_runtime_get_sync(domain->dev);
32362306a36Sopenharmony_ci	if (ret < 0) {
32462306a36Sopenharmony_ci		pm_runtime_put_noidle(domain->dev);
32562306a36Sopenharmony_ci		return ret;
32662306a36Sopenharmony_ci	}
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci	if (!IS_ERR(domain->regulator)) {
32962306a36Sopenharmony_ci		ret = regulator_enable(domain->regulator);
33062306a36Sopenharmony_ci		if (ret) {
33162306a36Sopenharmony_ci			dev_err(domain->dev,
33262306a36Sopenharmony_ci				"failed to enable regulator: %pe\n",
33362306a36Sopenharmony_ci				ERR_PTR(ret));
33462306a36Sopenharmony_ci			goto out_put_pm;
33562306a36Sopenharmony_ci		}
33662306a36Sopenharmony_ci	}
33762306a36Sopenharmony_ci
33862306a36Sopenharmony_ci	reset_control_assert(domain->reset);
33962306a36Sopenharmony_ci
34062306a36Sopenharmony_ci	/* Enable reset clocks for all devices in the domain */
34162306a36Sopenharmony_ci	ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
34262306a36Sopenharmony_ci	if (ret) {
34362306a36Sopenharmony_ci		dev_err(domain->dev, "failed to enable reset clocks\n");
34462306a36Sopenharmony_ci		goto out_regulator_disable;
34562306a36Sopenharmony_ci	}
34662306a36Sopenharmony_ci
34762306a36Sopenharmony_ci	/* delays for reset to propagate */
34862306a36Sopenharmony_ci	udelay(5);
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci	if (domain->bits.pxx) {
35162306a36Sopenharmony_ci		/* request the domain to power up */
35262306a36Sopenharmony_ci		regmap_update_bits(domain->regmap, domain->regs->pup,
35362306a36Sopenharmony_ci				   domain->bits.pxx, domain->bits.pxx);
35462306a36Sopenharmony_ci		/*
35562306a36Sopenharmony_ci		 * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait
35662306a36Sopenharmony_ci		 * for PUP_REQ/PDN_REQ bit to be cleared
35762306a36Sopenharmony_ci		 */
35862306a36Sopenharmony_ci		ret = regmap_read_poll_timeout(domain->regmap,
35962306a36Sopenharmony_ci					       domain->regs->pup, reg_val,
36062306a36Sopenharmony_ci					       !(reg_val & domain->bits.pxx),
36162306a36Sopenharmony_ci					       0, USEC_PER_MSEC);
36262306a36Sopenharmony_ci		if (ret) {
36362306a36Sopenharmony_ci			dev_err(domain->dev, "failed to command PGC\n");
36462306a36Sopenharmony_ci			goto out_clk_disable;
36562306a36Sopenharmony_ci		}
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci		/* disable power control */
36862306a36Sopenharmony_ci		for_each_set_bit(pgc, &domain->pgc, 32) {
36962306a36Sopenharmony_ci			regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(pgc),
37062306a36Sopenharmony_ci					  GPC_PGC_CTRL_PCR);
37162306a36Sopenharmony_ci		}
37262306a36Sopenharmony_ci	}
37362306a36Sopenharmony_ci
37462306a36Sopenharmony_ci	/* delay for reset to propagate */
37562306a36Sopenharmony_ci	udelay(5);
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ci	reset_control_deassert(domain->reset);
37862306a36Sopenharmony_ci
37962306a36Sopenharmony_ci	/* request the ADB400 to power up */
38062306a36Sopenharmony_ci	if (domain->bits.hskreq) {
38162306a36Sopenharmony_ci		regmap_update_bits(domain->regmap, domain->regs->hsk,
38262306a36Sopenharmony_ci				   domain->bits.hskreq, domain->bits.hskreq);
38362306a36Sopenharmony_ci
38462306a36Sopenharmony_ci		/*
38562306a36Sopenharmony_ci		 * ret = regmap_read_poll_timeout(domain->regmap, domain->regs->hsk, reg_val,
38662306a36Sopenharmony_ci		 *				  (reg_val & domain->bits.hskack), 0,
38762306a36Sopenharmony_ci		 *				  USEC_PER_MSEC);
38862306a36Sopenharmony_ci		 * Technically we need the commented code to wait handshake. But that needs
38962306a36Sopenharmony_ci		 * the BLK-CTL module BUS clk-en bit being set.
39062306a36Sopenharmony_ci		 *
39162306a36Sopenharmony_ci		 * There is a separate BLK-CTL module and we will have such a driver for it,
39262306a36Sopenharmony_ci		 * that driver will set the BUS clk-en bit and handshake will be triggered
39362306a36Sopenharmony_ci		 * automatically there. Just add a delay and suppose the handshake finish
39462306a36Sopenharmony_ci		 * after that.
39562306a36Sopenharmony_ci		 */
39662306a36Sopenharmony_ci	}
39762306a36Sopenharmony_ci
39862306a36Sopenharmony_ci	/* Disable reset clocks for all devices in the domain */
39962306a36Sopenharmony_ci	if (!domain->keep_clocks)
40062306a36Sopenharmony_ci		clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
40162306a36Sopenharmony_ci
40262306a36Sopenharmony_ci	return 0;
40362306a36Sopenharmony_ci
40462306a36Sopenharmony_ciout_clk_disable:
40562306a36Sopenharmony_ci	clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
40662306a36Sopenharmony_ciout_regulator_disable:
40762306a36Sopenharmony_ci	if (!IS_ERR(domain->regulator))
40862306a36Sopenharmony_ci		regulator_disable(domain->regulator);
40962306a36Sopenharmony_ciout_put_pm:
41062306a36Sopenharmony_ci	pm_runtime_put(domain->dev);
41162306a36Sopenharmony_ci
41262306a36Sopenharmony_ci	return ret;
41362306a36Sopenharmony_ci}
41462306a36Sopenharmony_ci
41562306a36Sopenharmony_cistatic int imx_pgc_power_down(struct generic_pm_domain *genpd)
41662306a36Sopenharmony_ci{
41762306a36Sopenharmony_ci	struct imx_pgc_domain *domain = to_imx_pgc_domain(genpd);
41862306a36Sopenharmony_ci	u32 reg_val, pgc;
41962306a36Sopenharmony_ci	int ret;
42062306a36Sopenharmony_ci
42162306a36Sopenharmony_ci	/* Enable reset clocks for all devices in the domain */
42262306a36Sopenharmony_ci	if (!domain->keep_clocks) {
42362306a36Sopenharmony_ci		ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
42462306a36Sopenharmony_ci		if (ret) {
42562306a36Sopenharmony_ci			dev_err(domain->dev, "failed to enable reset clocks\n");
42662306a36Sopenharmony_ci			return ret;
42762306a36Sopenharmony_ci		}
42862306a36Sopenharmony_ci	}
42962306a36Sopenharmony_ci
43062306a36Sopenharmony_ci	/* request the ADB400 to power down */
43162306a36Sopenharmony_ci	if (domain->bits.hskreq) {
43262306a36Sopenharmony_ci		regmap_clear_bits(domain->regmap, domain->regs->hsk,
43362306a36Sopenharmony_ci				  domain->bits.hskreq);
43462306a36Sopenharmony_ci
43562306a36Sopenharmony_ci		ret = regmap_read_poll_timeout(domain->regmap, domain->regs->hsk,
43662306a36Sopenharmony_ci					       reg_val,
43762306a36Sopenharmony_ci					       !(reg_val & domain->bits.hskack),
43862306a36Sopenharmony_ci					       0, USEC_PER_MSEC);
43962306a36Sopenharmony_ci		if (ret) {
44062306a36Sopenharmony_ci			dev_err(domain->dev, "failed to power down ADB400\n");
44162306a36Sopenharmony_ci			goto out_clk_disable;
44262306a36Sopenharmony_ci		}
44362306a36Sopenharmony_ci	}
44462306a36Sopenharmony_ci
44562306a36Sopenharmony_ci	if (domain->bits.pxx) {
44662306a36Sopenharmony_ci		/* enable power control */
44762306a36Sopenharmony_ci		for_each_set_bit(pgc, &domain->pgc, 32) {
44862306a36Sopenharmony_ci			regmap_update_bits(domain->regmap, GPC_PGC_CTRL(pgc),
44962306a36Sopenharmony_ci					   GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR);
45062306a36Sopenharmony_ci		}
45162306a36Sopenharmony_ci
45262306a36Sopenharmony_ci		/* request the domain to power down */
45362306a36Sopenharmony_ci		regmap_update_bits(domain->regmap, domain->regs->pdn,
45462306a36Sopenharmony_ci				   domain->bits.pxx, domain->bits.pxx);
45562306a36Sopenharmony_ci		/*
45662306a36Sopenharmony_ci		 * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait
45762306a36Sopenharmony_ci		 * for PUP_REQ/PDN_REQ bit to be cleared
45862306a36Sopenharmony_ci		 */
45962306a36Sopenharmony_ci		ret = regmap_read_poll_timeout(domain->regmap,
46062306a36Sopenharmony_ci					       domain->regs->pdn, reg_val,
46162306a36Sopenharmony_ci					       !(reg_val & domain->bits.pxx),
46262306a36Sopenharmony_ci					       0, USEC_PER_MSEC);
46362306a36Sopenharmony_ci		if (ret) {
46462306a36Sopenharmony_ci			dev_err(domain->dev, "failed to command PGC\n");
46562306a36Sopenharmony_ci			goto out_clk_disable;
46662306a36Sopenharmony_ci		}
46762306a36Sopenharmony_ci	}
46862306a36Sopenharmony_ci
46962306a36Sopenharmony_ci	/* Disable reset clocks for all devices in the domain */
47062306a36Sopenharmony_ci	clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
47162306a36Sopenharmony_ci
47262306a36Sopenharmony_ci	if (!IS_ERR(domain->regulator)) {
47362306a36Sopenharmony_ci		ret = regulator_disable(domain->regulator);
47462306a36Sopenharmony_ci		if (ret) {
47562306a36Sopenharmony_ci			dev_err(domain->dev,
47662306a36Sopenharmony_ci				"failed to disable regulator: %pe\n",
47762306a36Sopenharmony_ci				ERR_PTR(ret));
47862306a36Sopenharmony_ci			return ret;
47962306a36Sopenharmony_ci		}
48062306a36Sopenharmony_ci	}
48162306a36Sopenharmony_ci
48262306a36Sopenharmony_ci	pm_runtime_put_sync_suspend(domain->dev);
48362306a36Sopenharmony_ci
48462306a36Sopenharmony_ci	return 0;
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ciout_clk_disable:
48762306a36Sopenharmony_ci	if (!domain->keep_clocks)
48862306a36Sopenharmony_ci		clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
48962306a36Sopenharmony_ci
49062306a36Sopenharmony_ci	return ret;
49162306a36Sopenharmony_ci}
49262306a36Sopenharmony_ci
49362306a36Sopenharmony_cistatic const struct imx_pgc_domain imx7_pgc_domains[] = {
49462306a36Sopenharmony_ci	[IMX7_POWER_DOMAIN_MIPI_PHY] = {
49562306a36Sopenharmony_ci		.genpd = {
49662306a36Sopenharmony_ci			.name      = "mipi-phy",
49762306a36Sopenharmony_ci		},
49862306a36Sopenharmony_ci		.bits  = {
49962306a36Sopenharmony_ci			.pxx = IMX7_MIPI_PHY_SW_Pxx_REQ,
50062306a36Sopenharmony_ci			.map = IMX7_MIPI_PHY_A_CORE_DOMAIN,
50162306a36Sopenharmony_ci		},
50262306a36Sopenharmony_ci		.voltage   = 1000000,
50362306a36Sopenharmony_ci		.pgc	   = BIT(IMX7_PGC_MIPI),
50462306a36Sopenharmony_ci	},
50562306a36Sopenharmony_ci
50662306a36Sopenharmony_ci	[IMX7_POWER_DOMAIN_PCIE_PHY] = {
50762306a36Sopenharmony_ci		.genpd = {
50862306a36Sopenharmony_ci			.name      = "pcie-phy",
50962306a36Sopenharmony_ci		},
51062306a36Sopenharmony_ci		.bits  = {
51162306a36Sopenharmony_ci			.pxx = IMX7_PCIE_PHY_SW_Pxx_REQ,
51262306a36Sopenharmony_ci			.map = IMX7_PCIE_PHY_A_CORE_DOMAIN,
51362306a36Sopenharmony_ci		},
51462306a36Sopenharmony_ci		.voltage   = 1000000,
51562306a36Sopenharmony_ci		.pgc	   = BIT(IMX7_PGC_PCIE),
51662306a36Sopenharmony_ci	},
51762306a36Sopenharmony_ci
51862306a36Sopenharmony_ci	[IMX7_POWER_DOMAIN_USB_HSIC_PHY] = {
51962306a36Sopenharmony_ci		.genpd = {
52062306a36Sopenharmony_ci			.name      = "usb-hsic-phy",
52162306a36Sopenharmony_ci		},
52262306a36Sopenharmony_ci		.bits  = {
52362306a36Sopenharmony_ci			.pxx = IMX7_USB_HSIC_PHY_SW_Pxx_REQ,
52462306a36Sopenharmony_ci			.map = IMX7_USB_HSIC_PHY_A_CORE_DOMAIN,
52562306a36Sopenharmony_ci		},
52662306a36Sopenharmony_ci		.voltage   = 1200000,
52762306a36Sopenharmony_ci		.pgc	   = BIT(IMX7_PGC_USB_HSIC),
52862306a36Sopenharmony_ci	},
52962306a36Sopenharmony_ci};
53062306a36Sopenharmony_ci
53162306a36Sopenharmony_cistatic const struct regmap_range imx7_yes_ranges[] = {
53262306a36Sopenharmony_ci		regmap_reg_range(GPC_LPCR_A_CORE_BSC,
53362306a36Sopenharmony_ci				 GPC_M4_PU_PDN_FLG),
53462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX7_PGC_MIPI),
53562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX7_PGC_MIPI)),
53662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX7_PGC_PCIE),
53762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX7_PGC_PCIE)),
53862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX7_PGC_USB_HSIC),
53962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX7_PGC_USB_HSIC)),
54062306a36Sopenharmony_ci};
54162306a36Sopenharmony_ci
54262306a36Sopenharmony_cistatic const struct regmap_access_table imx7_access_table = {
54362306a36Sopenharmony_ci	.yes_ranges	= imx7_yes_ranges,
54462306a36Sopenharmony_ci	.n_yes_ranges	= ARRAY_SIZE(imx7_yes_ranges),
54562306a36Sopenharmony_ci};
54662306a36Sopenharmony_ci
54762306a36Sopenharmony_cistatic const struct imx_pgc_regs imx7_pgc_regs = {
54862306a36Sopenharmony_ci	.map = GPC_PGC_CPU_MAPPING,
54962306a36Sopenharmony_ci	.pup = GPC_PU_PGC_SW_PUP_REQ,
55062306a36Sopenharmony_ci	.pdn = GPC_PU_PGC_SW_PDN_REQ,
55162306a36Sopenharmony_ci	.hsk = GPC_PU_PWRHSK,
55262306a36Sopenharmony_ci};
55362306a36Sopenharmony_ci
55462306a36Sopenharmony_cistatic const struct imx_pgc_domain_data imx7_pgc_domain_data = {
55562306a36Sopenharmony_ci	.domains = imx7_pgc_domains,
55662306a36Sopenharmony_ci	.domains_num = ARRAY_SIZE(imx7_pgc_domains),
55762306a36Sopenharmony_ci	.reg_access_table = &imx7_access_table,
55862306a36Sopenharmony_ci	.pgc_regs = &imx7_pgc_regs,
55962306a36Sopenharmony_ci};
56062306a36Sopenharmony_ci
56162306a36Sopenharmony_cistatic const struct imx_pgc_domain imx8m_pgc_domains[] = {
56262306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_MIPI] = {
56362306a36Sopenharmony_ci		.genpd = {
56462306a36Sopenharmony_ci			.name      = "mipi",
56562306a36Sopenharmony_ci		},
56662306a36Sopenharmony_ci		.bits  = {
56762306a36Sopenharmony_ci			.pxx = IMX8M_MIPI_SW_Pxx_REQ,
56862306a36Sopenharmony_ci			.map = IMX8M_MIPI_A53_DOMAIN,
56962306a36Sopenharmony_ci		},
57062306a36Sopenharmony_ci		.pgc	   = BIT(IMX8M_PGC_MIPI),
57162306a36Sopenharmony_ci	},
57262306a36Sopenharmony_ci
57362306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_PCIE1] = {
57462306a36Sopenharmony_ci		.genpd = {
57562306a36Sopenharmony_ci			.name = "pcie1",
57662306a36Sopenharmony_ci		},
57762306a36Sopenharmony_ci		.bits  = {
57862306a36Sopenharmony_ci			.pxx = IMX8M_PCIE1_SW_Pxx_REQ,
57962306a36Sopenharmony_ci			.map = IMX8M_PCIE1_A53_DOMAIN,
58062306a36Sopenharmony_ci		},
58162306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_PCIE1),
58262306a36Sopenharmony_ci	},
58362306a36Sopenharmony_ci
58462306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_USB_OTG1] = {
58562306a36Sopenharmony_ci		.genpd = {
58662306a36Sopenharmony_ci			.name = "usb-otg1",
58762306a36Sopenharmony_ci		},
58862306a36Sopenharmony_ci		.bits  = {
58962306a36Sopenharmony_ci			.pxx = IMX8M_OTG1_SW_Pxx_REQ,
59062306a36Sopenharmony_ci			.map = IMX8M_OTG1_A53_DOMAIN,
59162306a36Sopenharmony_ci		},
59262306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_OTG1),
59362306a36Sopenharmony_ci	},
59462306a36Sopenharmony_ci
59562306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_USB_OTG2] = {
59662306a36Sopenharmony_ci		.genpd = {
59762306a36Sopenharmony_ci			.name = "usb-otg2",
59862306a36Sopenharmony_ci		},
59962306a36Sopenharmony_ci		.bits  = {
60062306a36Sopenharmony_ci			.pxx = IMX8M_OTG2_SW_Pxx_REQ,
60162306a36Sopenharmony_ci			.map = IMX8M_OTG2_A53_DOMAIN,
60262306a36Sopenharmony_ci		},
60362306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_OTG2),
60462306a36Sopenharmony_ci	},
60562306a36Sopenharmony_ci
60662306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_DDR1] = {
60762306a36Sopenharmony_ci		.genpd = {
60862306a36Sopenharmony_ci			.name = "ddr1",
60962306a36Sopenharmony_ci		},
61062306a36Sopenharmony_ci		.bits  = {
61162306a36Sopenharmony_ci			.pxx = IMX8M_DDR1_SW_Pxx_REQ,
61262306a36Sopenharmony_ci			.map = IMX8M_DDR2_A53_DOMAIN,
61362306a36Sopenharmony_ci		},
61462306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_DDR1),
61562306a36Sopenharmony_ci	},
61662306a36Sopenharmony_ci
61762306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_GPU] = {
61862306a36Sopenharmony_ci		.genpd = {
61962306a36Sopenharmony_ci			.name = "gpu",
62062306a36Sopenharmony_ci		},
62162306a36Sopenharmony_ci		.bits  = {
62262306a36Sopenharmony_ci			.pxx = IMX8M_GPU_SW_Pxx_REQ,
62362306a36Sopenharmony_ci			.map = IMX8M_GPU_A53_DOMAIN,
62462306a36Sopenharmony_ci			.hskreq = IMX8M_GPU_HSK_PWRDNREQN,
62562306a36Sopenharmony_ci			.hskack = IMX8M_GPU_HSK_PWRDNACKN,
62662306a36Sopenharmony_ci		},
62762306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_GPU),
62862306a36Sopenharmony_ci	},
62962306a36Sopenharmony_ci
63062306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_VPU] = {
63162306a36Sopenharmony_ci		.genpd = {
63262306a36Sopenharmony_ci			.name = "vpu",
63362306a36Sopenharmony_ci		},
63462306a36Sopenharmony_ci		.bits  = {
63562306a36Sopenharmony_ci			.pxx = IMX8M_VPU_SW_Pxx_REQ,
63662306a36Sopenharmony_ci			.map = IMX8M_VPU_A53_DOMAIN,
63762306a36Sopenharmony_ci			.hskreq = IMX8M_VPU_HSK_PWRDNREQN,
63862306a36Sopenharmony_ci			.hskack = IMX8M_VPU_HSK_PWRDNACKN,
63962306a36Sopenharmony_ci		},
64062306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_VPU),
64162306a36Sopenharmony_ci		.keep_clocks = true,
64262306a36Sopenharmony_ci	},
64362306a36Sopenharmony_ci
64462306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_DISP] = {
64562306a36Sopenharmony_ci		.genpd = {
64662306a36Sopenharmony_ci			.name = "disp",
64762306a36Sopenharmony_ci		},
64862306a36Sopenharmony_ci		.bits  = {
64962306a36Sopenharmony_ci			.pxx = IMX8M_DISP_SW_Pxx_REQ,
65062306a36Sopenharmony_ci			.map = IMX8M_DISP_A53_DOMAIN,
65162306a36Sopenharmony_ci			.hskreq = IMX8M_DISP_HSK_PWRDNREQN,
65262306a36Sopenharmony_ci			.hskack = IMX8M_DISP_HSK_PWRDNACKN,
65362306a36Sopenharmony_ci		},
65462306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_DISP),
65562306a36Sopenharmony_ci	},
65662306a36Sopenharmony_ci
65762306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_MIPI_CSI1] = {
65862306a36Sopenharmony_ci		.genpd = {
65962306a36Sopenharmony_ci			.name = "mipi-csi1",
66062306a36Sopenharmony_ci		},
66162306a36Sopenharmony_ci		.bits  = {
66262306a36Sopenharmony_ci			.pxx = IMX8M_MIPI_CSI1_SW_Pxx_REQ,
66362306a36Sopenharmony_ci			.map = IMX8M_MIPI_CSI1_A53_DOMAIN,
66462306a36Sopenharmony_ci		},
66562306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_MIPI_CSI1),
66662306a36Sopenharmony_ci	},
66762306a36Sopenharmony_ci
66862306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_MIPI_CSI2] = {
66962306a36Sopenharmony_ci		.genpd = {
67062306a36Sopenharmony_ci			.name = "mipi-csi2",
67162306a36Sopenharmony_ci		},
67262306a36Sopenharmony_ci		.bits  = {
67362306a36Sopenharmony_ci			.pxx = IMX8M_MIPI_CSI2_SW_Pxx_REQ,
67462306a36Sopenharmony_ci			.map = IMX8M_MIPI_CSI2_A53_DOMAIN,
67562306a36Sopenharmony_ci		},
67662306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_MIPI_CSI2),
67762306a36Sopenharmony_ci	},
67862306a36Sopenharmony_ci
67962306a36Sopenharmony_ci	[IMX8M_POWER_DOMAIN_PCIE2] = {
68062306a36Sopenharmony_ci		.genpd = {
68162306a36Sopenharmony_ci			.name = "pcie2",
68262306a36Sopenharmony_ci		},
68362306a36Sopenharmony_ci		.bits  = {
68462306a36Sopenharmony_ci			.pxx = IMX8M_PCIE2_SW_Pxx_REQ,
68562306a36Sopenharmony_ci			.map = IMX8M_PCIE2_A53_DOMAIN,
68662306a36Sopenharmony_ci		},
68762306a36Sopenharmony_ci		.pgc   = BIT(IMX8M_PGC_PCIE2),
68862306a36Sopenharmony_ci	},
68962306a36Sopenharmony_ci};
69062306a36Sopenharmony_ci
69162306a36Sopenharmony_cistatic const struct regmap_range imx8m_yes_ranges[] = {
69262306a36Sopenharmony_ci		regmap_reg_range(GPC_LPCR_A_CORE_BSC,
69362306a36Sopenharmony_ci				 GPC_PU_PWRHSK),
69462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_MIPI),
69562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_MIPI)),
69662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_PCIE1),
69762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_PCIE1)),
69862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_OTG1),
69962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_OTG1)),
70062306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_OTG2),
70162306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_OTG2)),
70262306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_DDR1),
70362306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_DDR1)),
70462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_GPU),
70562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_GPU)),
70662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_VPU),
70762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_VPU)),
70862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_DISP),
70962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_DISP)),
71062306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_MIPI_CSI1),
71162306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_MIPI_CSI1)),
71262306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_MIPI_CSI2),
71362306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_MIPI_CSI2)),
71462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8M_PGC_PCIE2),
71562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8M_PGC_PCIE2)),
71662306a36Sopenharmony_ci};
71762306a36Sopenharmony_ci
71862306a36Sopenharmony_cistatic const struct regmap_access_table imx8m_access_table = {
71962306a36Sopenharmony_ci	.yes_ranges	= imx8m_yes_ranges,
72062306a36Sopenharmony_ci	.n_yes_ranges	= ARRAY_SIZE(imx8m_yes_ranges),
72162306a36Sopenharmony_ci};
72262306a36Sopenharmony_ci
72362306a36Sopenharmony_cistatic const struct imx_pgc_domain_data imx8m_pgc_domain_data = {
72462306a36Sopenharmony_ci	.domains = imx8m_pgc_domains,
72562306a36Sopenharmony_ci	.domains_num = ARRAY_SIZE(imx8m_pgc_domains),
72662306a36Sopenharmony_ci	.reg_access_table = &imx8m_access_table,
72762306a36Sopenharmony_ci	.pgc_regs = &imx7_pgc_regs,
72862306a36Sopenharmony_ci};
72962306a36Sopenharmony_ci
73062306a36Sopenharmony_cistatic const struct imx_pgc_domain imx8mm_pgc_domains[] = {
73162306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_HSIOMIX] = {
73262306a36Sopenharmony_ci		.genpd = {
73362306a36Sopenharmony_ci			.name = "hsiomix",
73462306a36Sopenharmony_ci		},
73562306a36Sopenharmony_ci		.bits  = {
73662306a36Sopenharmony_ci			.pxx = 0, /* no power sequence control */
73762306a36Sopenharmony_ci			.map = 0, /* no power sequence control */
73862306a36Sopenharmony_ci			.hskreq = IMX8MM_HSIO_HSK_PWRDNREQN,
73962306a36Sopenharmony_ci			.hskack = IMX8MM_HSIO_HSK_PWRDNACKN,
74062306a36Sopenharmony_ci		},
74162306a36Sopenharmony_ci		.keep_clocks = true,
74262306a36Sopenharmony_ci	},
74362306a36Sopenharmony_ci
74462306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_PCIE] = {
74562306a36Sopenharmony_ci		.genpd = {
74662306a36Sopenharmony_ci			.name = "pcie",
74762306a36Sopenharmony_ci		},
74862306a36Sopenharmony_ci		.bits  = {
74962306a36Sopenharmony_ci			.pxx = IMX8MM_PCIE_SW_Pxx_REQ,
75062306a36Sopenharmony_ci			.map = IMX8MM_PCIE_A53_DOMAIN,
75162306a36Sopenharmony_ci		},
75262306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_PCIE),
75362306a36Sopenharmony_ci	},
75462306a36Sopenharmony_ci
75562306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_OTG1] = {
75662306a36Sopenharmony_ci		.genpd = {
75762306a36Sopenharmony_ci			.name = "usb-otg1",
75862306a36Sopenharmony_ci			.flags = GENPD_FLAG_ACTIVE_WAKEUP,
75962306a36Sopenharmony_ci		},
76062306a36Sopenharmony_ci		.bits  = {
76162306a36Sopenharmony_ci			.pxx = IMX8MM_OTG1_SW_Pxx_REQ,
76262306a36Sopenharmony_ci			.map = IMX8MM_OTG1_A53_DOMAIN,
76362306a36Sopenharmony_ci		},
76462306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_OTG1),
76562306a36Sopenharmony_ci	},
76662306a36Sopenharmony_ci
76762306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_OTG2] = {
76862306a36Sopenharmony_ci		.genpd = {
76962306a36Sopenharmony_ci			.name = "usb-otg2",
77062306a36Sopenharmony_ci			.flags = GENPD_FLAG_ACTIVE_WAKEUP,
77162306a36Sopenharmony_ci		},
77262306a36Sopenharmony_ci		.bits  = {
77362306a36Sopenharmony_ci			.pxx = IMX8MM_OTG2_SW_Pxx_REQ,
77462306a36Sopenharmony_ci			.map = IMX8MM_OTG2_A53_DOMAIN,
77562306a36Sopenharmony_ci		},
77662306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_OTG2),
77762306a36Sopenharmony_ci	},
77862306a36Sopenharmony_ci
77962306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_GPUMIX] = {
78062306a36Sopenharmony_ci		.genpd = {
78162306a36Sopenharmony_ci			.name = "gpumix",
78262306a36Sopenharmony_ci		},
78362306a36Sopenharmony_ci		.bits  = {
78462306a36Sopenharmony_ci			.pxx = IMX8MM_GPUMIX_SW_Pxx_REQ,
78562306a36Sopenharmony_ci			.map = IMX8MM_GPUMIX_A53_DOMAIN,
78662306a36Sopenharmony_ci			.hskreq = IMX8MM_GPUMIX_HSK_PWRDNREQN,
78762306a36Sopenharmony_ci			.hskack = IMX8MM_GPUMIX_HSK_PWRDNACKN,
78862306a36Sopenharmony_ci		},
78962306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_GPUMIX),
79062306a36Sopenharmony_ci		.keep_clocks = true,
79162306a36Sopenharmony_ci	},
79262306a36Sopenharmony_ci
79362306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_GPU] = {
79462306a36Sopenharmony_ci		.genpd = {
79562306a36Sopenharmony_ci			.name = "gpu",
79662306a36Sopenharmony_ci		},
79762306a36Sopenharmony_ci		.bits  = {
79862306a36Sopenharmony_ci			.pxx = IMX8MM_GPU_SW_Pxx_REQ,
79962306a36Sopenharmony_ci			.map = IMX8MM_GPU_A53_DOMAIN,
80062306a36Sopenharmony_ci			.hskreq = IMX8MM_GPU_HSK_PWRDNREQN,
80162306a36Sopenharmony_ci			.hskack = IMX8MM_GPU_HSK_PWRDNACKN,
80262306a36Sopenharmony_ci		},
80362306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_GPU2D) | BIT(IMX8MM_PGC_GPU3D),
80462306a36Sopenharmony_ci	},
80562306a36Sopenharmony_ci
80662306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_VPUMIX] = {
80762306a36Sopenharmony_ci		.genpd = {
80862306a36Sopenharmony_ci			.name = "vpumix",
80962306a36Sopenharmony_ci		},
81062306a36Sopenharmony_ci		.bits  = {
81162306a36Sopenharmony_ci			.pxx = IMX8MM_VPUMIX_SW_Pxx_REQ,
81262306a36Sopenharmony_ci			.map = IMX8MM_VPUMIX_A53_DOMAIN,
81362306a36Sopenharmony_ci			.hskreq = IMX8MM_VPUMIX_HSK_PWRDNREQN,
81462306a36Sopenharmony_ci			.hskack = IMX8MM_VPUMIX_HSK_PWRDNACKN,
81562306a36Sopenharmony_ci		},
81662306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_VPUMIX),
81762306a36Sopenharmony_ci		.keep_clocks = true,
81862306a36Sopenharmony_ci	},
81962306a36Sopenharmony_ci
82062306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_VPUG1] = {
82162306a36Sopenharmony_ci		.genpd = {
82262306a36Sopenharmony_ci			.name = "vpu-g1",
82362306a36Sopenharmony_ci		},
82462306a36Sopenharmony_ci		.bits  = {
82562306a36Sopenharmony_ci			.pxx = IMX8MM_VPUG1_SW_Pxx_REQ,
82662306a36Sopenharmony_ci			.map = IMX8MM_VPUG1_A53_DOMAIN,
82762306a36Sopenharmony_ci		},
82862306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_VPUG1),
82962306a36Sopenharmony_ci	},
83062306a36Sopenharmony_ci
83162306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_VPUG2] = {
83262306a36Sopenharmony_ci		.genpd = {
83362306a36Sopenharmony_ci			.name = "vpu-g2",
83462306a36Sopenharmony_ci		},
83562306a36Sopenharmony_ci		.bits  = {
83662306a36Sopenharmony_ci			.pxx = IMX8MM_VPUG2_SW_Pxx_REQ,
83762306a36Sopenharmony_ci			.map = IMX8MM_VPUG2_A53_DOMAIN,
83862306a36Sopenharmony_ci		},
83962306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_VPUG2),
84062306a36Sopenharmony_ci	},
84162306a36Sopenharmony_ci
84262306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_VPUH1] = {
84362306a36Sopenharmony_ci		.genpd = {
84462306a36Sopenharmony_ci			.name = "vpu-h1",
84562306a36Sopenharmony_ci		},
84662306a36Sopenharmony_ci		.bits  = {
84762306a36Sopenharmony_ci			.pxx = IMX8MM_VPUH1_SW_Pxx_REQ,
84862306a36Sopenharmony_ci			.map = IMX8MM_VPUH1_A53_DOMAIN,
84962306a36Sopenharmony_ci		},
85062306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_VPUH1),
85162306a36Sopenharmony_ci		.keep_clocks = true,
85262306a36Sopenharmony_ci	},
85362306a36Sopenharmony_ci
85462306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_DISPMIX] = {
85562306a36Sopenharmony_ci		.genpd = {
85662306a36Sopenharmony_ci			.name = "dispmix",
85762306a36Sopenharmony_ci		},
85862306a36Sopenharmony_ci		.bits  = {
85962306a36Sopenharmony_ci			.pxx = IMX8MM_DISPMIX_SW_Pxx_REQ,
86062306a36Sopenharmony_ci			.map = IMX8MM_DISPMIX_A53_DOMAIN,
86162306a36Sopenharmony_ci			.hskreq = IMX8MM_DISPMIX_HSK_PWRDNREQN,
86262306a36Sopenharmony_ci			.hskack = IMX8MM_DISPMIX_HSK_PWRDNACKN,
86362306a36Sopenharmony_ci		},
86462306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_DISPMIX),
86562306a36Sopenharmony_ci		.keep_clocks = true,
86662306a36Sopenharmony_ci	},
86762306a36Sopenharmony_ci
86862306a36Sopenharmony_ci	[IMX8MM_POWER_DOMAIN_MIPI] = {
86962306a36Sopenharmony_ci		.genpd = {
87062306a36Sopenharmony_ci			.name = "mipi",
87162306a36Sopenharmony_ci		},
87262306a36Sopenharmony_ci		.bits  = {
87362306a36Sopenharmony_ci			.pxx = IMX8MM_MIPI_SW_Pxx_REQ,
87462306a36Sopenharmony_ci			.map = IMX8MM_MIPI_A53_DOMAIN,
87562306a36Sopenharmony_ci		},
87662306a36Sopenharmony_ci		.pgc   = BIT(IMX8MM_PGC_MIPI),
87762306a36Sopenharmony_ci	},
87862306a36Sopenharmony_ci};
87962306a36Sopenharmony_ci
88062306a36Sopenharmony_cistatic const struct regmap_range imx8mm_yes_ranges[] = {
88162306a36Sopenharmony_ci		regmap_reg_range(GPC_LPCR_A_CORE_BSC,
88262306a36Sopenharmony_ci				 GPC_PU_PWRHSK),
88362306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_MIPI),
88462306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_MIPI)),
88562306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_PCIE),
88662306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_PCIE)),
88762306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_OTG1),
88862306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_OTG1)),
88962306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_OTG2),
89062306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_OTG2)),
89162306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_DDR1),
89262306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_DDR1)),
89362306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPU2D),
89462306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_GPU2D)),
89562306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPUMIX),
89662306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_GPUMIX)),
89762306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUMIX),
89862306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_VPUMIX)),
89962306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPU3D),
90062306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_GPU3D)),
90162306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_DISPMIX),
90262306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_DISPMIX)),
90362306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUG1),
90462306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_VPUG1)),
90562306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUG2),
90662306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_VPUG2)),
90762306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUH1),
90862306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MM_PGC_VPUH1)),
90962306a36Sopenharmony_ci};
91062306a36Sopenharmony_ci
91162306a36Sopenharmony_cistatic const struct regmap_access_table imx8mm_access_table = {
91262306a36Sopenharmony_ci	.yes_ranges	= imx8mm_yes_ranges,
91362306a36Sopenharmony_ci	.n_yes_ranges	= ARRAY_SIZE(imx8mm_yes_ranges),
91462306a36Sopenharmony_ci};
91562306a36Sopenharmony_ci
91662306a36Sopenharmony_cistatic const struct imx_pgc_domain_data imx8mm_pgc_domain_data = {
91762306a36Sopenharmony_ci	.domains = imx8mm_pgc_domains,
91862306a36Sopenharmony_ci	.domains_num = ARRAY_SIZE(imx8mm_pgc_domains),
91962306a36Sopenharmony_ci	.reg_access_table = &imx8mm_access_table,
92062306a36Sopenharmony_ci	.pgc_regs = &imx7_pgc_regs,
92162306a36Sopenharmony_ci};
92262306a36Sopenharmony_ci
92362306a36Sopenharmony_cistatic const struct imx_pgc_domain imx8mp_pgc_domains[] = {
92462306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_MIPI_PHY1] = {
92562306a36Sopenharmony_ci		.genpd = {
92662306a36Sopenharmony_ci			.name = "mipi-phy1",
92762306a36Sopenharmony_ci		},
92862306a36Sopenharmony_ci		.bits = {
92962306a36Sopenharmony_ci			.pxx = IMX8MP_MIPI_PHY1_SW_Pxx_REQ,
93062306a36Sopenharmony_ci			.map = IMX8MP_MIPI_PHY1_A53_DOMAIN,
93162306a36Sopenharmony_ci		},
93262306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_MIPI1),
93362306a36Sopenharmony_ci	},
93462306a36Sopenharmony_ci
93562306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_PCIE_PHY] = {
93662306a36Sopenharmony_ci		.genpd = {
93762306a36Sopenharmony_ci			.name = "pcie-phy1",
93862306a36Sopenharmony_ci		},
93962306a36Sopenharmony_ci		.bits = {
94062306a36Sopenharmony_ci			.pxx = IMX8MP_PCIE_PHY_SW_Pxx_REQ,
94162306a36Sopenharmony_ci			.map = IMX8MP_PCIE_PHY_A53_DOMAIN,
94262306a36Sopenharmony_ci		},
94362306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_PCIE),
94462306a36Sopenharmony_ci	},
94562306a36Sopenharmony_ci
94662306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_USB1_PHY] = {
94762306a36Sopenharmony_ci		.genpd = {
94862306a36Sopenharmony_ci			.name = "usb-otg1",
94962306a36Sopenharmony_ci		},
95062306a36Sopenharmony_ci		.bits = {
95162306a36Sopenharmony_ci			.pxx = IMX8MP_USB1_PHY_Pxx_REQ,
95262306a36Sopenharmony_ci			.map = IMX8MP_USB1_PHY_A53_DOMAIN,
95362306a36Sopenharmony_ci		},
95462306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_USB1),
95562306a36Sopenharmony_ci	},
95662306a36Sopenharmony_ci
95762306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_USB2_PHY] = {
95862306a36Sopenharmony_ci		.genpd = {
95962306a36Sopenharmony_ci			.name = "usb-otg2",
96062306a36Sopenharmony_ci		},
96162306a36Sopenharmony_ci		.bits = {
96262306a36Sopenharmony_ci			.pxx = IMX8MP_USB2_PHY_Pxx_REQ,
96362306a36Sopenharmony_ci			.map = IMX8MP_USB2_PHY_A53_DOMAIN,
96462306a36Sopenharmony_ci		},
96562306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_USB2),
96662306a36Sopenharmony_ci	},
96762306a36Sopenharmony_ci
96862306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_MLMIX] = {
96962306a36Sopenharmony_ci		.genpd = {
97062306a36Sopenharmony_ci			.name = "mlmix",
97162306a36Sopenharmony_ci		},
97262306a36Sopenharmony_ci		.bits = {
97362306a36Sopenharmony_ci			.pxx = IMX8MP_MLMIX_Pxx_REQ,
97462306a36Sopenharmony_ci			.map = IMX8MP_MLMIX_A53_DOMAIN,
97562306a36Sopenharmony_ci			.hskreq = IMX8MP_MLMIX_PWRDNREQN,
97662306a36Sopenharmony_ci			.hskack = IMX8MP_MLMIX_PWRDNACKN,
97762306a36Sopenharmony_ci		},
97862306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_MLMIX),
97962306a36Sopenharmony_ci		.keep_clocks = true,
98062306a36Sopenharmony_ci	},
98162306a36Sopenharmony_ci
98262306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_AUDIOMIX] = {
98362306a36Sopenharmony_ci		.genpd = {
98462306a36Sopenharmony_ci			.name = "audiomix",
98562306a36Sopenharmony_ci		},
98662306a36Sopenharmony_ci		.bits = {
98762306a36Sopenharmony_ci			.pxx = IMX8MP_AUDIOMIX_Pxx_REQ,
98862306a36Sopenharmony_ci			.map = IMX8MP_AUDIOMIX_A53_DOMAIN,
98962306a36Sopenharmony_ci			.hskreq = IMX8MP_AUDIOMIX_PWRDNREQN,
99062306a36Sopenharmony_ci			.hskack = IMX8MP_AUDIOMIX_PWRDNACKN,
99162306a36Sopenharmony_ci		},
99262306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_AUDIOMIX),
99362306a36Sopenharmony_ci		.keep_clocks = true,
99462306a36Sopenharmony_ci	},
99562306a36Sopenharmony_ci
99662306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_GPU2D] = {
99762306a36Sopenharmony_ci		.genpd = {
99862306a36Sopenharmony_ci			.name = "gpu2d",
99962306a36Sopenharmony_ci		},
100062306a36Sopenharmony_ci		.bits = {
100162306a36Sopenharmony_ci			.pxx = IMX8MP_GPU_2D_Pxx_REQ,
100262306a36Sopenharmony_ci			.map = IMX8MP_GPU2D_A53_DOMAIN,
100362306a36Sopenharmony_ci		},
100462306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_GPU2D),
100562306a36Sopenharmony_ci	},
100662306a36Sopenharmony_ci
100762306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_GPUMIX] = {
100862306a36Sopenharmony_ci		.genpd = {
100962306a36Sopenharmony_ci			.name = "gpumix",
101062306a36Sopenharmony_ci		},
101162306a36Sopenharmony_ci		.bits = {
101262306a36Sopenharmony_ci			.pxx = IMX8MP_GPU_SHARE_LOGIC_Pxx_REQ,
101362306a36Sopenharmony_ci			.map = IMX8MP_GPUMIX_A53_DOMAIN,
101462306a36Sopenharmony_ci			.hskreq = IMX8MP_GPUMIX_PWRDNREQN,
101562306a36Sopenharmony_ci			.hskack = IMX8MP_GPUMIX_PWRDNACKN,
101662306a36Sopenharmony_ci		},
101762306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_GPUMIX),
101862306a36Sopenharmony_ci		.keep_clocks = true,
101962306a36Sopenharmony_ci	},
102062306a36Sopenharmony_ci
102162306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_VPUMIX] = {
102262306a36Sopenharmony_ci		.genpd = {
102362306a36Sopenharmony_ci			.name = "vpumix",
102462306a36Sopenharmony_ci		},
102562306a36Sopenharmony_ci		.bits = {
102662306a36Sopenharmony_ci			.pxx = IMX8MP_VPU_MIX_SHARE_LOGIC_Pxx_REQ,
102762306a36Sopenharmony_ci			.map = IMX8MP_VPUMIX_A53_DOMAIN,
102862306a36Sopenharmony_ci			.hskreq = IMX8MP_VPUMIX_PWRDNREQN,
102962306a36Sopenharmony_ci			.hskack = IMX8MP_VPUMIX_PWRDNACKN,
103062306a36Sopenharmony_ci		},
103162306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_VPUMIX),
103262306a36Sopenharmony_ci		.keep_clocks = true,
103362306a36Sopenharmony_ci	},
103462306a36Sopenharmony_ci
103562306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_GPU3D] = {
103662306a36Sopenharmony_ci		.genpd = {
103762306a36Sopenharmony_ci			.name = "gpu3d",
103862306a36Sopenharmony_ci		},
103962306a36Sopenharmony_ci		.bits = {
104062306a36Sopenharmony_ci			.pxx = IMX8MP_GPU_3D_Pxx_REQ,
104162306a36Sopenharmony_ci			.map = IMX8MP_GPU3D_A53_DOMAIN,
104262306a36Sopenharmony_ci		},
104362306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_GPU3D),
104462306a36Sopenharmony_ci	},
104562306a36Sopenharmony_ci
104662306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_MEDIAMIX] = {
104762306a36Sopenharmony_ci		.genpd = {
104862306a36Sopenharmony_ci			.name = "mediamix",
104962306a36Sopenharmony_ci		},
105062306a36Sopenharmony_ci		.bits = {
105162306a36Sopenharmony_ci			.pxx = IMX8MP_MEDIMIX_Pxx_REQ,
105262306a36Sopenharmony_ci			.map = IMX8MP_MEDIAMIX_A53_DOMAIN,
105362306a36Sopenharmony_ci			.hskreq = IMX8MP_MEDIAMIX_PWRDNREQN,
105462306a36Sopenharmony_ci			.hskack = IMX8MP_MEDIAMIX_PWRDNACKN,
105562306a36Sopenharmony_ci		},
105662306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_MEDIAMIX),
105762306a36Sopenharmony_ci		.keep_clocks = true,
105862306a36Sopenharmony_ci	},
105962306a36Sopenharmony_ci
106062306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_VPU_G1] = {
106162306a36Sopenharmony_ci		.genpd = {
106262306a36Sopenharmony_ci			.name = "vpu-g1",
106362306a36Sopenharmony_ci		},
106462306a36Sopenharmony_ci		.bits = {
106562306a36Sopenharmony_ci			.pxx = IMX8MP_VPU_G1_Pxx_REQ,
106662306a36Sopenharmony_ci			.map = IMX8MP_VPU_G1_A53_DOMAIN,
106762306a36Sopenharmony_ci		},
106862306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_VPU_G1),
106962306a36Sopenharmony_ci	},
107062306a36Sopenharmony_ci
107162306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_VPU_G2] = {
107262306a36Sopenharmony_ci		.genpd = {
107362306a36Sopenharmony_ci			.name = "vpu-g2",
107462306a36Sopenharmony_ci		},
107562306a36Sopenharmony_ci		.bits = {
107662306a36Sopenharmony_ci			.pxx = IMX8MP_VPU_G2_Pxx_REQ,
107762306a36Sopenharmony_ci			.map = IMX8MP_VPU_G2_A53_DOMAIN
107862306a36Sopenharmony_ci		},
107962306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_VPU_G2),
108062306a36Sopenharmony_ci	},
108162306a36Sopenharmony_ci
108262306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_VPU_VC8000E] = {
108362306a36Sopenharmony_ci		.genpd = {
108462306a36Sopenharmony_ci			.name = "vpu-h1",
108562306a36Sopenharmony_ci		},
108662306a36Sopenharmony_ci		.bits = {
108762306a36Sopenharmony_ci			.pxx = IMX8MP_VPU_VC8K_Pxx_REQ,
108862306a36Sopenharmony_ci			.map = IMX8MP_VPU_VC8000E_A53_DOMAIN,
108962306a36Sopenharmony_ci		},
109062306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_VPU_VC8000E),
109162306a36Sopenharmony_ci	},
109262306a36Sopenharmony_ci
109362306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_HDMIMIX] = {
109462306a36Sopenharmony_ci		.genpd = {
109562306a36Sopenharmony_ci			.name = "hdmimix",
109662306a36Sopenharmony_ci		},
109762306a36Sopenharmony_ci		.bits = {
109862306a36Sopenharmony_ci			.pxx = IMX8MP_HDMIMIX_Pxx_REQ,
109962306a36Sopenharmony_ci			.map = IMX8MP_HDMIMIX_A53_DOMAIN,
110062306a36Sopenharmony_ci			.hskreq = IMX8MP_HDMIMIX_PWRDNREQN,
110162306a36Sopenharmony_ci			.hskack = IMX8MP_HDMIMIX_PWRDNACKN,
110262306a36Sopenharmony_ci		},
110362306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_HDMIMIX),
110462306a36Sopenharmony_ci		.keep_clocks = true,
110562306a36Sopenharmony_ci	},
110662306a36Sopenharmony_ci
110762306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_HDMI_PHY] = {
110862306a36Sopenharmony_ci		.genpd = {
110962306a36Sopenharmony_ci			.name = "hdmi-phy",
111062306a36Sopenharmony_ci		},
111162306a36Sopenharmony_ci		.bits = {
111262306a36Sopenharmony_ci			.pxx = IMX8MP_HDMI_PHY_Pxx_REQ,
111362306a36Sopenharmony_ci			.map = IMX8MP_HDMI_PHY_A53_DOMAIN,
111462306a36Sopenharmony_ci		},
111562306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_HDMI),
111662306a36Sopenharmony_ci	},
111762306a36Sopenharmony_ci
111862306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_MIPI_PHY2] = {
111962306a36Sopenharmony_ci		.genpd = {
112062306a36Sopenharmony_ci			.name = "mipi-phy2",
112162306a36Sopenharmony_ci		},
112262306a36Sopenharmony_ci		.bits = {
112362306a36Sopenharmony_ci			.pxx = IMX8MP_MIPI_PHY2_Pxx_REQ,
112462306a36Sopenharmony_ci			.map = IMX8MP_MIPI_PHY2_A53_DOMAIN,
112562306a36Sopenharmony_ci		},
112662306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_MIPI2),
112762306a36Sopenharmony_ci	},
112862306a36Sopenharmony_ci
112962306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_HSIOMIX] = {
113062306a36Sopenharmony_ci		.genpd = {
113162306a36Sopenharmony_ci			.name = "hsiomix",
113262306a36Sopenharmony_ci		},
113362306a36Sopenharmony_ci		.bits = {
113462306a36Sopenharmony_ci			.pxx = IMX8MP_HSIOMIX_Pxx_REQ,
113562306a36Sopenharmony_ci			.map = IMX8MP_HSIOMIX_A53_DOMAIN,
113662306a36Sopenharmony_ci			.hskreq = IMX8MP_HSIOMIX_PWRDNREQN,
113762306a36Sopenharmony_ci			.hskack = IMX8MP_HSIOMIX_PWRDNACKN,
113862306a36Sopenharmony_ci		},
113962306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_HSIOMIX),
114062306a36Sopenharmony_ci		.keep_clocks = true,
114162306a36Sopenharmony_ci	},
114262306a36Sopenharmony_ci
114362306a36Sopenharmony_ci	[IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP] = {
114462306a36Sopenharmony_ci		.genpd = {
114562306a36Sopenharmony_ci			.name = "mediamix-isp-dwp",
114662306a36Sopenharmony_ci		},
114762306a36Sopenharmony_ci		.bits = {
114862306a36Sopenharmony_ci			.pxx = IMX8MP_MEDIA_ISP_DWP_Pxx_REQ,
114962306a36Sopenharmony_ci			.map = IMX8MP_MEDIA_ISPDWP_A53_DOMAIN,
115062306a36Sopenharmony_ci		},
115162306a36Sopenharmony_ci		.pgc = BIT(IMX8MP_PGC_MEDIA_ISP_DWP),
115262306a36Sopenharmony_ci	},
115362306a36Sopenharmony_ci};
115462306a36Sopenharmony_ci
115562306a36Sopenharmony_cistatic const struct regmap_range imx8mp_yes_ranges[] = {
115662306a36Sopenharmony_ci		regmap_reg_range(GPC_LPCR_A_CORE_BSC,
115762306a36Sopenharmony_ci				 IMX8MP_GPC_PGC_CPU_MAPPING),
115862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_NOC),
115962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_NOC)),
116062306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_MIPI1),
116162306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_MIPI1)),
116262306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_PCIE),
116362306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_PCIE)),
116462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_USB1),
116562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_USB1)),
116662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_USB2),
116762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_USB2)),
116862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_MLMIX),
116962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_MLMIX)),
117062306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_AUDIOMIX),
117162306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_AUDIOMIX)),
117262306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_GPU2D),
117362306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_GPU2D)),
117462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_GPUMIX),
117562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_GPUMIX)),
117662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_VPUMIX),
117762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_VPUMIX)),
117862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_GPU3D),
117962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_GPU3D)),
118062306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_MEDIAMIX),
118162306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_MEDIAMIX)),
118262306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_VPU_G1),
118362306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_VPU_G1)),
118462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_VPU_G2),
118562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_VPU_G2)),
118662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_VPU_VC8000E),
118762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_VPU_VC8000E)),
118862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_HDMIMIX),
118962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_HDMIMIX)),
119062306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_HDMI),
119162306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_HDMI)),
119262306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_MIPI2),
119362306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_MIPI2)),
119462306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_HSIOMIX),
119562306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_HSIOMIX)),
119662306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_MEDIA_ISP_DWP),
119762306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_MEDIA_ISP_DWP)),
119862306a36Sopenharmony_ci		regmap_reg_range(GPC_PGC_CTRL(IMX8MP_PGC_DDRMIX),
119962306a36Sopenharmony_ci				 GPC_PGC_SR(IMX8MP_PGC_DDRMIX)),
120062306a36Sopenharmony_ci};
120162306a36Sopenharmony_ci
120262306a36Sopenharmony_cistatic const struct regmap_access_table imx8mp_access_table = {
120362306a36Sopenharmony_ci	.yes_ranges	= imx8mp_yes_ranges,
120462306a36Sopenharmony_ci	.n_yes_ranges	= ARRAY_SIZE(imx8mp_yes_ranges),
120562306a36Sopenharmony_ci};
120662306a36Sopenharmony_ci
120762306a36Sopenharmony_cistatic const struct imx_pgc_regs imx8mp_pgc_regs = {
120862306a36Sopenharmony_ci	.map = IMX8MP_GPC_PGC_CPU_MAPPING,
120962306a36Sopenharmony_ci	.pup = IMX8MP_GPC_PU_PGC_SW_PUP_REQ,
121062306a36Sopenharmony_ci	.pdn = IMX8MP_GPC_PU_PGC_SW_PDN_REQ,
121162306a36Sopenharmony_ci	.hsk = IMX8MP_GPC_PU_PWRHSK,
121262306a36Sopenharmony_ci};
121362306a36Sopenharmony_cistatic const struct imx_pgc_domain_data imx8mp_pgc_domain_data = {
121462306a36Sopenharmony_ci	.domains = imx8mp_pgc_domains,
121562306a36Sopenharmony_ci	.domains_num = ARRAY_SIZE(imx8mp_pgc_domains),
121662306a36Sopenharmony_ci	.reg_access_table = &imx8mp_access_table,
121762306a36Sopenharmony_ci	.pgc_regs = &imx8mp_pgc_regs,
121862306a36Sopenharmony_ci};
121962306a36Sopenharmony_ci
122062306a36Sopenharmony_cistatic const struct imx_pgc_domain imx8mn_pgc_domains[] = {
122162306a36Sopenharmony_ci	[IMX8MN_POWER_DOMAIN_HSIOMIX] = {
122262306a36Sopenharmony_ci		.genpd = {
122362306a36Sopenharmony_ci			.name = "hsiomix",
122462306a36Sopenharmony_ci		},
122562306a36Sopenharmony_ci		.bits  = {
122662306a36Sopenharmony_ci			.pxx = 0, /* no power sequence control */
122762306a36Sopenharmony_ci			.map = 0, /* no power sequence control */
122862306a36Sopenharmony_ci			.hskreq = IMX8MN_HSIO_HSK_PWRDNREQN,
122962306a36Sopenharmony_ci			.hskack = IMX8MN_HSIO_HSK_PWRDNACKN,
123062306a36Sopenharmony_ci		},
123162306a36Sopenharmony_ci		.keep_clocks = true,
123262306a36Sopenharmony_ci	},
123362306a36Sopenharmony_ci
123462306a36Sopenharmony_ci	[IMX8MN_POWER_DOMAIN_OTG1] = {
123562306a36Sopenharmony_ci		.genpd = {
123662306a36Sopenharmony_ci			.name = "usb-otg1",
123762306a36Sopenharmony_ci			.flags = GENPD_FLAG_ACTIVE_WAKEUP,
123862306a36Sopenharmony_ci		},
123962306a36Sopenharmony_ci		.bits  = {
124062306a36Sopenharmony_ci			.pxx = IMX8MN_OTG1_SW_Pxx_REQ,
124162306a36Sopenharmony_ci			.map = IMX8MN_OTG1_A53_DOMAIN,
124262306a36Sopenharmony_ci		},
124362306a36Sopenharmony_ci		.pgc   = BIT(IMX8MN_PGC_OTG1),
124462306a36Sopenharmony_ci	},
124562306a36Sopenharmony_ci
124662306a36Sopenharmony_ci	[IMX8MN_POWER_DOMAIN_GPUMIX] = {
124762306a36Sopenharmony_ci		.genpd = {
124862306a36Sopenharmony_ci			.name = "gpumix",
124962306a36Sopenharmony_ci		},
125062306a36Sopenharmony_ci		.bits  = {
125162306a36Sopenharmony_ci			.pxx = IMX8MN_GPUMIX_SW_Pxx_REQ,
125262306a36Sopenharmony_ci			.map = IMX8MN_GPUMIX_A53_DOMAIN,
125362306a36Sopenharmony_ci			.hskreq = IMX8MN_GPUMIX_HSK_PWRDNREQN,
125462306a36Sopenharmony_ci			.hskack = IMX8MN_GPUMIX_HSK_PWRDNACKN,
125562306a36Sopenharmony_ci		},
125662306a36Sopenharmony_ci		.pgc   = BIT(IMX8MN_PGC_GPUMIX),
125762306a36Sopenharmony_ci		.keep_clocks = true,
125862306a36Sopenharmony_ci	},
125962306a36Sopenharmony_ci
126062306a36Sopenharmony_ci	[IMX8MN_POWER_DOMAIN_DISPMIX] = {
126162306a36Sopenharmony_ci		.genpd = {
126262306a36Sopenharmony_ci			.name = "dispmix",
126362306a36Sopenharmony_ci		},
126462306a36Sopenharmony_ci			.bits  = {
126562306a36Sopenharmony_ci			.pxx = IMX8MN_DISPMIX_SW_Pxx_REQ,
126662306a36Sopenharmony_ci			.map = IMX8MN_DISPMIX_A53_DOMAIN,
126762306a36Sopenharmony_ci			.hskreq = IMX8MN_DISPMIX_HSK_PWRDNREQN,
126862306a36Sopenharmony_ci			.hskack = IMX8MN_DISPMIX_HSK_PWRDNACKN,
126962306a36Sopenharmony_ci		},
127062306a36Sopenharmony_ci		.pgc   = BIT(IMX8MN_PGC_DISPMIX),
127162306a36Sopenharmony_ci		.keep_clocks = true,
127262306a36Sopenharmony_ci	},
127362306a36Sopenharmony_ci
127462306a36Sopenharmony_ci	[IMX8MN_POWER_DOMAIN_MIPI] = {
127562306a36Sopenharmony_ci		.genpd = {
127662306a36Sopenharmony_ci			.name = "mipi",
127762306a36Sopenharmony_ci		},
127862306a36Sopenharmony_ci			.bits  = {
127962306a36Sopenharmony_ci			.pxx = IMX8MN_MIPI_SW_Pxx_REQ,
128062306a36Sopenharmony_ci			.map = IMX8MN_MIPI_A53_DOMAIN,
128162306a36Sopenharmony_ci		},
128262306a36Sopenharmony_ci		.pgc   = BIT(IMX8MN_PGC_MIPI),
128362306a36Sopenharmony_ci	},
128462306a36Sopenharmony_ci};
128562306a36Sopenharmony_ci
128662306a36Sopenharmony_cistatic const struct regmap_range imx8mn_yes_ranges[] = {
128762306a36Sopenharmony_ci	regmap_reg_range(GPC_LPCR_A_CORE_BSC,
128862306a36Sopenharmony_ci			 GPC_PU_PWRHSK),
128962306a36Sopenharmony_ci	regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_MIPI),
129062306a36Sopenharmony_ci			 GPC_PGC_SR(IMX8MN_PGC_MIPI)),
129162306a36Sopenharmony_ci	regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_OTG1),
129262306a36Sopenharmony_ci			 GPC_PGC_SR(IMX8MN_PGC_OTG1)),
129362306a36Sopenharmony_ci	regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_DDR1),
129462306a36Sopenharmony_ci			 GPC_PGC_SR(IMX8MN_PGC_DDR1)),
129562306a36Sopenharmony_ci	regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_GPUMIX),
129662306a36Sopenharmony_ci			 GPC_PGC_SR(IMX8MN_PGC_GPUMIX)),
129762306a36Sopenharmony_ci	regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_DISPMIX),
129862306a36Sopenharmony_ci			 GPC_PGC_SR(IMX8MN_PGC_DISPMIX)),
129962306a36Sopenharmony_ci};
130062306a36Sopenharmony_ci
130162306a36Sopenharmony_cistatic const struct regmap_access_table imx8mn_access_table = {
130262306a36Sopenharmony_ci	.yes_ranges	= imx8mn_yes_ranges,
130362306a36Sopenharmony_ci	.n_yes_ranges	= ARRAY_SIZE(imx8mn_yes_ranges),
130462306a36Sopenharmony_ci};
130562306a36Sopenharmony_ci
130662306a36Sopenharmony_cistatic const struct imx_pgc_domain_data imx8mn_pgc_domain_data = {
130762306a36Sopenharmony_ci	.domains = imx8mn_pgc_domains,
130862306a36Sopenharmony_ci	.domains_num = ARRAY_SIZE(imx8mn_pgc_domains),
130962306a36Sopenharmony_ci	.reg_access_table = &imx8mn_access_table,
131062306a36Sopenharmony_ci	.pgc_regs = &imx7_pgc_regs,
131162306a36Sopenharmony_ci};
131262306a36Sopenharmony_ci
131362306a36Sopenharmony_cistatic int imx_pgc_domain_probe(struct platform_device *pdev)
131462306a36Sopenharmony_ci{
131562306a36Sopenharmony_ci	struct imx_pgc_domain *domain = pdev->dev.platform_data;
131662306a36Sopenharmony_ci	int ret;
131762306a36Sopenharmony_ci
131862306a36Sopenharmony_ci	domain->dev = &pdev->dev;
131962306a36Sopenharmony_ci
132062306a36Sopenharmony_ci	domain->regulator = devm_regulator_get_optional(domain->dev, "power");
132162306a36Sopenharmony_ci	if (IS_ERR(domain->regulator)) {
132262306a36Sopenharmony_ci		if (PTR_ERR(domain->regulator) != -ENODEV)
132362306a36Sopenharmony_ci			return dev_err_probe(domain->dev, PTR_ERR(domain->regulator),
132462306a36Sopenharmony_ci					     "Failed to get domain's regulator\n");
132562306a36Sopenharmony_ci	} else if (domain->voltage) {
132662306a36Sopenharmony_ci		regulator_set_voltage(domain->regulator,
132762306a36Sopenharmony_ci				      domain->voltage, domain->voltage);
132862306a36Sopenharmony_ci	}
132962306a36Sopenharmony_ci
133062306a36Sopenharmony_ci	domain->num_clks = devm_clk_bulk_get_all(domain->dev, &domain->clks);
133162306a36Sopenharmony_ci	if (domain->num_clks < 0)
133262306a36Sopenharmony_ci		return dev_err_probe(domain->dev, domain->num_clks,
133362306a36Sopenharmony_ci				     "Failed to get domain's clocks\n");
133462306a36Sopenharmony_ci
133562306a36Sopenharmony_ci	domain->reset = devm_reset_control_array_get_optional_exclusive(domain->dev);
133662306a36Sopenharmony_ci	if (IS_ERR(domain->reset))
133762306a36Sopenharmony_ci		return dev_err_probe(domain->dev, PTR_ERR(domain->reset),
133862306a36Sopenharmony_ci				     "Failed to get domain's resets\n");
133962306a36Sopenharmony_ci
134062306a36Sopenharmony_ci	pm_runtime_enable(domain->dev);
134162306a36Sopenharmony_ci
134262306a36Sopenharmony_ci	if (domain->bits.map)
134362306a36Sopenharmony_ci		regmap_update_bits(domain->regmap, domain->regs->map,
134462306a36Sopenharmony_ci				   domain->bits.map, domain->bits.map);
134562306a36Sopenharmony_ci
134662306a36Sopenharmony_ci	ret = pm_genpd_init(&domain->genpd, NULL, true);
134762306a36Sopenharmony_ci	if (ret) {
134862306a36Sopenharmony_ci		dev_err(domain->dev, "Failed to init power domain\n");
134962306a36Sopenharmony_ci		goto out_domain_unmap;
135062306a36Sopenharmony_ci	}
135162306a36Sopenharmony_ci
135262306a36Sopenharmony_ci	if (IS_ENABLED(CONFIG_LOCKDEP) &&
135362306a36Sopenharmony_ci	    of_property_read_bool(domain->dev->of_node, "power-domains"))
135462306a36Sopenharmony_ci		lockdep_set_subclass(&domain->genpd.mlock, 1);
135562306a36Sopenharmony_ci
135662306a36Sopenharmony_ci	ret = of_genpd_add_provider_simple(domain->dev->of_node,
135762306a36Sopenharmony_ci					   &domain->genpd);
135862306a36Sopenharmony_ci	if (ret) {
135962306a36Sopenharmony_ci		dev_err(domain->dev, "Failed to add genpd provider\n");
136062306a36Sopenharmony_ci		goto out_genpd_remove;
136162306a36Sopenharmony_ci	}
136262306a36Sopenharmony_ci
136362306a36Sopenharmony_ci	return 0;
136462306a36Sopenharmony_ci
136562306a36Sopenharmony_ciout_genpd_remove:
136662306a36Sopenharmony_ci	pm_genpd_remove(&domain->genpd);
136762306a36Sopenharmony_ciout_domain_unmap:
136862306a36Sopenharmony_ci	if (domain->bits.map)
136962306a36Sopenharmony_ci		regmap_update_bits(domain->regmap, domain->regs->map,
137062306a36Sopenharmony_ci				   domain->bits.map, 0);
137162306a36Sopenharmony_ci	pm_runtime_disable(domain->dev);
137262306a36Sopenharmony_ci
137362306a36Sopenharmony_ci	return ret;
137462306a36Sopenharmony_ci}
137562306a36Sopenharmony_ci
137662306a36Sopenharmony_cistatic int imx_pgc_domain_remove(struct platform_device *pdev)
137762306a36Sopenharmony_ci{
137862306a36Sopenharmony_ci	struct imx_pgc_domain *domain = pdev->dev.platform_data;
137962306a36Sopenharmony_ci
138062306a36Sopenharmony_ci	of_genpd_del_provider(domain->dev->of_node);
138162306a36Sopenharmony_ci	pm_genpd_remove(&domain->genpd);
138262306a36Sopenharmony_ci
138362306a36Sopenharmony_ci	if (domain->bits.map)
138462306a36Sopenharmony_ci		regmap_update_bits(domain->regmap, domain->regs->map,
138562306a36Sopenharmony_ci				   domain->bits.map, 0);
138662306a36Sopenharmony_ci
138762306a36Sopenharmony_ci	pm_runtime_disable(domain->dev);
138862306a36Sopenharmony_ci
138962306a36Sopenharmony_ci	return 0;
139062306a36Sopenharmony_ci}
139162306a36Sopenharmony_ci
139262306a36Sopenharmony_ci#ifdef CONFIG_PM_SLEEP
139362306a36Sopenharmony_cistatic int imx_pgc_domain_suspend(struct device *dev)
139462306a36Sopenharmony_ci{
139562306a36Sopenharmony_ci	int ret;
139662306a36Sopenharmony_ci
139762306a36Sopenharmony_ci	/*
139862306a36Sopenharmony_ci	 * This may look strange, but is done so the generic PM_SLEEP code
139962306a36Sopenharmony_ci	 * can power down our domain and more importantly power it up again
140062306a36Sopenharmony_ci	 * after resume, without tripping over our usage of runtime PM to
140162306a36Sopenharmony_ci	 * power up/down the nested domains.
140262306a36Sopenharmony_ci	 */
140362306a36Sopenharmony_ci	ret = pm_runtime_get_sync(dev);
140462306a36Sopenharmony_ci	if (ret < 0) {
140562306a36Sopenharmony_ci		pm_runtime_put_noidle(dev);
140662306a36Sopenharmony_ci		return ret;
140762306a36Sopenharmony_ci	}
140862306a36Sopenharmony_ci
140962306a36Sopenharmony_ci	return 0;
141062306a36Sopenharmony_ci}
141162306a36Sopenharmony_ci
141262306a36Sopenharmony_cistatic int imx_pgc_domain_resume(struct device *dev)
141362306a36Sopenharmony_ci{
141462306a36Sopenharmony_ci	return pm_runtime_put(dev);
141562306a36Sopenharmony_ci}
141662306a36Sopenharmony_ci#endif
141762306a36Sopenharmony_ci
141862306a36Sopenharmony_cistatic const struct dev_pm_ops imx_pgc_domain_pm_ops = {
141962306a36Sopenharmony_ci	SET_SYSTEM_SLEEP_PM_OPS(imx_pgc_domain_suspend, imx_pgc_domain_resume)
142062306a36Sopenharmony_ci};
142162306a36Sopenharmony_ci
142262306a36Sopenharmony_cistatic const struct platform_device_id imx_pgc_domain_id[] = {
142362306a36Sopenharmony_ci	{ "imx-pgc-domain", },
142462306a36Sopenharmony_ci	{ },
142562306a36Sopenharmony_ci};
142662306a36Sopenharmony_ci
142762306a36Sopenharmony_cistatic struct platform_driver imx_pgc_domain_driver = {
142862306a36Sopenharmony_ci	.driver = {
142962306a36Sopenharmony_ci		.name = "imx-pgc",
143062306a36Sopenharmony_ci		.pm = &imx_pgc_domain_pm_ops,
143162306a36Sopenharmony_ci	},
143262306a36Sopenharmony_ci	.probe    = imx_pgc_domain_probe,
143362306a36Sopenharmony_ci	.remove   = imx_pgc_domain_remove,
143462306a36Sopenharmony_ci	.id_table = imx_pgc_domain_id,
143562306a36Sopenharmony_ci};
143662306a36Sopenharmony_cibuiltin_platform_driver(imx_pgc_domain_driver)
143762306a36Sopenharmony_ci
143862306a36Sopenharmony_cistatic int imx_gpcv2_probe(struct platform_device *pdev)
143962306a36Sopenharmony_ci{
144062306a36Sopenharmony_ci	const struct imx_pgc_domain_data *domain_data =
144162306a36Sopenharmony_ci			of_device_get_match_data(&pdev->dev);
144262306a36Sopenharmony_ci
144362306a36Sopenharmony_ci	struct regmap_config regmap_config = {
144462306a36Sopenharmony_ci		.reg_bits	= 32,
144562306a36Sopenharmony_ci		.val_bits	= 32,
144662306a36Sopenharmony_ci		.reg_stride	= 4,
144762306a36Sopenharmony_ci		.rd_table	= domain_data->reg_access_table,
144862306a36Sopenharmony_ci		.wr_table	= domain_data->reg_access_table,
144962306a36Sopenharmony_ci		.max_register   = SZ_4K,
145062306a36Sopenharmony_ci	};
145162306a36Sopenharmony_ci	struct device *dev = &pdev->dev;
145262306a36Sopenharmony_ci	struct device_node *pgc_np, *np;
145362306a36Sopenharmony_ci	struct regmap *regmap;
145462306a36Sopenharmony_ci	void __iomem *base;
145562306a36Sopenharmony_ci	int ret;
145662306a36Sopenharmony_ci
145762306a36Sopenharmony_ci	pgc_np = of_get_child_by_name(dev->of_node, "pgc");
145862306a36Sopenharmony_ci	if (!pgc_np) {
145962306a36Sopenharmony_ci		dev_err(dev, "No power domains specified in DT\n");
146062306a36Sopenharmony_ci		return -EINVAL;
146162306a36Sopenharmony_ci	}
146262306a36Sopenharmony_ci
146362306a36Sopenharmony_ci	base = devm_platform_ioremap_resource(pdev, 0);
146462306a36Sopenharmony_ci	if (IS_ERR(base))
146562306a36Sopenharmony_ci		return PTR_ERR(base);
146662306a36Sopenharmony_ci
146762306a36Sopenharmony_ci	regmap = devm_regmap_init_mmio(dev, base, &regmap_config);
146862306a36Sopenharmony_ci	if (IS_ERR(regmap)) {
146962306a36Sopenharmony_ci		ret = PTR_ERR(regmap);
147062306a36Sopenharmony_ci		dev_err(dev, "failed to init regmap (%d)\n", ret);
147162306a36Sopenharmony_ci		return ret;
147262306a36Sopenharmony_ci	}
147362306a36Sopenharmony_ci
147462306a36Sopenharmony_ci	for_each_child_of_node(pgc_np, np) {
147562306a36Sopenharmony_ci		struct platform_device *pd_pdev;
147662306a36Sopenharmony_ci		struct imx_pgc_domain *domain;
147762306a36Sopenharmony_ci		u32 domain_index;
147862306a36Sopenharmony_ci
147962306a36Sopenharmony_ci		if (!of_device_is_available(np))
148062306a36Sopenharmony_ci			continue;
148162306a36Sopenharmony_ci
148262306a36Sopenharmony_ci		ret = of_property_read_u32(np, "reg", &domain_index);
148362306a36Sopenharmony_ci		if (ret) {
148462306a36Sopenharmony_ci			dev_err(dev, "Failed to read 'reg' property\n");
148562306a36Sopenharmony_ci			of_node_put(np);
148662306a36Sopenharmony_ci			return ret;
148762306a36Sopenharmony_ci		}
148862306a36Sopenharmony_ci
148962306a36Sopenharmony_ci		if (domain_index >= domain_data->domains_num) {
149062306a36Sopenharmony_ci			dev_warn(dev,
149162306a36Sopenharmony_ci				 "Domain index %d is out of bounds\n",
149262306a36Sopenharmony_ci				 domain_index);
149362306a36Sopenharmony_ci			continue;
149462306a36Sopenharmony_ci		}
149562306a36Sopenharmony_ci
149662306a36Sopenharmony_ci		pd_pdev = platform_device_alloc("imx-pgc-domain",
149762306a36Sopenharmony_ci						domain_index);
149862306a36Sopenharmony_ci		if (!pd_pdev) {
149962306a36Sopenharmony_ci			dev_err(dev, "Failed to allocate platform device\n");
150062306a36Sopenharmony_ci			of_node_put(np);
150162306a36Sopenharmony_ci			return -ENOMEM;
150262306a36Sopenharmony_ci		}
150362306a36Sopenharmony_ci
150462306a36Sopenharmony_ci		ret = platform_device_add_data(pd_pdev,
150562306a36Sopenharmony_ci					       &domain_data->domains[domain_index],
150662306a36Sopenharmony_ci					       sizeof(domain_data->domains[domain_index]));
150762306a36Sopenharmony_ci		if (ret) {
150862306a36Sopenharmony_ci			platform_device_put(pd_pdev);
150962306a36Sopenharmony_ci			of_node_put(np);
151062306a36Sopenharmony_ci			return ret;
151162306a36Sopenharmony_ci		}
151262306a36Sopenharmony_ci
151362306a36Sopenharmony_ci		domain = pd_pdev->dev.platform_data;
151462306a36Sopenharmony_ci		domain->regmap = regmap;
151562306a36Sopenharmony_ci		domain->regs = domain_data->pgc_regs;
151662306a36Sopenharmony_ci
151762306a36Sopenharmony_ci		domain->genpd.power_on  = imx_pgc_power_up;
151862306a36Sopenharmony_ci		domain->genpd.power_off = imx_pgc_power_down;
151962306a36Sopenharmony_ci
152062306a36Sopenharmony_ci		pd_pdev->dev.parent = dev;
152162306a36Sopenharmony_ci		device_set_node(&pd_pdev->dev, of_fwnode_handle(np));
152262306a36Sopenharmony_ci
152362306a36Sopenharmony_ci		ret = platform_device_add(pd_pdev);
152462306a36Sopenharmony_ci		if (ret) {
152562306a36Sopenharmony_ci			platform_device_put(pd_pdev);
152662306a36Sopenharmony_ci			of_node_put(np);
152762306a36Sopenharmony_ci			return ret;
152862306a36Sopenharmony_ci		}
152962306a36Sopenharmony_ci	}
153062306a36Sopenharmony_ci
153162306a36Sopenharmony_ci	return 0;
153262306a36Sopenharmony_ci}
153362306a36Sopenharmony_ci
153462306a36Sopenharmony_cistatic const struct of_device_id imx_gpcv2_dt_ids[] = {
153562306a36Sopenharmony_ci	{ .compatible = "fsl,imx7d-gpc", .data = &imx7_pgc_domain_data, },
153662306a36Sopenharmony_ci	{ .compatible = "fsl,imx8mm-gpc", .data = &imx8mm_pgc_domain_data, },
153762306a36Sopenharmony_ci	{ .compatible = "fsl,imx8mn-gpc", .data = &imx8mn_pgc_domain_data, },
153862306a36Sopenharmony_ci	{ .compatible = "fsl,imx8mp-gpc", .data = &imx8mp_pgc_domain_data, },
153962306a36Sopenharmony_ci	{ .compatible = "fsl,imx8mq-gpc", .data = &imx8m_pgc_domain_data, },
154062306a36Sopenharmony_ci	{ }
154162306a36Sopenharmony_ci};
154262306a36Sopenharmony_ci
154362306a36Sopenharmony_cistatic struct platform_driver imx_gpc_driver = {
154462306a36Sopenharmony_ci	.driver = {
154562306a36Sopenharmony_ci		.name = "imx-gpcv2",
154662306a36Sopenharmony_ci		.of_match_table = imx_gpcv2_dt_ids,
154762306a36Sopenharmony_ci	},
154862306a36Sopenharmony_ci	.probe = imx_gpcv2_probe,
154962306a36Sopenharmony_ci};
155062306a36Sopenharmony_cibuiltin_platform_driver(imx_gpc_driver)
1551