Changeset 3f3c646 in rtems
- Timestamp:
- 06/02/23 20:06:09 (6 months ago)
- Branches:
- master
- Children:
- ee63681a
- Parents:
- 853429c3
- git-author:
- Kinsey Moore <kinsey.moore@…> (06/02/23 20:06:09)
- git-committer:
- Joel Sherrill <joel@…> (09/23/23 14:42:30)
- Location:
- bsps
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bsps/include/dev/spi/xqspipsu-flash-helper.h
r853429c3 r3f3c646 171 171 ******************************************************************************/ 172 172 int QspiPsu_NOR_RDID(XQspiPsu *QspiPsuPtr, u8 *ReadBfrPtr, u32 ReadLen); 173 174 /*****************************************************************************/ 175 /** 176 * 177 * This function performs a read of the SFDP configuration space. 178 * 179 * @param QspiPsuPtr is a pointer to the QSPIPSU driver component to use. 180 * @param ReadBfrPtr is a pointer to a buffer to be filled with 181 * configuration data. 182 * @param ReadLen is the total length of the configuration space to read. 183 * 184 * @return XST_SUCCESS if successful, else XST_FAILURE. 185 * 186 ******************************************************************************/ 187 int QspiPsu_NOR_RDSFDP( 188 XQspiPsu *QspiPsuPtr, 189 u32 Address, 190 u32 ByteCount, 191 u8 **ReadBfrPtr 192 ); -
bsps/include/dev/spi/xqspipsu_flash_config.h
r853429c3 r3f3c646 65 65 #define SEC_ERASE_CMD 0xD8 66 66 #define READ_ID 0x9F 67 #define READ_SFDP 0x5A 67 68 #define READ_CONFIG_CMD 0x35 68 69 #define WRITE_CONFIG_CMD 0x01 -
bsps/shared/dev/spi/xqspipsu-flash-helper.c
r853429c3 r3f3c646 273 273 Error++; 274 274 } 275 } 276 277 int QspiPsu_NOR_RDSFDP( 278 XQspiPsu *QspiPsuPtr, 279 u32 Address, 280 u32 ByteCount, 281 u8 **ReadBfrPtr 282 ) 283 { 284 int Status; 285 286 *ReadBfrPtr = ReadBuffer; 287 288 CmdBfr[COMMAND_OFFSET] = READ_SFDP; 289 CmdBfr[ADDRESS_1_OFFSET] = 290 (u8)((Address & 0xFF0000) >> 16); 291 CmdBfr[ADDRESS_2_OFFSET] = 292 (u8)((Address & 0xFF00) >> 8); 293 CmdBfr[ADDRESS_3_OFFSET] = 294 (u8)(Address & 0xFF); 295 296 FlashMsg[0].BusWidth = XQSPIPSU_SELECT_MODE_SPI; 297 FlashMsg[0].TxBfrPtr = CmdBfr; 298 FlashMsg[0].RxBfrPtr = NULL; 299 FlashMsg[0].ByteCount = 4; 300 FlashMsg[0].Flags = XQSPIPSU_MSG_FLAG_TX; 301 302 FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_SPI; 303 FlashMsg[1].TxBfrPtr = NULL; 304 FlashMsg[1].RxBfrPtr = NULL; 305 FlashMsg[1].ByteCount = DUMMY_CLOCKS; 306 FlashMsg[1].Flags = 0; 307 308 FlashMsg[2].BusWidth = XQSPIPSU_SELECT_MODE_SPI; 309 FlashMsg[2].TxBfrPtr = NULL; 310 FlashMsg[2].RxBfrPtr = *ReadBfrPtr; 311 FlashMsg[2].ByteCount = ByteCount; 312 FlashMsg[2].Flags = XQSPIPSU_MSG_FLAG_RX; 313 314 TransferInProgress = TRUE; 315 Status = XQspiPsu_InterruptTransfer(QspiPsuPtr, FlashMsg, 3); 316 if (Status != XST_SUCCESS) 317 return XST_FAILURE; 318 319 while (TransferInProgress); 320 321 rtems_cache_invalidate_multiple_data_lines(ReadBuffer, ByteCount); 322 return 0; 275 323 } 276 324
Note: See TracChangeset
for help on using the changeset viewer.