-
Notifications
You must be signed in to change notification settings - Fork 7.6k
add spi nand driver #50690
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
base: main
Are you sure you want to change the base?
add spi nand driver #50690
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.
Thanks for this contribution.
Some clean up required.
My main request would be to remove STM32 mentions, since there is nothing STM32 specific here aside from the board used for test.
@rogeryou can you please format your commits as described here: |
9755c14
to
901b863
Compare
I have formated my commits. |
@rogeryou, thank you for this contribution. It would be very nice to have nand flash support in zephyr. Regarding the PR, I have seen that the ecc is hidden for the user as to be able to use the standard flash interface. This is a good thing, but doesn't this also make any other part of the oob data unavailable ? IMHO it would be good to extend the flash driver for nand flashes with read/write possibilities of the oob data. This would allow adding bad block info to the oob area. |
@rogeryou |
Thank you for your suggestion. We will add APIs that operate OOB later. |
Could you tell me which part of the program you mentioned? |
555fd5d
to
eaf79f9
Compare
drivers/flash/spi_nand.c
Outdated
DEVICE_DT_INST_DEFINE(0, &spi_nand_init, NULL, | ||
&spi_nand_data_0, &spi_nand_config_0, | ||
POST_KERNEL, CONFIG_SPI_NAND_INIT_PRIORITY, | ||
&spi_nand_api); |
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 it would be possible to have multiple instances use, DT_INST_FOREACH_STATUS_OKAY
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 I may, I think that we can do that later, I would really like to focus on having even one instance driver working at this point.
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.
Sure, but this isn't difficult to do really?
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 is not, it is just few more lines. But these are another few lines to review before we get this thing in. Something we can easily get done later.
I doubt that you will have immediate need to connect N devices, if you have not been able to connect one for so long.
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.
Do we want driver specific samples? Can't you re-use the existing flash driver sample?
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.
SPI NAND Flash is a page-program type device and does not support 4-byte data programming. We also plan to add some software ECC test cases later.
3d4d13d
to
ad279f4
Compare
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.
The commit should be split in two, one for the driver and another for the sample.
381b034
to
ead3591
Compare
ead3591
to
4236599
Compare
@de-nordic @pdgendt Please review again. |
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.
Please run clang-format
on the new .c/.h files.
4236599
to
11f2630
Compare
11f2630
to
d580172
Compare
d580172
to
90e3228
Compare
f5bd58e
to
e352357
Compare
Add SPI NAND Flash driver support Signed-off-by: Daniel Zhang <[email protected]>
e352357
to
84f8da1
Compare
|
@de-nordic Please review again. |
This PR is updated for #43915.
Add SPI NAND block device driver for using SPI NAND Flash like Macronix Flash MX31LF4GE4BC.
This driver is tested on STM32L562E-DK.
The license of BCH code is updated.