-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: flash: andes_qspi: Fix bug when RX length exceeds 512 bytes and optimize the check for being used as a flash fetch device. #83676
Conversation
ATCSPI hardware limits single transfer to 512 bytes, so when reading data over 512 bytes, it needs to be split into multiple transfers Signed-off-by: Kevin Wang <kevinwang821020@google.com>
XIP may indicate that the program is executed either in local memory or flash. However, the SPI node is only used as a flash fetch device when the program is executed in flash. Therefore, optimize the related checks to ensure that when XIP is enabled but the program is executed in local memory, the qspi flash node can still be used. Signed-off-by: Kevin Wang <kevinwang821020@google.com>
@kevinwang821020 Can you log Zephyr bug for what you fix here and link the issue to this fix? |
Hi @de-nordic , |
I am not sure whether I am allowed to insist on reporting the bug, as it is in your platform. Nevertheless, I think that a role of a bug report, aside from reporting a problem for somebody to fix, is a way to inform users on a problem so that people with similar problems could find information that the issue may not be specific for their setup, and also provide information that the issue is tracked and being addressed. @kartben What do you think? Also, In case you would like to backport the issue fix, into previous release, then bug report is needed. |
I think this is a great suggestion. If others feel the same way, I will follow this suggestion and raise an issue (bug). |
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.
Looks OK to me.
I will re-assign the bug to representative of Andes to make sure vendor agrees on the change.
Looks good to me. |
This PR addresses two main issues.
The first one is fixing a bug that occurs when the flash receives more than 512 bytes of data. The root cause is that ATCSPI hardware only supports a maximum of 512 bytes per transfer. Therefore, if the received data exceeds this limit, the transfer needs to be split into multiple transactions.
The second issue is related to determining whether the SPI is used as a flash fetch device in XIP mode. Being in XIP mode does not necessarily mean that the program is executed from flash. The SPI node is only used as a flash fetch device when the program is actually running from flash. In other cases, the SPI node can still exist.