@@ -961,10 +961,22 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
961
961
uint8_t examined_byte;
962
962
963
963
do { // compound statement is the loop body
964
-
964
+ examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
965
+ if (examined_byte & 0x20 ) {
966
+ // Fast Read 1-4-4 Supported
967
+ _read_instruction = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE];
968
+ set_quad_enable = true ;
969
+ _dummy_cycles = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE - 1 ] & 0x1F ;
970
+ uint8_t mode_cycles = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE - 1 ] >> 5 ;
971
+ _alt_size = mode_cycles * 4 ;
972
+ _address_width = QSPI_CFG_BUS_QUAD;
973
+ _data_width = QSPI_CFG_BUS_QUAD;
974
+ tr_debug (" Read Bus Mode set to 1-4-4, Instruction: 0x%xh" , _read_instruction);
975
+ break ;
976
+ }
977
+ // QPI is checked as second option.
965
978
if (basic_param_table_size > QSPIF_BASIC_PARAM_TABLE_QPI_READ_SUPPORT_BYTE) {
966
979
examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_QPI_READ_SUPPORT_BYTE];
967
-
968
980
if (examined_byte & 0x10 ) {
969
981
// QPI 4-4-4 Supported
970
982
_read_instruction = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_444_READ_INST_BYTE];
@@ -976,23 +988,11 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
976
988
tr_debug (" Read Bus Mode set to 4-4-4, Instruction: 0x%xh" , _read_instruction);
977
989
_address_width = QSPI_CFG_BUS_QUAD;
978
990
_data_width = QSPI_CFG_BUS_QUAD;
991
+ break ;
979
992
}
980
993
}
981
- is_qpi_mode = false ;
982
- examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
983
- if (examined_byte & 0x20 ) {
984
- // Fast Read 1-4-4 Supported
985
- _read_instruction = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE];
986
- set_quad_enable = true ;
987
- _dummy_cycles = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE - 1 ] & 0x1F ;
988
- uint8_t mode_cycles = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE - 1 ] >> 5 ;
989
- _alt_size = mode_cycles * 4 ;
990
- _address_width = QSPI_CFG_BUS_QUAD;
991
- _data_width = QSPI_CFG_BUS_QUAD;
992
- tr_debug (" Read Bus Mode set to 1-4-4, Instruction: 0x%xh" , _read_instruction);
993
- break ;
994
- }
995
994
995
+ examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
996
996
if (examined_byte & 0x40 ) {
997
997
// Fast Read 1-1-4 Supported
998
998
_read_instruction = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_114_READ_INST_BYTE];
0 commit comments