Lines Matching +full:rpm +full:- +full:qcm2290

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2017-2019, Linaro Ltd.
22 #include <dt-bindings/arm/qcom,ids.h>
62 [SMEM_IMAGE_TABLE_RPM_INDEX] = "rpm",
237 { qcom_board_id_named(MSM8974PRO_AC, "MSM8974PRO-AC") },
248 { qcom_board_id_named(APQ8074PRO_AA, "APQ8074PRO-AA") },
249 { qcom_board_id_named(APQ8074PRO_AB, "APQ8074PRO-AB") },
250 { qcom_board_id_named(APQ8074PRO_AC, "APQ8074PRO-AC") },
251 { qcom_board_id_named(MSM8274PRO_AA, "MSM8274PRO-AA") },
252 { qcom_board_id_named(MSM8274PRO_AB, "MSM8274PRO-AB") },
253 { qcom_board_id_named(MSM8274PRO_AC, "MSM8274PRO-AC") },
254 { qcom_board_id_named(MSM8674PRO_AA, "MSM8674PRO-AA") },
255 { qcom_board_id_named(MSM8674PRO_AB, "MSM8674PRO-AB") },
256 { qcom_board_id_named(MSM8674PRO_AC, "MSM8674PRO-AC") },
257 { qcom_board_id_named(MSM8974PRO_AA, "MSM8974PRO-AA") },
258 { qcom_board_id_named(MSM8974PRO_AB, "MSM8974PRO-AB") },
389 { qcom_board_id(QCM2290) },
467 return single_open(file, _func, inode->i_private); \
479 qcom_socinfo->dbg_root, \
485 struct socinfo *socinfo = seq->private; in qcom_show_build_id()
487 seq_printf(seq, "%s\n", socinfo->build_id); in qcom_show_build_id()
494 struct socinfo *socinfo = seq->private; in qcom_show_pmic_model()
495 int model = SOCINFO_MINOR(le32_to_cpu(socinfo->pmic_model)); in qcom_show_pmic_model()
498 return -EINVAL; in qcom_show_pmic_model()
510 struct socinfo *socinfo = seq->private; in qcom_show_pmic_model_array()
511 unsigned int num_pmics = le32_to_cpu(socinfo->num_pmics); in qcom_show_pmic_model_array()
512 unsigned int pmic_array_offset = le32_to_cpu(socinfo->pmic_array_offset); in qcom_show_pmic_model_array()
536 struct socinfo *socinfo = seq->private; in qcom_show_pmic_die_revision()
539 SOCINFO_MAJOR(le32_to_cpu(socinfo->pmic_die_rev)), in qcom_show_pmic_die_revision()
540 SOCINFO_MINOR(le32_to_cpu(socinfo->pmic_die_rev))); in qcom_show_pmic_die_revision()
547 struct socinfo *socinfo = seq->private; in qcom_show_chip_id()
549 seq_printf(seq, "%s\n", socinfo->chip_id); in qcom_show_chip_id()
563 struct smem_image_version *image_version = seq->private; \
564 if (image_version->type[0] != '\0') \
565 seq_printf(seq, "%s\n", image_version->type); \
570 return single_open(file, show_image_##type, inode->i_private); \
594 qcom_socinfo->dbg_root = debugfs_create_dir("qcom_socinfo", NULL); in socinfo_debugfs_init()
596 qcom_socinfo->info.fmt = __le32_to_cpu(info->fmt); in socinfo_debugfs_init()
598 debugfs_create_x32("info_fmt", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
599 &qcom_socinfo->info.fmt); in socinfo_debugfs_init()
601 switch (qcom_socinfo->info.fmt) { in socinfo_debugfs_init()
603 qcom_socinfo->info.num_func_clusters = __le32_to_cpu(info->num_func_clusters); in socinfo_debugfs_init()
604 qcom_socinfo->info.boot_cluster = __le32_to_cpu(info->boot_cluster); in socinfo_debugfs_init()
605 qcom_socinfo->info.boot_core = __le32_to_cpu(info->boot_core); in socinfo_debugfs_init()
607 debugfs_create_u32("num_func_clusters", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
608 &qcom_socinfo->info.num_func_clusters); in socinfo_debugfs_init()
609 debugfs_create_u32("boot_cluster", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
610 &qcom_socinfo->info.boot_cluster); in socinfo_debugfs_init()
611 debugfs_create_u32("boot_core", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
612 &qcom_socinfo->info.boot_core); in socinfo_debugfs_init()
616 qcom_socinfo->info.oem_variant = __le32_to_cpu(info->oem_variant); in socinfo_debugfs_init()
617 debugfs_create_u32("oem_variant", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
618 &qcom_socinfo->info.oem_variant); in socinfo_debugfs_init()
621 qcom_socinfo->info.feature_code = __le32_to_cpu(info->feature_code); in socinfo_debugfs_init()
622 qcom_socinfo->info.pcode = __le32_to_cpu(info->pcode); in socinfo_debugfs_init()
624 debugfs_create_u32("feature_code", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
625 &qcom_socinfo->info.feature_code); in socinfo_debugfs_init()
626 debugfs_create_u32("pcode", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
627 &qcom_socinfo->info.pcode); in socinfo_debugfs_init()
630 qcom_socinfo->info.nmodem_supported = __le32_to_cpu(info->nmodem_supported); in socinfo_debugfs_init()
632 debugfs_create_u32("nmodem_supported", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
633 &qcom_socinfo->info.nmodem_supported); in socinfo_debugfs_init()
636 qcom_socinfo->info.num_clusters = __le32_to_cpu(info->num_clusters); in socinfo_debugfs_init()
637 qcom_socinfo->info.ncluster_array_offset = __le32_to_cpu(info->ncluster_array_offset); in socinfo_debugfs_init()
638 qcom_socinfo->info.num_subset_parts = __le32_to_cpu(info->num_subset_parts); in socinfo_debugfs_init()
639 qcom_socinfo->info.nsubset_parts_array_offset = in socinfo_debugfs_init()
640 __le32_to_cpu(info->nsubset_parts_array_offset); in socinfo_debugfs_init()
642 debugfs_create_u32("num_clusters", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
643 &qcom_socinfo->info.num_clusters); in socinfo_debugfs_init()
644 debugfs_create_u32("ncluster_array_offset", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
645 &qcom_socinfo->info.ncluster_array_offset); in socinfo_debugfs_init()
646 debugfs_create_u32("num_subset_parts", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
647 &qcom_socinfo->info.num_subset_parts); in socinfo_debugfs_init()
648 debugfs_create_u32("nsubset_parts_array_offset", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
649 &qcom_socinfo->info.nsubset_parts_array_offset); in socinfo_debugfs_init()
652 qcom_socinfo->info.nproduct_id = __le32_to_cpu(info->nproduct_id); in socinfo_debugfs_init()
654 debugfs_create_u32("nproduct_id", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
655 &qcom_socinfo->info.nproduct_id); in socinfo_debugfs_init()
659 qcom_socinfo->info.chip_family = in socinfo_debugfs_init()
660 __le32_to_cpu(info->chip_family); in socinfo_debugfs_init()
661 qcom_socinfo->info.raw_device_family = in socinfo_debugfs_init()
662 __le32_to_cpu(info->raw_device_family); in socinfo_debugfs_init()
663 qcom_socinfo->info.raw_device_num = in socinfo_debugfs_init()
664 __le32_to_cpu(info->raw_device_num); in socinfo_debugfs_init()
666 debugfs_create_x32("chip_family", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
667 &qcom_socinfo->info.chip_family); in socinfo_debugfs_init()
669 qcom_socinfo->dbg_root, in socinfo_debugfs_init()
670 &qcom_socinfo->info.raw_device_family); in socinfo_debugfs_init()
672 qcom_socinfo->dbg_root, in socinfo_debugfs_init()
673 &qcom_socinfo->info.raw_device_num); in socinfo_debugfs_init()
676 num_pmics = le32_to_cpu(info->num_pmics); in socinfo_debugfs_init()
677 pmic_array_offset = le32_to_cpu(info->pmic_array_offset); in socinfo_debugfs_init()
683 qcom_socinfo->info.foundry_id = __le32_to_cpu(info->foundry_id); in socinfo_debugfs_init()
685 debugfs_create_u32("foundry_id", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
686 &qcom_socinfo->info.foundry_id); in socinfo_debugfs_init()
694 qcom_socinfo->info.hw_plat_subtype = in socinfo_debugfs_init()
695 __le32_to_cpu(info->hw_plat_subtype); in socinfo_debugfs_init()
698 qcom_socinfo->dbg_root, in socinfo_debugfs_init()
699 &qcom_socinfo->info.hw_plat_subtype); in socinfo_debugfs_init()
702 qcom_socinfo->info.accessory_chip = in socinfo_debugfs_init()
703 __le32_to_cpu(info->accessory_chip); in socinfo_debugfs_init()
706 qcom_socinfo->dbg_root, in socinfo_debugfs_init()
707 &qcom_socinfo->info.accessory_chip); in socinfo_debugfs_init()
710 qcom_socinfo->info.plat_ver = __le32_to_cpu(info->plat_ver); in socinfo_debugfs_init()
713 qcom_socinfo->dbg_root, in socinfo_debugfs_init()
714 &qcom_socinfo->info.plat_ver); in socinfo_debugfs_init()
717 qcom_socinfo->info.hw_plat = __le32_to_cpu(info->hw_plat); in socinfo_debugfs_init()
720 qcom_socinfo->dbg_root, in socinfo_debugfs_init()
721 &qcom_socinfo->info.hw_plat); in socinfo_debugfs_init()
724 qcom_socinfo->info.raw_ver = __le32_to_cpu(info->raw_ver); in socinfo_debugfs_init()
726 debugfs_create_u32("raw_version", 0444, qcom_socinfo->dbg_root, in socinfo_debugfs_init()
727 &qcom_socinfo->info.raw_ver); in socinfo_debugfs_init()
742 qcom_socinfo->dbg_root); in socinfo_debugfs_init()
754 debugfs_remove_recursive(qcom_socinfo->dbg_root); in socinfo_debugfs_exit()
773 dev_err(&pdev->dev, "Couldn't find socinfo\n"); in qcom_socinfo_probe()
777 qs = devm_kzalloc(&pdev->dev, sizeof(*qs), GFP_KERNEL); in qcom_socinfo_probe()
779 return -ENOMEM; in qcom_socinfo_probe()
781 qs->attr.family = "Snapdragon"; in qcom_socinfo_probe()
782 qs->attr.machine = socinfo_machine(&pdev->dev, in qcom_socinfo_probe()
783 le32_to_cpu(info->id)); in qcom_socinfo_probe()
784 qs->attr.soc_id = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u", in qcom_socinfo_probe()
785 le32_to_cpu(info->id)); in qcom_socinfo_probe()
786 qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u", in qcom_socinfo_probe()
787 SOCINFO_MAJOR(le32_to_cpu(info->ver)), in qcom_socinfo_probe()
788 SOCINFO_MINOR(le32_to_cpu(info->ver))); in qcom_socinfo_probe()
789 if (!qs->attr.soc_id || !qs->attr.revision) in qcom_socinfo_probe()
790 return -ENOMEM; in qcom_socinfo_probe()
793 qs->attr.serial_number = devm_kasprintf(&pdev->dev, GFP_KERNEL, in qcom_socinfo_probe()
795 le32_to_cpu(info->serial_num)); in qcom_socinfo_probe()
796 if (!qs->attr.serial_number) in qcom_socinfo_probe()
797 return -ENOMEM; in qcom_socinfo_probe()
800 qs->soc_dev = soc_device_register(&qs->attr); in qcom_socinfo_probe()
801 if (IS_ERR(qs->soc_dev)) in qcom_socinfo_probe()
802 return PTR_ERR(qs->soc_dev); in qcom_socinfo_probe()
818 soc_device_unregister(qs->soc_dev); in qcom_socinfo_remove()
827 .name = "qcom-socinfo",
835 MODULE_ALIAS("platform:qcom-socinfo");