Skip to content

Fix QSPIF Bus mode mask and quad enable write SR size #10171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ int QSPIFBlockDevice::_sfdp_set_quad_enabled(uint8_t *basic_param_table_ptr)
case 1:
case 4:
status_reg_setup[1] = 0x02; //Bit 1 of Status Reg 2
sr_write_size = 2;
tr_debug("Setting QE Bit, Bit 1 of Status Reg 2");
break;

Expand All @@ -874,11 +875,12 @@ int QSPIFBlockDevice::_sfdp_set_quad_enabled(uint8_t *basic_param_table_ptr)
status_reg_setup[1] = 0x2; // Bit 1 of status Reg 2
_read_register_inst = 0x35;
sr_read_size = 1;
sr_write_size = 2;
tr_debug("Setting QE Bit, Bit 1 of Status Reg 2 -special read command");
break;
default:
tr_warning("_setQuadEnable - Unsuported QER configuration");
break;
tr_warning("Unsuported QER configuration");
return 0;
}

// Configure BUS Mode to 1_1_1 for all commands other than Read
Expand Down Expand Up @@ -1032,7 +1034,7 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
}
is_qpi_mode = false;
examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
if (examined_byte & 0x40) {
if (examined_byte & 0x20) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this mode fix related to sr_write_size - they are both in the same commit - should they be in separate commits ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its two small changes, both are related to quad enabling process... though they in different areas. I can separate them if required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be fine, what about commit message (issues have details for these fixes to be tter understand them) ?

// Fast Read 1-4-4 Supported
read_inst = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_144_READ_INST_BYTE];
set_quad_enable = true;
Expand All @@ -1045,7 +1047,7 @@ int QSPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table
break;
}

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

examined_byte = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_FAST_READ_SUPPORT_BYTE];
if (examined_byte & 0x20) {
if (examined_byte & 0x10) {
// Fast Read 1-2-2 Supported
read_inst = basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE];
_dummy_and_mode_cycles = (basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_122_READ_INST_BYTE - 1] >> 5)
Expand Down