Skip to content

Commit ce5194f

Browse files
author
offirko
committed
Fix Bus mode mask and status register write size in
some modes in quad enable
1 parent 54602f5 commit ce5194f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ int QSPIFBlockDevice::_sfdp_set_quad_enabled(uint8_t *basic_param_table_ptr)
854854
case 1:
855855
case 4:
856856
status_reg_setup[1] = 0x02; //Bit 1 of Status Reg 2
857+
sr_write_size = 2;
857858
tr_debug("Setting QE Bit, Bit 1 of Status Reg 2");
858859
break;
859860

@@ -874,6 +875,7 @@ int QSPIFBlockDevice::_sfdp_set_quad_enabled(uint8_t *basic_param_table_ptr)
874875
status_reg_setup[1] = 0x2; // Bit 1 of status Reg 2
875876
_read_register_inst = 0x35;
876877
sr_read_size = 1;
878+
sr_write_size = 2;
877879
tr_debug("Setting QE Bit, Bit 1 of Status Reg 2 -special read command");
878880
break;
879881
default:
@@ -1032,7 +1034,7 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
10321034
}
10331035
is_qpi_mode = false;
10341036
examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
1035-
if (examined_byte & 0x40) {
1037+
if (examined_byte & 0x20) {
10361038
// Fast Read 1-4-4 Supported
10371039
read_inst = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE];
10381040
set_quad_enable = true;
@@ -1045,7 +1047,7 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
10451047
break;
10461048
}
10471049

1048-
if (examined_byte & 0x80) {
1050+
if (examined_byte & 0x40) {
10491051
// Fast Read 1-1-4 Supported
10501052
read_inst = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_114_READ_INST_BYTE];
10511053
set_quad_enable = true;
@@ -1068,7 +1070,7 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
10681070
}
10691071

10701072
examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
1071-
if (examined_byte & 0x20) {
1073+
if (examined_byte & 0x10) {
10721074
// Fast Read 1-2-2 Supported
10731075
read_inst = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE];
10741076
_dummy_and_mode_cycles = (basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE - 1] >> 5)

0 commit comments

Comments
 (0)