![]() |
xilflash
Vitis Drivers API Documentation
|
This file contains methods used to extract and interpret Common Flash Interface(CFI) from a flash memory part that supports the CFI query command.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a rmm 10/25/07 First release 1.00a mta 10/25/07 Updated to flash library 1.01a ksu 04/10/08 Added support for AMD CFI Interface 2.00a ktn 12/04/09 Updated to use the HAL processor APIs/macros
Macros | |
| #define | XFLASH_CFI_H |
| < prevent circular inclusions More... | |
| #define | XFL_CFI_POSITION_PTR(Ptr, BaseAddr, Interleave, ByteAddr) |
| Moves the CFI data pointer to a physical address that corresponds to a specific CFI byte offset. More... | |
| #define | XFL_CFI_ADVANCE_PTR8(Ptr, Interleave) (Ptr = (void*)((u32)Ptr + (Interleave))) |
| Advances the CFI pointer to the next byte. More... | |
| #define | XFL_CFI_ADVANCE_PTR16(Ptr, Interleave) (Ptr = (void*)((u32)Ptr + ((Interleave) << 1))) |
| Advances the CFI pointer to the next 16-bit quantity. More... | |
Layout constants | |
| #define | XFL_LAYOUT_NUM_PARTS_MASK 0x000000FF |
| LAYOUT constants are used to parse the XFL_LAYOUT_X* constants. More... | |
| #define | XFL_LAYOUT_PART_MODE_MASK 0x0000FF00 |
| #define | XFL_LAYOUT_PART_WIDTH_MASK 0x00FF0000 |
| #define | XFL_LAYOUT_CFI_INTERL_MASK 0xFF000000 |
| #define | XFL_LAYOUT_NUM_PARTS_1 0x00000001 |
| #define | XFL_LAYOUT_NUM_PARTS_2 0x00000002 |
| #define | XFL_LAYOUT_NUM_PARTS_4 0x00000004 |
| #define | XFL_LAYOUT_PART_MODE_8 0x00000100 |
| #define | XFL_LAYOUT_PART_MODE_16 0x00000200 |
| #define | XFL_LAYOUT_PART_WIDTH_8 0x00010000 |
| #define | XFL_LAYOUT_PART_WIDTH_16 0x00020000 |
| #define | XFL_LAYOUT_CFI_INTERL_1 0x01000000 |
| #define | XFL_LAYOUT_CFI_INTERL_2 0x02000000 |
| #define | XFL_LAYOUT_CFI_INTERL_4 0x04000000 |
| #define | XFL_LAYOUT_CFI_INTERL_8 0x08000000 |
Functions | |
| int | XFlashCFI_ReadCommon (XFlash *InstancePtr, u8 BusWidth) |
| Retrieves the standard CFI data from the part(s), interpret the data, and update the provided geometry and properties structures. More... | |
| int | XFlashCFI_Read8 (u8 *Ptr, u8 Interleave, u8 Mode) |
| Reads 8-bits of data from the CFI data location into a local variable. More... | |
| int | XFlashCFI_Read16 (u8 *Ptr, u8 Interleave, u8 Mode) |
| Reads 16-bits of data from the CFI data location into a local variable. More... | |
| #define XFL_CFI_ADVANCE_PTR16 | ( | Ptr, | |
| Interleave | |||
| ) | (Ptr = (void*)((u32)Ptr + ((Interleave) << 1))) |
Advances the CFI pointer to the next 16-bit quantity.
| Ptr | is the pointer to advance. Can be a pointer to any type. |
| Interleave | is the byte interleaving (based on part layout). |
Referenced by XFlashCFI_ReadCommon().
| #define XFL_CFI_ADVANCE_PTR8 | ( | Ptr, | |
| Interleave | |||
| ) | (Ptr = (void*)((u32)Ptr + (Interleave))) |
Advances the CFI pointer to the next byte.
| Ptr | is the pointer to advance. Can be a pointer to any type. |
| Interleave | is the byte interleaving (based on part layout). |
Referenced by XFlashCFI_ReadCommon().
| #define XFL_CFI_POSITION_PTR | ( | Ptr, | |
| BaseAddr, | |||
| Interleave, | |||
| ByteAddr | |||
| ) |
Moves the CFI data pointer to a physical address that corresponds to a specific CFI byte offset.
| Ptr | is the pointer to modify. Can be of any type. |
| BaseAddr | is the base address of flash part. |
| Interleave | is the byte interleaving (based on part layout). |
| ByteAddr | is the byte offset within CFI data to read. |
Referenced by XFlashCFI_ReadCommon().
| #define XFL_LAYOUT_NUM_PARTS_MASK 0x000000FF |
LAYOUT constants are used to parse the XFL_LAYOUT_X* constants.
Referenced by XFlashCFI_ReadCommon().
| #define XFLASH_CFI_H |
< prevent circular inclusions
by using protection macros
| int XFlashCFI_Read16 | ( | u8 * | Ptr, |
| u8 | Interleave, | ||
| u8 | Mode | ||
| ) |
Reads 16-bits of data from the CFI data location into a local variable.
| Ptr | is the pointer to read. Can be a pointer to any type. |
| Interleave | is the byte interleaving (based on part layout). |
| Mode | is the mode of operation (based on part layout). |
Referenced by XFlashCFI_ReadCommon().
| int XFlashCFI_Read8 | ( | u8 * | Ptr, |
| u8 | Interleave, | ||
| u8 | Mode | ||
| ) |
Reads 8-bits of data from the CFI data location into a local variable.
| Ptr | is the pointer to read. Can be a pointer to any type. |
| Interleave | is the byte interleaving (based on part layout). |
| Mode | is the mode of operation (based on part layout). |
Referenced by XFlashCFI_ReadCommon().
| int XFlashCFI_ReadCommon | ( | XFlash * | InstancePtr, |
| u8 | BusWidth | ||
| ) |
Retrieves the standard CFI data from the part(s), interpret the data, and update the provided geometry and properties structures.
Extended CFI data is part specific and ignored here. This data must be read by the specific flash device family library.
| InstancePtr | is the pointer to the XFlash instance. |
| BusWidth | is the total width of the flash memory, in bytes. |
References XFL_CFI_ADVANCE_PTR16, XFL_CFI_ADVANCE_PTR8, XFL_CFI_POSITION_PTR, XFL_LAYOUT_NUM_PARTS_MASK, XFlashCFI_Read16(), and XFlashCFI_Read8().
Referenced by XFlash_Initialize().