Lines Matching +full:south +full:- +full:field

1 // SPDX-License-Identifier: GPL-2.0
8 * /sys/kernel/debug/telemetry/pss_info: Shows Primary Control Sub-Sys Counters
9 * /sys/kernel/debug/telemetry/ioss_info: Shows IO Sub-System Counters
25 #include <asm/intel-family.h>
31 /* ApolloLake SoC Event-IDs */
157 {"SOUTH", 48},
319 if ((debugfs_conf->pss_idle_evts > TELEM_PSS_IDLE_EVTS) || in telemetry_debugfs_check_evts()
320 (debugfs_conf->pcs_idle_blkd_evts > TELEM_PSS_IDLE_BLOCKED_EVTS) || in telemetry_debugfs_check_evts()
321 (debugfs_conf->pcs_s0ix_blkd_evts > TELEM_PSS_S0IX_BLOCKED_EVTS) || in telemetry_debugfs_check_evts()
322 (debugfs_conf->pss_ltr_evts > TELEM_PSS_LTR_BLOCKING_EVTS) || in telemetry_debugfs_check_evts()
323 (debugfs_conf->pss_wakeup_evts > TELEM_PSS_S0IX_WAKEUP_EVTS) || in telemetry_debugfs_check_evts()
324 (debugfs_conf->ioss_d0ix_evts > TELEM_IOSS_DX_D0IX_EVTS) || in telemetry_debugfs_check_evts()
325 (debugfs_conf->ioss_pg_evts > TELEM_IOSS_PG_EVTS)) in telemetry_debugfs_check_evts()
326 return -EINVAL; in telemetry_debugfs_check_evts()
354 seq_puts(s, "\n----------------------------------------------------\n"); in telem_pss_states_show()
355 seq_puts(s, "\tPSS TELEM EVENTLOG (Residency = field/19.2 us\n"); in telem_pss_states_show()
356 seq_puts(s, "----------------------------------------------------\n"); in telem_pss_states_show()
358 seq_printf(s, "%-32s %llu\n", in telem_pss_states_show()
362 if (evtlog[index].telem_evtid == conf->pss_idle_id) { in telem_pss_states_show()
363 pss_idle[conf->pss_idle_evts - 1] = in telem_pss_states_show()
365 conf->pss_idle_data[conf->pss_idle_evts - 1].bit_pos) & in telem_pss_states_show()
369 TELEM_CHECK_AND_PARSE_EVTS(conf->pss_idle_id, in telem_pss_states_show()
370 conf->pss_idle_evts - 1, in telem_pss_states_show()
372 conf->pss_idle_data, TELEM_MASK_BIT); in telem_pss_states_show()
374 TELEM_CHECK_AND_PARSE_EVTS(conf->pcs_idle_blkd_id, in telem_pss_states_show()
375 conf->pcs_idle_blkd_evts, in telem_pss_states_show()
378 conf->pcs_idle_blkd_data, in telem_pss_states_show()
381 TELEM_CHECK_AND_PARSE_EVTS(conf->pcs_s0ix_blkd_id, in telem_pss_states_show()
382 conf->pcs_s0ix_blkd_evts, in telem_pss_states_show()
385 conf->pcs_s0ix_blkd_data, in telem_pss_states_show()
388 TELEM_CHECK_AND_PARSE_EVTS(conf->pss_wakeup_id, in telem_pss_states_show()
389 conf->pss_wakeup_evts, in telem_pss_states_show()
392 conf->pss_wakeup, TELEM_MASK_BYTE); in telem_pss_states_show()
394 TELEM_CHECK_AND_PARSE_EVTS(conf->pss_ltr_blocking_id, in telem_pss_states_show()
395 conf->pss_ltr_evts, pss_ltr_blkd, in telem_pss_states_show()
397 conf->pss_ltr_data, TELEM_MASK_BYTE); in telem_pss_states_show()
399 if (evtlog[index].telem_evtid == debugfs_conf->pstates_id) in telem_pss_states_show()
403 seq_puts(s, "\n--------------------------------------\n"); in telem_pss_states_show()
405 seq_puts(s, "--------------------------------------\n"); in telem_pss_states_show()
415 seq_puts(s, "\n--------------------------------------\n"); in telem_pss_states_show()
417 seq_puts(s, "--------------------------------------\n"); in telem_pss_states_show()
419 for (index = 0; index < debugfs_conf->pss_idle_evts; index++) { in telem_pss_states_show()
420 seq_printf(s, "%-32s\t%u\n", in telem_pss_states_show()
421 debugfs_conf->pss_idle_data[index].name, in telem_pss_states_show()
425 seq_puts(s, "\n--------------------------------------\n"); in telem_pss_states_show()
427 seq_puts(s, "--------------------------------------\n"); in telem_pss_states_show()
429 for (index = 0; index < debugfs_conf->pcs_idle_blkd_evts; index++) { in telem_pss_states_show()
430 seq_printf(s, "%-32s\t%u\n", in telem_pss_states_show()
431 debugfs_conf->pcs_idle_blkd_data[index].name, in telem_pss_states_show()
435 seq_puts(s, "\n--------------------------------------\n"); in telem_pss_states_show()
437 seq_puts(s, "--------------------------------------\n"); in telem_pss_states_show()
439 for (index = 0; index < debugfs_conf->pcs_s0ix_blkd_evts; index++) { in telem_pss_states_show()
440 seq_printf(s, "%-32s\t%u\n", in telem_pss_states_show()
441 debugfs_conf->pcs_s0ix_blkd_data[index].name, in telem_pss_states_show()
445 seq_puts(s, "\n--------------------------------------\n"); in telem_pss_states_show()
447 seq_puts(s, "--------------------------------------\n"); in telem_pss_states_show()
449 for (index = 0; index < debugfs_conf->pss_ltr_evts; index++) { in telem_pss_states_show()
450 seq_printf(s, "%-32s\t%u\n", in telem_pss_states_show()
451 debugfs_conf->pss_ltr_data[index].name, in telem_pss_states_show()
455 seq_puts(s, "\n--------------------------------------\n"); in telem_pss_states_show()
457 seq_puts(s, "--------------------------------------\n"); in telem_pss_states_show()
459 for (index = 0; index < debugfs_conf->pss_wakeup_evts; index++) { in telem_pss_states_show()
460 seq_printf(s, "%-32s\t%u\n", in telem_pss_states_show()
461 debugfs_conf->pss_wakeup[index].name, in telem_pss_states_show()
486 seq_puts(s, "--------------------------------------\n"); in telem_ioss_states_show()
488 seq_puts(s, "--------------------------------------\n"); in telem_ioss_states_show()
490 seq_printf(s, "%-32s 0x%llx\n", in telem_ioss_states_show()
518 TELEM_CHECK_AND_PARSE_EVTS(conf->ioss_d3_id, in telem_soc_states_show()
519 conf->ioss_d0ix_evts, in telem_soc_states_show()
521 conf->ioss_d0ix_data, in telem_soc_states_show()
524 TELEM_CHECK_AND_PARSE_EVTS(conf->ioss_pg_id, conf->ioss_pg_evts, in telem_soc_states_show()
526 conf->ioss_pg_data, TELEM_MASK_BIT); in telem_soc_states_show()
528 TELEM_CHECK_AND_PARSE_EVTS(conf->ioss_d0ix_id, in telem_soc_states_show()
529 conf->ioss_d0ix_evts, in telem_soc_states_show()
531 conf->ioss_d0ix_data, in telem_soc_states_show()
534 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_total_occ_id, in telem_soc_states_show()
537 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id, in telem_soc_states_show()
540 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id, in telem_soc_states_show()
543 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_total_res_id, in telem_soc_states_show()
546 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id, in telem_soc_states_show()
549 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id, in telem_soc_states_show()
553 seq_puts(s, "\n---------------------------------------------------\n"); in telem_soc_states_show()
555 seq_puts(s, "---------------------------------------------------\n"); in telem_soc_states_show()
558 s0ix_shlw_ctr - in telem_soc_states_show()
559 conf->suspend_stats.shlw_ctr, in telem_soc_states_show()
560 (u64)((s0ix_shlw_res - in telem_soc_states_show()
561 conf->suspend_stats.shlw_res)*10/192)); in telem_soc_states_show()
564 s0ix_deep_ctr - in telem_soc_states_show()
565 conf->suspend_stats.deep_ctr, in telem_soc_states_show()
566 (u64)((s0ix_deep_res - in telem_soc_states_show()
567 conf->suspend_stats.deep_res)*10/192)); in telem_soc_states_show()
570 conf->suspend_stats.shlw_ctr, in telem_soc_states_show()
571 (u64)(conf->suspend_stats.shlw_res*10)/192); in telem_soc_states_show()
574 conf->suspend_stats.deep_ctr, in telem_soc_states_show()
575 (u64)(conf->suspend_stats.deep_res*10)/192); in telem_soc_states_show()
579 seq_puts(s, "\n-------------------------------------------------\n"); in telem_soc_states_show()
581 seq_puts(s, "-------------------------------------------------\n"); in telem_soc_states_show()
584 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); in telem_soc_states_show()
589 dev->vendor, dev->device, dev_name(&dev->dev), in telem_soc_states_show()
590 dev_driver_string(&dev->dev)); in telem_soc_states_show()
594 seq_puts(s, "\n--------------------------------------\n"); in telem_soc_states_show()
596 seq_puts(s, "--------------------------------------\n"); in telem_soc_states_show()
598 for (index = 0; index < conf->ioss_d0ix_evts; index++) { in telem_soc_states_show()
599 seq_printf(s, "%-10s\t %u\t %u\n", in telem_soc_states_show()
600 conf->ioss_d0ix_data[index].name, in telem_soc_states_show()
604 seq_puts(s, "\n--------------------------------------\n"); in telem_soc_states_show()
605 seq_puts(s, "South Complex PowerGate Status\n"); in telem_soc_states_show()
606 seq_puts(s, "--------------------------------------\n"); in telem_soc_states_show()
608 for (index = 0; index < conf->ioss_pg_evts; index++) { in telem_soc_states_show()
609 seq_printf(s, "%-10s\t %u\n", in telem_soc_states_show()
610 conf->ioss_pg_data[index].name, in telem_soc_states_show()
614 evtlog->telem_evtid = conf->pss_idle_id; in telem_soc_states_show()
619 seq_puts(s, "\n-----------------------------------------\n"); in telem_soc_states_show()
621 seq_puts(s, "-----------------------------------------\n"); in telem_soc_states_show()
622 for (idx = 0; idx < conf->pss_idle_evts - 1; idx++) { in telem_soc_states_show()
623 pss_idle[idx] = (evtlog->telem_evtlog >> in telem_soc_states_show()
624 conf->pss_idle_data[idx].bit_pos) & in telem_soc_states_show()
628 pss_idle[idx] = (evtlog->telem_evtlog >> in telem_soc_states_show()
629 conf->pss_idle_data[idx].bit_pos) & in telem_soc_states_show()
632 for (index = 0; index < conf->pss_idle_evts; index++) { in telem_soc_states_show()
633 seq_printf(s, "%-30s %u\n", in telem_soc_states_show()
634 conf->pss_idle_data[index].name, in telem_soc_states_show()
654 ret = intel_pmc_s0ix_counter_read(plt_config->pmc, &s0ix_total_res); in telem_s0ix_res_get()
675 return -EFAULT; in telem_pss_trc_verb_show()
704 return single_open(file, telem_pss_trc_verb_show, inode->i_private); in telem_pss_trc_verb_open()
723 return -EFAULT; in telem_ioss_trc_verb_show()
752 return single_open(file, telem_ioss_trc_verb_show, inode->i_private); in telem_ioss_trc_verb_open()
778 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id, in pm_suspend_prep_cb()
781 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id, in pm_suspend_prep_cb()
784 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id, in pm_suspend_prep_cb()
787 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id, in pm_suspend_prep_cb()
812 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id, in pm_suspend_exit_cb()
815 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id, in pm_suspend_exit_cb()
818 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id, in pm_suspend_exit_cb()
821 TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id, in pm_suspend_exit_cb()
837 * failure or not by cross-checking from PMC GCR registers directly. in pm_suspend_exit_cb()
842 struct intel_pmc_dev *pmc = plt_config->pmc; in pm_suspend_exit_cb()
861 suspend_shlw_ctr_exit -= suspend_shlw_ctr_temp; in pm_suspend_exit_cb()
862 suspend_deep_ctr_exit -= suspend_deep_ctr_temp; in pm_suspend_exit_cb()
863 suspend_shlw_res_exit -= suspend_shlw_res_temp; in pm_suspend_exit_cb()
864 suspend_deep_res_exit -= suspend_deep_res_temp; in pm_suspend_exit_cb()
867 conf->suspend_stats.shlw_ctr += in pm_suspend_exit_cb()
870 conf->suspend_stats.shlw_res += in pm_suspend_exit_cb()
875 conf->suspend_stats.deep_ctr += in pm_suspend_exit_cb()
878 conf->suspend_stats.deep_res += in pm_suspend_exit_cb()
913 return -ENODEV; in telemetry_debugfs_init()
915 debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data; in telemetry_debugfs_init()
919 return -ENODEV; in telemetry_debugfs_init()
925 return -EINVAL; in telemetry_debugfs_init()
931 debugfs_conf->telemetry_dbg_dir = dir; in telemetry_debugfs_init()
950 debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir); in telemetry_debugfs_exit()
951 debugfs_conf->telemetry_dbg_dir = NULL; in telemetry_debugfs_exit()