-
Notifications
You must be signed in to change notification settings - Fork 0
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
arch/arm64/imx9 Usb driver cache #289
Conversation
Modify cache clean/invalidate to get mass-storage transfer work (WIP) Signed-off-by: Jouni Ukkonen <[email protected]>
@@ -764,6 +765,9 @@ static inline void imx9_writedtd(struct imx9_dtd_s *dtd, | |||
const uint8_t *data, | |||
uint32_t nbytes) | |||
{ | |||
up_invalidate_dcache((uintptr_t)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 shouldn't be needed, the same is done below
@@ -776,8 +780,9 @@ static inline void imx9_writedtd(struct imx9_dtd_s *dtd, | |||
|
|||
up_clean_dcache((uintptr_t)dtd, | |||
(uintptr_t)dtd + sizeof(struct imx9_dtd_s)); | |||
up_clean_dcache((uintptr_t)data, | |||
(uintptr_t)data + nbytes); | |||
|
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 believe the original line is correct, except for CACHE_ALIGN_UP.
The *3 should not be needed
Perhaps the whole buffer should be invalidated (or cleaned) when it is allocated in imx9_epallocbuffer.
up_invalidate_dcache((uintptr_t)dtd->buffer0, | ||
(uintptr_t)dtd->buffer0 + dtd->xfer_len); | ||
(uintptr_t)dtd->buffer0 + CACHE_ALIGN_UP(dtd->xfer_len)); |
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 part is fishy at best :) Just add the CACHE_ALIGN_UP(), and remove the additional lines below.
buffer1,2,3,4 are adjacent, so if xfer_len is longer than 1 first buffer, then next ones are just invalidated
Modify cache clean/invalidate to get
mass-storage transfer work (WIP)
Summary
Impact
Testing