xref: /linux/drivers/platform/x86/intel/pmc/lnl.c (revision 6f9fac5535ba2038063c656f0afb496d7f87bcc1)
13748dfdaSRajvi Jingar // SPDX-License-Identifier: GPL-2.0
23748dfdaSRajvi Jingar /*
33748dfdaSRajvi Jingar  * This file contains platform specific structure definitions
43748dfdaSRajvi Jingar  * and init function used by Meteor Lake PCH.
53748dfdaSRajvi Jingar  *
63748dfdaSRajvi Jingar  * Copyright (c) 2022, Intel Corporation.
73748dfdaSRajvi Jingar  * All Rights Reserved.
83748dfdaSRajvi Jingar  *
93748dfdaSRajvi Jingar  */
103748dfdaSRajvi Jingar 
113748dfdaSRajvi Jingar #include <linux/cpu.h>
123748dfdaSRajvi Jingar #include <linux/pci.h>
133748dfdaSRajvi Jingar 
143748dfdaSRajvi Jingar #include "core.h"
153748dfdaSRajvi Jingar 
163748dfdaSRajvi Jingar #define SOCM_LPM_REQ_GUID	0x11594920
173748dfdaSRajvi Jingar 
183748dfdaSRajvi Jingar #define PMC_DEVID_SOCM	0xa87f
193748dfdaSRajvi Jingar 
203748dfdaSRajvi Jingar static const u8 LNL_LPM_REG_INDEX[] = {0, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20};
213748dfdaSRajvi Jingar 
223748dfdaSRajvi Jingar static struct pmc_info lnl_pmc_info_list[] = {
233748dfdaSRajvi Jingar 	{
243748dfdaSRajvi Jingar 		.guid	= SOCM_LPM_REQ_GUID,
253748dfdaSRajvi Jingar 		.devid	= PMC_DEVID_SOCM,
263748dfdaSRajvi Jingar 		.map	= &lnl_socm_reg_map,
273748dfdaSRajvi Jingar 	},
283748dfdaSRajvi Jingar 	{}
293748dfdaSRajvi Jingar };
303748dfdaSRajvi Jingar 
313748dfdaSRajvi Jingar const struct pmc_bit_map lnl_ltr_show_map[] = {
323748dfdaSRajvi Jingar 	{"SOUTHPORT_A",		CNP_PMC_LTR_SPA},
333748dfdaSRajvi Jingar 	{"SOUTHPORT_B",		CNP_PMC_LTR_SPB},
343748dfdaSRajvi Jingar 	{"SATA",		CNP_PMC_LTR_SATA},
353748dfdaSRajvi Jingar 	{"GIGABIT_ETHERNET",	CNP_PMC_LTR_GBE},
363748dfdaSRajvi Jingar 	{"XHCI",		CNP_PMC_LTR_XHCI},
373748dfdaSRajvi Jingar 	{"SOUTHPORT_F",		ADL_PMC_LTR_SPF},
383748dfdaSRajvi Jingar 	{"ME",			CNP_PMC_LTR_ME},
393748dfdaSRajvi Jingar 	/* EVA is Enterprise Value Add, doesn't really exist on PCH */
403748dfdaSRajvi Jingar 	{"SATA1",		CNP_PMC_LTR_EVA},
413748dfdaSRajvi Jingar 	{"SOUTHPORT_C",		CNP_PMC_LTR_SPC},
423748dfdaSRajvi Jingar 	{"HD_AUDIO",		CNP_PMC_LTR_AZ},
433748dfdaSRajvi Jingar 	{"CNV",			CNP_PMC_LTR_CNV},
443748dfdaSRajvi Jingar 	{"LPSS",		CNP_PMC_LTR_LPSS},
453748dfdaSRajvi Jingar 	{"SOUTHPORT_D",		CNP_PMC_LTR_SPD},
463748dfdaSRajvi Jingar 	{"SOUTHPORT_E",		CNP_PMC_LTR_SPE},
473748dfdaSRajvi Jingar 	{"SATA2",		CNP_PMC_LTR_CAM},
483748dfdaSRajvi Jingar 	{"ESPI",		CNP_PMC_LTR_ESPI},
493748dfdaSRajvi Jingar 	{"SCC",			CNP_PMC_LTR_SCC},
503748dfdaSRajvi Jingar 	{"ISH",			CNP_PMC_LTR_ISH},
513748dfdaSRajvi Jingar 	{"UFSX2",		CNP_PMC_LTR_UFSX2},
523748dfdaSRajvi Jingar 	{"EMMC",		CNP_PMC_LTR_EMMC},
533748dfdaSRajvi Jingar 	/*
543748dfdaSRajvi Jingar 	 * Check intel_pmc_core_ids[] users of cnp_reg_map for
553748dfdaSRajvi Jingar 	 * a list of core SoCs using this.
563748dfdaSRajvi Jingar 	 */
573748dfdaSRajvi Jingar 	{"WIGIG",		ICL_PMC_LTR_WIGIG},
583748dfdaSRajvi Jingar 	{"THC0",		TGL_PMC_LTR_THC0},
593748dfdaSRajvi Jingar 	{"THC1",		TGL_PMC_LTR_THC1},
603748dfdaSRajvi Jingar 	{"SOUTHPORT_G",		CNP_PMC_LTR_RESERVED},
613748dfdaSRajvi Jingar 
623748dfdaSRajvi Jingar 	{"ESE",			MTL_PMC_LTR_ESE},
633748dfdaSRajvi Jingar 	{"IOE_PMC",		MTL_PMC_LTR_IOE_PMC},
643748dfdaSRajvi Jingar 	{"DMI3",		ARL_PMC_LTR_DMI3},
653748dfdaSRajvi Jingar 	{"OSSE",		LNL_PMC_LTR_OSSE},
663748dfdaSRajvi Jingar 
673748dfdaSRajvi Jingar 	/* Below two cannot be used for LTR_IGNORE */
683748dfdaSRajvi Jingar 	{"CURRENT_PLATFORM",	CNP_PMC_LTR_CUR_PLT},
693748dfdaSRajvi Jingar 	{"AGGREGATED_SYSTEM",	CNP_PMC_LTR_CUR_ASLT},
703748dfdaSRajvi Jingar 	{}
713748dfdaSRajvi Jingar };
723748dfdaSRajvi Jingar 
733748dfdaSRajvi Jingar const struct pmc_bit_map lnl_power_gating_status_0_map[] = {
743748dfdaSRajvi Jingar 	{"PMC_PGD0_PG_STS",			BIT(0)},
753748dfdaSRajvi Jingar 	{"FUSE_OSSE_PGD0_PG_STS",		BIT(1)},
763748dfdaSRajvi Jingar 	{"ESPISPI_PGD0_PG_STS",			BIT(2)},
773748dfdaSRajvi Jingar 	{"XHCI_PGD0_PG_STS",			BIT(3)},
783748dfdaSRajvi Jingar 	{"SPA_PGD0_PG_STS",			BIT(4)},
793748dfdaSRajvi Jingar 	{"SPB_PGD0_PG_STS",			BIT(5)},
803748dfdaSRajvi Jingar 	{"SPR16B0_PGD0_PG_STS",			BIT(6)},
813748dfdaSRajvi Jingar 	{"GBE_PGD0_PG_STS",			BIT(7)},
823748dfdaSRajvi Jingar 	{"SBR8B7_PGD0_PG_STS",			BIT(8)},
833748dfdaSRajvi Jingar 	{"SBR8B6_PGD0_PG_STS",			BIT(9)},
843748dfdaSRajvi Jingar 	{"SBR16B1_PGD0_PG_STS",			BIT(10)},
853748dfdaSRajvi Jingar 	{"SBR8B8_PGD0_PG_STS",			BIT(11)},
863748dfdaSRajvi Jingar 	{"ESE_PGD3_PG_STS",			BIT(12)},
873748dfdaSRajvi Jingar 	{"D2D_DISP_PGD0_PG_STS",		BIT(13)},
883748dfdaSRajvi Jingar 	{"LPSS_PGD0_PG_STS",			BIT(14)},
893748dfdaSRajvi Jingar 	{"LPC_PGD0_PG_STS",			BIT(15)},
903748dfdaSRajvi Jingar 	{"SMB_PGD0_PG_STS",			BIT(16)},
913748dfdaSRajvi Jingar 	{"ISH_PGD0_PG_STS",			BIT(17)},
923748dfdaSRajvi Jingar 	{"SBR8B2_PGD0_PG_STS",			BIT(18)},
933748dfdaSRajvi Jingar 	{"NPK_PGD0_PG_STS",			BIT(19)},
943748dfdaSRajvi Jingar 	{"D2D_NOC_PGD0_PG_STS",			BIT(20)},
953748dfdaSRajvi Jingar 	{"SAFSS_PGD0_PG_STS",			BIT(21)},
963748dfdaSRajvi Jingar 	{"FUSE_PGD0_PG_STS",			BIT(22)},
973748dfdaSRajvi Jingar 	{"D2D_DISP_PGD1_PG_STS",		BIT(23)},
983748dfdaSRajvi Jingar 	{"MPFPW1_PGD0_PG_STS",			BIT(24)},
993748dfdaSRajvi Jingar 	{"XDCI_PGD0_PG_STS",			BIT(25)},
1003748dfdaSRajvi Jingar 	{"EXI_PGD0_PG_STS",			BIT(26)},
1013748dfdaSRajvi Jingar 	{"CSE_PGD0_PG_STS",			BIT(27)},
1023748dfdaSRajvi Jingar 	{"KVMCC_PGD0_PG_STS",			BIT(28)},
1033748dfdaSRajvi Jingar 	{"PMT_PGD0_PG_STS",			BIT(29)},
1043748dfdaSRajvi Jingar 	{"CLINK_PGD0_PG_STS",			BIT(30)},
1053748dfdaSRajvi Jingar 	{"PTIO_PGD0_PG_STS",			BIT(31)},
1063748dfdaSRajvi Jingar 	{}
1073748dfdaSRajvi Jingar };
1083748dfdaSRajvi Jingar 
1093748dfdaSRajvi Jingar const struct pmc_bit_map lnl_power_gating_status_1_map[] = {
1103748dfdaSRajvi Jingar 	{"USBR0_PGD0_PG_STS",			BIT(0)},
1113748dfdaSRajvi Jingar 	{"SUSRAM_PGD0_PG_STS",			BIT(1)},
1123748dfdaSRajvi Jingar 	{"SMT1_PGD0_PG_STS",			BIT(2)},
1133748dfdaSRajvi Jingar 	{"U3FPW1_PGD0_PG_STS",			BIT(3)},
1143748dfdaSRajvi Jingar 	{"SMS2_PGD0_PG_STS",			BIT(4)},
1153748dfdaSRajvi Jingar 	{"SMS1_PGD0_PG_STS",			BIT(5)},
1163748dfdaSRajvi Jingar 	{"CSMERTC_PGD0_PG_STS",			BIT(6)},
1173748dfdaSRajvi Jingar 	{"CSMEPSF_PGD0_PG_STS",			BIT(7)},
1183748dfdaSRajvi Jingar 	{"FIA_PG_PGD0_PG_STS",			BIT(8)},
1193748dfdaSRajvi Jingar 	{"SBR16B4_PGD0_PG_STS",			BIT(9)},
1203748dfdaSRajvi Jingar 	{"P2SB8B_PGD0_PG_STS",			BIT(10)},
1213748dfdaSRajvi Jingar 	{"DBG_SBR_PGD0_PG_STS",			BIT(11)},
1223748dfdaSRajvi Jingar 	{"SBR8B9_PGD0_PG_STS",			BIT(12)},
1233748dfdaSRajvi Jingar 	{"OSSE_SMT1_PGD0_PG_STS",		BIT(13)},
1243748dfdaSRajvi Jingar 	{"SBR8B10_PGD0_PG_STS",			BIT(14)},
1253748dfdaSRajvi Jingar 	{"SBR16B3_PGD0_PG_STS",			BIT(15)},
1263748dfdaSRajvi Jingar 	{"G5FPW1_PGD0_PG_STS",			BIT(16)},
1273748dfdaSRajvi Jingar 	{"SBRG_PGD0_PG_STS",			BIT(17)},
1283748dfdaSRajvi Jingar 	{"PSF4_PGD0_PG_STS",			BIT(18)},
1293748dfdaSRajvi Jingar 	{"CNVI_PGD0_PG_STS",			BIT(19)},
1303748dfdaSRajvi Jingar 	{"USFX2_PGD0_PG_STS",			BIT(20)},
1313748dfdaSRajvi Jingar 	{"ENDBG_PGD0_PG_STS",			BIT(21)},
1323748dfdaSRajvi Jingar 	{"FIACPCB_P5X4_PGD0_PG_STS",		BIT(22)},
1333748dfdaSRajvi Jingar 	{"SBR8B3_PGD0_PG_STS",			BIT(23)},
1343748dfdaSRajvi Jingar 	{"SBR8B0_PGD0_PG_STS",			BIT(24)},
1353748dfdaSRajvi Jingar 	{"NPK_PGD1_PG_STS",			BIT(25)},
1363748dfdaSRajvi Jingar 	{"OSSE_HOTHAM_PGD0_PG_STS",		BIT(26)},
1373748dfdaSRajvi Jingar 	{"D2D_NOC_PGD2_PG_STS",			BIT(27)},
1383748dfdaSRajvi Jingar 	{"SBR8B1_PGD0_PG_STS",			BIT(28)},
1393748dfdaSRajvi Jingar 	{"PSF6_PGD0_PG_STS",			BIT(29)},
1403748dfdaSRajvi Jingar 	{"PSF7_PGD0_PG_STS",			BIT(30)},
1413748dfdaSRajvi Jingar 	{"FIA_U_PGD0_PG_STS",			BIT(31)},
1423748dfdaSRajvi Jingar 	{}
1433748dfdaSRajvi Jingar };
1443748dfdaSRajvi Jingar 
1453748dfdaSRajvi Jingar const struct pmc_bit_map lnl_power_gating_status_2_map[] = {
1463748dfdaSRajvi Jingar 	{"PSF8_PGD0_PG_STS",			BIT(0)},
1473748dfdaSRajvi Jingar 	{"SBR16B2_PGD0_PG_STS",			BIT(1)},
1483748dfdaSRajvi Jingar 	{"D2D_IPU_PGD0_PG_STS",			BIT(2)},
1493748dfdaSRajvi Jingar 	{"FIACPCB_U_PGD0_PG_STS",		BIT(3)},
1503748dfdaSRajvi Jingar 	{"TAM_PGD0_PG_STS",			BIT(4)},
1513748dfdaSRajvi Jingar 	{"D2D_NOC_PGD1_PG_STS",			BIT(5)},
1523748dfdaSRajvi Jingar 	{"TBTLSX_PGD0_PG_STS",			BIT(6)},
1533748dfdaSRajvi Jingar 	{"THC0_PGD0_PG_STS",			BIT(7)},
1543748dfdaSRajvi Jingar 	{"THC1_PGD0_PG_STS",			BIT(8)},
1553748dfdaSRajvi Jingar 	{"PMC_PGD0_PG_STS",			BIT(9)},
1563748dfdaSRajvi Jingar 	{"SBR8B5_PGD0_PG_STS",			BIT(10)},
1573748dfdaSRajvi Jingar 	{"UFSPW1_PGD0_PG_STS",			BIT(11)},
1583748dfdaSRajvi Jingar 	{"DBC_PGD0_PG_STS",			BIT(12)},
1593748dfdaSRajvi Jingar 	{"TCSS_PGD0_PG_STS",			BIT(13)},
1603748dfdaSRajvi Jingar 	{"FIA_P5X4_PGD0_PG_STS",		BIT(14)},
1613748dfdaSRajvi Jingar 	{"DISP_PGA_PGD0_PG_STS",		BIT(15)},
1623748dfdaSRajvi Jingar 	{"DISP_PSF_PGD0_PG_STS",		BIT(16)},
1633748dfdaSRajvi Jingar 	{"PSF0_PGD0_PG_STS",			BIT(17)},
1643748dfdaSRajvi Jingar 	{"P2SB16B_PGD0_PG_STS",			BIT(18)},
1653748dfdaSRajvi Jingar 	{"ACE_PGD0_PG_STS",			BIT(19)},
1663748dfdaSRajvi Jingar 	{"ACE_PGD1_PG_STS",			BIT(20)},
1673748dfdaSRajvi Jingar 	{"ACE_PGD2_PG_STS",			BIT(21)},
1683748dfdaSRajvi Jingar 	{"ACE_PGD3_PG_STS",			BIT(22)},
1693748dfdaSRajvi Jingar 	{"ACE_PGD4_PG_STS",			BIT(23)},
1703748dfdaSRajvi Jingar 	{"ACE_PGD5_PG_STS",			BIT(24)},
1713748dfdaSRajvi Jingar 	{"ACE_PGD6_PG_STS",			BIT(25)},
1723748dfdaSRajvi Jingar 	{"ACE_PGD7_PG_STS",			BIT(26)},
1733748dfdaSRajvi Jingar 	{"ACE_PGD8_PG_STS",			BIT(27)},
1743748dfdaSRajvi Jingar 	{"ACE_PGD9_PG_STS",			BIT(28)},
1753748dfdaSRajvi Jingar 	{"ACE_PGD10_PG_STS",			BIT(29)},
1763748dfdaSRajvi Jingar 	{"FIACPCB_PG_PGD0_PG_STS",		BIT(30)},
1773748dfdaSRajvi Jingar 	{"OSSE_PGD0_PG_STS",			BIT(31)},
1783748dfdaSRajvi Jingar 	{}
1793748dfdaSRajvi Jingar };
1803748dfdaSRajvi Jingar 
1813748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_0_map[] = {
1823748dfdaSRajvi Jingar 	{"LPSS_D3_STS",				BIT(3)},
1833748dfdaSRajvi Jingar 	{"XDCI_D3_STS",				BIT(4)},
1843748dfdaSRajvi Jingar 	{"XHCI_D3_STS",				BIT(5)},
1853748dfdaSRajvi Jingar 	{"SPA_D3_STS",				BIT(12)},
1863748dfdaSRajvi Jingar 	{"SPB_D3_STS",				BIT(13)},
1873748dfdaSRajvi Jingar 	{"OSSE_D3_STS",				BIT(15)},
1883748dfdaSRajvi Jingar 	{"ESPISPI_D3_STS",			BIT(18)},
1893748dfdaSRajvi Jingar 	{"PSTH_D3_STS",				BIT(21)},
1903748dfdaSRajvi Jingar 	{}
1913748dfdaSRajvi Jingar };
1923748dfdaSRajvi Jingar 
1933748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_1_map[] = {
1943748dfdaSRajvi Jingar 	{"OSSE_SMT1_D3_STS",			BIT(7)},
1953748dfdaSRajvi Jingar 	{"GBE_D3_STS",				BIT(19)},
1963748dfdaSRajvi Jingar 	{"ITSS_D3_STS",				BIT(23)},
1973748dfdaSRajvi Jingar 	{"CNVI_D3_STS",				BIT(27)},
1983748dfdaSRajvi Jingar 	{"UFSX2_D3_STS",			BIT(28)},
1993748dfdaSRajvi Jingar 	{"OSSE_HOTHAM_D3_STS",			BIT(31)},
2003748dfdaSRajvi Jingar 	{}
2013748dfdaSRajvi Jingar };
2023748dfdaSRajvi Jingar 
2033748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_2_map[] = {
2043748dfdaSRajvi Jingar 	{"ESE_D3_STS",				BIT(0)},
2053748dfdaSRajvi Jingar 	{"CSMERTC_D3_STS",			BIT(1)},
2063748dfdaSRajvi Jingar 	{"SUSRAM_D3_STS",			BIT(2)},
2073748dfdaSRajvi Jingar 	{"CSE_D3_STS",				BIT(4)},
2083748dfdaSRajvi Jingar 	{"KVMCC_D3_STS",			BIT(5)},
2093748dfdaSRajvi Jingar 	{"USBR0_D3_STS",			BIT(6)},
2103748dfdaSRajvi Jingar 	{"ISH_D3_STS",				BIT(7)},
2113748dfdaSRajvi Jingar 	{"SMT1_D3_STS",				BIT(8)},
2123748dfdaSRajvi Jingar 	{"SMT2_D3_STS",				BIT(9)},
2133748dfdaSRajvi Jingar 	{"SMT3_D3_STS",				BIT(10)},
2143748dfdaSRajvi Jingar 	{"OSSE_SMT2_D3_STS",			BIT(13)},
2153748dfdaSRajvi Jingar 	{"CLINK_D3_STS",			BIT(14)},
2163748dfdaSRajvi Jingar 	{"PTIO_D3_STS",				BIT(16)},
2173748dfdaSRajvi Jingar 	{"PMT_D3_STS",				BIT(17)},
2183748dfdaSRajvi Jingar 	{"SMS1_D3_STS",				BIT(18)},
2193748dfdaSRajvi Jingar 	{"SMS2_D3_STS",				BIT(19)},
2203748dfdaSRajvi Jingar 	{}
2213748dfdaSRajvi Jingar };
2223748dfdaSRajvi Jingar 
2233748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_3_map[] = {
2243748dfdaSRajvi Jingar 	{"THC0_D3_STS",				BIT(14)},
2253748dfdaSRajvi Jingar 	{"THC1_D3_STS",				BIT(15)},
2263748dfdaSRajvi Jingar 	{"OSSE_SMT3_D3_STS",			BIT(21)},
2273748dfdaSRajvi Jingar 	{"ACE_D3_STS",				BIT(23)},
2283748dfdaSRajvi Jingar 	{}
2293748dfdaSRajvi Jingar };
2303748dfdaSRajvi Jingar 
2313748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_0_map[] = {
2323748dfdaSRajvi Jingar 	{"LPSS_VNN_REQ_STS",			BIT(3)},
2333748dfdaSRajvi Jingar 	{"OSSE_VNN_REQ_STS",			BIT(15)},
2343748dfdaSRajvi Jingar 	{"ESPISPI_VNN_REQ_STS",			BIT(18)},
2353748dfdaSRajvi Jingar 	{}
2363748dfdaSRajvi Jingar };
2373748dfdaSRajvi Jingar 
2383748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_1_map[] = {
2393748dfdaSRajvi Jingar 	{"NPK_VNN_REQ_STS",			BIT(4)},
2403748dfdaSRajvi Jingar 	{"OSSE_SMT1_VNN_REQ_STS",		BIT(7)},
2413748dfdaSRajvi Jingar 	{"DFXAGG_VNN_REQ_STS",			BIT(8)},
2423748dfdaSRajvi Jingar 	{"EXI_VNN_REQ_STS",			BIT(9)},
2433748dfdaSRajvi Jingar 	{"P2D_VNN_REQ_STS",			BIT(18)},
2443748dfdaSRajvi Jingar 	{"GBE_VNN_REQ_STS",			BIT(19)},
2453748dfdaSRajvi Jingar 	{"SMB_VNN_REQ_STS",			BIT(25)},
2463748dfdaSRajvi Jingar 	{"LPC_VNN_REQ_STS",			BIT(26)},
2473748dfdaSRajvi Jingar 	{}
2483748dfdaSRajvi Jingar };
2493748dfdaSRajvi Jingar 
2503748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_2_map[] = {
2513748dfdaSRajvi Jingar 	{"eSE_VNN_REQ_STS",			BIT(0)},
2523748dfdaSRajvi Jingar 	{"CSMERTC_VNN_REQ_STS",			BIT(1)},
2533748dfdaSRajvi Jingar 	{"CSE_VNN_REQ_STS",			BIT(4)},
2543748dfdaSRajvi Jingar 	{"ISH_VNN_REQ_STS",			BIT(7)},
2553748dfdaSRajvi Jingar 	{"SMT1_VNN_REQ_STS",			BIT(8)},
2563748dfdaSRajvi Jingar 	{"CLINK_VNN_REQ_STS",			BIT(14)},
2573748dfdaSRajvi Jingar 	{"SMS1_VNN_REQ_STS",			BIT(18)},
2583748dfdaSRajvi Jingar 	{"SMS2_VNN_REQ_STS",			BIT(19)},
2593748dfdaSRajvi Jingar 	{"GPIOCOM4_VNN_REQ_STS",		BIT(20)},
2603748dfdaSRajvi Jingar 	{"GPIOCOM3_VNN_REQ_STS",		BIT(21)},
2613748dfdaSRajvi Jingar 	{"GPIOCOM2_VNN_REQ_STS",		BIT(22)},
2623748dfdaSRajvi Jingar 	{"GPIOCOM1_VNN_REQ_STS",		BIT(23)},
2633748dfdaSRajvi Jingar 	{"GPIOCOM0_VNN_REQ_STS",		BIT(24)},
2643748dfdaSRajvi Jingar 	{}
2653748dfdaSRajvi Jingar };
2663748dfdaSRajvi Jingar 
2673748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_3_map[] = {
2683748dfdaSRajvi Jingar 	{"DISP_SHIM_VNN_REQ_STS",		BIT(2)},
2693748dfdaSRajvi Jingar 	{"DTS0_VNN_REQ_STS",			BIT(7)},
2703748dfdaSRajvi Jingar 	{"GPIOCOM5_VNN_REQ_STS",		BIT(11)},
2713748dfdaSRajvi Jingar 	{}
2723748dfdaSRajvi Jingar };
2733748dfdaSRajvi Jingar 
2743748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_misc_status_map[] = {
2753748dfdaSRajvi Jingar 	{"CPU_C10_REQ_STS",			BIT(0)},
2763748dfdaSRajvi Jingar 	{"TS_OFF_REQ_STS",			BIT(1)},
2773748dfdaSRajvi Jingar 	{"PNDE_MET_REQ_STS",			BIT(2)},
2783748dfdaSRajvi Jingar 	{"PCIE_DEEP_PM_REQ_STS",		BIT(3)},
2793748dfdaSRajvi Jingar 	{"PMC_CLK_THROTTLE_EN_REQ_STS",		BIT(4)},
2803748dfdaSRajvi Jingar 	{"NPK_VNNAON_REQ_STS",			BIT(5)},
2813748dfdaSRajvi Jingar 	{"VNN_SOC_REQ_STS",			BIT(6)},
2823748dfdaSRajvi Jingar 	{"ISH_VNNAON_REQ_STS",			BIT(7)},
2833748dfdaSRajvi Jingar 	{"D2D_NOC_CFI_QACTIVE_REQ_STS",		BIT(8)},
2843748dfdaSRajvi Jingar 	{"D2D_NOC_GPSB_QACTIVE_REQ_STS",	BIT(9)},
2853748dfdaSRajvi Jingar 	{"D2D_NOC_IPU_QACTIVE_REQ_STS",		BIT(10)},
2863748dfdaSRajvi Jingar 	{"PLT_GREATER_REQ_STS",			BIT(11)},
2873748dfdaSRajvi Jingar 	{"PCIE_CLKREQ_REQ_STS",			BIT(12)},
2883748dfdaSRajvi Jingar 	{"PMC_IDLE_FB_OCP_REQ_STS",		BIT(13)},
2893748dfdaSRajvi Jingar 	{"PM_SYNC_STATES_REQ_STS",		BIT(14)},
2903748dfdaSRajvi Jingar 	{"EA_REQ_STS",				BIT(15)},
2913748dfdaSRajvi Jingar 	{"MPHY_CORE_OFF_REQ_STS",		BIT(16)},
2923748dfdaSRajvi Jingar 	{"BRK_EV_EN_REQ_STS",			BIT(17)},
2933748dfdaSRajvi Jingar 	{"AUTO_DEMO_EN_REQ_STS",		BIT(18)},
2943748dfdaSRajvi Jingar 	{"ITSS_CLK_SRC_REQ_STS",		BIT(19)},
2953748dfdaSRajvi Jingar 	{"LPC_CLK_SRC_REQ_STS",			BIT(20)},
2963748dfdaSRajvi Jingar 	{"ARC_IDLE_REQ_STS",			BIT(21)},
2973748dfdaSRajvi Jingar 	{"MPHY_SUS_REQ_STS",			BIT(22)},
2983748dfdaSRajvi Jingar 	{"FIA_DEEP_PM_REQ_STS",			BIT(23)},
2993748dfdaSRajvi Jingar 	{"UXD_CONNECTED_REQ_STS",		BIT(24)},
3003748dfdaSRajvi Jingar 	{"ARC_INTERRUPT_WAKE_REQ_STS",	BIT(25)},
3013748dfdaSRajvi Jingar 	{"D2D_NOC_DISP_DDI_QACTIVE_REQ_STS",	BIT(26)},
3023748dfdaSRajvi Jingar 	{"PRE_WAKE0_REQ_STS",			BIT(27)},
3033748dfdaSRajvi Jingar 	{"PRE_WAKE1_REQ_STS",			BIT(28)},
3043748dfdaSRajvi Jingar 	{"PRE_WAKE2_EN_REQ_STS",		BIT(29)},
3053748dfdaSRajvi Jingar 	{"WOV_REQ_STS",				BIT(30)},
3063748dfdaSRajvi Jingar 	{"D2D_NOC_DISP_EDP_QACTIVE_REQ_STS_31",	BIT(31)},
3073748dfdaSRajvi Jingar 	{}
3083748dfdaSRajvi Jingar };
3093748dfdaSRajvi Jingar 
3103748dfdaSRajvi Jingar const struct pmc_bit_map lnl_clocksource_status_map[] = {
3113748dfdaSRajvi Jingar 	{"AON2_OFF_STS",			BIT(0)},
3123748dfdaSRajvi Jingar 	{"AON3_OFF_STS",			BIT(1)},
3133748dfdaSRajvi Jingar 	{"AON4_OFF_STS",			BIT(2)},
3143748dfdaSRajvi Jingar 	{"AON5_OFF_STS",			BIT(3)},
3153748dfdaSRajvi Jingar 	{"AON1_OFF_STS",			BIT(4)},
3163748dfdaSRajvi Jingar 	{"MPFPW1_0_PLL_OFF_STS",		BIT(6)},
3173748dfdaSRajvi Jingar 	{"USB3_PLL_OFF_STS",			BIT(8)},
3183748dfdaSRajvi Jingar 	{"AON3_SPL_OFF_STS",			BIT(9)},
3193748dfdaSRajvi Jingar 	{"G5FPW1_PLL_OFF_STS",			BIT(15)},
3203748dfdaSRajvi Jingar 	{"XTAL_AGGR_OFF_STS",			BIT(17)},
3213748dfdaSRajvi Jingar 	{"USB2_PLL_OFF_STS",			BIT(18)},
3223748dfdaSRajvi Jingar 	{"SAF_PLL_OFF_STS",			BIT(19)},
3233748dfdaSRajvi Jingar 	{"SE_TCSS_PLL_OFF_STS",			BIT(20)},
3243748dfdaSRajvi Jingar 	{"DDI_PLL_OFF_STS",			BIT(21)},
3253748dfdaSRajvi Jingar 	{"FILTER_PLL_OFF_STS",			BIT(22)},
3263748dfdaSRajvi Jingar 	{"ACE_PLL_OFF_STS",			BIT(24)},
3273748dfdaSRajvi Jingar 	{"FABRIC_PLL_OFF_STS",			BIT(25)},
3283748dfdaSRajvi Jingar 	{"SOC_PLL_OFF_STS",			BIT(26)},
3293748dfdaSRajvi Jingar 	{"REF_OFF_STS",				BIT(28)},
3303748dfdaSRajvi Jingar 	{"IMG_OFF_STS",				BIT(29)},
3313748dfdaSRajvi Jingar 	{"RTC_PLL_OFF_STS",			BIT(31)},
3323748dfdaSRajvi Jingar 	{}
3333748dfdaSRajvi Jingar };
3343748dfdaSRajvi Jingar 
3353748dfdaSRajvi Jingar const struct pmc_bit_map *lnl_lpm_maps[] = {
3363748dfdaSRajvi Jingar 	lnl_clocksource_status_map,
3373748dfdaSRajvi Jingar 	lnl_power_gating_status_0_map,
3383748dfdaSRajvi Jingar 	lnl_power_gating_status_1_map,
3393748dfdaSRajvi Jingar 	lnl_power_gating_status_2_map,
3403748dfdaSRajvi Jingar 	lnl_d3_status_0_map,
3413748dfdaSRajvi Jingar 	lnl_d3_status_1_map,
3423748dfdaSRajvi Jingar 	lnl_d3_status_2_map,
3433748dfdaSRajvi Jingar 	lnl_d3_status_3_map,
3443748dfdaSRajvi Jingar 	lnl_vnn_req_status_0_map,
3453748dfdaSRajvi Jingar 	lnl_vnn_req_status_1_map,
3463748dfdaSRajvi Jingar 	lnl_vnn_req_status_2_map,
3473748dfdaSRajvi Jingar 	lnl_vnn_req_status_3_map,
3483748dfdaSRajvi Jingar 	lnl_vnn_misc_status_map,
3493748dfdaSRajvi Jingar 	mtl_socm_signal_status_map,
3503748dfdaSRajvi Jingar 	NULL
3513748dfdaSRajvi Jingar };
3523748dfdaSRajvi Jingar 
3533748dfdaSRajvi Jingar const struct pmc_bit_map lnl_pfear_map[] = {
3543748dfdaSRajvi Jingar 	{"PMC_0",			BIT(0)},
3553748dfdaSRajvi Jingar 	{"FUSE_OSSE",			BIT(1)},
3563748dfdaSRajvi Jingar 	{"ESPISPI",			BIT(2)},
3573748dfdaSRajvi Jingar 	{"XHCI",			BIT(3)},
3583748dfdaSRajvi Jingar 	{"SPA",				BIT(4)},
3593748dfdaSRajvi Jingar 	{"SPB",				BIT(5)},
3603748dfdaSRajvi Jingar 	{"SBR16B0",			BIT(6)},
3613748dfdaSRajvi Jingar 	{"GBE",				BIT(7)},
3623748dfdaSRajvi Jingar 
3633748dfdaSRajvi Jingar 	{"SBR8B7",			BIT(0)},
3643748dfdaSRajvi Jingar 	{"SBR8B6",			BIT(1)},
3653748dfdaSRajvi Jingar 	{"SBR16B1",			BIT(1)},
3663748dfdaSRajvi Jingar 	{"SBR8B8",			BIT(2)},
3673748dfdaSRajvi Jingar 	{"ESE",				BIT(3)},
3683748dfdaSRajvi Jingar 	{"SBR8B10",			BIT(4)},
3693748dfdaSRajvi Jingar 	{"D2D_DISP_0",			BIT(5)},
3703748dfdaSRajvi Jingar 	{"LPSS",			BIT(6)},
3713748dfdaSRajvi Jingar 	{"LPC",				BIT(7)},
3723748dfdaSRajvi Jingar 
3733748dfdaSRajvi Jingar 	{"SMB",				BIT(0)},
3743748dfdaSRajvi Jingar 	{"ISH",				BIT(1)},
3753748dfdaSRajvi Jingar 	{"SBR8B2",			BIT(2)},
3763748dfdaSRajvi Jingar 	{"NPK_0",			BIT(3)},
3773748dfdaSRajvi Jingar 	{"D2D_NOC_0",			BIT(4)},
3783748dfdaSRajvi Jingar 	{"SAFSS",			BIT(5)},
3793748dfdaSRajvi Jingar 	{"FUSE",			BIT(6)},
3803748dfdaSRajvi Jingar 	{"D2D_DISP_1",			BIT(7)},
3813748dfdaSRajvi Jingar 
3823748dfdaSRajvi Jingar 	{"MPFPW1",			BIT(0)},
3833748dfdaSRajvi Jingar 	{"XDCI",			BIT(1)},
3843748dfdaSRajvi Jingar 	{"EXI",				BIT(2)},
3853748dfdaSRajvi Jingar 	{"CSE",				BIT(3)},
3863748dfdaSRajvi Jingar 	{"KVMCC",			BIT(4)},
3873748dfdaSRajvi Jingar 	{"PMT",				BIT(5)},
3883748dfdaSRajvi Jingar 	{"CLINK",			BIT(6)},
3893748dfdaSRajvi Jingar 	{"PTIO",			BIT(7)},
3903748dfdaSRajvi Jingar 
3913748dfdaSRajvi Jingar 	{"USBR",			BIT(0)},
3923748dfdaSRajvi Jingar 	{"SUSRAM",			BIT(1)},
3933748dfdaSRajvi Jingar 	{"SMT1",			BIT(2)},
3943748dfdaSRajvi Jingar 	{"U3FPW1",			BIT(3)},
3953748dfdaSRajvi Jingar 	{"SMS2",			BIT(4)},
3963748dfdaSRajvi Jingar 	{"SMS1",			BIT(5)},
3973748dfdaSRajvi Jingar 	{"CSMERTC",			BIT(6)},
3983748dfdaSRajvi Jingar 	{"CSMEPSF",			BIT(7)},
3993748dfdaSRajvi Jingar 
4003748dfdaSRajvi Jingar 	{"FIA_PG",			BIT(0)},
4013748dfdaSRajvi Jingar 	{"SBR16B4",			BIT(1)},
4023748dfdaSRajvi Jingar 	{"P2SB8B",			BIT(2)},
4033748dfdaSRajvi Jingar 	{"DBG_SBR",			BIT(3)},
4043748dfdaSRajvi Jingar 	{"SBR8B9",			BIT(4)},
4053748dfdaSRajvi Jingar 	{"OSSE_SMT1",			BIT(5)},
4063748dfdaSRajvi Jingar 	{"SBR8B10",			BIT(6)},
4073748dfdaSRajvi Jingar 	{"SBR16B3",			BIT(7)},
4083748dfdaSRajvi Jingar 
4093748dfdaSRajvi Jingar 	{"G5FPW1",			BIT(0)},
4103748dfdaSRajvi Jingar 	{"SBRG",			BIT(1)},
4113748dfdaSRajvi Jingar 	{"PSF4",			BIT(2)},
4123748dfdaSRajvi Jingar 	{"CNVI",			BIT(3)},
4133748dfdaSRajvi Jingar 	{"UFSX2",			BIT(4)},
4143748dfdaSRajvi Jingar 	{"ENDBG",			BIT(5)},
4153748dfdaSRajvi Jingar 	{"FIACPCB_P5X4",		BIT(6)},
4163748dfdaSRajvi Jingar 	{"SBR8B3",			BIT(7)},
4173748dfdaSRajvi Jingar 
4183748dfdaSRajvi Jingar 	{"SBR8B0",			BIT(0)},
4193748dfdaSRajvi Jingar 	{"NPK_1",			BIT(1)},
4203748dfdaSRajvi Jingar 	{"OSSE_HOTHAM",			BIT(2)},
4213748dfdaSRajvi Jingar 	{"D2D_NOC_2",			BIT(3)},
4223748dfdaSRajvi Jingar 	{"SBR8B1",			BIT(4)},
4233748dfdaSRajvi Jingar 	{"PSF6",			BIT(5)},
4243748dfdaSRajvi Jingar 	{"PSF7",			BIT(6)},
4253748dfdaSRajvi Jingar 	{"FIA_U",			BIT(7)},
4263748dfdaSRajvi Jingar 
4273748dfdaSRajvi Jingar 	{"PSF8",			BIT(0)},
4283748dfdaSRajvi Jingar 	{"SBR16B2",			BIT(1)},
4293748dfdaSRajvi Jingar 	{"D2D_IPU",			BIT(2)},
4303748dfdaSRajvi Jingar 	{"FIACPCB_U",			BIT(3)},
4313748dfdaSRajvi Jingar 	{"TAM",				BIT(4)},
4323748dfdaSRajvi Jingar 	{"D2D_NOC_1",			BIT(5)},
4333748dfdaSRajvi Jingar 	{"TBTLSX",			BIT(6)},
4343748dfdaSRajvi Jingar 	{"THC0",			BIT(7)},
4353748dfdaSRajvi Jingar 
4363748dfdaSRajvi Jingar 	{"THC1",			BIT(0)},
4373748dfdaSRajvi Jingar 	{"PMC_1",			BIT(1)},
4383748dfdaSRajvi Jingar 	{"SBR8B5",			BIT(2)},
4393748dfdaSRajvi Jingar 	{"UFSPW1",			BIT(3)},
4403748dfdaSRajvi Jingar 	{"DBC",				BIT(4)},
4413748dfdaSRajvi Jingar 	{"TCSS",			BIT(5)},
4423748dfdaSRajvi Jingar 	{"FIA_P5X4",			BIT(6)},
4433748dfdaSRajvi Jingar 	{"DISP_PGA",			BIT(7)},
4443748dfdaSRajvi Jingar 
4453748dfdaSRajvi Jingar 	{"DBG_PSF",			BIT(0)},
4463748dfdaSRajvi Jingar 	{"PSF0",			BIT(1)},
4473748dfdaSRajvi Jingar 	{"P2SB16B",			BIT(2)},
4483748dfdaSRajvi Jingar 	{"ACE0",			BIT(3)},
4493748dfdaSRajvi Jingar 	{"ACE1",			BIT(4)},
4503748dfdaSRajvi Jingar 	{"ACE2",			BIT(5)},
4513748dfdaSRajvi Jingar 	{"ACE3",			BIT(6)},
4523748dfdaSRajvi Jingar 	{"ACE4",			BIT(7)},
4533748dfdaSRajvi Jingar 
4543748dfdaSRajvi Jingar 	{"ACE5",			BIT(0)},
4553748dfdaSRajvi Jingar 	{"ACE6",			BIT(1)},
4563748dfdaSRajvi Jingar 	{"ACE7",			BIT(2)},
4573748dfdaSRajvi Jingar 	{"ACE8",			BIT(3)},
4583748dfdaSRajvi Jingar 	{"ACE9",			BIT(4)},
4593748dfdaSRajvi Jingar 	{"ACE10",			BIT(5)},
4603748dfdaSRajvi Jingar 	{"FIACPCB",			BIT(6)},
4613748dfdaSRajvi Jingar 	{"OSSE",			BIT(7)},
4623748dfdaSRajvi Jingar 	{}
4633748dfdaSRajvi Jingar };
4643748dfdaSRajvi Jingar 
4653748dfdaSRajvi Jingar const struct pmc_bit_map *ext_lnl_pfear_map[] = {
4663748dfdaSRajvi Jingar 	lnl_pfear_map,
4673748dfdaSRajvi Jingar 	NULL
4683748dfdaSRajvi Jingar };
4693748dfdaSRajvi Jingar 
4703748dfdaSRajvi Jingar const struct pmc_reg_map lnl_socm_reg_map = {
4713748dfdaSRajvi Jingar 	.pfear_sts = ext_lnl_pfear_map,
4723748dfdaSRajvi Jingar 	.slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET,
4733748dfdaSRajvi Jingar 	.slp_s0_res_counter_step = TGL_PMC_SLP_S0_RES_COUNTER_STEP,
4743748dfdaSRajvi Jingar 	.ltr_show_sts = lnl_ltr_show_map,
4753748dfdaSRajvi Jingar 	.msr_sts = msr_map,
4763748dfdaSRajvi Jingar 	.ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET,
4773748dfdaSRajvi Jingar 	.regmap_length = LNL_PMC_MMIO_REG_LEN,
4783748dfdaSRajvi Jingar 	.ppfear0_offset = CNP_PMC_HOST_PPFEAR0A,
4793748dfdaSRajvi Jingar 	.ppfear_buckets = LNL_PPFEAR_NUM_ENTRIES,
4803748dfdaSRajvi Jingar 	.pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
4813748dfdaSRajvi Jingar 	.pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
4823748dfdaSRajvi Jingar 	.ltr_ignore_max = LNL_NUM_IP_IGN_ALLOWED,
4833748dfdaSRajvi Jingar 	.lpm_num_maps = ADL_LPM_NUM_MAPS,
4843748dfdaSRajvi Jingar 	.lpm_res_counter_step_x2 = TGL_PMC_LPM_RES_COUNTER_STEP_X2,
4853748dfdaSRajvi Jingar 	.etr3_offset = ETR3_OFFSET,
4863748dfdaSRajvi Jingar 	.lpm_sts_latch_en_offset = MTL_LPM_STATUS_LATCH_EN_OFFSET,
4873748dfdaSRajvi Jingar 	.lpm_priority_offset = MTL_LPM_PRI_OFFSET,
4883748dfdaSRajvi Jingar 	.lpm_en_offset = MTL_LPM_EN_OFFSET,
4893748dfdaSRajvi Jingar 	.lpm_residency_offset = MTL_LPM_RESIDENCY_OFFSET,
4903748dfdaSRajvi Jingar 	.lpm_sts = lnl_lpm_maps,
4913748dfdaSRajvi Jingar 	.lpm_status_offset = MTL_LPM_STATUS_OFFSET,
4923748dfdaSRajvi Jingar 	.lpm_live_status_offset = MTL_LPM_LIVE_STATUS_OFFSET,
4933748dfdaSRajvi Jingar 	.lpm_reg_index = LNL_LPM_REG_INDEX,
4943748dfdaSRajvi Jingar };
4953748dfdaSRajvi Jingar 
4963748dfdaSRajvi Jingar #define LNL_NPU_PCI_DEV		0x643e
4973748dfdaSRajvi Jingar #define LNL_IPU_PCI_DEV		0x645d
4983748dfdaSRajvi Jingar 
4993748dfdaSRajvi Jingar /*
5003748dfdaSRajvi Jingar  * Set power state of select devices that do not have drivers to D3
5013748dfdaSRajvi Jingar  * so that they do not block Package C entry.
5023748dfdaSRajvi Jingar  */
5033748dfdaSRajvi Jingar static void lnl_d3_fixup(void)
5043748dfdaSRajvi Jingar {
5053748dfdaSRajvi Jingar 	pmc_core_set_device_d3(LNL_IPU_PCI_DEV);
5063748dfdaSRajvi Jingar 	pmc_core_set_device_d3(LNL_NPU_PCI_DEV);
5073748dfdaSRajvi Jingar }
5083748dfdaSRajvi Jingar 
5093748dfdaSRajvi Jingar static int lnl_resume(struct pmc_dev *pmcdev)
5103748dfdaSRajvi Jingar {
5113748dfdaSRajvi Jingar 	lnl_d3_fixup();
512*6f9fac55SDavid E. Box 	pmc_core_send_ltr_ignore(pmcdev, 3, 0);
513*6f9fac55SDavid E. Box 
5143748dfdaSRajvi Jingar 	return pmc_core_resume_common(pmcdev);
5153748dfdaSRajvi Jingar }
5163748dfdaSRajvi Jingar 
5173748dfdaSRajvi Jingar int lnl_core_init(struct pmc_dev *pmcdev)
5183748dfdaSRajvi Jingar {
5193748dfdaSRajvi Jingar 	int ret;
5203748dfdaSRajvi Jingar 	int func = 2;
5213748dfdaSRajvi Jingar 	bool ssram_init = true;
5223748dfdaSRajvi Jingar 	struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC];
5233748dfdaSRajvi Jingar 
5243748dfdaSRajvi Jingar 	lnl_d3_fixup();
5253748dfdaSRajvi Jingar 
526*6f9fac55SDavid E. Box 	pmcdev->suspend = cnl_suspend;
5273748dfdaSRajvi Jingar 	pmcdev->resume = lnl_resume;
5283748dfdaSRajvi Jingar 	pmcdev->regmap_list = lnl_pmc_info_list;
5293748dfdaSRajvi Jingar 	ret = pmc_core_ssram_init(pmcdev, func);
5303748dfdaSRajvi Jingar 
5313748dfdaSRajvi Jingar 	/* If regbase not assigned, set map and discover using legacy method */
5323748dfdaSRajvi Jingar 	if (ret) {
5333748dfdaSRajvi Jingar 		ssram_init = false;
5343748dfdaSRajvi Jingar 		pmc->map = &lnl_socm_reg_map;
5353748dfdaSRajvi Jingar 		ret = get_primary_reg_base(pmc);
5363748dfdaSRajvi Jingar 		if (ret)
5373748dfdaSRajvi Jingar 			return ret;
5383748dfdaSRajvi Jingar 	}
5393748dfdaSRajvi Jingar 
5403748dfdaSRajvi Jingar 	pmc_core_get_low_power_modes(pmcdev);
5413748dfdaSRajvi Jingar 
5423748dfdaSRajvi Jingar 	if (ssram_init) {
5433748dfdaSRajvi Jingar 		ret = pmc_core_ssram_get_lpm_reqs(pmcdev);
5443748dfdaSRajvi Jingar 		if (ret)
5453748dfdaSRajvi Jingar 			return ret;
5463748dfdaSRajvi Jingar 	}
5473748dfdaSRajvi Jingar 
5483748dfdaSRajvi Jingar 	return 0;
5493748dfdaSRajvi Jingar }
550