-
Notifications
You must be signed in to change notification settings - Fork 134
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
[driver] Adding SpiStack Flash #1054
[driver] Adding SpiStack Flash #1054
Conversation
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 like your opinion on the following alternative implementation.
I don't have enough understanding of flash chips to make an informed decision. All alternatives read like gibberish to me… gotta pass that potato back to you 😛
I like your opinion on waiting for the BUSY bit to clear in the program and erase function before issuing the command?
Could you flip it? Do an operation, then continue doing things until you really must wait again? That's how we typically do it in other drivers, basically moves the last wait in the function to the front if that makes sense here.
I'm no expert on flash chips either! For the moment I will leave the selectDie function as is, unless you have any comments to it. Afterall it is working and the overhead is probably not that significant, especially compared to the erase/program durations. I have flipped the waiting as suggested, and will confirm that it works with my W25M512VJ flash chip tonight. Then I will convert it to a PR. I should add that flipping it will add some overhead for example in the read fuction, but I believe it is worth it since the driver only waits when it has to. This will also make the flow of the tests seem strange as it can enter the memory test while still busy erasing the chip. I can ignore this as it is only aesthetic or I can make the busy function public and wait the threads manually. What do you think? |
d595bd0
to
c9a180a
Compare
Yeah, you should probably expose the wait method, otherwise it'll be confusing. |
I have made the Currently, I do not see any operation in the |
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.
Very nice driver! Please squash and then I'll merge it.
5fc859c
to
86a26f5
Compare
Thanks! Should I squash more than this? It occured to me as I was testing the driver with fibers, that it is problematic if a void functions returns a result and vice versa. I have now fixed this issue. |
86a26f5
to
ba23833
Compare
I have changed the implementation of the BdSpiFlash to use the W25M512JV instruction set as discussed in #890. In addition, I have added a wrapper that makes the stacked die seem like a contiguous piece of memory for homogenous storage devices. This was also discussed in #890, although my implementation is somewhat different.
Currently, the dieSelect function does more than I probably want it to, so I would like your opinion on the following alternative implementation.
Finally, the current implementation waits for the BUSY bit to clear after issuing a command. Although I do find it nice that the operation finishes before returning, it does block the driver from issuing commands that can be done while busy. For example with the SpiStack concurrent operations can be performed. Therefore I like your opinion on waiting for the BUSY bit to clear in the program and erase function before issuing the command? Thereby I can select another die and double the troughput. However, I should add that the performance gain is probably very small in practice unless I change the BdSpiStack addressing to be modulo erase block. This could possibly double the throughput, but since I do not know my own throughput at the moment, this is possibly better suited for a later PR!