bsps/xqspipsu: Add SFDP config space read ability

This adds a function to allow reading of the SFDP configuration space
that describes attributes of NOR flash chips.
This commit is contained in:
Kinsey Moore
2023-09-23 09:42:30 -05:00
committed by Joel Sherrill
parent 853429c3f8
commit 3f3c646dea
3 changed files with 69 additions and 0 deletions
@@ -170,3 +170,23 @@ u32 QspiPsu_NOR_Get_Sector_Size(XQspiPsu *QspiPsuPtr);
*
******************************************************************************/
int QspiPsu_NOR_RDID(XQspiPsu *QspiPsuPtr, u8 *ReadBfrPtr, u32 ReadLen);
/*****************************************************************************/
/**
*
* This function performs a read of the SFDP configuration space.
*
* @param QspiPsuPtr is a pointer to the QSPIPSU driver component to use.
* @param ReadBfrPtr is a pointer to a buffer to be filled with
* configuration data.
* @param ReadLen is the total length of the configuration space to read.
*
* @return XST_SUCCESS if successful, else XST_FAILURE.
*
******************************************************************************/
int QspiPsu_NOR_RDSFDP(
XQspiPsu *QspiPsuPtr,
u32 Address,
u32 ByteCount,
u8 **ReadBfrPtr
);
@@ -64,6 +64,7 @@ extern "C" {
#define BULK_ERASE_CMD 0xC7
#define SEC_ERASE_CMD 0xD8
#define READ_ID 0x9F
#define READ_SFDP 0x5A
#define READ_CONFIG_CMD 0x35
#define WRITE_CONFIG_CMD 0x01
#define ENTER_4B_ADDR_MODE 0xB7