| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: UTF-8 -*- |
| 3 |
# |
| 4 |
# Copyright 2016-2018 Martin Olejar |
| 5 |
# Copyright 2019-2024 NXP |
| 6 |
# |
| 7 |
# SPDX-License-Identifier: BSD-3-Clause |
| 8 |
|
| 9 |
"""Status and error codes used by the MBoot protocol.""" |
| 10 |
|
| 11 |
from ..utils.spsdk_enum import SpsdkEnum |
| 12 |
|
| 13 |
######################################################################################################################## |
| 14 |
# McuBoot Status Codes (Errors) |
| 15 |
######################################################################################################################## |
| 16 |
|
| 17 |
|
| 18 |
# pylint: disable=line-too-long |
| 19 |
# fmt: off |
| 20 |
class StatusCode(SpsdkEnum): |
| 21 |
"""McuBoot status codes.""" |
| 22 |
|
| 23 |
SUCCESS = (0, "Success", "Success") |
| 24 |
FAIL = (1, "Fail", "Fail") |
| 25 |
READ_ONLY = (2, "ReadOnly", "Read Only Error") |
| 26 |
OUT_OF_RANGE = (3, "OutOfRange", "Out Of Range Error") |
| 27 |
INVALID_ARGUMENT = (4, "InvalidArgument", "Invalid Argument Error") |
| 28 |
TIMEOUT = (5, "TimeoutError", "Timeout Error") |
| 29 |
NO_TRANSFER_IN_PROGRESS = (6, "NoTransferInProgress", "No Transfer In Progress Error") |
| 30 |
|
| 31 |
# Flash driver errors. |
| 32 |
FLASH_SIZE_ERROR = (100, "FlashSizeError", "FLASH Driver: Size Error") |
| 33 |
FLASH_ALIGNMENT_ERROR = (101, "FlashAlignmentError", "FLASH Driver: Alignment Error") |
| 34 |
FLASH_ADDRESS_ERROR = (102, "FlashAddressError", "FLASH Driver: Address Error") |
| 35 |
FLASH_ACCESS_ERROR = (103, "FlashAccessError", "FLASH Driver: Access Error") |
| 36 |
FLASH_PROTECTION_VIOLATION = (104, "FlashProtectionViolation", "FLASH Driver: Protection Violation") |
| 37 |
FLASH_COMMAND_FAILURE = (105, "FlashCommandFailure", "FLASH Driver: Command Failure") |
| 38 |
FLASH_UNKNOWN_PROPERTY = (106, "FlashUnknownProperty", "FLASH Driver: Unknown Property") |
| 39 |
FLASH_ERASE_KEY_ERROR = (107, "FlashEraseKeyError", "FLASH Driver: Provided Key Does Not Match Programmed Flash Memory Key") |
| 40 |
FLASH_REGION_EXECUTE_ONLY = (108, "FlashRegionExecuteOnly", "FLASH Driver: Region Execute Only") |
| 41 |
FLASH_EXEC_IN_RAM_NOT_READY = (109, "FlashExecuteInRamFunctionNotReady", "FLASH Driver: Execute In RAM Function Not Ready") |
| 42 |
FLASH_COMMAND_NOT_SUPPORTED = (111, "FlashCommandNotSupported", "FLASH Driver: Command Not Supported") |
| 43 |
FLASH_READ_ONLY_PROPERTY = (112, "FlashReadOnlyProperty", "FLASH Driver: Flash Memory Property Is Read-Only") |
| 44 |
FLASH_INVALID_PROPERTY_VALUE = (113, "FlashInvalidPropertyValue", "FLASH Driver: Flash Memory Property Value Out Of Range") |
| 45 |
FLASH_INVALID_SPECULATION_OPTION = (114, "FlashInvalidSpeculationOption", "FLASH Driver: Flash Memory Prefetch Speculation Option Is Invalid") |
| 46 |
FLASH_ECC_ERROR = (116, "FlashEccError", "FLASH Driver: ECC Error") |
| 47 |
FLASH_COMPARE_ERROR = (117, "FlashCompareError", "FLASH Driver: Destination And Source Memory Contents Do Not Match") |
| 48 |
FLASH_REGULATION_LOSS = (118, "FlashRegulationLoss", "FLASH Driver: Loss Of Regulation During Read") |
| 49 |
FLASH_INVALID_WAIT_STATE_CYCLES = (119, "FlashInvalidWaitStateCycles", "FLASH Driver: Wait State Cycle Set To Read/Write Mode Is Invalid") |
| 50 |
FLASH_OUT_OF_DATE_CFPA_PAGE = (132, "FlashOutOfDateCfpaPage", "FLASH Driver: Out Of Date CFPA Page") |
| 51 |
FLASH_BLANK_IFR_PAGE_DATA = (133, "FlashBlankIfrPageData", "FLASH Driver: Blank IFR Page Data") |
| 52 |
FLASH_ENCRYPTED_REGIONS_ERASE_NOT_DONE_AT_ONCE = (134, "FlashEncryptedRegionsEraseNotDoneAtOnce", "FLASH Driver: Encrypted Regions Erase Not Done At Once") |
| 53 |
FLASH_PROGRAM_VERIFICATION_NOT_ALLOWED = (135, "FlashProgramVerificationNotAllowed", "FLASH Driver: Program Verification Not Allowed") |
| 54 |
FLASH_HASH_CHECK_ERROR = (136, "FlashHashCheckError", "FLASH Driver: Hash Check Error") |
| 55 |
FLASH_SEALED_PFR_REGION = (137, "FlashSealedPfrRegion", "FLASH Driver: Sealed PFR Region") |
| 56 |
FLASH_PFR_REGION_WRITE_BROKEN = (138, "FlashPfrRegionWriteBroken", "FLASH Driver: PFR Region Write Broken") |
| 57 |
FLASH_NMPA_UPDATE_NOT_ALLOWED = (139, "FlashNmpaUpdateNotAllowed", "FLASH Driver: NMPA Update Not Allowed") |
| 58 |
FLASH_CMPA_CFG_DIRECT_ERASE_NOT_ALLOWED = (140, "FlashCmpaCfgDirectEraseNotAllowed", "FLASH Driver: CMPA Cfg Direct Erase Not Allowed") |
| 59 |
FLASH_PFR_BANK_IS_LOCKED = (141, "FlashPfrBankIsLocked", "FLASH Driver: PFR Bank Is Locked") |
| 60 |
FLASH_CFPA_SCRATCH_PAGE_INVALID = (148, "FlashCfpaScratchPageInvalid", "FLASH Driver: CFPA Scratch Page Invalid") |
| 61 |
FLASH_CFPA_VERSION_ROLLBACK_DISALLOWED = (149, "FlashCfpaVersionRollbackDisallowed", "FLASH Driver: CFPA Version Rollback Disallowed") |
| 62 |
FLASH_READ_HIDING_AREA_DISALLOWED = (150, "FlashReadHidingAreaDisallowed", "FLASH Driver: Flash Memory Hiding Read Not Allowed") |
| 63 |
FLASH_MODIFY_PROTECTED_AREA_DISALLOWED = (151, "FlashModifyProtectedAreaDisallowed", "FLASH Driver: Flash Firewall Page Locked Erase And Program Are Not Allowed") |
| 64 |
FLASH_COMMAND_OPERATION_IN_PROGRESS = (152, "FlashCommandOperationInProgress", "FLASH Driver: Flash Memory State Busy Flash Memory Command Is In Progress") |
| 65 |
|
| 66 |
# I2C driver errors. |
| 67 |
I2C_SLAVE_TX_UNDERRUN = (200, "I2cSlaveTxUnderrun", "I2C Driver: Slave Tx Underrun") |
| 68 |
I2C_SLAVE_RX_OVERRUN = (201, "I2cSlaveRxOverrun", "I2C Driver: Slave Rx Overrun") |
| 69 |
I2C_ARBITRATION_LOST = (202, "I2cArbitrationLost", "I2C Driver: Arbitration Lost") |
| 70 |
|
| 71 |
# SPI driver errors. |
| 72 |
SPI_SLAVE_TX_UNDERRUN = (300, "SpiSlaveTxUnderrun", "SPI Driver: Slave Tx Underrun") |
| 73 |
SPI_SLAVE_RX_OVERRUN = (301, "SpiSlaveRxOverrun", "SPI Driver: Slave Rx Overrun") |
| 74 |
|
| 75 |
# QuadSPI driver errors. |
| 76 |
QSPI_FLASH_SIZE_ERROR = (400, "QspiFlashSizeError", "QSPI Driver: Flash Size Error") |
| 77 |
QSPI_FLASH_ALIGNMENT_ERROR = (401, "QspiFlashAlignmentError", "QSPI Driver: Flash Alignment Error") |
| 78 |
QSPI_FLASH_ADDRESS_ERROR = (402, "QspiFlashAddressError", "QSPI Driver: Flash Address Error") |
| 79 |
QSPI_FLASH_COMMAND_FAILURE = (403, "QspiFlashCommandFailure", "QSPI Driver: Flash Command Failure") |
| 80 |
QSPI_FLASH_UNKNOWN_PROPERTY = (404, "QspiFlashUnknownProperty", "QSPI Driver: Flash Unknown Property") |
| 81 |
QSPI_NOT_CONFIGURED = (405, "QspiNotConfigured", "QSPI Driver: Not Configured") |
| 82 |
QSPI_COMMAND_NOT_SUPPORTED = (406, "QspiCommandNotSupported", "QSPI Driver: Command Not Supported") |
| 83 |
QSPI_COMMAND_TIMEOUT = (407, "QspiCommandTimeout", "QSPI Driver: Command Timeout") |
| 84 |
QSPI_WRITE_FAILURE = (408, "QspiWriteFailure", "QSPI Driver: Write Failure") |
| 85 |
|
| 86 |
# OTFAD driver errors. |
| 87 |
OTFAD_SECURITY_VIOLATION = (500, "OtfadSecurityViolation", "OTFAD Driver: Security Violation") |
| 88 |
OTFAD_LOGICALLY_DISABLED = (501, "OtfadLogicallyDisabled", "OTFAD Driver: Logically Disabled") |
| 89 |
OTFAD_INVALID_KEY = (502, "OtfadInvalidKey", "OTFAD Driver: Invalid Key") |
| 90 |
OTFAD_INVALID_KEY_BLOB = (503, "OtfadInvalidKeyBlob", "OTFAD Driver: Invalid Key Blob") |
| 91 |
|
| 92 |
# Sending errors. |
| 93 |
SENDING_OPERATION_CONDITION_ERROR = (1812, "SendOperationConditionError", "Send Operation Condition failed") |
| 94 |
|
| 95 |
# SDMMC driver errors. |
| 96 |
|
| 97 |
# FlexSPI statuses. |
| 98 |
FLEXSPI_SEQUENCE_EXECUTION_TIMEOUT_RT5xx = (6000, "FLEXSPI_SequenceExecutionTimeout_RT5xx", "FLEXSPI: Sequence Execution Timeout") |
| 99 |
FLEXSPI_INVALID_SEQUENCE_RT5xx = (6001, "FLEXSPI_InvalidSequence_RT5xx", "FLEXSPI: Invalid Sequence") |
| 100 |
FLEXSPI_DEVICE_TIMEOUT_RT5xx = (6002, "FLEXSPI_DeviceTimeout_RT5xx", "FLEXSPI: Device Timeout") |
| 101 |
FLEXSPI_SEQUENCE_EXECUTION_TIMEOUT = (7000, "FLEXSPI_SequenceExecutionTimeout", "FLEXSPI: Sequence Execution Timeout") |
| 102 |
FLEXSPI_INVALID_SEQUENCE = (7001, "FLEXSPI_InvalidSequence", "FLEXSPI: Invalid Sequence") |
| 103 |
FLEXSPI_DEVICE_TIMEOUT = (7002, "FLEXSPI_DeviceTimeout", "FLEXSPI: Device Timeout") |
| 104 |
|
| 105 |
# Bootloader errors. |
| 106 |
UNKNOWN_COMMAND = (10000, "UnknownCommand", "Unknown Command") |
| 107 |
SECURITY_VIOLATION = (10001, "SecurityViolation", "Security Violation") |
| 108 |
ABORT_DATA_PHASE = (10002, "AbortDataPhase", "Abort Data Phase") |
| 109 |
PING_ERROR = (10003, "PingError", "Ping Error") |
| 110 |
NO_RESPONSE = (10004, "NoResponse", "No response packet from target device") |
| 111 |
NO_RESPONSE_EXPECTED = (10005, "NoResponseExpected", "No Response Expected") |
| 112 |
UNSUPPORTED_COMMAND = (10006, "UnsupportedCommand", "Unsupported Command") |
| 113 |
|
| 114 |
# SB loader errors. |
| 115 |
ROMLDR_SECTION_OVERRUN = (10100, "RomLdrSectionOverrun", "ROM Loader: Section Overrun") |
| 116 |
ROMLDR_SIGNATURE = (10101, "RomLdrSignature", "ROM Loader: Signature Error") |
| 117 |
ROMLDR_SECTION_LENGTH = (10102, "RomLdrSectionLength", "ROM Loader: Section Length Error") |
| 118 |
ROMLDR_UNENCRYPTED_ONLY = (10103, "RomLdrUnencryptedOnly", "ROM Loader: Unencrypted Only") |
| 119 |
ROMLDR_EOF_REACHED = (10104, "RomLdrEOFReached", "ROM Loader: EOF Reached") |
| 120 |
ROMLDR_CHECKSUM = (10105, "RomLdrChecksum", "ROM Loader: Checksum Error") |
| 121 |
ROMLDR_CRC32_ERROR = (10106, "RomLdrCrc32Error", "ROM Loader: CRC32 Error") |
| 122 |
ROMLDR_UNKNOWN_COMMAND = (10107, "RomLdrUnknownCommand", "ROM Loader: Unknown Command") |
| 123 |
ROMLDR_ID_NOT_FOUND = (10108, "RomLdrIdNotFound", "ROM Loader: ID Not Found") |
| 124 |
ROMLDR_DATA_UNDERRUN = (10109, "RomLdrDataUnderrun", "ROM Loader: Data Underrun") |
| 125 |
ROMLDR_JUMP_RETURNED = (10110, "RomLdrJumpReturned", "ROM Loader: Jump Returned") |
| 126 |
ROMLDR_CALL_FAILED = (10111, "RomLdrCallFailed", "ROM Loader: Call Failed") |
| 127 |
ROMLDR_KEY_NOT_FOUND = (10112, "RomLdrKeyNotFound", "ROM Loader: Key Not Found") |
| 128 |
ROMLDR_SECURE_ONLY = (10113, "RomLdrSecureOnly", "ROM Loader: Secure Only") |
| 129 |
ROMLDR_RESET_RETURNED = (10114, "RomLdrResetReturned", "ROM Loader: Reset Returned") |
| 130 |
ROMLDR_ROLLBACK_BLOCKED = (10115, "RomLdrRollbackBlocked", "ROM Loader: Rollback Blocked") |
| 131 |
ROMLDR_INVALID_SECTION_MAC_COUNT = (10116, "RomLdrInvalidSectionMacCount", "ROM Loader: Invalid Section Mac Count") |
| 132 |
ROMLDR_UNEXPECTED_COMMAND = (10117, "RomLdrUnexpectedCommand", "ROM Loader: Unexpected Command") |
| 133 |
ROMLDR_BAD_SBKEK = (10118, "RomLdrBadSBKEK", "ROM Loader: Bad SBKEK Detected") |
| 134 |
ROMLDR_PENDING_JUMP_COMMAND = (10119, "RomLdrPendingJumpCommand", "ROM Loader: Pending Jump Command") |
| 135 |
|
| 136 |
# Memory interface errors. |
| 137 |
MEMORY_RANGE_INVALID = (10200, "MemoryRangeInvalid", "Memory Range Invalid") |
| 138 |
MEMORY_READ_FAILED = (10201, "MemoryReadFailed", "Memory Read Failed") |
| 139 |
MEMORY_WRITE_FAILED = (10202, "MemoryWriteFailed", "Memory Write Failed") |
| 140 |
MEMORY_CUMULATIVE_WRITE = (10203, "MemoryCumulativeWrite", "Memory Cumulative Write") |
| 141 |
MEMORY_APP_OVERLAP_WITH_EXECUTE_ONLY_REGION = (10204, "MemoryAppOverlapWithExecuteOnlyRegion", "Memory App Overlap with exec region") |
| 142 |
MEMORY_NOT_CONFIGURED = (10205, "MemoryNotConfigured", "Memory Not Configured") |
| 143 |
MEMORY_ALIGNMENT_ERROR = (10206, "MemoryAlignmentError", "Memory Alignment Error") |
| 144 |
MEMORY_VERIFY_FAILED = (10207, "MemoryVerifyFailed", "Memory Verify Failed") |
| 145 |
MEMORY_WRITE_PROTECTED = (10208, "MemoryWriteProtected", "Memory Write Protected") |
| 146 |
MEMORY_ADDRESS_ERROR = (10209, "MemoryAddressError", "Memory Address Error") |
| 147 |
MEMORY_BLANK_CHECK_FAILED = (10210, "MemoryBlankCheckFailed", "Memory Black Check Failed") |
| 148 |
MEMORY_BLANK_PAGE_READ_DISALLOWED = (10211, "MemoryBlankPageReadDisallowed", "Memory Blank Page Read Disallowed") |
| 149 |
MEMORY_PROTECTED_PAGE_READ_DISALLOWED = (10212, "MemoryProtectedPageReadDisallowed", "Memory Protected Page Read Disallowed") |
| 150 |
MEMORY_PFR_SPEC_REGION_WRITE_BROKEN = (10213, "MemoryPfrSpecRegionWriteBroken", "Memory PFR Spec Region Write Broken") |
| 151 |
MEMORY_UNSUPPORTED_COMMAND = (10214, "MemoryUnsupportedCommand", "Memory Unsupported Command") |
| 152 |
|
| 153 |
# Property store errors. |
| 154 |
UNKNOWN_PROPERTY = (10300, "UnknownProperty", "Unknown Property") |
| 155 |
READ_ONLY_PROPERTY = (10301, "ReadOnlyProperty", "Read Only Property") |
| 156 |
INVALID_PROPERTY_VALUE = (10302, "InvalidPropertyValue", "Invalid Property Value") |
| 157 |
|
| 158 |
# Property store errors. |
| 159 |
APP_CRC_CHECK_PASSED = (10400, "AppCrcCheckPassed", "Application CRC Check: Passed") |
| 160 |
APP_CRC_CHECK_FAILED = (10401, "AppCrcCheckFailed", "Application: CRC Check: Failed") |
| 161 |
APP_CRC_CHECK_INACTIVE = (10402, "AppCrcCheckInactive", "Application CRC Check: Inactive") |
| 162 |
APP_CRC_CHECK_INVALID = (10403, "AppCrcCheckInvalid", "Application CRC Check: Invalid") |
| 163 |
APP_CRC_CHECK_OUT_OF_RANGE = (10404, "AppCrcCheckOutOfRange", "Application CRC Check: Out Of Range") |
| 164 |
|
| 165 |
# Packetizer errors. |
| 166 |
PACKETIZER_NO_PING_RESPONSE = (10500, "NoPingResponse", "Packetizer Error: No Ping Response") |
| 167 |
PACKETIZER_INVALID_PACKET_TYPE = (10501, "InvalidPacketType", "Packetizer Error: No response received for ping command") |
| 168 |
PACKETIZER_INVALID_CRC = (10502, "InvalidCRC", "Packetizer Error: Invalid packet type") |
| 169 |
PACKETIZER_NO_COMMAND_RESPONSE = (10503, "NoCommandResponse", "Packetizer Error: No response received for command") |
| 170 |
|
| 171 |
# Reliable Update statuses. |
| 172 |
RELIABLE_UPDATE_SUCCESS = (10600, "ReliableUpdateSuccess", "Reliable Update: Success") |
| 173 |
RELIABLE_UPDATE_FAIL = (10601, "ReliableUpdateFail", "Reliable Update: Fail") |
| 174 |
RELIABLE_UPDATE_INACTIVE = (10602, "ReliableUpdateInactive", "Reliable Update: Inactive") |
| 175 |
RELIABLE_UPDATE_BACKUPAPPLICATIONINVALID = (10603, "ReliableUpdateBackupApplicationInvalid", "Reliable Update: Backup Application Invalid") |
| 176 |
RELIABLE_UPDATE_STILLINMAINAPPLICATION = (10604, "ReliableUpdateStillInMainApplication", "Reliable Update: Still In Main Application") |
| 177 |
RELIABLE_UPDATE_SWAPSYSTEMNOTREADY = (10605, "ReliableUpdateSwapSystemNotReady", "Reliable Update: Swap System Not Ready") |
| 178 |
RELIABLE_UPDATE_BACKUPBOOTLOADERNOTREADY = (10606, "ReliableUpdateBackupBootloaderNotReady", "Reliable Update: Backup Bootloader Not Ready") |
| 179 |
RELIABLE_UPDATE_SWAPINDICATORADDRESSINVALID = (10607, "ReliableUpdateSwapIndicatorAddressInvalid", "Reliable Update: Swap Indicator Address Invalid") |
| 180 |
RELIABLE_UPDATE_SWAPSYSTEMNOTAVAILABLE = (10608, "ReliableUpdateSwapSystemNotAvailable", "Reliable Update: Swap System Not Available") |
| 181 |
RELIABLE_UPDATE_SWAPTEST = (10609, "ReliableUpdateSwapTest", "Reliable Update: Swap Test") |
| 182 |
|
| 183 |
# Serial NOR/EEPROM statuses. |
| 184 |
SERIAL_NOR_EEPROM_ADDRESS_INVALID = (10700, "SerialNorEepromAddressInvalid", "SerialNorEeprom: Address Invalid") |
| 185 |
SERIAL_NOR_EEPROM_TRANSFER_ERROR = (10701, "SerialNorEepromTransferError", "SerialNorEeprom: Transfer Error") |
| 186 |
SERIAL_NOR_EEPROM_TYPE_INVALID = (10702, "SerialNorEepromTypeInvalid", "SerialNorEeprom: Type Invalid") |
| 187 |
SERIAL_NOR_EEPROM_SIZE_INVALID = (10703, "SerialNorEepromSizeInvalid", "SerialNorEeprom: Size Invalid") |
| 188 |
SERIAL_NOR_EEPROM_COMMAND_INVALID = (10704, "SerialNorEepromCommandInvalid", "SerialNorEeprom: Command Invalid") |
| 189 |
|
| 190 |
# ROM API statuses. |
| 191 |
ROM_API_NEED_MORE_DATA = (10800, "RomApiNeedMoreData", "RomApi: Need More Data") |
| 192 |
ROM_API_BUFFER_SIZE_NOT_ENOUGH = (10801, "RomApiBufferSizeNotEnough", "RomApi: Buffer Size Not Enough") |
| 193 |
ROM_API_INVALID_BUFFER = (10802, "RomApiInvalidBuffer", "RomApi: Invalid Buffer") |
| 194 |
|
| 195 |
# FlexSPI NAND statuses. |
| 196 |
FLEXSPINAND_READ_PAGE_FAIL = (20000, "FlexSPINANDReadPageFail", "FlexSPINAND: Read Page Fail") |
| 197 |
FLEXSPINAND_READ_CACHE_FAIL = (20001, "FlexSPINANDReadCacheFail", "FlexSPINAND: Read Cache Fail") |
| 198 |
FLEXSPINAND_ECC_CHECK_FAIL = (20002, "FlexSPINANDEccCheckFail", "FlexSPINAND: Ecc Check Fail") |
| 199 |
FLEXSPINAND_PAGE_LOAD_FAIL = (20003, "FlexSPINANDPageLoadFail", "FlexSPINAND: Page Load Fail") |
| 200 |
FLEXSPINAND_PAGE_EXECUTE_FAIL = (20004, "FlexSPINANDPageExecuteFail", "FlexSPINAND: Page Execute Fail") |
| 201 |
FLEXSPINAND_ERASE_BLOCK_FAIL = (20005, "FlexSPINANDEraseBlockFail", "FlexSPINAND: Erase Block Fail") |
| 202 |
FLEXSPINAND_WAIT_TIMEOUT = (20006, "FlexSPINANDWaitTimeout", "FlexSPINAND: Wait Timeout") |
| 203 |
FlexSPINAND_NOT_SUPPORTED = (20007, "SPINANDPageSizeOverTheMaxSupportedSize", "SPI NAND: PageSize over the max supported size") |
| 204 |
FlexSPINAND_FCB_UPDATE_FAIL = (20008, "FailedToUpdateFlashConfigBlockToSPINAND", "SPI NAND: Failed to update Flash config block to SPI NAND") |
| 205 |
FlexSPINAND_DBBT_UPDATE_FAIL = (20009, "Failed to update discovered bad block table to SPI NAND", "SPI NAND: Failed to update discovered bad block table to SPI NAND") |
| 206 |
FLEXSPINAND_WRITEALIGNMENTERROR = (20010, "FlexSPINANDWriteAlignmentError", "FlexSPINAND: Write Alignment Error") |
| 207 |
FLEXSPINAND_NOT_FOUND = (20011, "FlexSPINANDNotFound", "FlexSPINAND: Not Found") |
| 208 |
|
| 209 |
# FlexSPI NOR statuses. |
| 210 |
FLEXSPINOR_PROGRAM_FAIL = (20100, "FLEXSPINORProgramFail", "FLEXSPINOR: Program Fail") |
| 211 |
FLEXSPINOR_ERASE_SECTOR_FAIL = (20101, "FLEXSPINOREraseSectorFail", "FLEXSPINOR: Erase Sector Fail") |
| 212 |
FLEXSPINOR_ERASE_ALL_FAIL = (20102, "FLEXSPINOREraseAllFail", "FLEXSPINOR: Erase All Fail") |
| 213 |
FLEXSPINOR_WAIT_TIMEOUT = (20103, "FLEXSPINORWaitTimeout", "FLEXSPINOR:Wait Timeout") |
| 214 |
FLEXSPINOR_NOT_SUPPORTED = (20104, "FLEXSPINORPageSizeOverTheMaxSupportedSize", "FlexSPINOR: PageSize over the max supported size") |
| 215 |
FLEXSPINOR_WRITE_ALIGNMENT_ERROR = (20105, "FlexSPINORWriteAlignmentError", "FlexSPINOR:Write Alignment Error") |
| 216 |
FLEXSPINOR_COMMANDFAILURE = (20106, "FlexSPINORCommandFailure", "FlexSPINOR: Command Failure") |
| 217 |
FLEXSPINOR_SFDP_NOTFOUND = (20107, "FlexSPINORSFDPNotFound", "FlexSPINOR: SFDP Not Found") |
| 218 |
FLEXSPINOR_UNSUPPORTED_SFDP_VERSION = (20108, "FLEXSPINORUnsupportedSFDPVersion", "FLEXSPINOR: Unsupported SFDP Version") |
| 219 |
FLEXSPINOR_FLASH_NOTFOUND = (20109, "FLEXSPINORFlashNotFound", "FLEXSPINOR Flash Not Found") |
| 220 |
FLEXSPINOR_DTR_READ_DUMMYPROBEFAILED = (20110, "FLEXSPINORDTRReadDummyProbeFailed", "FLEXSPINOR: DTR Read Dummy Probe Failed") |
| 221 |
|
| 222 |
# OCOTP statuses. |
| 223 |
OCOTP_READ_FAILURE = (20200, "OCOTPReadFailure", "OCOTP: Read Failure") |
| 224 |
OCOTP_PROGRAM_FAILURE = (20201, "OCOTPProgramFailure", "OCOTP: Program Failure") |
| 225 |
OCOTP_RELOAD_FAILURE = (20202, "OCOTPReloadFailure", "OCOTP: Reload Failure") |
| 226 |
OCOTP_WAIT_TIMEOUT = (20203, "OCOTPWaitTimeout", "OCOTP: Wait Timeout") |
| 227 |
|
| 228 |
# SEMC NOR statuses. |
| 229 |
SEMCNOR_DEVICE_TIMEOUT = (21100, "SemcNOR_DeviceTimeout", "SemcNOR: Device Timeout") |
| 230 |
SEMCNOR_INVALID_MEMORY_ADDRESS = (21101, "SemcNOR_InvalidMemoryAddress", "SemcNOR: Invalid Memory Address") |
| 231 |
SEMCNOR_UNMATCHED_COMMAND_SET = (21102, "SemcNOR_unmatchedCommandSet", "SemcNOR: unmatched Command Set") |
| 232 |
SEMCNOR_ADDRESS_ALIGNMENT_ERROR = (21103, "SemcNOR_AddressAlignmentError", "SemcNOR: Address Alignment Error") |
| 233 |
SEMCNOR_INVALID_CFI_SIGNATURE = (21104, "SemcNOR_InvalidCfiSignature", "SemcNOR: Invalid Cfi Signature") |
| 234 |
SEMCNOR_COMMAND_ERROR_NO_OP_TO_SUSPEND = (21105, "SemcNOR_CommandErrorNoOpToSuspend", "SemcNOR: Command Error No Op To Suspend") |
| 235 |
SEMCNOR_COMMAND_ERROR_NO_INFO_AVAILABLE = (21106, "SemcNOR_CommandErrorNoInfoAvailable", "SemcNOR: Command Error No Info Available") |
| 236 |
SEMCNOR_BLOCK_ERASE_COMMAND_FAILURE = (21107, "SemcNOR_BlockEraseCommandFailure", "SemcNOR: Block Erase Command Failure") |
| 237 |
SEMCNOR_BUFFER_PROGRAM_COMMAND_FAILURE = (21108, "SemcNOR_BufferProgramCommandFailure", "SemcNOR: Buffer Program Command Failure") |
| 238 |
SEMCNOR_PROGRAM_VERIFY_FAILURE = (21109, "SemcNOR_ProgramVerifyFailure", "SemcNOR: Program Verify Failure") |
| 239 |
SEMCNOR_ERASE_VERIFY_FAILURE = (21110, "SemcNOR_EraseVerifyFailure", "SemcNOR: Erase Verify Failure") |
| 240 |
SEMCNOR_INVALID_CFG_TAG = (21116, "SemcNOR_InvalidCfgTag", "SemcNOR: Invalid Cfg Tag") |
| 241 |
|
| 242 |
# SEMC NAND statuses. |
| 243 |
SEMCNAND_DEVICE_TIMEOUT = (21200, "SemcNAND_DeviceTimeout", "SemcNAND: Device Timeout") |
| 244 |
SEMCNAND_INVALID_MEMORY_ADDRESS = (21201, "SemcNAND_InvalidMemoryAddress", "SemcNAND: Invalid Memory Address") |
| 245 |
SEMCNAND_NOT_EQUAL_TO_ONE_PAGE_SIZE = (21202, "SemcNAND_NotEqualToOnePageSize", "SemcNAND: Not Equal To One Page Size") |
| 246 |
SEMCNAND_MORE_THAN_ONE_PAGE_SIZE = (21203, "SemcNAND_MoreThanOnePageSize", "SemcNAND: More Than One Page Size") |
| 247 |
SEMCNAND_ECC_CHECK_FAIL = (21204, "SemcNAND_EccCheckFail", "SemcNAND: Ecc Check Fail") |
| 248 |
SEMCNAND_INVALID_ONFI_PARAMETER = (21205, "SemcNAND_InvalidOnfiParameter", "SemcNAND: Invalid Onfi Parameter") |
| 249 |
SEMCNAND_CANNOT_ENABLE_DEVICE_ECC = (21206, "SemcNAND_CannotEnableDeviceEcc", "SemcNAND: Cannot Enable Device Ecc") |
| 250 |
SEMCNAND_SWITCH_TIMING_MODE_FAILURE = (21207, "SemcNAND_SwitchTimingModeFailure", "SemcNAND: Switch Timing Mode Failure") |
| 251 |
SEMCNAND_PROGRAM_VERIFY_FAILURE = (21208, "SemcNAND_ProgramVerifyFailure", "SemcNAND: Program Verify Failure") |
| 252 |
SEMCNAND_ERASE_VERIFY_FAILURE = (21209, "SemcNAND_EraseVerifyFailure", "SemcNAND: Erase Verify Failure") |
| 253 |
SEMCNAND_INVALID_READBACK_BUFFER = (21210, "SemcNAND_InvalidReadbackBuffer", "SemcNAND: Invalid Readback Buffer") |
| 254 |
SEMCNAND_INVALID_CFG_TAG = (21216, "SemcNAND_InvalidCfgTag", "SemcNAND: Invalid Cfg Tag") |
| 255 |
SEMCNAND_FAIL_TO_UPDATE_FCB = (21217, "SemcNAND_FailToUpdateFcb", "SemcNAND: Fail To Update Fcb") |
| 256 |
SEMCNAND_FAIL_TO_UPDATE_DBBT = (21218, "SemcNAND_FailToUpdateDbbt", "SemcNAND: Fail To Update Dbbt") |
| 257 |
SEMCNAND_DISALLOW_OVERWRITE_BCB = (21219, "SemcNAND_DisallowOverwriteBcb", "SemcNAND: Disallow Overwrite Bcb") |
| 258 |
SEMCNAND_ONLY_SUPPORT_ONFI_DEVICE = (21220, "SemcNAND_OnlySupportOnfiDevice", "SemcNAND: Only Support Onfi Device") |
| 259 |
SEMCNAND_MORE_THAN_MAX_IMAGE_COPY = (21221, "SemcNAND_MoreThanMaxImageCopy", "SemcNAND: More Than Max Image Copy") |
| 260 |
SEMCNAND_DISORDERED_IMAGE_COPIES = (21222, "SemcNAND_DisorderedImageCopies", "SemcNAND: Disordered Image Copies") |
| 261 |
|
| 262 |
# SPIFI NOR statuses. |
| 263 |
SPIFINOR_PROGRAM_FAIL = (22000, "SPIFINOR_ProgramFail", "SPIFINOR: Program Fail") |
| 264 |
SPIFINOR_ERASE_SECTORFAIL = (22001, "SPIFINOR_EraseSectorFail", "SPIFINOR: Erase Sector Fail") |
| 265 |
SPIFINOR_ERASE_ALL_FAIL = (22002, "SPIFINOR_EraseAllFail", "SPIFINOR: Erase All Fail") |
| 266 |
SPIFINOR_WAIT_TIMEOUT = (22003, "SPIFINOR_WaitTimeout", "SPIFINOR: Wait Timeout") |
| 267 |
SPIFINOR_NOT_SUPPORTED = (22004, "SPIFINOR_NotSupported", "SPIFINOR: Not Supported") |
| 268 |
SPIFINOR_WRITE_ALIGNMENTERROR = (22005, "SPIFINOR_WriteAlignmentError", "SPIFINOR: Write Alignment Error") |
| 269 |
SPIFINOR_COMMAND_FAILURE = (22006, "SPIFINOR_CommandFailure", "SPIFINOR: Command Failure") |
| 270 |
SPIFINOR_SFDP_NOT_FOUND = (22007, "SPIFINOR_SFDP_NotFound", "SPIFINOR: SFDP Not Found") |
| 271 |
|
| 272 |
# EDGELOCK ENCLAVE statuses. |
| 273 |
EDGELOCK_INVALID_RESPONSE = (30000, "EDGELOCK_InvalidResponse", "EDGELOCK: Invalid Response") |
| 274 |
EDGELOCK_RESPONSE_ERROR = (30001, "EDGELOCK_ResponseError", "EDGELOCK: Response Error") |
| 275 |
EDGELOCK_ABORT = (30002, "EDGELOCK_Abort", "EDGELOCK: Abort") |
| 276 |
EDGELOCK_OPERATION_FAILED = (30003, "EDGELOCK_OperationFailed", "EDGELOCK: Operation Failed") |
| 277 |
EDGELOCK_OTP_PROGRAM_FAILURE = (30004, "EDGELOCK_OTPProgramFailure", "EDGELOCK: OTP Program Failure") |
| 278 |
EDGELOCK_OTP_LOCKED = (30005, "EDGELOCK_OTPLocked", "EDGELOCK: OTP Locked") |
| 279 |
EDGELOCK_OTP_INVALID_IDX = (30006, "EDGELOCK_OTPInvalidIDX", "EDGELOCK: OTP Invalid IDX") |
| 280 |
EDGELOCK_INVALID_LIFECYCLE = (30007, "EDGELOCK_InvalidLifecycle", "EDGELOCK: Invalid Lifecycle") |
| 281 |
|
| 282 |
# OTP statuses. |
| 283 |
OTP_INVALID_ADDRESS = (52801, "OTP_InvalidAddress", "OTD: Invalid OTP address") |
| 284 |
OTP_PROGRAM_FAIL = (52802, "OTP_ProgrammingFail", "OTD: Programming failed") |
| 285 |
OTP_CRC_FAIL = (52803, "OTP_CRCFail", "OTP: CRC check failed") |
| 286 |
OTP_ERROR = (52804, "OTP_Error", "OTP: Error happened during OTP operation") |
| 287 |
OTP_ECC_CRC_FAIL = (52805, "OTP_EccCheckFail", "OTP: ECC check failed during OTP operation") |
| 288 |
OTP_LOCKED = (52806, "OTP_FieldLocked", "OTP: Field is locked when programming") |
| 289 |
OTP_TIMEOUT = (52807, "OTP_Timeout", "OTP: Operation timed out") |
| 290 |
OTP_CRC_CHECK_PASS = (52808, "OTP_CRCCheckPass", "OTP: CRC check passed") |
| 291 |
OTP_VERIFY_FAIL = (52009, "OPT_VerifyFail", "OTP: Failed to verify OTP write") |
| 292 |
|
| 293 |
# Security subsystem statuses. |
| 294 |
SECURITY_SUBSYSTEM_ERROR = (1515890085, "SecuritySubSystemError", "Security SubSystem Error") |
| 295 |
|
| 296 |
# TrustProvisioning statuses. |
| 297 |
TP_SUCCESS = (0, "TP_SUCCESS", "TP: SUCCESS") |
| 298 |
TP_GENERAL_ERROR = (80000, "TP_GENERAL_ERROR", "TP: General error") |
| 299 |
TP_CRYPTO_ERROR = (80001, "TP_CRYPTO_ERROR", "TP: Error during cryptographic operation") |
| 300 |
TP_NULLPTR_ERROR = (80002, "TP_NULLPTR_ERROR", "TP: NULL pointer dereference or when buffer could not be allocated") |
| 301 |
TP_ALREADYINITIALIZED = (80003, "TP_ALREADYINITIALIZED", "TP: Already initialized") |
| 302 |
TP_BUFFERSMALL = (80004, "TP_BUFFERSMALL", "TP: Buffer is too small") |
| 303 |
TP_ADDRESS_ERROR = (80005, "TP_ADDRESS_ERROR", "TP: Address out of allowed range or buffer could not be allocated") |
| 304 |
TP_CONTAINERINVALID = (80006, "TP_CONTAINERINVALID", "TP: Container header or size is invalid") |
| 305 |
TP_CONTAINERENTRYINVALID = (80007, "TP_CONTAINERENTRYINVALID", "TP: Container entry invalid") |
| 306 |
TP_CONTAINERENTRYNOTFOUND = (80008, "TP_CONTAINERENTRYNOTFOUND", "TP: Container entry not found in container") |
| 307 |
TP_INVALIDSTATEOPERATION = (80009, "TP_INVALIDSTATEOPERATION", "TP: Attempt to process command in disallowed state") |
| 308 |
TP_COMMAND_ERROR = (80010, "TP_COMMAND_ERROR", "TP: ISP command arguments are invalid") |
| 309 |
TP_PUF_ERROR = (80011, "TP_PUF_ERROR", "TP: PUF operation error") |
| 310 |
TP_FLASH_ERROR = (80012, "TP_FLASH_ERROR", "TP: Flash erase/program/verify_erase failed") |
| 311 |
TP_SECRETBOX_ERROR = (80013, "TP_SECRETBOX_ERROR", "TP: SBKEK or USER KEK cannot be stored in secret box") |
| 312 |
TP_PFR_ERROR = (80014, "TP_PFR_ERROR", "TP: Protected Flash Region operation failed") |
| 313 |
TP_VERIFICATION_ERROR = (80015, "TP_VERIFICATION_ERROR", "TP: Container signature verification failed") |
| 314 |
TP_CFPA_ERROR = (80016, "TP_CFPA_ERROR", "TP: CFPA page cannot be stored") |
| 315 |
TP_CMPA_ERROR = (80017, "TP_CMPA_ERROR", "TP: CMPA page cannot be stored or ROTKH or SECU registers are invalid") |
| 316 |
TP_ADDR_OUT_OF_RANGE = (80018, "TP_ADDR_OUT_OF_RANGE", "TP: Address is out of range") |
| 317 |
TP_CONTAINER_ADDR_ERROR = (80019, "TP_CONTAINER_ADDR_ERROR", "TP: Container address in write context is invalid or there is no memory for entry storage") |
| 318 |
TP_CONTAINER_ADDR_UNALIGNED = (80020, "TP_CONTAINER_ADDR_UNALIGNED", "TP: Container address in read context is unaligned") |
| 319 |
TP_CONTAINER_BUFF_SMALL = (80021, "TP_CONTAINER_BUFF_SMALL", "TP: There is not enough memory to store the container") |
| 320 |
TP_CONTAINER_NO_ENTRY = (80022, "TP_CONTAINER_NO_ENTRY", "TP: Attempt to sign an empty container") |
| 321 |
TP_CERT_ADDR_ERROR = (80023, "TP_CERT_ADDR_ERROR", "TP: Destination address of OEM certificate is invalid") |
| 322 |
TP_CERT_ADDR_UNALIGNED = (80024, "TP_CERT_ADDR_UNALIGNED", "TP: Destination address of certificate is unaligned") |
| 323 |
TP_CERT_OVERLAPPING = (80025, "TP_CERT_OVERLAPPING", "TP: OEM certificates are overlapping due to wrong destination addresses") |
| 324 |
TP_PACKET_ERROR = (80026, "TP_PACKET_ERROR", "TP: Error during packet sending/receiving") |
| 325 |
TP_PACKET_DATA_ERROR = (80027, "TP_PACKET_DATA_ERROR", "TP: Data in packet handle are invalid") |
| 326 |
TP_UNKNOWN_COMMAND = (80028, "TP_UNKNOWN_COMMAND", "TP: Unknown command was received") |
| 327 |
TP_SB3_FILE_ERROR = (80029, "TP_SB3_FILE_ERROR", "TP: Error during processing SB3 file") |
| 328 |
# TP_CRITICAL_ERROR_START (80100) |
| 329 |
TP_GENERAL_CRITICAL_ERROR = (80101, "TP_GENERAL_CRITICAL_ERROR", "TP: Critical error") |
| 330 |
TP_CRYPTO_CRITICAL_ERROR = (80102, "TP_CRYPTO_CRITICAL_ERROR", "TP: Error of crypto module which prevents proper functionality") |
| 331 |
TP_PUF_CRITICAL_ERROR = (80103, "TP_PUF_CRITICAL_ERROR", "TP: Initialization or start of the PUF periphery failed") |
| 332 |
TP_PFR_CRITICAL_ERROR = (80104, "TP_PFR_CRITICAL_ERROR", "TP: Initialization of PFR or reading of activation code failed") |
| 333 |
TP_PERIPHERAL_CRITICAL_ERROR = (80105, "TP_PERIPHERAL_CRITICAL_ERROR", "TP: Peripheral failure") |
| 334 |
TP_PRINCE_CRITICAL_ERROR = (80106, "TP_PRINCE_CRITICAL_ERROR", "TP: Error during PRINCE encryption/decryption") |
| 335 |
TP_SHA_CHECK_CRITICAL_ERROR = (80107, "TP_SHA_CHECK_CRITICAL_ERROR", "TP: SHA check verification failed") |
| 336 |
|
| 337 |
# IAP statuses. |
| 338 |
IAP_INVALID_ARGUMENT = (100001, "IAP_InvalidArgument", "IAP: Invalid Argument Detected During API Execution") |
| 339 |
IAP_OUT_OF_MEMORY = (100002, "IAP_OutOfMemory", "IAP: Heap Size Not Large Enough During API Execution") |
| 340 |
IAP_READ_DISALLOWED = (100003, "IAP_ReadDisallowed ", "IAP: Read Memory Operation Disallowed During API Execution") |
| 341 |
IAP_CUMULATIVE_WRITE = (100004, "IAP_CumulativeWrite", "IAP: Flash Memory Region To Be Programmed Is Not Empty") |
| 342 |
IAP_ERASE_FAILUIRE = (100005, "IAP_EraseFailuire", "IAP: Erase Operation Failed") |
| 343 |
IAP_COMMAND_NOT_SUPPORTED = (100006, "IAP_CommandNotSupported", "IAP: Specific Command Not Supported") |
| 344 |
IAP_MEMORY_ACCESS_DISABLED = (100007, "IAP_MemoryAccessDisabled", "IAP: Memory Access Disabled") |
| 345 |
# fmt: on |
| 346 |
|
| 347 |
|
| 348 |
def stringify_status_code(status_code: int) -> str: |
| 349 |
"""Stringifies the MBoot status code.""" |
| 350 |
return ( |
| 351 |
f"{status_code} ({status_code:#x}) " |
| 352 |
f"{StatusCode.get_description(status_code) if status_code in StatusCode.tags() else f'Unknown error code ({status_code})'}." |
| 353 |
) |