mtk_status.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:13k
- /*******************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2006
- *
- ******************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * mtk_status.h
- *
- * Project:
- * --------
- * BootRom Library
- *
- * Description:
- * ------------
- * The definition of error code
- *
- * Author:
- * -------
- * Amos Hsu (mtk00539)
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- * Jan 31 2008 mtk01413
- * [STP100001630] [FlashTool] v3.0804.0 release
- * New features:
- * 1. USB Download for End User
- * Enhancements:
- * 1. [DA] Download Optimization with 921k on MT6225/MT6229/MT6230/MT6235/MT6238
- * 2. [DA] Provide two download methodology : Best Effort Erase (default) and Sequential Erase
- * 3. [DA] New CheckID algorithm for all SPANSION MCP series
- *
- * Dec 3 2007 mtk01413
- * [STP100001568] [FlashTool] v3.0748.0 release
- *
- *
- * Aug 30 2007 mtk01413
- * [STP100001497] [FlashTool] v3.2.0 release
- *
- *
- * Mar 12 2007 mtk01413
- * [STP100001329] FlashTool v3.1.04 release
- *
- *
- * Jan 2 2007 mtk01413
- * [STP100001195] FlashTool v3.1.02 release
- * New features:
- * 1. [BROM_DLL/DA] Support FOTA(Firmware update Over The Air) download.
- * 2. [BROM_DLL/DA] Support MT6223 download.
- * 3. [BROM_DLL/DA] Support MT6268T download.
- * 4. [DA] Supports new NOR Flash device
- * [SPANSION] S29GL128NH
- * [SPANSION] S29GL128NL
- * [SPANSION] S29GL256NH
- * [SPANSION] S29GL256NL
- * [SPANSION] S29GL512NH
- * [SPANSION] S29GL512NL
- *
- * Enhancements:
- * 1. [DA] Support BBC(Blank Block Check) for NOR Flash Format.
- * 2. [BROM_DLL/DA] Support Retransmit mechanism for NAND Readback operation.
- * 3. [BROM_DLL] Enhance E-NFB Check.
- *
- *
- * Sep 27 2006 mtk00539
- * [STP100001145] FlashTool v3.1.01 release
- *
- *
- * Aug 16 2006 mtk00539
- * [STP100001057] FlashTool v3.1.00 release
- * Add new status code
- * S_BROM_NOT_SUPPORT_MT6205B
- * S_DA_HANDSET_FAT_INFO_NOT_FOUND
- * S_FT_GET_PROJECT_ID_FAIL
- * S_DL_PROJECT_ID_DIFF_BETWEEN_MAIN_CODE_AND_JUMP_TBL
- * S_SECURITY_DOWNLOAD_FILE_IS_CORRUPTED
- *
- *
- * Aug 14 2006 mtk01413
- * [STP100001057] FlashTool v3.1.00 release
- *
- *
- * Aug 14 2006 mtk00539
- * [STP100001057] FlashTool v3.1.00 release
- *
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #ifndef _MTK_STATUS_H_
- #define _MTK_STATUS_H_
- //------------------------------------------------------------------------------
- // return code
- //------------------------------------------------------------------------------
- typedef enum {
- S_DONE = 0
- // private random error code (1~999)
- // common error code (1000~1999)
- ,S_COMMON_ERROR_BEGIN = 1000
- ,S_STOP = S_COMMON_ERROR_BEGIN
- ,S_UNDEFINED_ERROR
- ,S_INVALID_ARGUMENTS
- ,S_INVALID_BBCHIP_TYPE
- ,S_INVALID_EXT_CLOCK
- ,S_GET_DLL_VER_FAIL
- ,S_INVALID_BUF
- ,S_BUF_IS_NULL
- ,S_BUF_LEN_IS_ZERO
- ,S_BUF_SIZE_TOO_SMALL
- ,S_NOT_ENOUGH_MEMORY
- ,S_COM_PORT_OPEN_FAIL
- ,S_COM_PORT_SET_TIMEOUT_FAIL
- ,S_COM_PORT_SET_STATE_FAIL
- ,S_COM_PORT_PURGE_FAIL
- ,S_FILEPATH_NOT_SPECIFIED_YET
- ,S_UNKNOWN_TARGET_BBCHIP
- ,S_SKIP_BBCHIP_HW_VER_CHECK
- ,S_UNSUPPORTED_VER_OF_BOOT_ROM
- ,S_UNSUPPORTED_VER_OF_BOOTLOADER
- ,S_UNSUPPORTED_VER_OF_DA
- ,S_UNSUPPORTED_VER_OF_SEC_INFO
- ,S_UNSUPPORTED_VER_OF_ROM_INFO
- ,S_SEC_INFO_NOT_FOUND
- ,S_ROM_INFO_NOT_FOUND
- ,S_CUST_PARA_NOT_SUPPORTED
- ,S_CUST_PARA_WRITE_LEN_INCONSISTENT
- ,S_SEC_RO_NOT_SUPPORTED
- ,S_SEC_RO_WRITE_LEN_INCONSISTENT
- ,S_ADDR_N_LEN_NOT_32BITS_ALIGNMENT
- ,S_UART_CHKSUM_ERROR
- ,S_NOR_FLASH_BOOT
- ,S_NAND_FLASH_BOOT
- ,S_UNSUPPORTED_VER_OF_EMI_INFO
- ,S_COMMON_ERROR_END // END
- // BOOT ROM error code (2000~2999)
- ,S_BROM_ERROR_BEGIN = 2000
- ,S_BROM_SET_META_REG_FAIL = S_BROM_ERROR_BEGIN
- ,S_BROM_SET_FLASHTOOL_REG_FAIL
- ,S_BROM_SET_REMAP_REG_FAIL
- ,S_BROM_SET_EMI_FAIL
- ,S_BROM_DOWNLOAD_DA_FAIL
- ,S_BROM_CMD_STARTCMD_FAIL
- ,S_BROM_CMD_STARTCMD_TIMEOUT
- ,S_BROM_CMD_JUMP_FAIL
- ,S_BROM_CMD_WRITE16_MEM_FAIL
- ,S_BROM_CMD_READ16_MEM_FAIL
- ,S_BROM_CMD_WRITE16_REG_FAIL
- ,S_BROM_CMD_READ16_REG_FAIL
- ,S_BROM_CMD_CHKSUM16_MEM_FAIL
- ,S_BROM_CMD_WRITE32_MEM_FAIL
- ,S_BROM_CMD_READ32_MEM_FAIL
- ,S_BROM_CMD_WRITE32_REG_FAIL
- ,S_BROM_CMD_READ32_REG_FAIL
- ,S_BROM_CMD_CHKSUM32_MEM_FAIL
- ,S_BROM_JUMP_TO_META_MODE_FAIL
- ,S_BROM_WR16_RD16_MEM_RESULT_DIFF
- ,S_BROM_CHKSUM16_MEM_RESULT_DIFF
- ,S_BROM_BBCHIP_HW_VER_INCORRECT
- ,S_BROM_FAIL_TO_GET_BBCHIP_HW_VER
- ,S_BROM_AUTOBAUD_FAIL
- ,S_BROM_SPEEDUP_BAUDRATE_FAIL
- ,S_BROM_LOCK_POWERKEY_FAIL
- ,S_BROM_WM_APP_MSG_OUT_OF_RANGE
- ,S_BROM_NOT_SUPPORT_MT6205B
- ,S_BROM_EXCEED_MAX_DATA_BLOCKS
- ,S_BROM_EXTERNAL_SRAM_DETECTION_FAIL
- ,S_BROM_EXTERNAL_DRAM_DETECTION_FAIL
- ,S_BROM_GET_FW_VER_FAIL
- ,S_BROM_ERROR_END // END
- // DA error code (3000~3999)
- ,S_DA_ERROR_BEGIN = 3000
- ,S_DA_INT_RAM_ERROR = S_DA_ERROR_BEGIN
- ,S_DA_EXT_RAM_ERROR
- ,S_DA_SETUP_DRAM_FAIL
- ,S_DA_SETUP_PLL_ERR
- ,S_DA_DRAM_NOT_SUPPORT
- ,S_DA_RAM_FLOARTING
- ,S_DA_RAM_UNACCESSABLE
- ,S_DA_RAM_ERROR
- ,S_DA_DEVICE_NOT_FOUND
- ,S_DA_NOR_UNSUPPORTED_DEV_ID
- ,S_DA_NAND_UNSUPPORTED_DEV_ID
- ,S_DA_NOR_FLASH_NOT_FOUND
- ,S_DA_NAND_FLASH_NOT_FOUND
- ,S_DA_SOC_CHECK_FAIL
- ,S_DA_NOR_PROGRAM_FAILED
- ,S_DA_NOR_ERASE_FAILED
- ,S_DA_NAND_PAGE_PROGRAM_FAILED
- ,S_DA_NAND_SPARE_PROGRAM_FAILED
- ,S_DA_NAND_HW_COPYBACK_FAILED
- ,S_DA_NAND_ERASE_FAILED
- ,S_DA_TIMEOUT
- ,S_DA_IN_PROGRESS
- ,S_DA_SUPERAND_ONLY_SUPPORT_PAGE_READ
- ,S_DA_SUPERAND_PAGE_PRGRAM_NOT_SUPPORT
- ,S_DA_SUPERAND_SPARE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PARA_AREA_IS_BLANK
- ,S_DA_ENTER_RELAY_MODE_FAIL
- ,S_DA_ENTER_RELAY_MODE_IS_FORBIDDEN_AFTER_META
- ,S_DA_ERROR_END // END
- // FlashTool error code (4000~4999)
- ,S_FT_ERROR_BEGIN = 4000
- ,S_FT_CALLBACK_DA_REPORT_FAIL = S_FT_ERROR_BEGIN
- ,S_FT_DA_NO_RESPONSE
- ,S_FT_DA_SYNC_INCORRECT
- ,S_FT_DA_VERSION_INCORRECT
- ,S_FT_DA_INIT_SYNC_ERROR
- ,S_FT_GET_DSP_VER_FAIL
- ,S_FT_CHANGE_BAUDRATE_FAIL
- ,S_FT_SET_DOWNLOAD_BLOCK_FAIL
- ,S_FT_DOWNLOAD_FAIL
- ,S_FT_READBACK_FAIL
- ,S_FT_FORMAT_FAIL
- ,S_FT_FINISH_CMD_FAIL
- ,S_FT_ENABLE_WATCHDOG_FAIL
- ,S_FT_NFB_DOWNLOAD_BOOTLOADER_FAIL
- ,S_FT_NFB_DOWNLOAD_CODE_FAIL
- ,S_FT_NFB_INVALID_BOOTLOADER_DRAM_SETTING
- ,S_FT_NAND_READADDR_NOT_PAGE_ALIGNMENT
- ,S_FT_NAND_READLEN_NOT_PAGE_ALIGNMENT
- ,S_FT_READ_REG16_FAIL
- ,S_FT_WRITE_REG16_FAIL
- ,S_FT_CUST_PARA_GET_INFO_FAIL
- ,S_FT_CUST_PARA_READ_FAIL
- ,S_FT_CUST_PARA_WRITE_FAIL
- ,S_FT_INVALID_FTCFG_OPERATION
- ,S_FT_INVALID_CUST_PARA_OPERATION
- ,S_FT_INVALID_SEC_RO_OPERATION
- ,S_FT_INVALID_OTP_OPERATION
- ,S_FT_POST_PROCESS_FAIL
- ,S_FT_FTCFG_UPDATE_FAIL
- ,S_FT_SEC_RO_GET_INFO_FAIL
- ,S_FT_SEC_RO_READ_FAIL
- ,S_FT_SEC_RO_WRITE_FAIL
- ,S_FT_ENABLE_DRAM_FAIL
- ,S_FT_FS_FINDFIRSTEX_FAIL
- ,S_FT_FS_FINDNEXTEX_FAIL
- ,S_FT_FS_FOPEN_FAIL
- ,S_FT_FS_GETFILESIZE_FAIL
- ,S_FT_FS_READ_FAIL
- ,S_FT_FS_FILENAME_INVALID
- ,S_FT_FS_FILENAME_TOO_LONG
- ,S_FT_FS_ASSERT
- ,S_FT_OTP_ADDR_NOT_WORD_ALIGNMENT
- ,S_FT_OTP_LENGTH_NOT_WORD_ALIGNMENT
- ,S_FT_OTP_INVALID_ADDRESS_RANGE
- ,S_FT_NAND_READ_TO_BUFFER_NOT_SUPPORT
- ,S_FT_GET_PROJECT_ID_FAIL
- ,S_FT_ENFB_ROM_FILE_SMALL_THAN_HEADER_DESCRIBE
- ,S_FT_RW_EXTRACT_NFB_FAIL
- ,S_FT_MEMORY_TEST_FAIL
- ,S_FT_ERROR_END // END
- // FlashTool Handle error code (5000~5999)
- ,S_FTHND_ERROR_BEGIN = 5000
- ,S_AUTH_HANDLE_IS_NOT_READY = S_FTHND_ERROR_BEGIN
- ,S_INVALID_AUTH_FILE
- ,S_INVALID_DA_FILE
- ,S_DA_HANDLE_IS_NOT_READY
- ,S_FTHND_ILLEGAL_INDEX
- ,S_FTHND_HANDLE_BUSY_NOW
- ,S_FTHND_FILE_IS_UPDATED
- ,S_FTHND_FILE_IS_NOT_LOADED_YET
- ,S_FTHND_FILE_LOAD_FAIL
- ,S_FTHND_FILE_UNLOAD_FAIL
- ,S_FTHND_LIST_IS_EMPTY
- ,S_DL_SCAT_INCORRECT_FORMAT
- ,S_DL_SCAT_ADDR_IS_NOT_WORD_ALIGN
- ,S_DL_SCAT_OFFSET_IS_NOT_WORD_ALIGN
- ,S_DL_SCAT_ADDR_IS_NOT_ASCENDING_ORDER
- ,S_DL_SCAT_JUMPTABLE_IS_NOT_ABSOLUTE_ADDR
- ,S_DL_LOAD_REGION_IS_OVERLAP
- ,S_DL_LOAD_REGION_NOT_FOUND
- ,S_DL_NOT_RESOURCE_BIN
- ,S_DL_MULTIBIN_MECHANISM_DISABLED
- ,S_DL_RESOURCE_NOT_MATCH_IN_JUMPTABLE
- ,S_DL_RESOURCE_MUST_DOWNLOAD_WITH_JUMPTABLE
- ,S_DL_OVERLAP_WITH_EXISTING_RESOURCE
- ,S_DL_INVALID_RESOURCE_BIN
- ,S_DL_JUMPTABLE_INCONSISTENT_WITH_SCAT
- ,S_DL_INVALID_JUMPTABLE
- ,S_DL_REGION_ADDR_INCONSISTENT_WITH_SCAT
- ,S_DL_REGION_ADDR_INCONSISTENT_WITH_RESOURCE_ADDR
- ,S_DL_INVALID_BOOTLOADER
- ,S_DL_BOOTLOADER_IS_NOT_LOADED_YET
- ,S_DL_BOOTLOADER_NOT_FOUND
- ,S_DL_REMOTE_FILE_UNSUPPORTED_BY_BL_AUTOLOAD
- ,S_DLIST_SAME_BBCHIP_SW_VER
- ,S_DLIST_BBCHIP_HW_VER_NOT_MATCHED
- ,S_DLIST_NO_MATCHED_DL_HANDLE_FOUND
- ,S_DLIST_DL_HANDLE_NOT_IN_LIST
- ,S_DLIST_DL_HANDLE_ALREADY_IN_LIST
- ,S_FTHND_CALLBACK_REMOTE_GET_FILE_LEN_FAIL
- ,S_FTHND_CALLBACK_REMOTE_READ_FILE_FAIL
- ,S_FTHND_CALLBACK_FILE_INTEGRITY_CHECK_FAIL
- ,S_UNSUPPORTED_VER_OF_AUTH_FILE
- ,S_DL_PROJECT_ID_DIFF_BETWEEN_MAIN_CODE_AND_JUMP_TBL
- ,S_DL_SCAT_OPEN_FAIL
- ,S_FTHND_CALLBACK_COM_INIT_STAGE_FAIL
- ,S_DL_UNSECURE_MAUI_TO_SECURE_BB
- ,S_FTHND_CALLBACK_REMOTE_GET_SIG_LEN_FAIL
- ,S_FTHND_CALLBACK_REMOTE_READ_SIG_FAIL
- ,S_FTHND_ERROR_END // END
- // security error code (6000~6999)
- ,S_SECURITY_ERROR_BEGIN = 6000
- ,S_SECURITY_CALLBACK_SLA_CHALLENGE_FAIL = S_SECURITY_ERROR_BEGIN
- ,S_SECURITY_SLA_WRONG_AUTH_FILE
- ,S_SECURITY_SLA_INVALID_AUTH_FILE
- ,S_SECURITY_SLA_CHALLENGE_FAIL
- ,S_SECURITY_SLA_FAIL
- ,S_SECURITY_DAA_FAIL
- ,S_SECURITY_SBC_FAIL
- ,S_SECURITY_SF_SECURE_VER_CHECK_FAIL
- ,S_SECURITY_SF_HANDSET_SECURE_CUSTOM_NAME_NOT_MATCH
- ,S_SECURITY_SF_FTCFG_LOCKDOWN
- ,S_SECURITY_SF_CODE_DOWNLOAD_FORBIDDEN
- ,S_SECURITY_SF_CODE_READBACK_FORBIDDEN
- ,S_SECURITY_SF_CODE_FORMAT_FORBIDDEN
- ,S_SECURITY_SF_SEC_RO_DOWNLOAD_FORBIDDEN
- ,S_SECURITY_SF_SEC_RO_READBACK_FORBIDDEN
- ,S_SECURITY_SF_SEC_RO_FORMAT_FORBIDDEN
- ,S_SECURITY_SF_FAT_DOWNLOAD_FORBIDDEN
- ,S_SECURITY_SF_FAT_READBACK_FORBIDDEN
- ,S_SECURITY_SF_FAT_FORMAT_FORBIDDEN
- ,S_SECURITY_SF_RESTRICTED_AREA_ACCESS_FORBIDDEN
- ,S_SECURITY_SECURE_CUSTOM_NAME_NOT_MATCH_BETWEEN_AUTH_AND_DL_HANDLE
- ,S_SECURITY_DOWNLOAD_FILE_IS_CORRUPTED
- ,S_SECURITY_NOT_SUPPORT
- ,S_SECURITY_BOOTLOADER_IMAGE_SIGNATURE_FAIL
- ,S_SECURITY_BOOTLOADER_ELDER_SW_VERSION_CANNOT_BE_DOWNLOADED
- ,S_SECURITY_BOOTLOADER_IMAGE_NO_SIGNATURE
-
- ,S_SECURITY_ERROR_END // END
- // expand to 32bits width
- ,S_MAX_STATUS_WIDTH = 0x7FFFFFFF
- } STATUS_E;
- #define STATUS_CODE(err_code, private_err_code)
- ((S_COMMON_ERROR_BEGIN<=err_code)?err_code:private_err_code)
- #endif