@@ -118,6 +118,10 @@ static const struct pmc_bit_map spt_pfear_map[] = {
118118};
119119
120120static const struct pmc_bit_map * ext_spt_pfear_map [] = {
121+ /*
122+ * Check intel_pmc_core_ids[] users of spt_reg_map for
123+ * a list of core SoCs using this.
124+ */
121125 spt_pfear_map ,
122126 NULL
123127};
@@ -154,6 +158,7 @@ static const struct pmc_reg_map spt_reg_map = {
154158 .ltr_show_sts = spt_ltr_show_map ,
155159 .msr_sts = msr_map ,
156160 .slp_s0_offset = SPT_PMC_SLP_S0_RES_COUNTER_OFFSET ,
161+ .slp_s0_res_counter_step = SPT_PMC_SLP_S0_RES_COUNTER_STEP ,
157162 .ltr_ignore_offset = SPT_PMC_LTR_IGNORE_OFFSET ,
158163 .regmap_length = SPT_PMC_MMIO_REG_LEN ,
159164 .ppfear0_offset = SPT_PMC_XRAM_PPFEAR0A ,
@@ -166,7 +171,6 @@ static const struct pmc_reg_map spt_reg_map = {
166171
167172/* Cannon Lake: PGD PFET Enable Ack Status Register(s) bitmap */
168173static const struct pmc_bit_map cnp_pfear_map [] = {
169- /* Reserved for Cannon Lake but valid for Comet Lake */
170174 {"PMC" , BIT (0 )},
171175 {"OPI-DMI" , BIT (1 )},
172176 {"SPI/eSPI" , BIT (2 )},
@@ -192,10 +196,6 @@ static const struct pmc_bit_map cnp_pfear_map[] = {
192196 {"SDX" , BIT (4 )},
193197 {"SPE" , BIT (5 )},
194198 {"Fuse" , BIT (6 )},
195- /*
196- * Reserved for Cannon Lake but valid for Ice Lake, Comet Lake,
197- * Tiger Lake, Elkhart Lake and Jasper Lake.
198- */
199199 {"SBR8" , BIT (7 )},
200200
201201 {"CSME_FSC" , BIT (0 )},
@@ -239,23 +239,22 @@ static const struct pmc_bit_map cnp_pfear_map[] = {
239239 {"HDA_PGD4" , BIT (2 )},
240240 {"HDA_PGD5" , BIT (3 )},
241241 {"HDA_PGD6" , BIT (4 )},
242- /*
243- * Reserved for Cannon Lake but valid for Ice Lake, Comet Lake,
244- * Tiger Lake, ELkhart Lake and Jasper Lake.
245- */
246242 {"PSF6" , BIT (5 )},
247243 {"PSF7" , BIT (6 )},
248244 {"PSF8" , BIT (7 )},
249245 {}
250246};
251247
252248static const struct pmc_bit_map * ext_cnp_pfear_map [] = {
249+ /*
250+ * Check intel_pmc_core_ids[] users of cnp_reg_map for
251+ * a list of core SoCs using this.
252+ */
253253 cnp_pfear_map ,
254254 NULL
255255};
256256
257257static const struct pmc_bit_map icl_pfear_map [] = {
258- /* Ice Lake and Jasper Lake generation onwards only */
259258 {"RES_65" , BIT (0 )},
260259 {"RES_66" , BIT (1 )},
261260 {"RES_67" , BIT (2 )},
@@ -268,13 +267,16 @@ static const struct pmc_bit_map icl_pfear_map[] = {
268267};
269268
270269static const struct pmc_bit_map * ext_icl_pfear_map [] = {
270+ /*
271+ * Check intel_pmc_core_ids[] users of icl_reg_map for
272+ * a list of core SoCs using this.
273+ */
271274 cnp_pfear_map ,
272275 icl_pfear_map ,
273276 NULL
274277};
275278
276279static const struct pmc_bit_map tgl_pfear_map [] = {
277- /* Tiger Lake and Elkhart Lake generation onwards only */
278280 {"PSF9" , BIT (0 )},
279281 {"RES_66" , BIT (1 )},
280282 {"RES_67" , BIT (2 )},
@@ -286,6 +288,10 @@ static const struct pmc_bit_map tgl_pfear_map[] = {
286288};
287289
288290static const struct pmc_bit_map * ext_tgl_pfear_map [] = {
291+ /*
292+ * Check intel_pmc_core_ids[] users of tgl_reg_map for
293+ * a list of core SoCs using this.
294+ */
289295 cnp_pfear_map ,
290296 tgl_pfear_map ,
291297 NULL
@@ -369,7 +375,10 @@ static const struct pmc_bit_map cnp_ltr_show_map[] = {
369375 {"ISH" , CNP_PMC_LTR_ISH },
370376 {"UFSX2" , CNP_PMC_LTR_UFSX2 },
371377 {"EMMC" , CNP_PMC_LTR_EMMC },
372- /* Reserved for Cannon Lake but valid for Ice Lake */
378+ /*
379+ * Check intel_pmc_core_ids[] users of cnp_reg_map for
380+ * a list of core SoCs using this.
381+ */
373382 {"WIGIG" , ICL_PMC_LTR_WIGIG },
374383 /* Below two cannot be used for LTR_IGNORE */
375384 {"CURRENT_PLATFORM" , CNP_PMC_LTR_CUR_PLT },
@@ -380,6 +389,7 @@ static const struct pmc_bit_map cnp_ltr_show_map[] = {
380389static const struct pmc_reg_map cnp_reg_map = {
381390 .pfear_sts = ext_cnp_pfear_map ,
382391 .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET ,
392+ .slp_s0_res_counter_step = SPT_PMC_SLP_S0_RES_COUNTER_STEP ,
383393 .slps0_dbg_maps = cnp_slps0_dbg_maps ,
384394 .ltr_show_sts = cnp_ltr_show_map ,
385395 .msr_sts = msr_map ,
@@ -396,6 +406,7 @@ static const struct pmc_reg_map cnp_reg_map = {
396406static const struct pmc_reg_map icl_reg_map = {
397407 .pfear_sts = ext_icl_pfear_map ,
398408 .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET ,
409+ .slp_s0_res_counter_step = ICL_PMC_SLP_S0_RES_COUNTER_STEP ,
399410 .slps0_dbg_maps = cnp_slps0_dbg_maps ,
400411 .ltr_show_sts = cnp_ltr_show_map ,
401412 .msr_sts = msr_map ,
@@ -409,7 +420,7 @@ static const struct pmc_reg_map icl_reg_map = {
409420 .ltr_ignore_max = ICL_NUM_IP_IGN_ALLOWED ,
410421};
411422
412- static const struct pmc_bit_map tgl_lpm0_map [] = {
423+ static const struct pmc_bit_map tgl_clocksource_status_map [] = {
413424 {"USB2PLL_OFF_STS" , BIT (18 )},
414425 {"PCIe/USB3.1_Gen2PLL_OFF_STS" , BIT (19 )},
415426 {"PCIe_Gen3PLL_OFF_STS" , BIT (20 )},
@@ -425,35 +436,35 @@ static const struct pmc_bit_map tgl_lpm0_map[] = {
425436 {}
426437};
427438
428- static const struct pmc_bit_map tgl_lpm1_map [] = {
429- {"SPI_PG_STS " , BIT (2 )},
430- {"xHCI_PG_STS " , BIT (3 )},
431- {"PCIe_Ctrller_A_PG_STS " , BIT (4 )},
432- {"PCIe_Ctrller_B_PG_STS " , BIT (5 )},
433- {"PCIe_Ctrller_C_PG_STS " , BIT (6 )},
434- {"GBE_PG_STS " , BIT (7 )},
435- {"SATA_PG_STS " , BIT (8 )},
436- {"HDA0_PG_STS " , BIT (9 )},
437- {"HDA1_PG_STS " , BIT (10 )},
438- {"HDA2_PG_STS " , BIT (11 )},
439- {"HDA3_PG_STS " , BIT (12 )},
440- {"PCIe_Ctrller_D_PG_STS" , BIT (13 )},
441- {"ISIO_PG_STS " , BIT (14 )},
442- {"SMB_PG_STS " , BIT (16 )},
443- {"ISH_PG_STS " , BIT (17 )},
444- {"ITH_PG_STS " , BIT (19 )},
445- {"SDX_PG_STS " , BIT (20 )},
446- {"xDCI_PG_STS " , BIT (25 )},
447- {"DCI_PG_STS " , BIT (26 )},
448- {"CSME0_PG_STS " , BIT (27 )},
449- {"CSME_KVM_PG_STS " , BIT (28 )},
450- {"CSME1_PG_STS " , BIT (29 )},
451- {"CSME_CLINK_PG_STS " , BIT (30 )},
452- {"CSME2_PG_STS " , BIT (31 )},
439+ static const struct pmc_bit_map tgl_power_gating_status_map [] = {
440+ {"CSME_PG_STS " , BIT (0 )},
441+ {"SATA_PG_STS " , BIT (1 )},
442+ {"xHCI_PG_STS " , BIT (2 )},
443+ {"UFSX2_PG_STS " , BIT (3 )},
444+ {"OTG_PG_STS " , BIT (5 )},
445+ {"SPA_PG_STS " , BIT (6 )},
446+ {"SPB_PG_STS " , BIT (7 )},
447+ {"SPC_PG_STS " , BIT (8 )},
448+ {"SPD_PG_STS " , BIT (9 )},
449+ {"SPE_PG_STS " , BIT (10 )},
450+ {"SPF_PG_STS " , BIT (11 )},
451+ {"LSX_PG_STS" , BIT (13 )},
452+ {"P2SB_PG_STS " , BIT (14 )},
453+ {"PSF_PG_STS " , BIT (15 )},
454+ {"SBR_PG_STS " , BIT (16 )},
455+ {"OPIDMI_PG_STS " , BIT (17 )},
456+ {"THC0_PG_STS " , BIT (18 )},
457+ {"THC1_PG_STS " , BIT (19 )},
458+ {"GBETSN_PG_STS " , BIT (20 )},
459+ {"GBE_PG_STS " , BIT (21 )},
460+ {"LPSS_PG_STS " , BIT (22 )},
461+ {"MMP_UFSX2_PG_STS " , BIT (23 )},
462+ {"MMP_UFSX2B_PG_STS " , BIT (24 )},
463+ {"FIA_PG_STS " , BIT (25 )},
453464 {}
454465};
455466
456- static const struct pmc_bit_map tgl_lpm2_map [] = {
467+ static const struct pmc_bit_map tgl_d3_status_map [] = {
457468 {"ADSP_D3_STS" , BIT (0 )},
458469 {"SATA_D3_STS" , BIT (1 )},
459470 {"xHCI0_D3_STS" , BIT (2 )},
@@ -468,7 +479,7 @@ static const struct pmc_bit_map tgl_lpm2_map[] = {
468479 {}
469480};
470481
471- static const struct pmc_bit_map tgl_lpm3_map [] = {
482+ static const struct pmc_bit_map tgl_vnn_req_status_map [] = {
472483 {"GPIO_COM0_VNN_REQ_STS" , BIT (1 )},
473484 {"GPIO_COM1_VNN_REQ_STS" , BIT (2 )},
474485 {"GPIO_COM2_VNN_REQ_STS" , BIT (3 )},
@@ -493,7 +504,7 @@ static const struct pmc_bit_map tgl_lpm3_map[] = {
493504 {}
494505};
495506
496- static const struct pmc_bit_map tgl_lpm4_map [] = {
507+ static const struct pmc_bit_map tgl_vnn_misc_status_map [] = {
497508 {"CPU_C10_REQ_STS_0" , BIT (0 )},
498509 {"PCIe_LPM_En_REQ_STS_3" , BIT (3 )},
499510 {"ITH_REQ_STS_5" , BIT (5 )},
@@ -509,7 +520,7 @@ static const struct pmc_bit_map tgl_lpm4_map[] = {
509520 {}
510521};
511522
512- static const struct pmc_bit_map tgl_lpm5_map [] = {
523+ static const struct pmc_bit_map tgl_signal_status_map [] = {
513524 {"LSX_Wake0_En_STS" , BIT (0 )},
514525 {"LSX_Wake0_Pol_STS" , BIT (1 )},
515526 {"LSX_Wake1_En_STS" , BIT (2 )},
@@ -546,18 +557,19 @@ static const struct pmc_bit_map tgl_lpm5_map[] = {
546557};
547558
548559static const struct pmc_bit_map * tgl_lpm_maps [] = {
549- tgl_lpm0_map ,
550- tgl_lpm1_map ,
551- tgl_lpm2_map ,
552- tgl_lpm3_map ,
553- tgl_lpm4_map ,
554- tgl_lpm5_map ,
560+ tgl_clocksource_status_map ,
561+ tgl_power_gating_status_map ,
562+ tgl_d3_status_map ,
563+ tgl_vnn_req_status_map ,
564+ tgl_vnn_misc_status_map ,
565+ tgl_signal_status_map ,
555566 NULL
556567};
557568
558569static const struct pmc_reg_map tgl_reg_map = {
559570 .pfear_sts = ext_tgl_pfear_map ,
560571 .slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET ,
572+ .slp_s0_res_counter_step = TGL_PMC_SLP_S0_RES_COUNTER_STEP ,
561573 .ltr_show_sts = cnp_ltr_show_map ,
562574 .msr_sts = msr_map ,
563575 .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET ,
@@ -586,9 +598,9 @@ static inline void pmc_core_reg_write(struct pmc_dev *pmcdev, int reg_offset,
586598 writel (val , pmcdev -> regbase + reg_offset );
587599}
588600
589- static inline u64 pmc_core_adjust_slp_s0_step (u32 value )
601+ static inline u64 pmc_core_adjust_slp_s0_step (struct pmc_dev * pmcdev , u32 value )
590602{
591- return (u64 )value * SPT_PMC_SLP_S0_RES_COUNTER_STEP ;
603+ return (u64 )value * pmcdev -> map -> slp_s0_res_counter_step ;
592604}
593605
594606static int pmc_core_dev_state_get (void * data , u64 * val )
@@ -598,7 +610,7 @@ static int pmc_core_dev_state_get(void *data, u64 *val)
598610 u32 value ;
599611
600612 value = pmc_core_reg_read (pmcdev , map -> slp_s0_offset );
601- * val = pmc_core_adjust_slp_s0_step (value );
613+ * val = pmc_core_adjust_slp_s0_step (pmcdev , value );
602614
603615 return 0 ;
604616}
@@ -628,7 +640,7 @@ static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,
628640 offset += 4 ;
629641 while (map -> name ) {
630642 if (dev )
631- dev_dbg (dev , "SLP_S0_DBG: %-32s\tState: %s\n" ,
643+ dev_info (dev , "SLP_S0_DBG: %-32s\tState: %s\n" ,
632644 map -> name ,
633645 data & map -> bit_mask ? "Yes" : "No" );
634646 if (s )
@@ -671,15 +683,15 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
671683
672684 for (idx = 0 ; idx < arr_size ; idx ++ ) {
673685 if (dev )
674- dev_dbg (dev , "\nLPM_%s_%d:\t0x%x\n" , str , idx ,
686+ dev_info (dev , "\nLPM_%s_%d:\t0x%x\n" , str , idx ,
675687 lpm_regs [idx ]);
676688 if (s )
677689 seq_printf (s , "\nLPM_%s_%d:\t0x%x\n" , str , idx ,
678690 lpm_regs [idx ]);
679691 for (index = 0 ; maps [idx ][index ].name && index < len ; index ++ ) {
680692 bit_mask = maps [idx ][index ].bit_mask ;
681693 if (dev )
682- dev_dbg (dev , "%-30s %-30d\n" ,
694+ dev_info (dev , "%-30s %-30d\n" ,
683695 maps [idx ][index ].name ,
684696 lpm_regs [idx ] & bit_mask ? 1 : 0 );
685697 if (s )
@@ -1147,6 +1159,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
11471159 X86_MATCH_INTEL_FAM6_MODEL (TIGERLAKE , & tgl_reg_map ),
11481160 X86_MATCH_INTEL_FAM6_MODEL (ATOM_TREMONT , & tgl_reg_map ),
11491161 X86_MATCH_INTEL_FAM6_MODEL (ATOM_TREMONT_L , & icl_reg_map ),
1162+ X86_MATCH_INTEL_FAM6_MODEL (ROCKETLAKE , & tgl_reg_map ),
11501163 {}
11511164};
11521165
0 commit comments