![]() |
xilflash
Vitis Drivers API Documentation
|
Functions | |
| int | XFlash_Initialize (XFlash *InstancePtr, u32 BaseAddress, u8 BusWidth, int IsPlatformFlash) |
| This function initializes a specific XFlash instance. More... | |
| int | XFlash_Reset (XFlash *InstancePtr) |
| This function resets the flash device and places it in read mode. More... | |
| int | XFlash_DeviceControl (XFlash *InstancePtr, u32 Command, DeviceCtrlParam *Parameters) |
| This function is used to execute device specific commands. More... | |
| int | XFlash_Read (XFlash *InstancePtr, u32 Offset, u32 Bytes, void *DestPtr) |
| This function reads the data from the Flash device and copies it into the specified user buffer. More... | |
| int | XFlash_Write (XFlash *InstancePtr, u32 Offset, u32 Bytes, void *SrcPtr) |
| This function programs the flash device(s) with data specified in the user buffer. More... | |
| int | XFlash_Erase (XFlash *InstancePtr, u32 Offset, u32 Bytes) |
| This function erases the specified address range in the flash device. More... | |
| int | XFlash_Lock (XFlash *InstancePtr, u32 Offset, u32 Bytes) |
| This function Locks the blocks in the specified range of the flash device(s). More... | |
| int | XFlash_Unlock (XFlash *InstancePtr, u32 Offset, u32 Bytes) |
| This function Unlocks the blocks in the specified range of the flash device(s). More... | |
| int | XFlash_IsReady (XFlash *InstancePtr) |
| This function checks the readiness of the device, which means it has been successfully initialized. More... | |
| int XFlash_DeviceControl | ( | XFlash * | InstancePtr, |
| u32 | Command, | ||
| DeviceCtrlParam * | Parameters | ||
| ) |
This function is used to execute device specific commands.
For a list of device specific commands, see the xilflash.h.
| InstancePtr | Pointer to the XFlash instance. |
| Command | Device specific command to issue. |
| Parameters | Specifies the arguments passed to the device control function. |
Referenced by FlashDeviceControlExample(), and PlatformFlashReadWriteExample().
| int XFlash_Erase | ( | XFlash * | InstancePtr, |
| u32 | Offset, | ||
| u32 | Bytes | ||
| ) |
This function erases the specified address range in the flash device.
The number of bytes to erase can be any number as long as it is within the bounds of the device(s).
The device is polled until an error or the operation completes successfully.
| InstancePtr | Pointer to the XFlash instance. |
| Offset | Offset into the device(s) address space from which to begin erasure. |
| Bytes | Number of bytes to erase. |
Referenced by FlashProtectionExample(), FlashReadWriteExample(), and PlatformFlashReadWriteExample().
| int XFlash_Initialize | ( | XFlash * | InstancePtr, |
| u32 | BaseAddress, | ||
| u8 | BusWidth, | ||
| int | IsPlatformFlash | ||
| ) |
This function initializes a specific XFlash instance.
The initialization entails:
Initialize the Xilinx Platform Flash XL to Async mode if the user selects to use the Platform Flash XL in the MLD. The Platform Flash XL is an Intel CFI complaint device.
| InstancePtr | Pointer to the XFlash instance. |
| BaseAddress | Base address of the flash memory. |
| BusWidth | Total width of the flash memory, in bytes |
| IsPlatformFlash | Used to specify if the flash is a platform flash. |
References XFlashCFI_ReadCommon().
Referenced by FlashDeviceControlExample(), FlashProtectionExample(), FlashReadWriteExample(), and PlatformFlashReadWriteExample().
| int XFlash_IsReady | ( | XFlash * | InstancePtr | ) |
This function checks the readiness of the device, which means it has been successfully initialized.
| InstancePtr | Pointer to the XFlash instance. |
| int XFlash_Lock | ( | XFlash * | InstancePtr, |
| u32 | Offset, | ||
| u32 | Bytes | ||
| ) |
This function Locks the blocks in the specified range of the flash device(s).
The device is polled until an error or the operation completes successfully.
| InstancePtr | Pointer to the XFlash instance. |
| Offset | Offset into the device(s) address space from which to begin block locking. The first three bytes of every block is reserved for special purpose. The offset should be at least three bytes from start of the block. |
| Bytes | Number of bytes to Lock in the Block starting from Offset. |
Referenced by FlashProtectionExample().
| int XFlash_Read | ( | XFlash * | InstancePtr, |
| u32 | Offset, | ||
| u32 | Bytes, | ||
| void * | DestPtr | ||
| ) |
This function reads the data from the Flash device and copies it into the specified user buffer.
The source and destination addresses can be on any alignment supported by the processor.
The device is polled until an error or the operation completes successfully.
| InstancePtr | Pointer to the XFlash instance. |
| Offset | Offset into the device(s) address space from which to read. |
| Bytes | Number of bytes to copy. |
| DestPtr | Destination address to copy data to. |
Referenced by FlashProtectionExample(), FlashReadWriteExample(), and PlatformFlashReadWriteExample().
| int XFlash_Reset | ( | XFlash * | InstancePtr | ) |
This function resets the flash device and places it in read mode.
| InstancePtr | Pointer to the XFlash instance. |
Referenced by FlashDeviceControlExample(), FlashProtectionExample(), FlashReadWriteExample(), and PlatformFlashReadWriteExample().
| int XFlash_Unlock | ( | XFlash * | InstancePtr, |
| u32 | Offset, | ||
| u32 | Bytes | ||
| ) |
This function Unlocks the blocks in the specified range of the flash device(s).
The device is polled until an error or the operation completes successfully.
| InstancePtr | Pointer to the XFlash instance. |
| Offset | Offset into the device(s) address space from which to begin block UnLocking. The first three bytes of every block is reserved for special purpose. The offset should be at least three bytes from start of the block. |
| Bytes | Number of bytes to UnLock in the Block starting from Offset. |
Referenced by FlashProtectionExample(), FlashReadWriteExample(), and PlatformFlashReadWriteExample().
| int XFlash_Write | ( | XFlash * | InstancePtr, |
| u32 | Offset, | ||
| u32 | Bytes, | ||
| void * | SrcPtr | ||
| ) |
This function programs the flash device(s) with data specified in the user buffer.
The source and destination address must be aligned to the width of the flash's data bus.
The device is polled until an error or the operation completes successfully.
| InstancePtr | Pointer to the XFlash instance. |
| Offset | Offset into the device(s) address space from which to begin programming. Must be aligned to the width of the flash's data bus. |
| Bytes | Number of bytes to program. |
| SrcPtr | Source address containing data to be programmed. Must be aligned to the width of the flash's data bus. The SrcPtr doesn't have to be aligned to the flash width if the processor supports unaligned access. But, since this library is generic, and some processors(eg. Microblaze) do not support unaligned access; this API requires the SrcPtr to be aligned. |
Referenced by FlashProtectionExample(), FlashReadWriteExample(), and PlatformFlashReadWriteExample().