Gilbert Gilb's adec30ace4 fix(c9xx): don't flush dcache when invalidating
The data cache invalidation function for c9xx CPUs uses `dcache.cipa`
instruction. According to T-Head extension specification[1] section
3.1.5, this instruction also performs a cache clean along with the
invalidation.

On top of being incorrect, this leads to a serious issue on the
designware ethernet driver, where stalled cache may get flushed each
time we handle a new received packet[2]. As a result, received packet
are randomly corrupted with old cached data. This can easily be
reproduced by sending an ARP request to the device during a TFTP
transfer. The last TFTP block is treated as the ARP reply we just sent,
which makes U-Boot hang on the block.

Always use `dcache.ipa` instruction to invalidate dcache. Replace
existing usages of `dcache.ipa` with our implementation.

Note that this fix is slightly intrusive as it changes the cache
invalidation behavior in all drivers. However, I have not noticed any
side-effect during my tests.

[1] https://github.com/T-head-Semi/thead-extension-spec/releases/download/2.3.0/xthead-2023-11-10-2.3.0.pdf

[2] 918a8c89e0/drivers/net/designware.c (L475)
2023-12-15 23:35:31 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-11-22 15:50:04 +08:00
2022-09-13 11:04:33 +08:00
2023-05-10 02:25:53 +08:00
2023-07-30 03:57:28 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2022-11-22 15:50:04 +08:00
2022-09-13 11:04:33 +08:00
2023-08-19 02:17:24 +08:00
2022-09-13 11:04:33 +08:00
2023-08-19 02:17:24 +08:00
2022-09-13 11:04:33 +08:00
2022-09-13 11:04:33 +08:00
2023-08-19 02:17:24 +08:00
Description
No description provided
Readme 33 MiB
Languages
C 95.6%
Python 1.9%
Assembly 1%
Makefile 0.6%
Perl 0.4%
Other 0.2%