rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
fsl_ftfx_flexnvm.c File Reference

Functions

static status_t flexnvm_convert_start_address (flexnvm_config_t *config, uint32_t start)
 Convert address for Flexnvm dflash.
 
status_t FLEXNVM_Init (flexnvm_config_t *config)
 Initializes the global flash properties structure members.
 
status_t FLEXNVM_DflashErase (flexnvm_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key)
 Erases the Dflash sectors encompassed by parameters passed into function.
 
status_t FLEXNVM_EraseAll (flexnvm_config_t *config, uint32_t key)
 Erases entire flexnvm.
 
status_t FLEXNVM_EraseAllUnsecure (flexnvm_config_t *config, uint32_t key)
 Erases the entire flexnvm, including protected sectors.
 
status_t FLEXNVM_DflashProgram (flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
 Programs flash with data at locations passed in through parameters.
 
status_t FLEXNVM_DflashProgramSection (flexnvm_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 FLEXNVM_ProgramPartition (flexnvm_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 FLEXNVM_ReadResource (flexnvm_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 FLEXNVM_DflashVerifyErase (flexnvm_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 FLEXNVM_VerifyEraseAll (flexnvm_config_t *config, ftfx_margin_value_t margin)
 Verifies erasure of the entire flash at a specified margin level.
 
status_t FLEXNVM_DflashVerifyProgram (flexnvm_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 FLEXNVM_GetSecurityState (flexnvm_config_t *config, ftfx_security_state_t *state)
 Returns the security state via the pointer passed into the function.
 
status_t FLEXNVM_SecurityBypass (flexnvm_config_t *config, const uint8_t *backdoorKey)
 Allows users to bypass security with a backdoor key.
 
status_t FLEXNVM_SetFlexramFunction (flexnvm_config_t *config, ftfx_flexram_func_opt_t option)
 Sets the FlexRAM function command.
 
status_t FLEXNVM_EepromWrite (flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
 Programs the EEPROM with data at locations passed in through parameters.
 
status_t FLEXNVM_DflashSetProtection (flexnvm_config_t *config, uint8_t protectStatus)
 Sets the DFlash protection to the intended protection status.
 
status_t FLEXNVM_DflashGetProtection (flexnvm_config_t *config, uint8_t *protectStatus)
 Gets the DFlash protection status.
 
status_t FLEXNVM_EepromSetProtection (flexnvm_config_t *config, uint8_t protectStatus)
 Sets the EEPROM protection to the intended protection status.
 
status_t FLEXNVM_EepromGetProtection (flexnvm_config_t *config, uint8_t *protectStatus)
 Gets the EEPROM protection status.
 
status_t FLEXNVM_GetProperty (flexnvm_config_t *config, flexnvm_property_tag_t whichProperty, uint32_t *value)
 Returns the desired flexnvm property.
 

Function Documentation

◆ flexnvm_convert_start_address()

static status_t flexnvm_convert_start_address ( flexnvm_config_t config,
uint32_t  start 
)
static

Convert address for Flexnvm dflash.

Definition at line 424 of file fsl_ftfx_flexnvm.c.

425{
426 if (config == NULL)
427 {
429 }
430
431 /* From Spec: When required by the command, address bit 23 selects between program flash memory
432 * (=0) and data flash memory (=1).*/
433 config->ftfxConfig.opsConfig.convertedAddress = start - config->ftfxConfig.flashDesc.blockBase + 0x800000U;
434
436}
static constexpr persistent_config_s * config
@ kStatus_FTFx_Success
@ kStatus_FTFx_InvalidArgument

Referenced by FLEXNVM_DflashErase(), FLEXNVM_DflashProgram(), FLEXNVM_DflashProgramSection(), FLEXNVM_DflashVerifyErase(), and FLEXNVM_DflashVerifyProgram().

Here is the caller graph for this function:

Go to the source code of this file.