Skip to content

Commit 0403883

Browse files
authored
Merge pull request ARMmbed#10171 from offirko/offir_qspi_bus_mask_fix
Fix QSPIF Bus mode mask and quad enable write SR size
2 parents 1b4f6ae + 15fdb6e commit 0403883

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp

Lines changed: 7 additions & 5 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,11 +875,12 @@ 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:
880-
tr_warning("_setQuadEnable - Unsuported QER configuration");
881-
break;
882+
tr_warning("Unsuported QER configuration");
883+
return 0;
882884
}
883885

884886
// Configure BUS Mode to 1_1_1 for all commands other than Read
@@ -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)