1 /******************************************************************************
4 Lantiq Deutschland GmbH
6 For licensing information, see the file 'LICENSE' in the root folder of
9 ******************************************************************************/
10 /***************************************************************
15 ***************************************************************/
16 #ifndef __MHI_DUT_INCLUDED_H
17 #define __MHI_DUT_INCLUDED_H
18 //---------------------------------------------------------------------------------
20 //---------------------------------------------------------------------------------
21 #include "mhi_ieee_address.h"
22 #include "mhi_mib_id.h"
27 //---------------------------------------------------------------------------------
29 //---------------------------------------------------------------------------------
30 #define TPC_ARRAY_SIZE (3)
31 #define DUT_ANT_VALUES_ARRAY_SIZE (3)
33 #define BIST_RESULTS_ARRAY_SIZE (7)
35 #define UMI_DEBUG_BLOCK_SIZE (384)
36 #define UMI_C100_DATA_SIZE (UMI_DEBUG_BLOCK_SIZE - (sizeof(uint16) + sizeof(uint16) + sizeof(C100_MSG_HEADER)))
37 #define UMI_DEBUG_DATA_SIZE (UMI_DEBUG_BLOCK_SIZE - (sizeof(uint16) + sizeof(uint16)))
39 #define DUT_MSG_DATA_LENGTH (376)
40 #define MAX_DUT_EEPROM_ACCESS_SIZE (DUT_MSG_DATA_LENGTH-16)
42 typedef enum dutChipModule
44 DUT_CHIP_MODULE_UMAC_MEM
= 1,
45 DUT_CHIP_MODULE_LMAC_MEM
,
51 typedef enum dutNvMemoryType
53 DUT_NV_MEMORY_EEPROM
= 1,
54 DUT_NV_MEMORY_FLASH
= 2,
55 DUT_NV_MEMORY_EFUSE
= 3,
58 typedef enum dutChipVar
60 DUT_CHIP_VAR_TPC_FREQ
= 31,
64 typedef enum dutRiscMode
70 //---------------------------------------------
71 // Dut Message Definition
72 //---------------------------------------------
74 // Dut Mngmnt Module Messages
75 DUT_HW_DEPENDENT_CONFIG_REQ
= 2,
76 DUT_HW_DEPENDENT_CONFIG_CFM
,
85 DUT_READ_BIST_RESULTS_REQ
,
86 DUT_READ_BIST_RESULTS_CFM
,
91 DUT_WRITE_SECURED_REGISTER_REQ
,
92 DUT_WRITE_SECURED_REGISTER_CFM
,
93 DUT_READ_FREQ_TPC_STRUCTS_REQ
,
94 DUT_READ_FREQ_TPC_STRUCTS_CFM
,
95 DUT_RUN_CALIBRATION_REQ
,
96 DUT_RUN_CALIBRATION_CFM
,
99 DUT_READ_CALIBRATION_RESULTS_REQ
, //New - Optional
100 DUT_READ_CALIBRATION_RESULTS_CFM
, //New - Optional
102 // Dut Hw Acces Module Messages
103 DUT_READ_CHIP_VERSION_REQ
= 0x100,
104 DUT_READ_CHIP_VERSION_CFM
,
105 DUT_READ_GENRISC_VERSION_REQ
,
106 DUT_READ_GENRISC_VERSION_CFM
,
107 DUT_ENABLE_TX_ANTENNA_REQ
,
108 DUT_ENABLE_TX_ANTENNA_CFM
,
109 DUT_ENABLE_RX_ANTENNA_REQ
,
110 DUT_ENABLE_RX_ANTENNA_CFM
,
111 DUT_SET_DEFAULT_ANTENNA_SET_REQ
,
112 DUT_SET_DEFAULT_ANTENNA_SET_CFM
,
115 DUT_TX_SPACELESS_REQ
,
116 DUT_TX_SPACELESS_CFM
,
117 DUT_SET_SCRAMBLER_MODE_REQ
,
118 DUT_SET_SCRAMBLER_MODE_CFM
,
123 DUT_READ_PACKET_COUNTERS_REQ
,
124 DUT_READ_PACKET_COUNTERS_CFM
,
125 DUT_SET_TX_POWER_LIMIT_REQ
,
126 DUT_SET_TX_POWER_LIMIT_CFM
,
127 DUT_SET_RISC_MODE_REQ
,
128 DUT_SET_RISC_MODE_CFM
,
130 DUT_GET_TX_POWER_FEEDBACK_REQ
,
131 DUT_GET_TX_POWER_FEEDBACK_CFM
,
132 DUT_SET_TX_GAINS_REQ
,
133 DUT_SET_TX_GAINS_CFM
,
134 DUT_GET_TX_GAINS_REQ
,
135 DUT_GET_TX_GAINS_CFM
,
136 DUT_GET_RX_GAINS_REQ
,
137 DUT_GET_RX_GAINS_CFM
,
138 DUT_GET_XTAL_VALUE_REQ
,
139 DUT_GET_XTAL_VALUE_CFM
,
140 DUT_SET_XTAL_VALUE_REQ
,
141 DUT_SET_XTAL_VALUE_CFM
,
144 DUT_GET_TEMEPERATUE_SENSOR_REQ
,//New
145 DUT_GET_TEMEPERATUE_SENSOR_CFM
,//New
146 DUT_SET_RFM_MODE_REQ
,//New
147 DUT_SET_RFM_MODE_CFM
,//New
148 DUT_SET_RF_LOOPBACK_REQ
,//New
149 DUT_SET_RF_LOOPBACK_CFM
,//New
150 DUT_SET_GIPO_OUTPUT_LEVEL_REQ
,//New
151 DUT_SET_GIPO_OUTPUT_LEVEL_CFM
,//New
152 DUT_CANCEL_TX_PHASE_REQ
,
153 DUT_CANCEL_TX_PHASE_CFM
,
158 DUT_GET_LNA_PARAMS_REQ
,
159 DUT_GET_LNA_PARAMS_CFM
,
160 DUT_SET_LNA_PARAMS_REQ
,
161 DUT_SET_LNA_PARAMS_CFM
,
163 // Dut Tx Module Messages
164 DUT_START_TX_REQ
= 0x200,
168 DUT_UNKNOWN_MSG_CFM
= 0x300,
173 typedef enum dutDriverMessagesIdEnum_t
175 DUT_SERVER_MSG_RESET_MAC
= 0x01,
176 DUT_SERVER_MSG_UPLOAD_PROGMODEL
= 0x02,
177 DUT_SERVER_MSG_MAC_C100
= 0x03,
178 DUT_SERVER_MSG_RESEND_NOT_IN_USE
= 0x04,
179 DUT_SERVER_MSG_DRIVER_GENERAL
= 0x05,
180 DUT_SERVER_MSG_CNT
= 0x06
181 } dutDriverMessagesId_e
;
185 // DGM - driver general message
186 DUT_DGM_READ_NV_MEMORY_REQ
= 0x2,
187 DUT_DGM_READ_NV_MEMORY_CFM
,
188 DUT_DGM_WRITE_NV_MEMORY_REQ
,
189 DUT_DGM_WRITE_NV_MEMORY_CFM
,
190 DUT_DGM_FLUSH_NV_MEMORY_REQ
,
191 DUT_DGM_FLUSH_NV_MEMORY_CFM
,
192 DUT_DGM_GET_NV_FLASH_NAME_REQ
,
193 DUT_DGM_GET_NV_FLASH_NAME_CFM
194 } dutDriverGeneralMsgId_e
;
197 typedef enum dutStatus
203 //---------------------------------------------------------------------------------
204 // Data Type Definition
205 //---------------------------------------------------------------------------------
206 typedef struct dutMessage
212 uint8 data
[MTLK_PAD4(DUT_MSG_DATA_LENGTH
)];
213 } __MTLK_PACKED dutMessage_t
;
215 #define dutDriverMessageHeaderLength 8
217 typedef struct _C100_MSG_HEADER
222 } __MTLK_PACKED C100_MSG_HEADER
;
224 typedef struct _UMI_C100
228 C100_MSG_HEADER sC100hdr
;
229 uint8 au8Data
[MTLK_PAD4(UMI_C100_DATA_SIZE
)];
230 } __MTLK_PACKED UMI_C100
;
232 // To Align with mhi_umi convention
233 typedef dutMessage_t UMI_DUT
;
234 //----- Hw Dependent Params----------//
235 typedef struct dutHwDependentConfParams
240 } dutHwDependentConfParams_t
;
242 //----- FW Configure Params----------//
243 typedef struct dutConfigureParams
245 EEPROM_VERSION_TYPE sEepromInfo
;
247 uint32 tpcTimerValue
;
250 uint16 calibrationAlgoMask
;
251 IEEE_ADDR sIEEE_ADDR
;
255 uint8 spectrumMode
; //20M, Half Band, FULL.
256 uint8 secondaryChannel
;
261 int8 forceTpc
[TPC_ARRAY_SIZE
];
262 uint8 tpcModeIsInClosedLoop
; // 1 - Close loop\ 0 - Open Loop
264 uint8 tpcDebugTxPower
;
267 } dutConfigureParams_t
;
269 //----- FW SetChannel Params----------//
270 typedef struct dutSetChannelParams
272 IEEE_ADDR sIEEE_ADDR
;
273 EEPROM_VERSION_TYPE sEepromInfo
;
274 TPC_FREQ TPC_Freqs
[TPC_ARRAY_SIZE
][TPC_FREQ_STR_NUM
]; // for each ant, 2 CB and 2 nCB structures
276 uint16 calibrationAlgoMask
;
277 uint8 tpcModeIsInClosedLoop
; // 1 - Close loop\ 0 - Open Loop
280 uint8 secondaryChannel
;
281 } dutSetChannelParams_t
;
283 //----- Eeprom Params----------//
286 typedef struct dutEepromParams
291 uint8 data
[MTLK_PAD4(MAX_DUT_EEPROM_ACCESS_SIZE
)];
294 //----- NV memory Acces Params (Dut Driver Structure)----------//
295 typedef struct dutNvMemoryAccessParams
301 uint8 data
[MTLK_PAD4(MAX_DUT_EEPROM_ACCESS_SIZE
)];
302 } __MTLK_PACKED dutNvMemoryAccessParams_t
;
305 typedef struct dutNvMemoryFlushParams
310 } __MTLK_PACKED dutNvMemoryFlushParams_t
;
312 typedef struct dutResetParams
316 uint8 doReset
; // 0 - Enable DUT mode on the fly, 1 - EnableDUT mode via acripts (using rmmode/insmode dut=1)
318 } __MTLK_PACKED dutResetParams_t
;
322 //----- Memory access Params DUT_READ_MEMORY_REQ\CFM----------//
323 //----- Memory access Params DUT_WRITE_MEMORY_REQ\CFM----------//
324 //----- Memory access Params DUT_WRITE_SECURED_REGISTER_REQ\CFM----------//
325 #define MAX_DUT_MEMORY_ACCESS_SIZE (DUT_MSG_DATA_LENGTH-8)
327 typedef struct dutMemoryAccessParams
332 uint8 data
[MAX_DUT_MEMORY_ACCESS_SIZE
];
333 } dutMemoryAccessParams_t
;
335 typedef struct dutSecuredWriteParams
337 /* modify secured register: */
338 /* (*address) = (*address) & ~mask | data */
342 } dutSecuredWriteParams_t
;
344 //----- Frequency TPC Params DUT_READ_FREQ_TPC_STRUCTS_REQ\CFM----------//,
345 typedef struct dutFreqTpcParams
347 TPC_FREQ tpcFreq
[DUT_ANT_VALUES_ARRAY_SIZE
*TPC_FREQ_STR_NUM
];
348 } dutFreqTpcParams_t
;
350 //----- Frequency TPC Params DUT_RUN_CALIBRATION_REQ\CFM----------//,
351 typedef struct dutCalibrationParams
354 uint16 calibrationMask
;
355 uint8 tpcModeIsInClosedLoop
; // 1 - Close loop\ 0 - Open Loop
356 } dutCalibrationParams_t
;
358 //----- Frequency TPC Params DUT_STOP_FW_REQ\CFM----------//,
359 typedef struct dutStopFwParams
365 //----- Bist Results----------//
366 typedef struct dutBistResults
368 int8 bistResults
[BIST_RESULTS_ARRAY_SIZE
];
371 //----- Chip Version----------//
372 typedef struct dutChipVersion
375 uint32 rfChipVersion
;
378 //--------------------------------------//
380 //--------------------------------------//
381 typedef struct dutTxParams
388 uint16 packetLength
;// 0xffff - Random size,other - data size.
389 uint16 packetType
;// 0xffff - Random Type,0x00XX - data fixed 0xXX.
392 uint16 frameCtrlField
;
396 uint8 txExtendedRate
;
401 //--------------------------------------//
402 // Hw Configuration Data Types //
403 //--------------------------------------//
404 //----- Read Hw Params DUT_READ_HW_VERSION_REQ\CFM----------//
405 typedef struct dutHwParams
415 //----- Set Tpc Table Params (DUT_SET_TPC_REQ\CFM)----------//
416 typedef struct dutTpcParams
418 uint8 powerTableIndex
; // The location in the TPC table
419 uint8 powerGainIndex
[DUT_ANT_VALUES_ARRAY_SIZE
]; // requested TPC Index
422 //----- Rfic Rssi Params DUT_GET_RSSI_REQ\CFM----------//
423 typedef struct dutRssiParams
425 uint8 rssi
[DUT_ANT_VALUES_ARRAY_SIZE
];
429 //----- Tpc Feedback params Params(DUT_GET_TPC_FEEDBACK_REQ\CFM) ----------//
430 typedef struct dutTpcFeedbackparams
433 uint32 actualNumOfSamples
;
434 uint32 valueSum
[DUT_ANT_VALUES_ARRAY_SIZE
];
435 } dutTpcFeedbackparams_t
;
436 //----- Tx Tone Params (DUT_SET_TX_TONE_REQ\CFM) ----------//
437 typedef struct dutTxToneParams
445 //----- Tx Spaceless Params (DUT_SET_SPACELESS_TX_REQ\CFM) ----------//
446 typedef struct dutTxSpacelessParams
449 } dutTxSpacelessParams_t
;
451 //----- Scrambler Mode Params (DUT_TX_SPACELESS_REQ\CFM) ----------//
452 typedef struct dutScramblerParams
455 } dutScramblerParams_t
;
457 //----- Set IFS Params (DUT_SET_IFS_REQ\CFM) ----------//
458 typedef struct dutIfsParams
463 //----- Counters Params DUT_READ_PACKET_COUNTERS_REQ\CFM----------//
464 typedef struct packetCountersParams
466 uint32 phyRxPacketCounter
;
467 uint32 phyRxCrcErrorCounter
;
468 uint32 fwPacketCounter
;
470 } packetCountersParams_t
;
472 //----- Set Tx Power Limit Params (DUT_SET_TX_POWER_LIMIT_REQ\CFM)----------//
473 typedef struct powerLimitParams
476 } powerLimitParams_t
;
478 //----- Counters Params DUT_SET_RISC_MODE_REQ\CFM----------//
479 typedef struct riscModeParams
481 dutRiscMode_e riscMode
; // 0- Off 1 - On
484 //----- Set Antenna Params Params DUT_ENABLE_TX_ANTENNA_REQ\CFM----------//
485 //----- Set Antenna Params Params DUT_ENABLE_RX_ANTENNA_REQ\CFM----------//
486 typedef struct dutSetAntennaParams
488 uint8 enabledAntMask
; // bit 0-2: Ants 0-2 ON (3 - ants 0,1 ON, 7 - ants 0,1,2 ON, 0 - all off)
489 } dutSetAntennaParams_t
;
491 //----- Set Antenna Params Params (DUT_SET_DEFAULT_ANTENNA_SET_REQ\CFM) ----------//
492 typedef struct antSelectionParams
495 } antSelectionParams_t
;
496 //----- Rfic Gains Params DUT_SET_TX_GAINS_REQ\CFM ----------//
497 //----- Rfic Gains Params DUT_GET_TX_GAINS_REQ\CFM ----------//
498 typedef struct dutAntTxGains
501 uint8 paDriverGain
; // 3bit 0-High 1- Medium 2-Low
504 typedef struct dutRficTxGainsParams
506 dutAntTxGains_t antTxGains
[DUT_ANT_VALUES_ARRAY_SIZE
];
507 } dutRficTxGainsParams_t
;
509 //----- Rfic Gains Params DUT_GET_RX_GAINS_REQ\CFM ----------//
510 typedef struct dutAntRxGains
513 int8 lnaGain
; // 3bit 0-High 1- Medium 2-Low
517 typedef struct dutRficRxGainsParams
519 dutAntRxGains_t antRxGains
[DUT_ANT_VALUES_ARRAY_SIZE
];
520 } dutRficRxGainsParams_t
;
522 //----- Xtal Params DUT_GET_XTAL_VALUE_REQ\CFM----------//
523 typedef struct dutXtalParams
528 typedef struct dutLnaParams
534 typedef struct dutTxPhaseParams
537 } dutTxPhaseParams_t
;
539 typedef struct dutCddParams
544 typedef struct dutQbfParams
551 #define MTLK_PACK_OFF
552 #include "mtlkpack.h"