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