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