//***************************************************************************** // (C) Automotive Lighting Reutlingen GmbH // Tuebinger Strasse 123, 72762 Reutlingen, Germany // // Automotive Lighting Reutlingen GmbH owns all the rights to this work. // This work shall not be copied, reproduced, used, modified, transferred // or its information shall not be disclosed without the prior written // authorization of Automotive Lighting Reutlingen GmbH. //***************************************************************************** //----------------------------------------------------------------------------- /// \file CddEft.c /// /// \brief Default EFT data for ECU initial test operation /// /// \author EEG, Harold ALSH/EES //----------------------------------------------------------------------------- #ifndef CDD_EFT_H_ #define CDD_EFT_H_ /******************************************************************************* ** include ** *******************************************************************************/ #include /******************************************************************************* ** defines ** *******************************************************************************/ #define EFT_CRC_SIZE 0x08 #define EFT_CALIB_SIZE 0xF8 #define EFT_HWDESC_SIZE 0x80 #define EFT_ECUVARCFG_SIZE 0x180 //EFT Checksum block (little endian) for the EFT_START_ADDRESS -> EFT_END_ADDRESS #define EFT_CRC_ADDRESS 0x80035000ul #define EFT_START_ADDRESS 0x80035004ul //EFT block start address #define EFT_END_ADDRESS 0x800352FFul //EFT block end address #define EFT_CRC_INITIAL_VAL 0xFFFFFFFFul //EFT CRC calculation initial value /******************************************************************************* ** interface for EFT data users ** *******************************************************************************/ #define EFT_ECUVARCFG_HSS_CHIP EftData.Eft_EcuVarCfg.Val.Hss_Chip #define EFT_ECUVARCFG_CAN EftData.Eft_EcuVarCfg.Val.Can #define EFT_ECUVARCFG_UART EftData.Eft_EcuVarCfg.Val.Uart #define EFT_ECUVARCFG_LIN EftData.Eft_EcuVarCfg.Val.Lin #define EFT_ECUVARCFG_LVDS EftData.Eft_EcuVarCfg.Val.Lvds #define EFT_ECUVARCFG_FLASH EftData.Eft_EcuVarCfg.Val.Flash #define EFT_ECUVARCFG_DCDC EftData.Eft_EcuVarCfg.Val.Ext_Supply_Dcdc #define EFT_ECUVARCFG_LDO EftData.Eft_EcuVarCfg.Val.Ext_Supply_Ldo #define EFT_ECUVARCFG_IMU EftData.Eft_EcuVarCfg.Val.Imu #define EFT_ECUVARCFG_SBC EftData.Eft_EcuVarCfg.Val.Sbc #define EFT_ECUVARCFG_MCU EftData.Eft_EcuVarCfg.Val.Mcu #define EFT_ECUVARCFG_ETHY EftData.Eft_EcuVarCfg.Val.Ethy /******************************************************************************* ** type definitions enum ** *******************************************************************************/ typedef enum { EFT_HSS_CHIP_0, EFT_HSS_CHIP_1, EFT_HSS_CHIP_MAX } eEft_Hss_Chip; typedef enum { EFT_CAN0_1, EFT_CAN1_0, EFT_CAN1_1, EFT_CAN1_2, EFT_CAN1_3, EFT_CAN_MAX } eEft_Can; typedef enum { EFT_UART_0, EFT_UART_1, EFT_UART_2, EFT_UART_3, EFT_UART_4, EFT_UART_5, EFT_UART_6, EFT_UART_7, EFT_UART_MAX } eEft_Uart; typedef enum { EFT_LIN_1, EFT_LIN_2, EFT_LIN_MAX } eEft_Lin; typedef enum { EFT_LVDS_1, EFT_LVDS_2, EFT_LVDS_MAX } eEft_Lvds; typedef enum { EFT_FLASH_0, EFT_FLASH_1, EFT_FLASH_MAX } eEft_Flash; /******************************************************************************* ** type definitions struct ** *******************************************************************************/ //----------------------------------------------------------------------------- // Structure tEft_Crc: CRC32 on tEft_Calib/tEft_HwDesc/tEft_EcuVarCfg //----------------------------------------------------------------------------- typedef struct { uint32 ulCrc; } tEft_Crc32; typedef struct { // eft version uint8 ucMajorVersion; uint8 ucMinorVersion; uint8 ucReserved1; uint8 ucReserved2; } tEft_DocVers; typedef struct { tEft_Crc32 Crc32; tEft_DocVers Vers; } tEft_Crc; //----------------------------------------------------------------------------- // Structure tEft_Calib: ECU calibration //----------------------------------------------------------------------------- #ifndef UNIT_TEST #pragma pack 2 #else #pragma pack(2) #endif typedef struct { char acText[4]; // string "CALI" } tEft_Calib_Text; typedef struct { // Calibration structure type // 0: Default Data, 1: Initial version structure type uint8 ucType; uint8 ucReserved1; uint8 ucReserved2; uint8 ucReserved3; } tEft_Calib_Type; typedef struct { tEft_Calib_Text Text; // string "CALI" tEft_Calib_Type Type; // Calibration structure type } tEft_Calib_Val; typedef union { tEft_Calib_Val Val; uint8 aucFill[EFT_CALIB_SIZE]; } tEft_Calib; //----------------------------------------------------------------------------- // Structure tEft_HwDesc: ECU identification //----------------------------------------------------------------------------- typedef struct { char acText[4]; // string "HWID" } tEft_HwDesc_Text; typedef struct { // Type AL // 0: Default Data // 1: Initial version type B0-sample // 2: Initial version type B1-sample // 3: Initial version type C0-sample // 4: Initial version type C1-sample uint8 ucTypeAl; // Type Customer // 0: Default Data, 1: Initial version type uint8 ucTypeCust; uint8 ucReserved1; uint8 ucReserved2; } tEft_HwDesc_Type; typedef struct { uint8 aucYear [4]; uint8 aucMonth[2]; uint8 aucDay [2]; } tECUManufacturingDate; typedef struct { uint8 ucLine; uint8 ucEOL; uint8 ucReserved1; uint8 ucReserved2; uint8 aucCounter[4]; } tECUDynSN; typedef struct { uint8 aucECUPartnumber[12]; tECUManufacturingDate sECUManufacturingDate; tECUDynSN sECUDynSN; uint8 aucAL_ECR_Number[11]; uint8 ucReserved; uint8 aucReserved[16]; } tEft_HwId_AL; typedef struct { uint8 size; // valid data size uint8 aucSystemSupplierId[15]; }tEft_HwId_Cust_SystemSupplierId; typedef struct { uint8 size; // valid data size uint8 aucSystemName[11]; }tEft_HwId_Cust_SystemName; typedef struct { uint8 size; // valid data size uint8 aucSWPartNumber[15]; }tEft_HwId_Cust_SWPartNumber; typedef struct { uint8 size; // valid data size uint8 aucHWPartNumber[15]; }tEft_HwId_Cust_HWPartNumber; typedef struct { uint8 aucHWCust_TEXT[4]; // string "CUST" tEft_HwId_Cust_SystemSupplierId sSystemSupplierId; tEft_HwId_Cust_SystemName sSystemName; tEft_HwId_Cust_SWPartNumber sSWPartNumber; tEft_HwId_Cust_HWPartNumber sHWPartNumber; }tEft_HwId_Cust_Val; typedef union // Union size must not exceed 64 bytes { tEft_HwId_Cust_Val Val; uint8 aucReserved[64]; }tEft_HwId_Cust; typedef struct { tEft_HwDesc_Text Text; // string "HWID" tEft_HwDesc_Type Type; // HwId structure type tEft_HwId_AL Al; // Identification AL tEft_HwId_Cust Cust; // Identification Customer } tEft_HwDesc_Val; typedef union { tEft_HwDesc_Val Val; uint8 aucFill[EFT_HWDESC_SIZE]; } tEft_HwDesc; //----------------------------------------------------------------------------- // Structure tEft_EcuVarCfg: characterizing ECU variant //----------------------------------------------------------------------------- typedef struct { char acText[4]; // string "VCFG" } tEft_EcuVarCfg_Text; typedef struct { // Variant structure type // 0: Default Data // 1: Initial version type // 2: Initial with MCU and SBC Cfg. uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Type; typedef struct { // Design variant // 0: n/a // 1: LDC_FULL, 2: LDC_VC1 // 3: LDC_XXX, 4: LDC_XXX uint8 ucEcu; uint8 ucReserved2; } tEft_EcuVarCfg_ECU; typedef struct { // Assigned LDC HSSx output // 0=channel not mounted // 1 =mounted uint8 ucMount; // Maximum current // Imax/Imin = AN12*Factor/1000 uint8 ucMaxA; uint16 unMaxmA; uint16 unMinmA; uint8 aucReserved[2]; } tEft_EcuVarCfg_HSS_CH; typedef struct { // Driver Variant // 0: chip not mounted // 1: BTS72220-4ESA uint8 ucType; uint8 aucReserved[3]; tEft_EcuVarCfg_HSS_CH sCh[4]; } tEft_EcuVarCfg_Hss_Chip; typedef struct { // assembly SUBCAN // 00: not mounted // 01: TJA1044 // 02: TCAN1042 // 03: TJA1042 uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Can; typedef struct { // assembly UARTCAN // 00: not mounted // 01: TJA1044 // 02: TCAN1042 // 03: TJA1042 uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Uart; typedef struct { // assembly LIN // 00: not mounted // 01: TJA1021 uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Lin; typedef struct { // assembly LVDS // 00: not mounted // 01: DS90LV011 // 02: NBA3N011 uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Lvds; typedef struct { // assembly LVDS // 00: not mounted // 01: IS25LP512MG // 02: IS25LP01G uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Flash; typedef struct { // assembly ext Supply(DC/DC) // 00: not fitted // 01: AP64350 (5V/3000mA) uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Ext_Supply_Dcdc; typedef struct { // assembly ext Supply(LDO) // 00: not fitted // 01: TPS7B8250 (5V/200mA) uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Ext_Supply_Ldo; typedef struct { // Driver Variant // 00: not mounted // 01: EWTS5GLC21 uint8 ucType; // Factor = 805.86 * Kl / R_IS uint16 unFactor_Ch[4]; } tEft_EcuVarCfg_ADC_Factor_Hss; typedef struct { // assembly IMU // 0: HSS chip not mounted // 1: mounted uint8 ucType; uint8 ucReserved; } tEft_EcuVarCfg_Imu; typedef struct { // assembly SBC // 00: not mounted // 01: TLE9471-3ES V33 // 02: TLE9471 V33 uint8 ucType; uint8 aucReserved[3]; } tEft_EcuVarCfg_Sbc; typedef struct { // assembly MCU // 00:SAK-TC377TP // 01: SAK-TC377TX // 02: SAK-TC367TP uint8 ucType; uint8 aucReserved[3]; } tEft_EcuVarCfg_Mcu; typedef struct { // assembly ETHPHY // 00: not mounted // 01: DP83TC812 // 02: DP83TG720 uint8 ucType; uint8 aucReserved[3]; } tEft_EcuVarCfg_Ethphy; typedef struct { // Factor = 805.86 * (R_Upper + R_Lower) / R_Lower // Factor = 0 , not fitted uint16 unFactor_Kl30; // AN0 uint16 unFactor_Sbc_3v3; // AN1 uint16 unFactor_Dcdc_5v; // AN2 uint16 unFactor_Soc_3v3; // AN3 uint16 unFactor_Mcu_1v25; // AN4 uint16 unFactor_Soc_A35_1v; // AN5 uint16 unFactor_Soc_Gpu_1v; // AN6 uint16 unFactor_Soc_Main_1v; // AN7 uint16 unFactor_Ddr_Vdd_1v1; // AN8 uint16 unFactor_Emmc_1v8; // AN9 uint16 unFactor_Gpio; // AN10 uint16 unFactor_Sbc_5V; // AN11 // HSS[0] -> CH0, CH1, CH2, CH3 // HSS[1] -> CH4, CH5, CH6, CH7 tEft_EcuVarCfg_ADC_Factor_Hss sHss[EFT_HSS_CHIP_MAX]; // AN12, AN13 // NTC Curve1 // 0: not fitted // 1: NTC Curve1 // 2: NTC Curve2 uint8 ucFactor_Pcb_Temp; // AN14 uint8 ucReserved; // Factor = 805.86 * (R_Upper + R_Lower) / R_Lower uint16 unFactor_K15; // AN15 uint16 unFactor_ADIN0; // AN16 uint16 unFactor_ADIN1; // AN17 } tEft_EcuVarCfg_AdcFactor; typedef struct { tEft_EcuVarCfg_Text Text; // string "VCFG" tEft_EcuVarCfg_Type Type; // EcuVarCfg structure type tEft_EcuVarCfg_ECU Ecu; // [0] -> CH0, CH1, CH2, CH3 // [1] -> CH4, CH5, CH6, CH7 tEft_EcuVarCfg_Hss_Chip Hss_Chip[EFT_HSS_CHIP_MAX]; tEft_EcuVarCfg_Can Can[EFT_CAN_MAX]; tEft_EcuVarCfg_Uart Uart[EFT_UART_MAX]; tEft_EcuVarCfg_Lin Lin[EFT_LIN_MAX]; tEft_EcuVarCfg_Lvds Lvds[EFT_LVDS_MAX]; tEft_EcuVarCfg_Flash Flash[EFT_FLASH_MAX]; tEft_EcuVarCfg_Ext_Supply_Dcdc Ext_Supply_Dcdc; tEft_EcuVarCfg_Ext_Supply_Ldo Ext_Supply_Ldo; tEft_EcuVarCfg_AdcFactor AdcFactor; tEft_EcuVarCfg_Imu Imu; tEft_EcuVarCfg_Sbc Sbc; tEft_EcuVarCfg_Mcu Mcu; tEft_EcuVarCfg_Ethphy Ethy; } tEft_EcuVarCfg_Val; typedef union { tEft_EcuVarCfg_Val Val; uint8 aucFill[EFT_ECUVARCFG_SIZE]; } tEft_EcuVarCfg; #ifndef UNIT_TEST #pragma pack 0 #else #pragma pack(0) #endif //----------------------------------------------------------------------------- // Structure tEftData: characterizing ECU variant //----------------------------------------------------------------------------- // EFT data struct typedef struct { tEft_Crc Eft_Crc; tEft_Calib Eft_Calib; tEft_HwDesc Eft_HwDesc; tEft_EcuVarCfg Eft_EcuVarCfg; } tEftData; /******************************************************************************* ** prototypes ** *******************************************************************************/ /******************************************************************************* ** Start declaration or definitions of functions ** *******************************************************************************/ #define ctadCddEft_START_SEC_CODE #include void CddEft_Init(void); boolean CddEft_DataValid(void); #define ctadCddEft_STOP_SEC_CODE #include /******************************************************************************* ** End declaration or definitions of functions ** *******************************************************************************/ /******************************************************************************* ** externals ** *******************************************************************************/ #ifdef UNIT_TEST tEftData EftData; #else // EftData address set in Hh002_App_TRICORE_TASKING_LinkerScript.lsl extern const tEftData EftData; #endif #endif