Lines Matching +full:target +full:- +full:rpm
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2011-2021, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022-2025, Qualcomm Innovation Center, Inc. All rights reserved.
100 u64 accumulated = stat->accumulated; in qcom_print_stats()
105 if (stat->last_entered_at > stat->last_exited_at) in qcom_print_stats()
106 accumulated += arch_timer_read_counter() - stat->last_entered_at; in qcom_print_stats()
108 seq_printf(s, "Count: %u\n", stat->count); in qcom_print_stats()
109 seq_printf(s, "Last Entered At: %llu\n", stat->last_entered_at); in qcom_print_stats()
110 seq_printf(s, "Last Exited At: %llu\n", stat->last_exited_at); in qcom_print_stats()
116 struct subsystem_data *subsystem = s->private; in qcom_subsystem_sleep_stats_show()
120 stat = qcom_smem_get(subsystem->pid, subsystem->smem_item, NULL); in qcom_subsystem_sleep_stats_show()
131 struct stats_data *d = s->private; in qcom_soc_sleep_stats_show()
132 void __iomem *reg = d->base; in qcom_soc_sleep_stats_show()
138 if (d->appended_stats_avail) { in qcom_soc_sleep_stats_show()
161 * Bits - Meaning in qcom_ddr_stats_print()
162 * 0:7 - DDR LPM name, can be of 0xd4, 0xd3, 0x11 and 0xd0. in qcom_ddr_stats_print()
163 * 8:15 - 0x0 (indicates its a LPM stat) in qcom_ddr_stats_print()
164 * 16:31 - Unused in qcom_ddr_stats_print()
167 * Bits - Meaning in qcom_ddr_stats_print()
168 * 0:4 - DDR Clock plan index (CP IDX) in qcom_ddr_stats_print()
169 * 5:7 - Unused in qcom_ddr_stats_print()
170 * 8:15 - 0x1 (indicates its Freq stat) in qcom_ddr_stats_print()
171 * 16:31 - Frequency value in Mhz in qcom_ddr_stats_print()
173 switch (DDR_STATS_TYPE(data->name)) { in qcom_ddr_stats_print()
176 DDR_STATS_LPM_NAME(data->name), data->count, data->duration); in qcom_ddr_stats_print()
179 if (!data->count || !DDR_STATS_FREQ(data->name)) in qcom_ddr_stats_print()
182 cp_idx = DDR_STATS_CP_IDX(data->name); in qcom_ddr_stats_print()
184 DDR_STATS_FREQ(data->name), cp_idx, data->count, data->duration); in qcom_ddr_stats_print()
192 void __iomem *reg = (void __iomem *)s->private; in qcom_ddr_stats_show()
198 return -EINVAL; in qcom_ddr_stats_show()
234 if (!config->ddr_stats_offset) in qcom_create_ddr_stat_files()
237 key = readl_relaxed(reg + config->ddr_stats_offset + DDR_STATS_MAGIC_KEY_ADDR); in qcom_create_ddr_stat_files()
240 (__force void *)reg + config->ddr_stats_offset, in qcom_create_ddr_stat_files()
249 size_t stats_offset = config->stats_offset; in qcom_create_soc_sleep_stat_files()
254 * On RPM targets, stats offset location is dynamic and changes from target in qcom_create_soc_sleep_stat_files()
255 * to target and sometimes from build to build for same target. in qcom_create_soc_sleep_stat_files()
260 if (config->dynamic_offset) { in qcom_create_soc_sleep_stat_files()
265 for (i = 0; i < config->num_records; i++) { in qcom_create_soc_sleep_stat_files()
272 * For rpmh-sleep-stats: "aosd", "cxsd" and "ddr". in qcom_create_soc_sleep_stat_files()
273 * For rpm-sleep-stats: "vmin" and "vlow". in qcom_create_soc_sleep_stat_files()
295 if (!config->subsystem_stats_in_smem) in qcom_create_subsystem_stat_files()
311 config = device_get_match_data(&pdev->dev); in qcom_stats_probe()
313 return -ENODEV; in qcom_stats_probe()
317 return -ENOMEM; in qcom_stats_probe()
319 d = devm_kcalloc(&pdev->dev, config->num_records, in qcom_stats_probe()
322 return -ENOMEM; in qcom_stats_probe()
324 for (i = 0; i < config->num_records; i++) in qcom_stats_probe()
325 d[i].appended_stats_avail = config->appended_stats_avail; in qcom_stats_probe()
331 qcom_stats_qmp = qmp_get(&pdev->dev); in qcom_stats_probe()
334 if (!of_property_present(pdev->dev.of_node, "qcom,qmp")) in qcom_stats_probe()
336 else if (PTR_ERR(qcom_stats_qmp) == -EPROBE_DEFER) in qcom_stats_probe()
337 return -EPROBE_DEFER; in qcom_stats_probe()
350 device_set_pm_not_required(&pdev->dev); in qcom_stats_probe()
370 /* Older RPM firmwares have the stats at a fixed offset instead */
397 { .compatible = "qcom,apq8084-rpm-stats", .data = &rpm_data_dba0 },
398 { .compatible = "qcom,msm8226-rpm-stats", .data = &rpm_data_dba0 },
399 { .compatible = "qcom,msm8916-rpm-stats", .data = &rpm_data_dba0 },
400 { .compatible = "qcom,msm8974-rpm-stats", .data = &rpm_data_dba0 },
401 { .compatible = "qcom,rpm-stats", .data = &rpm_data },
402 { .compatible = "qcom,rpmh-stats", .data = &rpmh_data },
403 { .compatible = "qcom,sdm845-rpmh-stats", .data = &rpmh_data_sdm845 },