13748dfdaSRajvi Jingar // SPDX-License-Identifier: GPL-2.0
23748dfdaSRajvi Jingar /*
33748dfdaSRajvi Jingar * This file contains platform specific structure definitions
4f1f663ebSColin Ian King * and init function used by Lunar 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 const struct pmc_bit_map lnl_ltr_show_map[] = {
173748dfdaSRajvi Jingar {"SOUTHPORT_A", CNP_PMC_LTR_SPA},
183748dfdaSRajvi Jingar {"SOUTHPORT_B", CNP_PMC_LTR_SPB},
193748dfdaSRajvi Jingar {"SATA", CNP_PMC_LTR_SATA},
203748dfdaSRajvi Jingar {"GIGABIT_ETHERNET", CNP_PMC_LTR_GBE},
213748dfdaSRajvi Jingar {"XHCI", CNP_PMC_LTR_XHCI},
223748dfdaSRajvi Jingar {"SOUTHPORT_F", ADL_PMC_LTR_SPF},
233748dfdaSRajvi Jingar {"ME", CNP_PMC_LTR_ME},
243748dfdaSRajvi Jingar /* EVA is Enterprise Value Add, doesn't really exist on PCH */
253748dfdaSRajvi Jingar {"SATA1", CNP_PMC_LTR_EVA},
263748dfdaSRajvi Jingar {"SOUTHPORT_C", CNP_PMC_LTR_SPC},
273748dfdaSRajvi Jingar {"HD_AUDIO", CNP_PMC_LTR_AZ},
283748dfdaSRajvi Jingar {"CNV", CNP_PMC_LTR_CNV},
293748dfdaSRajvi Jingar {"LPSS", CNP_PMC_LTR_LPSS},
303748dfdaSRajvi Jingar {"SOUTHPORT_D", CNP_PMC_LTR_SPD},
313748dfdaSRajvi Jingar {"SOUTHPORT_E", CNP_PMC_LTR_SPE},
323748dfdaSRajvi Jingar {"SATA2", CNP_PMC_LTR_CAM},
333748dfdaSRajvi Jingar {"ESPI", CNP_PMC_LTR_ESPI},
343748dfdaSRajvi Jingar {"SCC", CNP_PMC_LTR_SCC},
353748dfdaSRajvi Jingar {"ISH", CNP_PMC_LTR_ISH},
363748dfdaSRajvi Jingar {"UFSX2", CNP_PMC_LTR_UFSX2},
373748dfdaSRajvi Jingar {"EMMC", CNP_PMC_LTR_EMMC},
383748dfdaSRajvi Jingar /*
393748dfdaSRajvi Jingar * Check intel_pmc_core_ids[] users of cnp_reg_map for
403748dfdaSRajvi Jingar * a list of core SoCs using this.
413748dfdaSRajvi Jingar */
423748dfdaSRajvi Jingar {"WIGIG", ICL_PMC_LTR_WIGIG},
433748dfdaSRajvi Jingar {"THC0", TGL_PMC_LTR_THC0},
443748dfdaSRajvi Jingar {"THC1", TGL_PMC_LTR_THC1},
453748dfdaSRajvi Jingar {"SOUTHPORT_G", CNP_PMC_LTR_RESERVED},
463748dfdaSRajvi Jingar
473748dfdaSRajvi Jingar {"ESE", MTL_PMC_LTR_ESE},
483748dfdaSRajvi Jingar {"IOE_PMC", MTL_PMC_LTR_IOE_PMC},
493748dfdaSRajvi Jingar {"DMI3", ARL_PMC_LTR_DMI3},
503748dfdaSRajvi Jingar {"OSSE", LNL_PMC_LTR_OSSE},
513748dfdaSRajvi Jingar
523748dfdaSRajvi Jingar /* Below two cannot be used for LTR_IGNORE */
533748dfdaSRajvi Jingar {"CURRENT_PLATFORM", CNP_PMC_LTR_CUR_PLT},
543748dfdaSRajvi Jingar {"AGGREGATED_SYSTEM", CNP_PMC_LTR_CUR_ASLT},
553748dfdaSRajvi Jingar {}
563748dfdaSRajvi Jingar };
573748dfdaSRajvi Jingar
583748dfdaSRajvi Jingar const struct pmc_bit_map lnl_power_gating_status_0_map[] = {
59*86cc9c70SXi Pardee {"PMC_PGD0_PG_STS", BIT(0), 0},
60*86cc9c70SXi Pardee {"FUSE_OSSE_PGD0_PG_STS", BIT(1), 0},
61*86cc9c70SXi Pardee {"ESPISPI_PGD0_PG_STS", BIT(2), 0},
62*86cc9c70SXi Pardee {"XHCI_PGD0_PG_STS", BIT(3), 1},
63*86cc9c70SXi Pardee {"SPA_PGD0_PG_STS", BIT(4), 1},
64*86cc9c70SXi Pardee {"SPB_PGD0_PG_STS", BIT(5), 1},
65*86cc9c70SXi Pardee {"SPR16B0_PGD0_PG_STS", BIT(6), 0},
66*86cc9c70SXi Pardee {"GBE_PGD0_PG_STS", BIT(7), 1},
67*86cc9c70SXi Pardee {"SBR8B7_PGD0_PG_STS", BIT(8), 0},
68*86cc9c70SXi Pardee {"SBR8B6_PGD0_PG_STS", BIT(9), 0},
69*86cc9c70SXi Pardee {"SBR16B1_PGD0_PG_STS", BIT(10), 0},
70*86cc9c70SXi Pardee {"SBR8B8_PGD0_PG_STS", BIT(11), 0},
71*86cc9c70SXi Pardee {"ESE_PGD3_PG_STS", BIT(12), 1},
72*86cc9c70SXi Pardee {"D2D_DISP_PGD0_PG_STS", BIT(13), 1},
73*86cc9c70SXi Pardee {"LPSS_PGD0_PG_STS", BIT(14), 1},
74*86cc9c70SXi Pardee {"LPC_PGD0_PG_STS", BIT(15), 0},
75*86cc9c70SXi Pardee {"SMB_PGD0_PG_STS", BIT(16), 0},
76*86cc9c70SXi Pardee {"ISH_PGD0_PG_STS", BIT(17), 0},
77*86cc9c70SXi Pardee {"SBR8B2_PGD0_PG_STS", BIT(18), 0},
78*86cc9c70SXi Pardee {"NPK_PGD0_PG_STS", BIT(19), 0},
79*86cc9c70SXi Pardee {"D2D_NOC_PGD0_PG_STS", BIT(20), 0},
80*86cc9c70SXi Pardee {"SAFSS_PGD0_PG_STS", BIT(21), 0},
81*86cc9c70SXi Pardee {"FUSE_PGD0_PG_STS", BIT(22), 0},
82*86cc9c70SXi Pardee {"D2D_DISP_PGD1_PG_STS", BIT(23), 1},
83*86cc9c70SXi Pardee {"MPFPW1_PGD0_PG_STS", BIT(24), 0},
84*86cc9c70SXi Pardee {"XDCI_PGD0_PG_STS", BIT(25), 1},
85*86cc9c70SXi Pardee {"EXI_PGD0_PG_STS", BIT(26), 0},
86*86cc9c70SXi Pardee {"CSE_PGD0_PG_STS", BIT(27), 1},
87*86cc9c70SXi Pardee {"KVMCC_PGD0_PG_STS", BIT(28), 1},
88*86cc9c70SXi Pardee {"PMT_PGD0_PG_STS", BIT(29), 1},
89*86cc9c70SXi Pardee {"CLINK_PGD0_PG_STS", BIT(30), 1},
90*86cc9c70SXi Pardee {"PTIO_PGD0_PG_STS", BIT(31), 1},
913748dfdaSRajvi Jingar {}
923748dfdaSRajvi Jingar };
933748dfdaSRajvi Jingar
943748dfdaSRajvi Jingar const struct pmc_bit_map lnl_power_gating_status_1_map[] = {
95*86cc9c70SXi Pardee {"USBR0_PGD0_PG_STS", BIT(0), 1},
96*86cc9c70SXi Pardee {"SUSRAM_PGD0_PG_STS", BIT(1), 1},
97*86cc9c70SXi Pardee {"SMT1_PGD0_PG_STS", BIT(2), 1},
98*86cc9c70SXi Pardee {"U3FPW1_PGD0_PG_STS", BIT(3), 0},
99*86cc9c70SXi Pardee {"SMS2_PGD0_PG_STS", BIT(4), 1},
100*86cc9c70SXi Pardee {"SMS1_PGD0_PG_STS", BIT(5), 1},
101*86cc9c70SXi Pardee {"CSMERTC_PGD0_PG_STS", BIT(6), 0},
102*86cc9c70SXi Pardee {"CSMEPSF_PGD0_PG_STS", BIT(7), 0},
103*86cc9c70SXi Pardee {"FIA_PG_PGD0_PG_STS", BIT(8), 0},
104*86cc9c70SXi Pardee {"SBR16B4_PGD0_PG_STS", BIT(9), 0},
105*86cc9c70SXi Pardee {"P2SB8B_PGD0_PG_STS", BIT(10), 1},
106*86cc9c70SXi Pardee {"DBG_SBR_PGD0_PG_STS", BIT(11), 0},
107*86cc9c70SXi Pardee {"SBR8B9_PGD0_PG_STS", BIT(12), 0},
108*86cc9c70SXi Pardee {"OSSE_SMT1_PGD0_PG_STS", BIT(13), 1},
109*86cc9c70SXi Pardee {"SBR8B10_PGD0_PG_STS", BIT(14), 0},
110*86cc9c70SXi Pardee {"SBR16B3_PGD0_PG_STS", BIT(15), 0},
111*86cc9c70SXi Pardee {"G5FPW1_PGD0_PG_STS", BIT(16), 0},
112*86cc9c70SXi Pardee {"SBRG_PGD0_PG_STS", BIT(17), 0},
113*86cc9c70SXi Pardee {"PSF4_PGD0_PG_STS", BIT(18), 0},
114*86cc9c70SXi Pardee {"CNVI_PGD0_PG_STS", BIT(19), 0},
115*86cc9c70SXi Pardee {"USFX2_PGD0_PG_STS", BIT(20), 1},
116*86cc9c70SXi Pardee {"ENDBG_PGD0_PG_STS", BIT(21), 0},
117*86cc9c70SXi Pardee {"FIACPCB_P5X4_PGD0_PG_STS", BIT(22), 0},
118*86cc9c70SXi Pardee {"SBR8B3_PGD0_PG_STS", BIT(23), 0},
119*86cc9c70SXi Pardee {"SBR8B0_PGD0_PG_STS", BIT(24), 0},
120*86cc9c70SXi Pardee {"NPK_PGD1_PG_STS", BIT(25), 0},
121*86cc9c70SXi Pardee {"OSSE_HOTHAM_PGD0_PG_STS", BIT(26), 1},
122*86cc9c70SXi Pardee {"D2D_NOC_PGD2_PG_STS", BIT(27), 1},
123*86cc9c70SXi Pardee {"SBR8B1_PGD0_PG_STS", BIT(28), 0},
124*86cc9c70SXi Pardee {"PSF6_PGD0_PG_STS", BIT(29), 0},
125*86cc9c70SXi Pardee {"PSF7_PGD0_PG_STS", BIT(30), 0},
126*86cc9c70SXi Pardee {"FIA_U_PGD0_PG_STS", BIT(31), 0},
1273748dfdaSRajvi Jingar {}
1283748dfdaSRajvi Jingar };
1293748dfdaSRajvi Jingar
1303748dfdaSRajvi Jingar const struct pmc_bit_map lnl_power_gating_status_2_map[] = {
131*86cc9c70SXi Pardee {"PSF8_PGD0_PG_STS", BIT(0), 0},
132*86cc9c70SXi Pardee {"SBR16B2_PGD0_PG_STS", BIT(1), 0},
133*86cc9c70SXi Pardee {"D2D_IPU_PGD0_PG_STS", BIT(2), 1},
134*86cc9c70SXi Pardee {"FIACPCB_U_PGD0_PG_STS", BIT(3), 0},
135*86cc9c70SXi Pardee {"TAM_PGD0_PG_STS", BIT(4), 1},
136*86cc9c70SXi Pardee {"D2D_NOC_PGD1_PG_STS", BIT(5), 1},
137*86cc9c70SXi Pardee {"TBTLSX_PGD0_PG_STS", BIT(6), 1},
138*86cc9c70SXi Pardee {"THC0_PGD0_PG_STS", BIT(7), 1},
139*86cc9c70SXi Pardee {"THC1_PGD0_PG_STS", BIT(8), 1},
140*86cc9c70SXi Pardee {"PMC_PGD0_PG_STS", BIT(9), 0},
141*86cc9c70SXi Pardee {"SBR8B5_PGD0_PG_STS", BIT(10), 0},
142*86cc9c70SXi Pardee {"UFSPW1_PGD0_PG_STS", BIT(11), 0},
143*86cc9c70SXi Pardee {"DBC_PGD0_PG_STS", BIT(12), 0},
144*86cc9c70SXi Pardee {"TCSS_PGD0_PG_STS", BIT(13), 0},
145*86cc9c70SXi Pardee {"FIA_P5X4_PGD0_PG_STS", BIT(14), 0},
146*86cc9c70SXi Pardee {"DISP_PGA_PGD0_PG_STS", BIT(15), 0},
147*86cc9c70SXi Pardee {"DISP_PSF_PGD0_PG_STS", BIT(16), 0},
148*86cc9c70SXi Pardee {"PSF0_PGD0_PG_STS", BIT(17), 0},
149*86cc9c70SXi Pardee {"P2SB16B_PGD0_PG_STS", BIT(18), 1},
150*86cc9c70SXi Pardee {"ACE_PGD0_PG_STS", BIT(19), 0},
151*86cc9c70SXi Pardee {"ACE_PGD1_PG_STS", BIT(20), 0},
152*86cc9c70SXi Pardee {"ACE_PGD2_PG_STS", BIT(21), 0},
153*86cc9c70SXi Pardee {"ACE_PGD3_PG_STS", BIT(22), 0},
154*86cc9c70SXi Pardee {"ACE_PGD4_PG_STS", BIT(23), 0},
155*86cc9c70SXi Pardee {"ACE_PGD5_PG_STS", BIT(24), 0},
156*86cc9c70SXi Pardee {"ACE_PGD6_PG_STS", BIT(25), 0},
157*86cc9c70SXi Pardee {"ACE_PGD7_PG_STS", BIT(26), 0},
158*86cc9c70SXi Pardee {"ACE_PGD8_PG_STS", BIT(27), 0},
159*86cc9c70SXi Pardee {"ACE_PGD9_PG_STS", BIT(28), 0},
160*86cc9c70SXi Pardee {"ACE_PGD10_PG_STS", BIT(29), 0},
161*86cc9c70SXi Pardee {"FIACPCB_PG_PGD0_PG_STS", BIT(30), 0},
162*86cc9c70SXi Pardee {"OSSE_PGD0_PG_STS", BIT(31), 1},
1633748dfdaSRajvi Jingar {}
1643748dfdaSRajvi Jingar };
1653748dfdaSRajvi Jingar
1663748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_0_map[] = {
167*86cc9c70SXi Pardee {"LPSS_D3_STS", BIT(3), 1},
168*86cc9c70SXi Pardee {"XDCI_D3_STS", BIT(4), 1},
169*86cc9c70SXi Pardee {"XHCI_D3_STS", BIT(5), 1},
170*86cc9c70SXi Pardee {"SPA_D3_STS", BIT(12), 0},
171*86cc9c70SXi Pardee {"SPB_D3_STS", BIT(13), 0},
172*86cc9c70SXi Pardee {"OSSE_D3_STS", BIT(15), 0},
173*86cc9c70SXi Pardee {"ESPISPI_D3_STS", BIT(18), 0},
174*86cc9c70SXi Pardee {"PSTH_D3_STS", BIT(21), 0},
1753748dfdaSRajvi Jingar {}
1763748dfdaSRajvi Jingar };
1773748dfdaSRajvi Jingar
1783748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_1_map[] = {
179*86cc9c70SXi Pardee {"OSSE_SMT1_D3_STS", BIT(7), 0},
180*86cc9c70SXi Pardee {"GBE_D3_STS", BIT(19), 0},
181*86cc9c70SXi Pardee {"ITSS_D3_STS", BIT(23), 0},
182*86cc9c70SXi Pardee {"CNVI_D3_STS", BIT(27), 0},
183*86cc9c70SXi Pardee {"UFSX2_D3_STS", BIT(28), 1},
184*86cc9c70SXi Pardee {"OSSE_HOTHAM_D3_STS", BIT(31), 0},
1853748dfdaSRajvi Jingar {}
1863748dfdaSRajvi Jingar };
1873748dfdaSRajvi Jingar
1883748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_2_map[] = {
189*86cc9c70SXi Pardee {"ESE_D3_STS", BIT(0), 0},
190*86cc9c70SXi Pardee {"CSMERTC_D3_STS", BIT(1), 0},
191*86cc9c70SXi Pardee {"SUSRAM_D3_STS", BIT(2), 0},
192*86cc9c70SXi Pardee {"CSE_D3_STS", BIT(4), 0},
193*86cc9c70SXi Pardee {"KVMCC_D3_STS", BIT(5), 0},
194*86cc9c70SXi Pardee {"USBR0_D3_STS", BIT(6), 0},
195*86cc9c70SXi Pardee {"ISH_D3_STS", BIT(7), 0},
196*86cc9c70SXi Pardee {"SMT1_D3_STS", BIT(8), 0},
197*86cc9c70SXi Pardee {"SMT2_D3_STS", BIT(9), 0},
198*86cc9c70SXi Pardee {"SMT3_D3_STS", BIT(10), 0},
199*86cc9c70SXi Pardee {"OSSE_SMT2_D3_STS", BIT(13), 0},
200*86cc9c70SXi Pardee {"CLINK_D3_STS", BIT(14), 0},
201*86cc9c70SXi Pardee {"PTIO_D3_STS", BIT(16), 0},
202*86cc9c70SXi Pardee {"PMT_D3_STS", BIT(17), 0},
203*86cc9c70SXi Pardee {"SMS1_D3_STS", BIT(18), 0},
204*86cc9c70SXi Pardee {"SMS2_D3_STS", BIT(19), 0},
2053748dfdaSRajvi Jingar {}
2063748dfdaSRajvi Jingar };
2073748dfdaSRajvi Jingar
2083748dfdaSRajvi Jingar const struct pmc_bit_map lnl_d3_status_3_map[] = {
209*86cc9c70SXi Pardee {"THC0_D3_STS", BIT(14), 1},
210*86cc9c70SXi Pardee {"THC1_D3_STS", BIT(15), 1},
211*86cc9c70SXi Pardee {"OSSE_SMT3_D3_STS", BIT(21), 0},
212*86cc9c70SXi Pardee {"ACE_D3_STS", BIT(23), 0},
2133748dfdaSRajvi Jingar {}
2143748dfdaSRajvi Jingar };
2153748dfdaSRajvi Jingar
2163748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_0_map[] = {
217*86cc9c70SXi Pardee {"LPSS_VNN_REQ_STS", BIT(3), 1},
218*86cc9c70SXi Pardee {"OSSE_VNN_REQ_STS", BIT(15), 1},
219*86cc9c70SXi Pardee {"ESPISPI_VNN_REQ_STS", BIT(18), 1},
2203748dfdaSRajvi Jingar {}
2213748dfdaSRajvi Jingar };
2223748dfdaSRajvi Jingar
2233748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_1_map[] = {
224*86cc9c70SXi Pardee {"NPK_VNN_REQ_STS", BIT(4), 1},
225*86cc9c70SXi Pardee {"OSSE_SMT1_VNN_REQ_STS", BIT(7), 1},
226*86cc9c70SXi Pardee {"DFXAGG_VNN_REQ_STS", BIT(8), 0},
227*86cc9c70SXi Pardee {"EXI_VNN_REQ_STS", BIT(9), 1},
228*86cc9c70SXi Pardee {"P2D_VNN_REQ_STS", BIT(18), 1},
229*86cc9c70SXi Pardee {"GBE_VNN_REQ_STS", BIT(19), 1},
230*86cc9c70SXi Pardee {"SMB_VNN_REQ_STS", BIT(25), 1},
231*86cc9c70SXi Pardee {"LPC_VNN_REQ_STS", BIT(26), 0},
2323748dfdaSRajvi Jingar {}
2333748dfdaSRajvi Jingar };
2343748dfdaSRajvi Jingar
2353748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_2_map[] = {
236*86cc9c70SXi Pardee {"eSE_VNN_REQ_STS", BIT(0), 1},
237*86cc9c70SXi Pardee {"CSMERTC_VNN_REQ_STS", BIT(1), 1},
238*86cc9c70SXi Pardee {"CSE_VNN_REQ_STS", BIT(4), 1},
239*86cc9c70SXi Pardee {"ISH_VNN_REQ_STS", BIT(7), 1},
240*86cc9c70SXi Pardee {"SMT1_VNN_REQ_STS", BIT(8), 1},
241*86cc9c70SXi Pardee {"CLINK_VNN_REQ_STS", BIT(14), 1},
242*86cc9c70SXi Pardee {"SMS1_VNN_REQ_STS", BIT(18), 1},
243*86cc9c70SXi Pardee {"SMS2_VNN_REQ_STS", BIT(19), 1},
244*86cc9c70SXi Pardee {"GPIOCOM4_VNN_REQ_STS", BIT(20), 1},
245*86cc9c70SXi Pardee {"GPIOCOM3_VNN_REQ_STS", BIT(21), 1},
246*86cc9c70SXi Pardee {"GPIOCOM2_VNN_REQ_STS", BIT(22), 0},
247*86cc9c70SXi Pardee {"GPIOCOM1_VNN_REQ_STS", BIT(23), 1},
248*86cc9c70SXi Pardee {"GPIOCOM0_VNN_REQ_STS", BIT(24), 1},
2493748dfdaSRajvi Jingar {}
2503748dfdaSRajvi Jingar };
2513748dfdaSRajvi Jingar
2523748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_req_status_3_map[] = {
253*86cc9c70SXi Pardee {"DISP_SHIM_VNN_REQ_STS", BIT(2), 0},
254*86cc9c70SXi Pardee {"DTS0_VNN_REQ_STS", BIT(7), 0},
255*86cc9c70SXi Pardee {"GPIOCOM5_VNN_REQ_STS", BIT(11), 2},
2563748dfdaSRajvi Jingar {}
2573748dfdaSRajvi Jingar };
2583748dfdaSRajvi Jingar
2593748dfdaSRajvi Jingar const struct pmc_bit_map lnl_vnn_misc_status_map[] = {
260*86cc9c70SXi Pardee {"CPU_C10_REQ_STS", BIT(0), 0},
261*86cc9c70SXi Pardee {"TS_OFF_REQ_STS", BIT(1), 0},
262*86cc9c70SXi Pardee {"PNDE_MET_REQ_STS", BIT(2), 1},
263*86cc9c70SXi Pardee {"PCIE_DEEP_PM_REQ_STS", BIT(3), 0},
264*86cc9c70SXi Pardee {"PMC_CLK_THROTTLE_EN_REQ_STS", BIT(4), 0},
265*86cc9c70SXi Pardee {"NPK_VNNAON_REQ_STS", BIT(5), 0},
266*86cc9c70SXi Pardee {"VNN_SOC_REQ_STS", BIT(6), 1},
267*86cc9c70SXi Pardee {"ISH_VNNAON_REQ_STS", BIT(7), 0},
268*86cc9c70SXi Pardee {"D2D_NOC_CFI_QACTIVE_REQ_STS", BIT(8), 1},
269*86cc9c70SXi Pardee {"D2D_NOC_GPSB_QACTIVE_REQ_STS", BIT(9), 1},
270*86cc9c70SXi Pardee {"D2D_NOC_IPU_QACTIVE_REQ_STS", BIT(10), 1},
271*86cc9c70SXi Pardee {"PLT_GREATER_REQ_STS", BIT(11), 1},
272*86cc9c70SXi Pardee {"PCIE_CLKREQ_REQ_STS", BIT(12), 0},
273*86cc9c70SXi Pardee {"PMC_IDLE_FB_OCP_REQ_STS", BIT(13), 0},
274*86cc9c70SXi Pardee {"PM_SYNC_STATES_REQ_STS", BIT(14), 0},
275*86cc9c70SXi Pardee {"EA_REQ_STS", BIT(15), 0},
276*86cc9c70SXi Pardee {"MPHY_CORE_OFF_REQ_STS", BIT(16), 0},
277*86cc9c70SXi Pardee {"BRK_EV_EN_REQ_STS", BIT(17), 0},
278*86cc9c70SXi Pardee {"AUTO_DEMO_EN_REQ_STS", BIT(18), 0},
279*86cc9c70SXi Pardee {"ITSS_CLK_SRC_REQ_STS", BIT(19), 1},
280*86cc9c70SXi Pardee {"LPC_CLK_SRC_REQ_STS", BIT(20), 0},
281*86cc9c70SXi Pardee {"ARC_IDLE_REQ_STS", BIT(21), 0},
282*86cc9c70SXi Pardee {"MPHY_SUS_REQ_STS", BIT(22), 0},
283*86cc9c70SXi Pardee {"FIA_DEEP_PM_REQ_STS", BIT(23), 0},
284*86cc9c70SXi Pardee {"UXD_CONNECTED_REQ_STS", BIT(24), 1},
285*86cc9c70SXi Pardee {"ARC_INTERRUPT_WAKE_REQ_STS", BIT(25), 0},
286*86cc9c70SXi Pardee {"D2D_NOC_DISP_DDI_QACTIVE_REQ_STS", BIT(26), 1},
287*86cc9c70SXi Pardee {"PRE_WAKE0_REQ_STS", BIT(27), 1},
288*86cc9c70SXi Pardee {"PRE_WAKE1_REQ_STS", BIT(28), 1},
289*86cc9c70SXi Pardee {"PRE_WAKE2_EN_REQ_STS", BIT(29), 1},
290*86cc9c70SXi Pardee {"WOV_REQ_STS", BIT(30), 0},
291*86cc9c70SXi Pardee {"D2D_NOC_DISP_EDP_QACTIVE_REQ_STS_31", BIT(31), 1},
2923748dfdaSRajvi Jingar {}
2933748dfdaSRajvi Jingar };
2943748dfdaSRajvi Jingar
2953748dfdaSRajvi Jingar const struct pmc_bit_map lnl_clocksource_status_map[] = {
296*86cc9c70SXi Pardee {"AON2_OFF_STS", BIT(0), 0},
297*86cc9c70SXi Pardee {"AON3_OFF_STS", BIT(1), 1},
298*86cc9c70SXi Pardee {"AON4_OFF_STS", BIT(2), 1},
299*86cc9c70SXi Pardee {"AON5_OFF_STS", BIT(3), 1},
300*86cc9c70SXi Pardee {"AON1_OFF_STS", BIT(4), 0},
301*86cc9c70SXi Pardee {"MPFPW1_0_PLL_OFF_STS", BIT(6), 1},
302*86cc9c70SXi Pardee {"USB3_PLL_OFF_STS", BIT(8), 1},
303*86cc9c70SXi Pardee {"AON3_SPL_OFF_STS", BIT(9), 1},
304*86cc9c70SXi Pardee {"G5FPW1_PLL_OFF_STS", BIT(15), 1},
305*86cc9c70SXi Pardee {"XTAL_AGGR_OFF_STS", BIT(17), 1},
306*86cc9c70SXi Pardee {"USB2_PLL_OFF_STS", BIT(18), 0},
307*86cc9c70SXi Pardee {"SAF_PLL_OFF_STS", BIT(19), 1},
308*86cc9c70SXi Pardee {"SE_TCSS_PLL_OFF_STS", BIT(20), 1},
309*86cc9c70SXi Pardee {"DDI_PLL_OFF_STS", BIT(21), 1},
310*86cc9c70SXi Pardee {"FILTER_PLL_OFF_STS", BIT(22), 1},
311*86cc9c70SXi Pardee {"ACE_PLL_OFF_STS", BIT(24), 0},
312*86cc9c70SXi Pardee {"FABRIC_PLL_OFF_STS", BIT(25), 1},
313*86cc9c70SXi Pardee {"SOC_PLL_OFF_STS", BIT(26), 1},
314*86cc9c70SXi Pardee {"REF_OFF_STS", BIT(28), 1},
315*86cc9c70SXi Pardee {"IMG_OFF_STS", BIT(29), 1},
316*86cc9c70SXi Pardee {"RTC_PLL_OFF_STS", BIT(31), 0},
3173748dfdaSRajvi Jingar {}
3183748dfdaSRajvi Jingar };
3193748dfdaSRajvi Jingar
3204f3eec14SXi Pardee const struct pmc_bit_map lnl_signal_status_map[] = {
321*86cc9c70SXi Pardee {"LSX_Wake0_STS", BIT(0), 0},
322*86cc9c70SXi Pardee {"LSX_Wake1_STS", BIT(1), 0},
323*86cc9c70SXi Pardee {"LSX_Wake2_STS", BIT(2), 0},
324*86cc9c70SXi Pardee {"LSX_Wake3_STS", BIT(3), 0},
325*86cc9c70SXi Pardee {"LSX_Wake4_STS", BIT(4), 0},
326*86cc9c70SXi Pardee {"LSX_Wake5_STS", BIT(5), 0},
327*86cc9c70SXi Pardee {"LSX_Wake6_STS", BIT(6), 0},
328*86cc9c70SXi Pardee {"LSX_Wake7_STS", BIT(7), 0},
329*86cc9c70SXi Pardee {"LPSS_Wake0_STS", BIT(8), 1},
330*86cc9c70SXi Pardee {"LPSS_Wake1_STS", BIT(9), 1},
331*86cc9c70SXi Pardee {"Int_Timer_SS_Wake0_STS", BIT(10), 1},
332*86cc9c70SXi Pardee {"Int_Timer_SS_Wake1_STS", BIT(11), 1},
333*86cc9c70SXi Pardee {"Int_Timer_SS_Wake2_STS", BIT(12), 1},
334*86cc9c70SXi Pardee {"Int_Timer_SS_Wake3_STS", BIT(13), 1},
335*86cc9c70SXi Pardee {"Int_Timer_SS_Wake4_STS", BIT(14), 1},
336*86cc9c70SXi Pardee {"Int_Timer_SS_Wake5_STS", BIT(15), 1},
337*86cc9c70SXi Pardee {}
338*86cc9c70SXi Pardee };
339*86cc9c70SXi Pardee
340*86cc9c70SXi Pardee const struct pmc_bit_map lnl_rsc_status_map[] = {
341*86cc9c70SXi Pardee {"Memory", 0, 1},
342*86cc9c70SXi Pardee {"PSF0", 0, 1},
343*86cc9c70SXi Pardee {"PSF4", 0, 1},
344*86cc9c70SXi Pardee {"PSF6", 0, 1},
345*86cc9c70SXi Pardee {"PSF7", 0, 1},
346*86cc9c70SXi Pardee {"PSF8", 0, 1},
347*86cc9c70SXi Pardee {"SAF_CFI_LINK", 0, 1},
348*86cc9c70SXi Pardee {"SBR", 0, 1},
3494f3eec14SXi Pardee {}
3504f3eec14SXi Pardee };
3514f3eec14SXi Pardee
3523748dfdaSRajvi Jingar const struct pmc_bit_map *lnl_lpm_maps[] = {
3533748dfdaSRajvi Jingar lnl_clocksource_status_map,
3543748dfdaSRajvi Jingar lnl_power_gating_status_0_map,
3553748dfdaSRajvi Jingar lnl_power_gating_status_1_map,
3563748dfdaSRajvi Jingar lnl_power_gating_status_2_map,
3573748dfdaSRajvi Jingar lnl_d3_status_0_map,
3583748dfdaSRajvi Jingar lnl_d3_status_1_map,
3593748dfdaSRajvi Jingar lnl_d3_status_2_map,
3603748dfdaSRajvi Jingar lnl_d3_status_3_map,
3613748dfdaSRajvi Jingar lnl_vnn_req_status_0_map,
3623748dfdaSRajvi Jingar lnl_vnn_req_status_1_map,
3633748dfdaSRajvi Jingar lnl_vnn_req_status_2_map,
3643748dfdaSRajvi Jingar lnl_vnn_req_status_3_map,
3653748dfdaSRajvi Jingar lnl_vnn_misc_status_map,
3664f3eec14SXi Pardee lnl_signal_status_map,
3673748dfdaSRajvi Jingar NULL
3683748dfdaSRajvi Jingar };
3693748dfdaSRajvi Jingar
370*86cc9c70SXi Pardee const struct pmc_bit_map *lnl_blk_maps[] = {
371*86cc9c70SXi Pardee lnl_power_gating_status_0_map,
372*86cc9c70SXi Pardee lnl_power_gating_status_1_map,
373*86cc9c70SXi Pardee lnl_power_gating_status_2_map,
374*86cc9c70SXi Pardee lnl_rsc_status_map,
375*86cc9c70SXi Pardee lnl_vnn_req_status_0_map,
376*86cc9c70SXi Pardee lnl_vnn_req_status_1_map,
377*86cc9c70SXi Pardee lnl_vnn_req_status_2_map,
378*86cc9c70SXi Pardee lnl_vnn_req_status_3_map,
379*86cc9c70SXi Pardee lnl_d3_status_0_map,
380*86cc9c70SXi Pardee lnl_d3_status_1_map,
381*86cc9c70SXi Pardee lnl_d3_status_2_map,
382*86cc9c70SXi Pardee lnl_d3_status_3_map,
383*86cc9c70SXi Pardee lnl_clocksource_status_map,
384*86cc9c70SXi Pardee lnl_vnn_misc_status_map,
385*86cc9c70SXi Pardee lnl_signal_status_map,
386*86cc9c70SXi Pardee NULL
387*86cc9c70SXi Pardee };
388*86cc9c70SXi Pardee
3893748dfdaSRajvi Jingar const struct pmc_bit_map lnl_pfear_map[] = {
3903748dfdaSRajvi Jingar {"PMC_0", BIT(0)},
3913748dfdaSRajvi Jingar {"FUSE_OSSE", BIT(1)},
3923748dfdaSRajvi Jingar {"ESPISPI", BIT(2)},
3933748dfdaSRajvi Jingar {"XHCI", BIT(3)},
3943748dfdaSRajvi Jingar {"SPA", BIT(4)},
3953748dfdaSRajvi Jingar {"SPB", BIT(5)},
3963748dfdaSRajvi Jingar {"SBR16B0", BIT(6)},
3973748dfdaSRajvi Jingar {"GBE", BIT(7)},
3983748dfdaSRajvi Jingar
3993748dfdaSRajvi Jingar {"SBR8B7", BIT(0)},
4003748dfdaSRajvi Jingar {"SBR8B6", BIT(1)},
4013748dfdaSRajvi Jingar {"SBR16B1", BIT(1)},
4023748dfdaSRajvi Jingar {"SBR8B8", BIT(2)},
4033748dfdaSRajvi Jingar {"ESE", BIT(3)},
4043748dfdaSRajvi Jingar {"SBR8B10", BIT(4)},
4053748dfdaSRajvi Jingar {"D2D_DISP_0", BIT(5)},
4063748dfdaSRajvi Jingar {"LPSS", BIT(6)},
4073748dfdaSRajvi Jingar {"LPC", BIT(7)},
4083748dfdaSRajvi Jingar
4093748dfdaSRajvi Jingar {"SMB", BIT(0)},
4103748dfdaSRajvi Jingar {"ISH", BIT(1)},
4113748dfdaSRajvi Jingar {"SBR8B2", BIT(2)},
4123748dfdaSRajvi Jingar {"NPK_0", BIT(3)},
4133748dfdaSRajvi Jingar {"D2D_NOC_0", BIT(4)},
4143748dfdaSRajvi Jingar {"SAFSS", BIT(5)},
4153748dfdaSRajvi Jingar {"FUSE", BIT(6)},
4163748dfdaSRajvi Jingar {"D2D_DISP_1", BIT(7)},
4173748dfdaSRajvi Jingar
4183748dfdaSRajvi Jingar {"MPFPW1", BIT(0)},
4193748dfdaSRajvi Jingar {"XDCI", BIT(1)},
4203748dfdaSRajvi Jingar {"EXI", BIT(2)},
4213748dfdaSRajvi Jingar {"CSE", BIT(3)},
4223748dfdaSRajvi Jingar {"KVMCC", BIT(4)},
4233748dfdaSRajvi Jingar {"PMT", BIT(5)},
4243748dfdaSRajvi Jingar {"CLINK", BIT(6)},
4253748dfdaSRajvi Jingar {"PTIO", BIT(7)},
4263748dfdaSRajvi Jingar
4273748dfdaSRajvi Jingar {"USBR", BIT(0)},
4283748dfdaSRajvi Jingar {"SUSRAM", BIT(1)},
4293748dfdaSRajvi Jingar {"SMT1", BIT(2)},
4303748dfdaSRajvi Jingar {"U3FPW1", BIT(3)},
4313748dfdaSRajvi Jingar {"SMS2", BIT(4)},
4323748dfdaSRajvi Jingar {"SMS1", BIT(5)},
4333748dfdaSRajvi Jingar {"CSMERTC", BIT(6)},
4343748dfdaSRajvi Jingar {"CSMEPSF", BIT(7)},
4353748dfdaSRajvi Jingar
4363748dfdaSRajvi Jingar {"FIA_PG", BIT(0)},
4373748dfdaSRajvi Jingar {"SBR16B4", BIT(1)},
4383748dfdaSRajvi Jingar {"P2SB8B", BIT(2)},
4393748dfdaSRajvi Jingar {"DBG_SBR", BIT(3)},
4403748dfdaSRajvi Jingar {"SBR8B9", BIT(4)},
4413748dfdaSRajvi Jingar {"OSSE_SMT1", BIT(5)},
4423748dfdaSRajvi Jingar {"SBR8B10", BIT(6)},
4433748dfdaSRajvi Jingar {"SBR16B3", BIT(7)},
4443748dfdaSRajvi Jingar
4453748dfdaSRajvi Jingar {"G5FPW1", BIT(0)},
4463748dfdaSRajvi Jingar {"SBRG", BIT(1)},
4473748dfdaSRajvi Jingar {"PSF4", BIT(2)},
4483748dfdaSRajvi Jingar {"CNVI", BIT(3)},
4493748dfdaSRajvi Jingar {"UFSX2", BIT(4)},
4503748dfdaSRajvi Jingar {"ENDBG", BIT(5)},
4513748dfdaSRajvi Jingar {"FIACPCB_P5X4", BIT(6)},
4523748dfdaSRajvi Jingar {"SBR8B3", BIT(7)},
4533748dfdaSRajvi Jingar
4543748dfdaSRajvi Jingar {"SBR8B0", BIT(0)},
4553748dfdaSRajvi Jingar {"NPK_1", BIT(1)},
4563748dfdaSRajvi Jingar {"OSSE_HOTHAM", BIT(2)},
4573748dfdaSRajvi Jingar {"D2D_NOC_2", BIT(3)},
4583748dfdaSRajvi Jingar {"SBR8B1", BIT(4)},
4593748dfdaSRajvi Jingar {"PSF6", BIT(5)},
4603748dfdaSRajvi Jingar {"PSF7", BIT(6)},
4613748dfdaSRajvi Jingar {"FIA_U", BIT(7)},
4623748dfdaSRajvi Jingar
4633748dfdaSRajvi Jingar {"PSF8", BIT(0)},
4643748dfdaSRajvi Jingar {"SBR16B2", BIT(1)},
4653748dfdaSRajvi Jingar {"D2D_IPU", BIT(2)},
4663748dfdaSRajvi Jingar {"FIACPCB_U", BIT(3)},
4673748dfdaSRajvi Jingar {"TAM", BIT(4)},
4683748dfdaSRajvi Jingar {"D2D_NOC_1", BIT(5)},
4693748dfdaSRajvi Jingar {"TBTLSX", BIT(6)},
4703748dfdaSRajvi Jingar {"THC0", BIT(7)},
4713748dfdaSRajvi Jingar
4723748dfdaSRajvi Jingar {"THC1", BIT(0)},
4733748dfdaSRajvi Jingar {"PMC_1", BIT(1)},
4743748dfdaSRajvi Jingar {"SBR8B5", BIT(2)},
4753748dfdaSRajvi Jingar {"UFSPW1", BIT(3)},
4763748dfdaSRajvi Jingar {"DBC", BIT(4)},
4773748dfdaSRajvi Jingar {"TCSS", BIT(5)},
4783748dfdaSRajvi Jingar {"FIA_P5X4", BIT(6)},
4793748dfdaSRajvi Jingar {"DISP_PGA", BIT(7)},
4803748dfdaSRajvi Jingar
4813748dfdaSRajvi Jingar {"DBG_PSF", BIT(0)},
4823748dfdaSRajvi Jingar {"PSF0", BIT(1)},
4833748dfdaSRajvi Jingar {"P2SB16B", BIT(2)},
4843748dfdaSRajvi Jingar {"ACE0", BIT(3)},
4853748dfdaSRajvi Jingar {"ACE1", BIT(4)},
4863748dfdaSRajvi Jingar {"ACE2", BIT(5)},
4873748dfdaSRajvi Jingar {"ACE3", BIT(6)},
4883748dfdaSRajvi Jingar {"ACE4", BIT(7)},
4893748dfdaSRajvi Jingar
4903748dfdaSRajvi Jingar {"ACE5", BIT(0)},
4913748dfdaSRajvi Jingar {"ACE6", BIT(1)},
4923748dfdaSRajvi Jingar {"ACE7", BIT(2)},
4933748dfdaSRajvi Jingar {"ACE8", BIT(3)},
4943748dfdaSRajvi Jingar {"ACE9", BIT(4)},
4953748dfdaSRajvi Jingar {"ACE10", BIT(5)},
4963748dfdaSRajvi Jingar {"FIACPCB", BIT(6)},
4973748dfdaSRajvi Jingar {"OSSE", BIT(7)},
4983748dfdaSRajvi Jingar {}
4993748dfdaSRajvi Jingar };
5003748dfdaSRajvi Jingar
5013748dfdaSRajvi Jingar const struct pmc_bit_map *ext_lnl_pfear_map[] = {
5023748dfdaSRajvi Jingar lnl_pfear_map,
5033748dfdaSRajvi Jingar NULL
5043748dfdaSRajvi Jingar };
5053748dfdaSRajvi Jingar
5063748dfdaSRajvi Jingar const struct pmc_reg_map lnl_socm_reg_map = {
5073748dfdaSRajvi Jingar .pfear_sts = ext_lnl_pfear_map,
5083748dfdaSRajvi Jingar .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET,
5093748dfdaSRajvi Jingar .slp_s0_res_counter_step = TGL_PMC_SLP_S0_RES_COUNTER_STEP,
5103748dfdaSRajvi Jingar .ltr_show_sts = lnl_ltr_show_map,
5113748dfdaSRajvi Jingar .msr_sts = msr_map,
5123748dfdaSRajvi Jingar .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET,
5133748dfdaSRajvi Jingar .regmap_length = LNL_PMC_MMIO_REG_LEN,
5143748dfdaSRajvi Jingar .ppfear0_offset = CNP_PMC_HOST_PPFEAR0A,
5153748dfdaSRajvi Jingar .ppfear_buckets = LNL_PPFEAR_NUM_ENTRIES,
5163748dfdaSRajvi Jingar .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
5173748dfdaSRajvi Jingar .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
5183748dfdaSRajvi Jingar .ltr_ignore_max = LNL_NUM_IP_IGN_ALLOWED,
5193748dfdaSRajvi Jingar .lpm_num_maps = ADL_LPM_NUM_MAPS,
5203748dfdaSRajvi Jingar .lpm_res_counter_step_x2 = TGL_PMC_LPM_RES_COUNTER_STEP_X2,
5213748dfdaSRajvi Jingar .etr3_offset = ETR3_OFFSET,
5223748dfdaSRajvi Jingar .lpm_sts_latch_en_offset = MTL_LPM_STATUS_LATCH_EN_OFFSET,
5233748dfdaSRajvi Jingar .lpm_priority_offset = MTL_LPM_PRI_OFFSET,
5243748dfdaSRajvi Jingar .lpm_en_offset = MTL_LPM_EN_OFFSET,
5253748dfdaSRajvi Jingar .lpm_residency_offset = MTL_LPM_RESIDENCY_OFFSET,
5263748dfdaSRajvi Jingar .lpm_sts = lnl_lpm_maps,
5273748dfdaSRajvi Jingar .lpm_status_offset = MTL_LPM_STATUS_OFFSET,
5283748dfdaSRajvi Jingar .lpm_live_status_offset = MTL_LPM_LIVE_STATUS_OFFSET,
529*86cc9c70SXi Pardee .s0ix_blocker_maps = lnl_blk_maps,
530*86cc9c70SXi Pardee .s0ix_blocker_offset = LNL_S0IX_BLOCKER_OFFSET,
5313748dfdaSRajvi Jingar };
5323748dfdaSRajvi Jingar
5333748dfdaSRajvi Jingar #define LNL_NPU_PCI_DEV 0x643e
5343748dfdaSRajvi Jingar #define LNL_IPU_PCI_DEV 0x645d
5353748dfdaSRajvi Jingar
5363748dfdaSRajvi Jingar /*
5373748dfdaSRajvi Jingar * Set power state of select devices that do not have drivers to D3
5383748dfdaSRajvi Jingar * so that they do not block Package C entry.
5393748dfdaSRajvi Jingar */
lnl_d3_fixup(void)5403748dfdaSRajvi Jingar static void lnl_d3_fixup(void)
5413748dfdaSRajvi Jingar {
5423748dfdaSRajvi Jingar pmc_core_set_device_d3(LNL_IPU_PCI_DEV);
5433748dfdaSRajvi Jingar pmc_core_set_device_d3(LNL_NPU_PCI_DEV);
5443748dfdaSRajvi Jingar }
5453748dfdaSRajvi Jingar
lnl_resume(struct pmc_dev * pmcdev)5463748dfdaSRajvi Jingar static int lnl_resume(struct pmc_dev *pmcdev)
5473748dfdaSRajvi Jingar {
5483748dfdaSRajvi Jingar lnl_d3_fixup();
5496f9fac55SDavid E. Box pmc_core_send_ltr_ignore(pmcdev, 3, 0);
5506f9fac55SDavid E. Box
5513748dfdaSRajvi Jingar return pmc_core_resume_common(pmcdev);
5523748dfdaSRajvi Jingar }
5533748dfdaSRajvi Jingar
lnl_core_init(struct pmc_dev * pmcdev)5543748dfdaSRajvi Jingar int lnl_core_init(struct pmc_dev *pmcdev)
5553748dfdaSRajvi Jingar {
5563748dfdaSRajvi Jingar int ret;
5573748dfdaSRajvi Jingar struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC];
5583748dfdaSRajvi Jingar
5593748dfdaSRajvi Jingar lnl_d3_fixup();
5603748dfdaSRajvi Jingar
5616f9fac55SDavid E. Box pmcdev->suspend = cnl_suspend;
5623748dfdaSRajvi Jingar pmcdev->resume = lnl_resume;
5633748dfdaSRajvi Jingar
5643748dfdaSRajvi Jingar pmc->map = &lnl_socm_reg_map;
5653748dfdaSRajvi Jingar ret = get_primary_reg_base(pmc);
5663748dfdaSRajvi Jingar if (ret)
5673748dfdaSRajvi Jingar return ret;
5683748dfdaSRajvi Jingar
5693748dfdaSRajvi Jingar pmc_core_get_low_power_modes(pmcdev);
5703748dfdaSRajvi Jingar
5713748dfdaSRajvi Jingar return 0;
5723748dfdaSRajvi Jingar }
573