diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2023-03-16 12:37:43 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2023-03-22 13:30:08 -0500 |
commit | 7163014e3f8c1c2ffeb8af406c49327a91c3317f (patch) | |
tree | 2c8af09b10d152ca70cc9d03cddd481eb2d26be9 /bsps/include/dev/spi/xqspipsu-flash-helper.h | |
parent | bsps/zynqmp: Use correct include path (diff) | |
download | rtems-7163014e3f8c1c2ffeb8af406c49327a91c3317f.tar.bz2 |
bsps/xqspipsu: Add support for reading ECC
This adds a helper function to read the ECC status for an ECC unit in
SPI-attached NOR memory.
Diffstat (limited to '')
-rw-r--r-- | bsps/include/dev/spi/xqspipsu-flash-helper.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bsps/include/dev/spi/xqspipsu-flash-helper.h b/bsps/include/dev/spi/xqspipsu-flash-helper.h index 075f7f826d..22f85f156c 100644 --- a/bsps/include/dev/spi/xqspipsu-flash-helper.h +++ b/bsps/include/dev/spi/xqspipsu-flash-helper.h @@ -79,3 +79,32 @@ int QspiPsu_NOR_Read( u32 ByteCount, u8 **ReadBfrPtr ); + +/*****************************************************************************/ +/** + * + * This function performs a read of the ECC Status Register for a given address. + * + * @param QspiPsuPtr is a pointer to the QSPIPSU driver component to use. + * @param Address contains the address of the ECC unit for which the ECCSR + * needs to be read. The ECC unit contains 16 bytes of user data + * and all bytes in an ECC unit will return the same ECCSR. + * @param ReadBfrPtr is a pointer to a single byte to which the ECCSR will + * be written. + * + * @return XST_SUCCESS if successful, else XST_FAILURE. + * + * @note Only the three least significant bits of the returned byte are + * meaningful. If all bits are 0, ECC is enabled for this unit and + * no errors have been encountered. + * Bit 0 is 1: ECC is disabled for the requested unit. + * Bit 1 is 1: A single bit error has been corrected in user data. + * Bit 2 is 1: A single bit error has been found in the ECC data + * and may indicate user data corruption. + * + ******************************************************************************/ +int QspiPsu_NOR_Read_Ecc( + XQspiPsu *QspiPsuPtr, + u32 Address, + u8 *ReadBfrPtr +); |