rusEFI
The most advanced open source ECU
|
Flash controller command numbers | |
enum | _ftfx_ram_func_constants { kFTFx_RamFuncMaxSizeInWords = 16U } |
Constants for execute-in-RAM flash function. More... | |
typedef void(* | callFtfxRunCommand_t) (FTFx_REG8_ACCESS_TYPE ftfx_fstat) |
A function pointer used to point to relocated flash_run_command() | |
Enumeration for Flash security register code | |
enum | _ftfx_fsec_register_code { kFTFx_FsecRegCode_KEYEN_Enabled = 0x80U , kFTFx_FsecRegCode_SEC_Unsecured = 0x02U } |
enum | _ftfx_pflash_config_area_range { kFTFx_PflashConfigAreaStart = 0x400U , kFTFx_PflashConfigAreaEnd = 0x40FU } |
Enumeration for flash config area. More... | |
static const uint16_t | s_ftfxRunCommandFunctionCode [] |
Position independent code of flash_run_command() | |
static uint32_t | s_ftfxRunCommand [kFTFx_RamFuncMaxSizeInWords] |
A static buffer used to hold flash_run_command() | |
static volatile uint32_t *const | kFCCOBx = (volatile uint32_t *)&FTFx_FCCOB3_REG |
Access to FTFx Registers. | |
static const uint16_t | kEepromDensities [16] |
Table of eeprom sizes. | |
static const uint32_t | kDflashDensities [16] |
Table of dflash sizes. | |
static status_t | ftfx_init_ifr (ftfx_config_t *config) |
Init IFR memory related info. | |
static void | ftfx_copy_run_command_to_ram (uint32_t *ftfxRunCommand) |
Copy flash_run_command() to RAM. | |
static status_t | ftfx_command_sequence (ftfx_config_t *config) |
Internal function Flash command sequence. Called by driver APIs only. | |
static status_t | ftfx_check_mem_range (ftfx_config_t *config, uint32_t startAddress, uint32_t lengthInBytes, uint8_t alignmentBaseline) |
Validates the range and alignment of the given address range. | |
static status_t | ftfx_check_user_key (uint32_t key) |
Validates the given user key for flash erase APIs. | |
static uint32_t | ftfx_read_word_from_byte_address (const uint8_t *src) |
Reads word from byte address. | |
static void | ftfx_write_word_to_byte_address (uint8_t *dst, uint32_t word) |
Writes word to byte address. | |
static status_t | ftfx_check_resource_range (ftfx_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t alignmentBaseline, ftfx_read_resource_opt_t option) |
Validates the range of the given resource address. | |
static status_t | ftfx_check_flexram_function_option (ftfx_flexram_func_opt_t option) |
Validates the gived flexram function option. | |
static status_t | ftfx_check_swap_control_option (ftfx_swap_control_opt_t option) |
Validates the gived swap control option. | |
status_t | FTFx_API_Init (ftfx_config_t *config) |
Initializes the global flash properties structure members. | |
status_t | FTFx_API_UpdateFlexnvmPartitionStatus (ftfx_config_t *config) |
Updates FlexNVM memory partition status according to data flash 0 IFR. | |
status_t | FTFx_CMD_Erase (ftfx_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) |
Erases the flash sectors encompassed by parameters passed into function. | |
status_t | FTFx_CMD_EraseAll (ftfx_config_t *config, uint32_t key) |
Erases entire flash. | |
status_t | FTFx_CMD_EraseAllUnsecure (ftfx_config_t *config, uint32_t key) |
Erases the entire flash, including protected sectors. | |
status_t | FTFx_CMD_EraseAllExecuteOnlySegments (ftfx_config_t *config, uint32_t key) |
Erases all program flash execute-only segments defined by the FXACC registers. | |
status_t | FTFx_CMD_Program (ftfx_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) |
Programs flash with data at locations passed in through parameters. | |
status_t | FTFx_CMD_ProgramOnce (ftfx_config_t *config, uint32_t index, uint8_t *src, uint32_t lengthInBytes) |
Programs Program Once Field through parameters. | |
status_t | FTFx_CMD_ProgramSection (ftfx_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) |
Programs flash with data at locations passed in through parameters via the Program Section command. | |
status_t | FTFx_CMD_ProgramPartition (ftfx_config_t *config, ftfx_partition_flexram_load_opt_t option, uint32_t eepromDataSizeCode, uint32_t flexnvmPartitionCode) |
Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the FlexRAM. | |
status_t | FTFx_CMD_ReadOnce (ftfx_config_t *config, uint32_t index, uint8_t *dst, uint32_t lengthInBytes) |
Reads the Program Once Field through parameters. | |
status_t | FTFx_CMD_ReadResource (ftfx_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option) |
Reads the resource with data at locations passed in through parameters. | |
status_t | FTFx_CMD_VerifyErase (ftfx_config_t *config, uint32_t start, uint32_t lengthInBytes, ftfx_margin_value_t margin) |
Verifies an erasure of the desired flash area at a specified margin level. | |
status_t | FTFx_CMD_VerifyEraseAll (ftfx_config_t *config, ftfx_margin_value_t margin) |
Verifies erasure of the entire flash at a specified margin level. | |
status_t | FTFx_CMD_VerifyEraseAllExecuteOnlySegments (ftfx_config_t *config, ftfx_margin_value_t margin) |
Verifies whether the program flash execute-only segments have been erased to the specified read margin level. | |
status_t | FTFx_CMD_VerifyProgram (ftfx_config_t *config, uint32_t start, uint32_t lengthInBytes, const uint8_t *expectedData, ftfx_margin_value_t margin, uint32_t *failedAddress, uint32_t *failedData) |
Verifies programming of the desired flash area at a specified margin level. | |
status_t | FTFx_CMD_SecurityBypass (ftfx_config_t *config, const uint8_t *backdoorKey) |
Allows users to bypass security with a backdoor key. | |
status_t | FTFx_REG_GetSecurityState (ftfx_config_t *config, ftfx_security_state_t *state) |
Returns the security state via the pointer passed into the function. | |
status_t | FTFx_CMD_SetFlexramFunction (ftfx_config_t *config, ftfx_flexram_func_opt_t option) |
Sets the FlexRAM function command. | |
status_t | FTFx_CMD_SwapControl (ftfx_config_t *config, uint32_t address, ftfx_swap_control_opt_t option, ftfx_swap_state_config_t *returnInfo) |
Configures the Swap function or checks the swap state of the Flash module. | |
typedef void(* callFtfxRunCommand_t) (FTFx_REG8_ACCESS_TYPE ftfx_fstat) |
A function pointer used to point to relocated flash_run_command()
Definition at line 81 of file fsl_ftfx_controller.c.
Enumerator | |
---|---|
kFTFx_FsecRegCode_KEYEN_Enabled | |
kFTFx_FsecRegCode_SEC_Unsecured |
Definition at line 87 of file fsl_ftfx_controller.c.
Enumeration for flash config area.
Enumerator | |
---|---|
kFTFx_PflashConfigAreaStart | |
kFTFx_PflashConfigAreaEnd |
Definition at line 97 of file fsl_ftfx_controller.c.
Constants for execute-in-RAM flash function.
Enumerator | |
---|---|
kFTFx_RamFuncMaxSizeInWords | The maximum size of execute-in-RAM function. |
Definition at line 75 of file fsl_ftfx_controller.c.
status_t FTFx_API_Init | ( | ftfx_config_t * | config | ) |
Initializes the global flash properties structure members.
This function checks and initializes the Flash module for the other Flash APIs.
config | Pointer to the storage for the driver runtime state. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
Definition at line 240 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_Init().
status_t FTFx_API_UpdateFlexnvmPartitionStatus | ( | ftfx_config_t * | config | ) |
Updates FlexNVM memory partition status according to data flash 0 IFR.
This function updates FlexNVM memory partition status.
config | Pointer to the storage for the driver runtime state. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_PartitionStatusUpdateFailure | Failed to update the partition status. |
Definition at line 269 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_Init(), FTFx_CMD_EraseAll(), and FTFx_CMD_EraseAllUnsecure().
|
inlinestatic |
Validates the gived flexram function option.
Definition at line 1380 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_SetFlexramFunction().
|
static |
Validates the range and alignment of the given address range.
Definition at line 1243 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_Erase(), FTFx_CMD_Program(), FTFx_CMD_ProgramSection(), FTFx_CMD_VerifyErase(), and FTFx_CMD_VerifyProgram().
|
static |
Validates the range of the given resource address.
Definition at line 1321 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_ReadResource().
|
static |
Validates the gived swap control option.
Definition at line 1394 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_SwapControl().
|
static |
Validates the given user key for flash erase APIs.
Definition at line 1270 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_Erase(), FTFx_CMD_EraseAll(), FTFx_CMD_EraseAllExecuteOnlySegments(), and FTFx_CMD_EraseAllUnsecure().
status_t FTFx_CMD_Erase | ( | ftfx_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
uint32_t | key | ||
) |
Erases the flash sectors encompassed by parameters passed into function.
This function erases the appropriate number of flash sectors based on the desired start address and length.
config | The pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be erased. The start address does not need to be sector-aligned but must be word-aligned. |
lengthInBytes | The length, given in bytes (not words or long-words) to be erased. Must be word-aligned. |
key | The value used to validate all flash erase APIs. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | The parameter is not aligned with the specified baseline. |
kStatus_FTFx_AddressError | The address is out of range. |
kStatus_FTFx_EraseKeyError | The API erase key is invalid. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 312 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_DflashErase().
status_t FTFx_CMD_EraseAll | ( | ftfx_config_t * | config, |
uint32_t | key | ||
) |
Erases entire flash.
config | Pointer to the storage for the driver runtime state. |
key | A value used to validate all flash erase APIs. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_EraseKeyError | API erase key is invalid. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during command execution. |
kStatus_FTFx_PartitionStatusUpdateFailure | Failed to update the partition status. |
Definition at line 375 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_EraseAll().
status_t FTFx_CMD_EraseAllExecuteOnlySegments | ( | ftfx_config_t * | config, |
uint32_t | key | ||
) |
Erases all program flash execute-only segments defined by the FXACC registers.
config | Pointer to the storage for the driver runtime state. |
key | A value used to validate all flash erase APIs. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_EraseKeyError | API erase key is invalid. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 445 of file fsl_ftfx_controller.c.
status_t FTFx_CMD_EraseAllUnsecure | ( | ftfx_config_t * | config, |
uint32_t | key | ||
) |
Erases the entire flash, including protected sectors.
config | Pointer to the storage for the driver runtime state. |
key | A value used to validate all flash erase APIs. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_EraseKeyError | API erase key is invalid. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during command execution. |
kStatus_FTFx_PartitionStatusUpdateFailure | Failed to update the partition status. |
Definition at line 410 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_EraseAllUnsecure().
status_t FTFx_CMD_Program | ( | ftfx_config_t * | config, |
uint32_t | start, | ||
uint8_t * | src, | ||
uint32_t | lengthInBytes | ||
) |
Programs flash with data at locations passed in through parameters.
This function programs the flash memory with the desired data for a given flash area as determined by the start address and the length.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
src | A pointer to the source buffer of data that is to be programmed into the flash. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | Parameter is not aligned with the specified baseline. |
kStatus_FTFx_AddressError | Address is out of range. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 471 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_DflashProgram().
status_t FTFx_CMD_ProgramOnce | ( | ftfx_config_t * | config, |
uint32_t | index, | ||
uint8_t * | src, | ||
uint32_t | lengthInBytes | ||
) |
Programs Program Once Field through parameters.
This function programs the Program Once Field with the desired data for a given flash area as determined by the index and length.
config | A pointer to the storage for the driver runtime state. |
index | The index indicating which area of the Program Once Field to be programmed. |
src | A pointer to the source buffer of data that is to be programmed into the Program Once Field. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 534 of file fsl_ftfx_controller.c.
status_t FTFx_CMD_ProgramPartition | ( | ftfx_config_t * | config, |
ftfx_partition_flexram_load_opt_t | option, | ||
uint32_t | eepromDataSizeCode, | ||
uint32_t | flexnvmPartitionCode | ||
) |
Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the FlexRAM.
config | Pointer to storage for the driver runtime state. |
option | The option used to set FlexRAM load behavior during reset. |
eepromDataSizeCode | Determines the amount of FlexRAM used in each of the available EEPROM subsystems. |
flexnvmPartitionCode | Specifies how to split the FlexNVM block between data flash memory and EEPROM backup memory supporting EEPROM functions. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | Invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during command execution. |
Definition at line 695 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_ProgramPartition().
status_t FTFx_CMD_ProgramSection | ( | ftfx_config_t * | config, |
uint32_t | start, | ||
uint8_t * | src, | ||
uint32_t | lengthInBytes | ||
) |
Programs flash with data at locations passed in through parameters via the Program Section command.
This function programs the flash memory with the desired data for a given flash area as determined by the start address and length.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
src | A pointer to the source buffer of data that is to be programmed into the flash. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | Parameter is not aligned with specified baseline. |
kStatus_FTFx_AddressError | Address is out of range. |
kStatus_FTFx_SetFlexramAsRamError | Failed to set flexram as RAM. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during command execution. |
kStatus_FTFx_RecoverFlexramAsEepromError | Failed to recover FlexRAM as EEPROM. |
Definition at line 574 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_DflashProgramSection().
status_t FTFx_CMD_ReadOnce | ( | ftfx_config_t * | config, |
uint32_t | index, | ||
uint8_t * | dst, | ||
uint32_t | lengthInBytes | ||
) |
Reads the Program Once Field through parameters.
This function reads the read once feild with given index and length.
config | A pointer to the storage for the driver runtime state. |
index | The index indicating the area of program once field to be read. |
dst | A pointer to the destination buffer of data that is used to store data to be read. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 730 of file fsl_ftfx_controller.c.
status_t FTFx_CMD_ReadResource | ( | ftfx_config_t * | config, |
uint32_t | start, | ||
uint8_t * | dst, | ||
uint32_t | lengthInBytes, | ||
ftfx_read_resource_opt_t | option | ||
) |
Reads the resource with data at locations passed in through parameters.
This function reads the flash memory with the desired location for a given flash area as determined by the start address and length.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
dst | A pointer to the destination buffer of data that is used to store data to be read. |
lengthInBytes | The length, given in bytes (not words or long-words), to be read. Must be word-aligned. |
option | The resource option which indicates which area should be read back. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | Parameter is not aligned with the specified baseline. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 772 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_ReadResource(), and FTFx_API_UpdateFlexnvmPartitionStatus().
status_t FTFx_CMD_SecurityBypass | ( | ftfx_config_t * | config, |
const uint8_t * | backdoorKey | ||
) |
Allows users to bypass security with a backdoor key.
If the MCU is in secured state, this function unsecures the MCU by comparing the provided backdoor key with ones in the flash configuration field.
config | A pointer to the storage for the driver runtime state. |
backdoorKey | A pointer to the user buffer containing the backdoor key. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 978 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_SecurityBypass().
status_t FTFx_CMD_SetFlexramFunction | ( | ftfx_config_t * | config, |
ftfx_flexram_func_opt_t | option | ||
) |
Sets the FlexRAM function command.
config | A pointer to the storage for the driver runtime state. |
option | The option used to set the work mode of FlexRAM. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 1049 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_EepromWrite(), FLEXNVM_SetFlexramFunction(), and FTFx_CMD_ProgramSection().
status_t FTFx_CMD_SwapControl | ( | ftfx_config_t * | config, |
uint32_t | address, | ||
ftfx_swap_control_opt_t | option, | ||
ftfx_swap_state_config_t * | returnInfo | ||
) |
Configures the Swap function or checks the swap state of the Flash module.
config | A pointer to the storage for the driver runtime state. |
address | Address used to configure the flash Swap function. |
option | The possible option used to configure Flash Swap function or check the flash Swap status |
returnInfo | A pointer to the data which is used to return the information of flash Swap. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | Parameter is not aligned with specified baseline. |
kStatus_FTFx_SwapIndicatorAddressError | Swap indicator address is invalid. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 1073 of file fsl_ftfx_controller.c.
status_t FTFx_CMD_VerifyErase | ( | ftfx_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
ftfx_margin_value_t | margin | ||
) |
Verifies an erasure of the desired flash area at a specified margin level.
This function checks the appropriate number of flash sectors based on the desired start address and length to check whether the flash is erased to the specified read margin level.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be verified. The start address does not need to be sector-aligned but must be word-aligned. |
lengthInBytes | The length, given in bytes (not words or long-words), to be verified. Must be word-aligned. |
margin | Read margin choice. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | Parameter is not aligned with specified baseline. |
kStatus_FTFx_AddressError | Address is out of range. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 836 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_DflashVerifyErase().
status_t FTFx_CMD_VerifyEraseAll | ( | ftfx_config_t * | config, |
ftfx_margin_value_t | margin | ||
) |
Verifies erasure of the entire flash at a specified margin level.
This function checks whether the flash is erased to the specified read margin level.
config | A pointer to the storage for the driver runtime state. |
margin | Read margin choice. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 895 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_VerifyEraseAll().
status_t FTFx_CMD_VerifyEraseAllExecuteOnlySegments | ( | ftfx_config_t * | config, |
ftfx_margin_value_t | margin | ||
) |
Verifies whether the program flash execute-only segments have been erased to the specified read margin level.
config | A pointer to the storage for the driver runtime state. |
margin | Read margin choice. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 909 of file fsl_ftfx_controller.c.
status_t FTFx_CMD_VerifyProgram | ( | ftfx_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
const uint8_t * | expectedData, | ||
ftfx_margin_value_t | margin, | ||
uint32_t * | failedAddress, | ||
uint32_t * | failedData | ||
) |
Verifies programming of the desired flash area at a specified margin level.
This function verifies the data programed in the flash memory using the Flash Program Check Command and compares it to the expected data for a given flash area as determined by the start address and length.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be verified. Must be word-aligned. |
lengthInBytes | The length, given in bytes (not words or long-words), to be verified. Must be word-aligned. |
expectedData | A pointer to the expected data that is to be verified against. |
margin | Read margin choice. |
failedAddress | A pointer to the returned failing address. |
failedData | A pointer to the returned failing data. Some derivatives do not include failed data as part of the FCCOBx registers. In this case, zeros are returned upon failure. |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
kStatus_FTFx_AlignmentError | Parameter is not aligned with specified baseline. |
kStatus_FTFx_AddressError | Address is out of range. |
kStatus_FTFx_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FTFx_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FTFx_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FTFx_CommandFailure | Run-time error during the command execution. |
Definition at line 923 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_DflashVerifyProgram().
|
static |
Internal function Flash command sequence. Called by driver APIs only.
FTFx Command Sequence.
This function is used to perform the command write sequence to the flash.
driver | Pointer to storage for the driver runtime state. |
Definition at line 1187 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_Erase(), FTFx_CMD_EraseAll(), FTFx_CMD_EraseAllExecuteOnlySegments(), FTFx_CMD_EraseAllUnsecure(), FTFx_CMD_Program(), FTFx_CMD_ProgramOnce(), FTFx_CMD_ProgramPartition(), FTFx_CMD_ProgramSection(), FTFx_CMD_ReadOnce(), FTFx_CMD_ReadResource(), FTFx_CMD_SecurityBypass(), FTFx_CMD_SetFlexramFunction(), FTFx_CMD_SwapControl(), FTFx_CMD_VerifyErase(), FTFx_CMD_VerifyEraseAll(), FTFx_CMD_VerifyEraseAllExecuteOnlySegments(), and FTFx_CMD_VerifyProgram().
|
static |
Copy flash_run_command() to RAM.
Copy PIC of flash_run_command() to RAM.
Definition at line 1169 of file fsl_ftfx_controller.c.
Referenced by FTFx_API_Init().
|
static |
Init IFR memory related info.
Definition at line 1117 of file fsl_ftfx_controller.c.
Referenced by FTFx_API_Init().
|
static |
Reads word from byte address.
Definition at line 1282 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_Program(), FTFx_CMD_ProgramOnce(), and FTFx_CMD_VerifyProgram().
status_t FTFx_REG_GetSecurityState | ( | ftfx_config_t * | config, |
ftfx_security_state_t * | state | ||
) |
Returns the security state via the pointer passed into the function.
This function retrieves the current flash security status, including the security enabling state and the backdoor key enabling state.
config | A pointer to storage for the driver runtime state. |
state | A pointer to the value returned for the current security status code: |
kStatus_FTFx_Success | API was executed successfully. |
kStatus_FTFx_InvalidArgument | An invalid argument is provided. |
Definition at line 1010 of file fsl_ftfx_controller.c.
Referenced by FLEXNVM_GetSecurityState().
|
static |
Writes word to byte address.
Definition at line 1303 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_ReadOnce(), and FTFx_CMD_ReadResource().
|
static |
Table of dflash sizes.
Definition at line 216 of file fsl_ftfx_controller.c.
Referenced by FTFx_API_UpdateFlexnvmPartitionStatus().
|
static |
Table of eeprom sizes.
Definition at line 197 of file fsl_ftfx_controller.c.
Referenced by FTFx_API_UpdateFlexnvmPartitionStatus().
|
static |
Access to FTFx Registers.
Definition at line 193 of file fsl_ftfx_controller.c.
Referenced by FTFx_CMD_Erase(), FTFx_CMD_EraseAll(), FTFx_CMD_EraseAllExecuteOnlySegments(), FTFx_CMD_EraseAllUnsecure(), FTFx_CMD_Program(), FTFx_CMD_ProgramOnce(), FTFx_CMD_ProgramPartition(), FTFx_CMD_ProgramSection(), FTFx_CMD_ReadOnce(), FTFx_CMD_ReadResource(), FTFx_CMD_SecurityBypass(), FTFx_CMD_SetFlexramFunction(), FTFx_CMD_SwapControl(), FTFx_CMD_VerifyErase(), FTFx_CMD_VerifyEraseAll(), FTFx_CMD_VerifyEraseAllExecuteOnlySegments(), and FTFx_CMD_VerifyProgram().
|
static |
A static buffer used to hold flash_run_command()
Definition at line 188 of file fsl_ftfx_controller.c.
Referenced by FTFx_API_Init().
|
static |
Position independent code of flash_run_command()
Note1: The prototype of C function is shown as below:
Note2: The binary code is generated by IAR 7.70.1
Definition at line 177 of file fsl_ftfx_controller.c.
Referenced by ftfx_copy_run_command_to_ram().