@@ -247,8 +247,11 @@ int QSPIFBlockDevice::init()
247
247
}
248
248
249
249
// Configure BUS Mode to 1_1_1 for all commands other than Read
250
- _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
251
- 0 , QSPI_CFG_BUS_SINGLE, 0 );
250
+ if (QSPI_STATUS_OK != _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
251
+ 0 , QSPI_CFG_BUS_SINGLE, 0 )) {
252
+ status = QSPIF_BD_ERROR_CONF_FORMAT_FAILED;
253
+ goto exit_point;
254
+ }
252
255
253
256
_is_initialized = true ;
254
257
@@ -303,17 +306,20 @@ int QSPIFBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
303
306
_mutex.lock ();
304
307
305
308
// Configure Bus for Reading
306
- _qspi_configure_format (_inst_width, _address_width, _address_size, _address_width, // Alt width == address width
307
- _alt_size, _data_width, _dummy_cycles);
309
+ if (QSPI_STATUS_OK != _qspi_configure_format (_inst_width, _address_width, _address_size, _address_width, // Alt width == address width
310
+ _alt_size, _data_width, _dummy_cycles)) {
311
+ return QSPIF_BD_ERROR_CONF_FORMAT_FAILED;
312
+ }
308
313
309
314
if (QSPI_STATUS_OK != _qspi_send_read_command (_read_instruction, buffer, addr, size)) {
310
- status = QSPIF_BD_ERROR_DEVICE_ERROR;
311
315
tr_error (" Read Command failed" );
316
+ return QSPIF_BD_ERROR_DEVICE_ERROR;
312
317
}
313
318
314
319
// All commands other than Read use default 1-1-1 Bus mode (Program/Erase are constrained by flash memory performance more than bus performance)
315
- _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
316
- 0 , QSPI_CFG_BUS_SINGLE, 0 );
320
+ if (QSPI_STATUS_OK != _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE, 0 , QSPI_CFG_BUS_SINGLE, 0 )) {
321
+ return QSPIF_BD_ERROR_CONF_FORMAT_FAILED;
322
+ }
317
323
318
324
_mutex.unlock ();
319
325
return status;
@@ -718,8 +724,10 @@ int QSPIFBlockDevice::_sfdp_parse_sfdp_headers(uint32_t &basic_table_addr, size_
718
724
bd_addr_t addr = 0x0 ;
719
725
720
726
// Set 1-1-1 bus mode for SFDP header parsing
721
- _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
722
- 0 , QSPI_CFG_BUS_SINGLE, 8 );
727
+ if (QSPI_STATUS_OK != _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
728
+ 0 , QSPI_CFG_BUS_SINGLE, 8 )) {
729
+ return -1 ;
730
+ }
723
731
724
732
qspi_status_t status = _qspi_send_read_command (QSPIF_SFDP, (char *)sfdp_header, addr /* address*/ , data_length);
725
733
if (status != QSPI_STATUS_OK) {
@@ -885,8 +893,10 @@ int QSPIFBlockDevice::_sfdp_set_quad_enabled(uint8_t *basic_param_table_ptr)
885
893
}
886
894
887
895
// Configure BUS Mode to 1_1_1 for all commands other than Read
888
- _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
889
- 0 , QSPI_CFG_BUS_SINGLE, 0 );
896
+ if (QSPI_STATUS_OK != _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
897
+ 0 , QSPI_CFG_BUS_SINGLE, 0 )) {
898
+ return -1 ;
899
+ }
890
900
891
901
// Read Status Register
892
902
if (QSPI_STATUS_OK == _qspi_send_general_command (_read_register_inst, QSPI_NO_ADDRESS_COMMAND, NULL , 0 ,
@@ -1211,8 +1221,11 @@ int QSPIFBlockDevice::_enable_fast_mdoe()
1211
1221
status_reg_qer_setup[2 ] = 0x2 ; // Bit 1 of config Reg 2
1212
1222
1213
1223
// Configure BUS Mode to 1_1_1 for all commands other than Read
1214
- _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
1215
- 0 , QSPI_CFG_BUS_SINGLE, 0 );
1224
+ if (QSPI_STATUS_OK != _qspi_configure_format (QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_SINGLE, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_BUS_SINGLE,
1225
+ 0 , QSPI_CFG_BUS_SINGLE, 0 )) {
1226
+ tr_error (" _qspi_configure_format failed" );
1227
+ return QSPIF_BD_ERROR_CONF_FORMAT_FAILED;
1228
+ }
1216
1229
1217
1230
// Read Status Register
1218
1231
if (QSPI_STATUS_OK == _qspi_send_general_command (read_conf_register_inst, QSPI_NO_ADDRESS_COMMAND, NULL , 0 ,
0 commit comments