-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
FLASH Add W25M homogeneous stack driver and W25M512 support #5722
Conversation
src/main/drivers/flash_w25m.c
Outdated
int dieNumber = address / dieSize; | ||
uint32_t dieAddress = address % dieSize; | ||
|
||
if (dieAddress + rlen > dieSize) { |
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.
I would probably rewrite this to:
tlen = MIN(dieAddress + rlen, dieSize) - dieAddress
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.
Let me try that!
@jflyper What chip package you were using for your development? I thought there was one pin compatible with one of existing NOR chips used on FCs. |
src/main/drivers/flash_w25m.c
Outdated
rbytes = dieDevice[dieNumber].vTable->readBytes(&dieDevice[dieNumber], dieAddress, buffer, tlen); | ||
|
||
if (!rbytes) { | ||
debug[0]++; |
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 will have to be changed to use DEBUG_SET()
or removed, or else it will break other debug modes.
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.
Oops...
|
||
#include "pg/flash.h" | ||
|
||
#define W25M_INSTRUCTION_SOFTWARE_DIE_SELECT 0xC2 |
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.
Unaligned spacing.
e5a0690
to
9b5b7c5
Compare
src/main/drivers/flash_w25m.c
Outdated
for (rlen = length; rlen; rlen -= tlen) { | ||
int dieNumber = address / dieSize; | ||
uint32_t dieAddress = address % dieSize; | ||
tlen = MIN(dieAddress + rlen, dieSize) - dieAddress |
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.
Now this needs to include common/maths.h
.
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.
Ouch!!! (And a semi-colon...)
9b5b7c5
to
7171814
Compare
The homogeneous stack driver provides support for Winbond W25M series spistack flash chips that are stacks of same sized dies.
W25M512JV ( = 2 x W25Q256JV )
https://www.winbond.com/resource-files/w25m512jv%20revc%2001062017.pdf
Note:
Support for W25M02G will be provided by the W25M homogeneous mode driver once W25N01G is added.