1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 3 #ifndef __QCOM_SOCINFO_H__ 3 #ifndef __QCOM_SOCINFO_H__ 4 #define __QCOM_SOCINFO_H__ 4 #define __QCOM_SOCINFO_H__ 5 5 6 #include <linux/types.h> 6 #include <linux/types.h> 7 7 8 /* 8 /* 9 * SMEM item id, used to acquire handles to re 9 * SMEM item id, used to acquire handles to respective 10 * SMEM region. 10 * SMEM region. 11 */ 11 */ 12 #define SMEM_HW_SW_BUILD_ID 137 12 #define SMEM_HW_SW_BUILD_ID 137 13 13 14 #define SMEM_SOCINFO_BUILD_ID_LENGTH 32 14 #define SMEM_SOCINFO_BUILD_ID_LENGTH 32 15 #define SMEM_SOCINFO_CHIP_ID_LENGTH 32 15 #define SMEM_SOCINFO_CHIP_ID_LENGTH 32 16 16 17 /* 17 /* 18 * SoC version type with major number in the u 18 * SoC version type with major number in the upper 16 bits and minor 19 * number in the lower 16 bits. 19 * number in the lower 16 bits. 20 */ 20 */ 21 #define SOCINFO_MAJOR(ver) (((ver) >> 16) & 0x 21 #define SOCINFO_MAJOR(ver) (((ver) >> 16) & 0xffff) 22 #define SOCINFO_MINOR(ver) ((ver) & 0xffff) 22 #define SOCINFO_MINOR(ver) ((ver) & 0xffff) 23 #define SOCINFO_VERSION(maj, min) ((((maj) & 23 #define SOCINFO_VERSION(maj, min) ((((maj) & 0xffff) << 16)|((min) & 0xffff)) 24 24 25 /* Socinfo SMEM item structure */ 25 /* Socinfo SMEM item structure */ 26 struct socinfo { 26 struct socinfo { 27 __le32 fmt; 27 __le32 fmt; 28 __le32 id; 28 __le32 id; 29 __le32 ver; 29 __le32 ver; 30 char build_id[SMEM_SOCINFO_BUILD_ID_LE 30 char build_id[SMEM_SOCINFO_BUILD_ID_LENGTH]; 31 /* Version 2 */ 31 /* Version 2 */ 32 __le32 raw_id; 32 __le32 raw_id; 33 __le32 raw_ver; 33 __le32 raw_ver; 34 /* Version 3 */ 34 /* Version 3 */ 35 __le32 hw_plat; 35 __le32 hw_plat; 36 /* Version 4 */ 36 /* Version 4 */ 37 __le32 plat_ver; 37 __le32 plat_ver; 38 /* Version 5 */ 38 /* Version 5 */ 39 __le32 accessory_chip; 39 __le32 accessory_chip; 40 /* Version 6 */ 40 /* Version 6 */ 41 __le32 hw_plat_subtype; 41 __le32 hw_plat_subtype; 42 /* Version 7 */ 42 /* Version 7 */ 43 __le32 pmic_model; 43 __le32 pmic_model; 44 __le32 pmic_die_rev; 44 __le32 pmic_die_rev; 45 /* Version 8 */ 45 /* Version 8 */ 46 __le32 pmic_model_1; 46 __le32 pmic_model_1; 47 __le32 pmic_die_rev_1; 47 __le32 pmic_die_rev_1; 48 __le32 pmic_model_2; 48 __le32 pmic_model_2; 49 __le32 pmic_die_rev_2; 49 __le32 pmic_die_rev_2; 50 /* Version 9 */ 50 /* Version 9 */ 51 __le32 foundry_id; 51 __le32 foundry_id; 52 /* Version 10 */ 52 /* Version 10 */ 53 __le32 serial_num; 53 __le32 serial_num; 54 /* Version 11 */ 54 /* Version 11 */ 55 __le32 num_pmics; 55 __le32 num_pmics; 56 __le32 pmic_array_offset; 56 __le32 pmic_array_offset; 57 /* Version 12 */ 57 /* Version 12 */ 58 __le32 chip_family; 58 __le32 chip_family; 59 __le32 raw_device_family; 59 __le32 raw_device_family; 60 __le32 raw_device_num; 60 __le32 raw_device_num; 61 /* Version 13 */ 61 /* Version 13 */ 62 __le32 nproduct_id; 62 __le32 nproduct_id; 63 char chip_id[SMEM_SOCINFO_CHIP_ID_LENG 63 char chip_id[SMEM_SOCINFO_CHIP_ID_LENGTH]; 64 /* Version 14 */ 64 /* Version 14 */ 65 __le32 num_clusters; 65 __le32 num_clusters; 66 __le32 ncluster_array_offset; 66 __le32 ncluster_array_offset; 67 __le32 num_subset_parts; 67 __le32 num_subset_parts; 68 __le32 nsubset_parts_array_offset; 68 __le32 nsubset_parts_array_offset; 69 /* Version 15 */ 69 /* Version 15 */ 70 __le32 nmodem_supported; 70 __le32 nmodem_supported; 71 /* Version 16 */ 71 /* Version 16 */ 72 __le32 feature_code; 72 __le32 feature_code; 73 __le32 pcode; 73 __le32 pcode; 74 __le32 npartnamemap_offset; 74 __le32 npartnamemap_offset; 75 __le32 nnum_partname_mapping; 75 __le32 nnum_partname_mapping; 76 /* Version 17 */ 76 /* Version 17 */ 77 __le32 oem_variant; 77 __le32 oem_variant; 78 /* Version 18 */ 78 /* Version 18 */ 79 __le32 num_kvps; 79 __le32 num_kvps; 80 __le32 kvps_offset; 80 __le32 kvps_offset; 81 /* Version 19 */ 81 /* Version 19 */ 82 __le32 num_func_clusters; 82 __le32 num_func_clusters; 83 __le32 boot_cluster; 83 __le32 boot_cluster; 84 __le32 boot_core; 84 __le32 boot_core; 85 }; 85 }; 86 86 87 /* Internal feature codes */ 87 /* Internal feature codes */ 88 enum qcom_socinfo_feature_code { 88 enum qcom_socinfo_feature_code { 89 /* External feature codes */ 89 /* External feature codes */ 90 SOCINFO_FC_UNKNOWN = 0x0, 90 SOCINFO_FC_UNKNOWN = 0x0, 91 SOCINFO_FC_AA, 91 SOCINFO_FC_AA, 92 SOCINFO_FC_AB, 92 SOCINFO_FC_AB, 93 SOCINFO_FC_AC, 93 SOCINFO_FC_AC, 94 SOCINFO_FC_AD, 94 SOCINFO_FC_AD, 95 SOCINFO_FC_AE, 95 SOCINFO_FC_AE, 96 SOCINFO_FC_AF, 96 SOCINFO_FC_AF, 97 SOCINFO_FC_AG, 97 SOCINFO_FC_AG, 98 SOCINFO_FC_AH, 98 SOCINFO_FC_AH, 99 }; 99 }; 100 100 101 /* Internal feature codes */ 101 /* Internal feature codes */ 102 /* Valid values: 0 <= n <= 0xf */ 102 /* Valid values: 0 <= n <= 0xf */ 103 #define SOCINFO_FC_Yn(n) (0xf1 103 #define SOCINFO_FC_Yn(n) (0xf1 + (n)) 104 #define SOCINFO_FC_INT_MAX SOCINF 104 #define SOCINFO_FC_INT_MAX SOCINFO_FC_Yn(0xf) 105 105 106 /* Product codes */ 106 /* Product codes */ 107 #define SOCINFO_PC_UNKNOWN 0 107 #define SOCINFO_PC_UNKNOWN 0 108 #define SOCINFO_PCn(n) ((n) + 108 #define SOCINFO_PCn(n) ((n) + 1) 109 #define SOCINFO_PC_RESERVE (BIT(3 109 #define SOCINFO_PC_RESERVE (BIT(31) - 1) 110 110 111 #endif 111 #endif 112 112
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.