b.liu | b7530d2 | 2025-06-16 19:49:05 +0800 | [diff] [blame] | 1 | /* |
| 2 | * mbtk_device.h |
| 3 | * |
| 4 | * MBTK device_info partition data header. |
| 5 | * |
| 6 | * Author : lb |
| 7 | * Date : 2023/12/30 11:36:35 |
| 8 | */ |
| 9 | #ifndef _MBTK_DEVICE_H |
| 10 | #define _MBTK_DEVICE_H |
| 11 | //#include "mbtk_type.h" |
| 12 | |
| 13 | #define MBTK_DEVICE_INFO_PARTITION_NAME "device_info" |
| 14 | #define MBTK_DEVICE_INFO_PARTITION_TAG 0x87878787 |
| 15 | #define MBTK_DEVICE_INFO_CURR_VERSION 2 |
| 16 | |
| 17 | // 78,147,482,134742231 |
| 18 | #define MBTK_BAND_ALL_GSM_DEFAULT 78 // GSM : ASR default. |
| 19 | #define MBTK_BAND_ALL_WCDMA_DEFAULT 147 // WCDMA : ASR default. |
| 20 | #define MBTK_BAND_ALL_TDLTE_DEFAULT 482 // TDD-LTE : ASR default. |
| 21 | #define MBTK_BAND_ALL_FDDLTE_DEFAULT 134742231 // FDD-LTE : ASR default. |
| 22 | #define MBTK_BAND_ALL_EXT_LTE_DEFAULT 0 // EXT-LTE |
| 23 | #define MBTK_BAND_ALL_NR_3_DEFAULT 0 |
| 24 | #define MBTK_BAND_ALL_NR_2_DEFAULT 24576 // n78/n79 |
| 25 | #define MBTK_BAND_ALL_NR_1_DEFAULT 256 // n41 |
| 26 | #define MBTK_BAND_ALL_NR_0_DEFAULT 134217877 // n1/n3/n5/n8/n28 |
| 27 | |
| 28 | #define MBTK_BAND_CN_GSM_DEFAULT 11 // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900) |
b.liu | 02cfe4b | 2025-06-17 14:20:18 +0800 | [diff] [blame] | 29 | #define MBTK_BAND_CN_WCDMA_DEFAULT 129 // WCDMA : B1/B8 |
b.liu | b7530d2 | 2025-06-16 19:49:05 +0800 | [diff] [blame] | 30 | #define MBTK_BAND_CN_TDLTE_DEFAULT 482 // TDD-LTE : B34/B38/B39/B40/B41 |
| 31 | #define MBTK_BAND_CN_FDDLTE_DEFAULT 149 // FDD-LTE : B1/B3/B5/B8 |
| 32 | #define MBTK_BAND_CN_EXT_LTE_DEFAULT 0 // EXT-LTE |
| 33 | #define MBTK_BAND_CN_NR_3_DEFAULT 0 |
| 34 | #define MBTK_BAND_CN_NR_2_DEFAULT 24576 // n78/n79 |
| 35 | #define MBTK_BAND_CN_NR_1_DEFAULT 384 // n40/n41 |
| 36 | #define MBTK_BAND_CN_NR_0_DEFAULT 134217877 // n1/n3/n5/n8/n28 |
| 37 | |
| 38 | #define MBTK_BAND_EU_GSM_DEFAULT 11 // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900) |
| 39 | #define MBTK_BAND_EU_WCDMA_DEFAULT 145 // WCDMA : B1/B5/B8 |
| 40 | #define MBTK_BAND_EU_TDLTE_DEFAULT 416 // TDD-LTE : B38/B40/B41 |
| 41 | #define MBTK_BAND_EU_FDDLTE_DEFAULT 134742229 // FDD-LTE : B1/B3/B5/B7/B8/B20/B28 |
| 42 | #define MBTK_BAND_EU_EXT_LTE_DEFAULT 0 // EXT-LTE |
| 43 | #define MBTK_BAND_EU_NR_3_DEFAULT 0 |
| 44 | #define MBTK_BAND_EU_NR_2_DEFAULT 12352 // n71/n77/n78 |
| 45 | #define MBTK_BAND_EU_NR_1_DEFAULT 416 // n38/n40/n41 |
| 46 | #define MBTK_BAND_EU_NR_0_DEFAULT 134742229 // n1/n3/n5/n7/n8/n20/n28 |
| 47 | |
| 48 | #define MBTK_BAND_SA_GSM_DEFAULT 79 // GSM : B2/B3/B5/B8(GSM 850/PGSM 900/EGSM 900/DCS GSM 1800/PCS GSM 1900) |
| 49 | #define MBTK_BAND_SA_WCDMA_DEFAULT 155 // WCDMA : B1/B2/B4/B5/B8 |
| 50 | #define MBTK_BAND_SA_TDLTE_DEFAULT 128 // TDD-LTE : B40 |
| 51 | #define MBTK_BAND_SA_FDDLTE_DEFAULT 134217951 // FDD-LTE : B1/B2/B3/B4/B5/B7/B8/B28 |
| 52 | #define MBTK_BAND_SA_EXT_LTE_DEFAULT 2 // EXT-LTE : B66 |
| 53 | #define MBTK_BAND_SA_NR_3_DEFAULT MBTK_BAND_ALL_NR_3_DEFAULT |
| 54 | #define MBTK_BAND_SA_NR_2_DEFAULT MBTK_BAND_ALL_NR_2_DEFAULT |
| 55 | #define MBTK_BAND_SA_NR_1_DEFAULT MBTK_BAND_ALL_NR_1_DEFAULT |
| 56 | #define MBTK_BAND_SA_NR_0_DEFAULT MBTK_BAND_ALL_NR_0_DEFAULT |
| 57 | |
| 58 | #define MBTK_DEVICE_INFO_ITEM_STR_BASIC "BASIC" |
| 59 | #define MBTK_DEVICE_INFO_ITEM_STR_FOTA "FOTA" |
| 60 | #define MBTK_DEVICE_INFO_ITEM_STR_MODEM "MODEM" |
| 61 | #define MBTK_DEVICE_INFO_ITEM_STR_LOG "LOG" |
| 62 | |
| 63 | #define MBTK_DEVICE_INFO_ITEM_ADDR_BASIC 0x100 // Header is 0x100 |
| 64 | #define MBTK_DEVICE_INFO_ITEM_ADDR_FOTA 0x500 // Basic is 1k |
| 65 | #define MBTK_DEVICE_INFO_ITEM_ADDR_MODEM 0x900 // Fota is 1k |
| 66 | #define MBTK_DEVICE_INFO_ITEM_ADDR_LOG 0xD00 // Modem is 1k |
| 67 | |
| 68 | #define MBTK_NET_SUPPORT_2G (1) |
| 69 | #define MBTK_NET_SUPPORT_3G (1<<1) |
| 70 | #define MBTK_NET_SUPPORT_4G (1<<2) |
| 71 | #define MBTK_NET_SUPPORT_5G (1<<3) |
| 72 | |
| 73 | typedef enum { |
| 74 | MBTK_DEVICE_INFO_ITEM_BASIC = 0, |
| 75 | MBTK_DEVICE_INFO_ITEM_FOTA, |
| 76 | MBTK_DEVICE_INFO_ITEM_MODEM, |
| 77 | MBTK_DEVICE_INFO_ITEM_LOG, |
| 78 | |
| 79 | MBTK_DEVICE_INFO_ITEM_NUM |
| 80 | } mbtk_device_info_item_enum; |
| 81 | |
| 82 | typedef struct { |
| 83 | mbtk_device_info_item_enum item; |
| 84 | uint32 addr; |
| 85 | } mbtk_device_info_item_header_t; |
| 86 | |
| 87 | typedef struct { |
| 88 | uint32 tag; |
| 89 | uint32 version; // Default : 0x01 |
| 90 | uint32 item_count; |
| 91 | mbtk_device_info_item_header_t item_header[MBTK_DEVICE_INFO_ITEM_NUM]; |
| 92 | } mbtk_device_info_header_t; |
| 93 | |
| 94 | typedef enum { |
| 95 | MBTK_REBOOT_FLAG_NORMAL = 0, |
| 96 | MBTK_REBOOT_FLAG_DOWNLOAD, |
| 97 | MBTK_REBOOT_FLAG_POWER_OFF, //Power off and restart |
| 98 | MBTK_REBOOT_FLAG_HARDWARE, //Hardware restart |
| 99 | MBTK_REBOOT_FLAG_COMMAND, //"reboot" "reboot -f" Command restart |
| 100 | MBTK_REBOOT_FLAG_ABNORMAL, //Abnormal restart |
| 101 | MBTK_REBOOT_FLAG_UNKNOWN, //unknown restart |
| 102 | } mbtk_device_info_reboot_flag_enum; |
| 103 | |
| 104 | typedef struct { |
| 105 | uint8 name[16]; |
| 106 | uint32 version; // Default : 0x01 |
| 107 | uint8 project[16]; // T108 / L508_X6 |
| 108 | uint8 project_cust[16]; // T108_C1 / L508_X6_C1 (Refer to: Custom_Model in blf file.) |
| 109 | uint32 ab_support; // 1 for ab |
| 110 | mbtk_device_info_reboot_flag_enum reboot_flag; |
| 111 | uint8 revision_out[48]; // L508_X6v01.01b04.00 |
| 112 | uint8 revision_in[64]; |
| 113 | uint8 build_time[64]; |
| 114 | uint8 asr_baseline[64]; |
| 115 | } mbtk_device_info_basic_t; |
| 116 | |
| 117 | typedef struct { |
| 118 | uint8 name[16]; |
| 119 | uint32 version; // Default : 0x01 |
| 120 | uint32 state; // |
| 121 | } mbtk_device_info_fota_t; |
| 122 | |
| 123 | typedef enum { |
| 124 | MBTK_MODEM_BAND_AREA_ALL, |
| 125 | MBTK_MODEM_BAND_AREA_CN, |
| 126 | MBTK_MODEM_BAND_AREA_EU, |
| 127 | MBTK_MODEM_BAND_AREA_SA |
| 128 | } mbtk_modem_band_area_enum; |
| 129 | |
| 130 | typedef struct { |
| 131 | uint8 name[16]; |
| 132 | uint32 version; // Default : 0x01 |
| 133 | mbtk_modem_band_area_enum band_area; |
| 134 | uint32 net_pref; // Refor to : mbtk_net_pref_enum |
| 135 | uint32 net_support; // 1:GSM 2:WCDMA 4:LTE 8:NR |
| 136 | uint32 band_gsm; |
| 137 | uint32 band_wcdma; |
| 138 | uint32 band_tdlte; |
| 139 | uint32 band_fddlte; |
| 140 | uint32 band_lte_ext; |
| 141 | uint32 band_nr_3; |
| 142 | uint32 band_nr_2; |
| 143 | uint32 band_nr_1; |
| 144 | uint32 band_nr_0; |
| 145 | } mbtk_device_info_modem_t; |
| 146 | |
| 147 | typedef struct { |
| 148 | uint8 name[16]; |
| 149 | uint32 version; // Default : 0x01 |
| 150 | uint32 state; // |
| 151 | } mbtk_device_info_log_t; |
| 152 | |
| 153 | |
| 154 | #endif /* _MBTK_DEVICE_H */ |
| 155 | |