-
Notifications
You must be signed in to change notification settings - Fork 3k
SFDP: consolidation of SFDP parsing [5/5] #12528
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
Conversation
|
@VeijoPesonen, thank you for your changes. |
|
@SeppoTakalo @kyle-cypress @jeromecoutant Could we have a review please ? |
kyle-cypress
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Flagged a couple of minor items.
Rebased on latest master locally and successfully ran storage tests on CY8CKIT_062_WIFI_BT.
Tried to run on CY8CKIT_064_SB as well but encountered an assertion (on both this branch and on master - so not caused by these changes):
[1583886448.20][CONN][RXD] Error Status: 0x80FF0144 Code: 324 Module: 255
[1583886448.21][CONN][RXD] Error Message: Assertion failed: _area_params[0].size == _area_params[1].size
[1583886448.21][CONN][RXD] Location: 0x1000ED11
[1583886448.21][CONN][RXD] File: ./features/storage/kvstore/tdbstore/TDBStore.cpp+209
[1583886448.22][CONN][RXD] Error Value: 0x0
[1583886448.22][CONN][RXD] Current Thread: main Id: 0x8001BE8 Entry: 0x1000FFE5 StackSize: 0x1000 StackMem: 0x8002A48 SP: 0x80037CC
[1583886448.24][CONN][RXD] For more info, visit: https://mbed.com/s/error?error=0x80FF0144&osver=999999&core=0x410FC241&comp=2&ver=60300&tgt=CY8CPROTO_064_SB
[1583886448.24][CONN][RXD] -- MbedOS Error Info --
I'll investigate more tomorrow and file a separate issue if necessary.
| goto exit_point; | ||
| } | ||
| /**************************** Parse SFDP data ***********************************/ | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This set of curly braces doesn't seem to serve a purpose (no flow control, and contains no declarations so it is not being used to introduce a child scope)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, only reason I added those was to show clearly which part of the code has something to do with SFDP parsing. And to remove comments which were saying the same thing as functions being called.
|
@VeijoPesonen could you please take a look at @kyle-cypress 's comments ? |
| } | ||
|
|
||
| /**************************** Parse SFDP headers and tables ***********************************/ | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this set of scope brackets here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only reason I added those was to show clearly which part of the code has something to do with SFDP parsing. And to remove comments which were saying the same thing as functions being called.
| return status; | ||
| } | ||
|
|
||
| int SPIFBlockDevice::_handle_vendor_quirks() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a new externally accessible interface function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's actually private even when it might look like it's public. private-label has been used twice in this file.
drivers/source/SFDP.cpp
Outdated
| hdr_info.bptbl.addr = sfdp_get_param_tbl_ptr(phdr_ptr->DWORD2); | ||
| hdr_info.bptbl.size = std::min((phdr_ptr->P_LEN * 4), SFDP_BASIC_PARAMS_TBL_SIZE); | ||
| break; | ||
| /* TODO: Following headers should be parsed */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't have TODO's in released code....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look ready for coming into master? Should this really be on a feature branch ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good question @VeijoPesonen @SeppoTakalo why are we not parsing these headers? Do we need to mention somewhere not supported cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these TODo's are due to currently unsupported devices or functionality, then we should say something along those lines ie 'This is currently unsupported functionality'. This should also be in our docs somewhere ? 'TODO's ' look unprofessional in released code....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't have TODO's in released code....
Personally I would prefer to see if something is not implemented. I wouldn't want to give a wrong impression that SFDP database parsing takes into consideration all possible combinations as long as it's not true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these TODo's are due to currently unsupported devices or functionality, then we should say something along those lines ie 'This is currently unsupported functionality'. This should also be in our docs somewhere ? 'TODO's ' look unprofessional in released code....
TODO -> UNSUPPORTED, agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look ready for coming into master? Should this really be on a feature branch ?
The plan is not to implement parsing of all possible headers so I don't see a reason to introduce a feature branch.
| return largest_erase_type; | ||
| } | ||
|
|
||
| int sfdp_detect_device_density(uint8_t *bptbl_ptr, sfdp_bptbl_info &bptbl_info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this also another publicly available interface function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this time that is the case.
Apologies for the delayed response, I took a vacation last week. I'll come back to this as soon as possible. |
Pull request has been modified.
Earlier it was assumed that the table has a certain max length but that isn't true.
Making search for common erase type between regions more clear
C++14-ify memory allocation.
Indexing runs from highest to lowest, not other way round.
|
CI started |
Test run: FAILEDSummary: 1 of 7 test jobs failed Failed test jobs:
|
|
Test results updated. |
|
Dynamic memory usage reported to @ARMmbed/mbed-os-test team, will be reviewed |
|
Should be fixed now so I will restart CI |
|
CI started |
Test run: SUCCESSSummary: 7 of 7 test jobs passed |
Summary of changes
Depends on PR #12524[merged].
Purpose of this PR is to consolidate SFDP header and table parsing and make the QSPIF- and SPIFBlockDevices to use the same shared implementation. Before this PR almost the same code was found from both of the components.
Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
Failures with Cypress targets are also visible with master branch.
Reviewers
@SeppoTakalo
@kyle-cypress
@jeromecoutant