linux-gbmc: Add RoT mailbox backoff to everspin
When writing to the 64KB RAM-backed RoT mailbox region on Google
Hoth/Dauntless SPI NOR parts (at 0x700000 on 32MB hothb2-512 parts, or
the top 64KB on 64MB/128MB parts), the RoT intercepts the write and
holds the flash busy (SR_WIP) for several milliseconds while processing
the mailbox command. Tight status register polling in
spi_nor_wait_till_ready causes excessive SPI bus traffic and CPU usage.
Override the MTD _write callback in everspin.c so that status polling on
pages within the 64KB mailbox region uses an exponential backoff sleep
(250us doubling up to 20ms), while non-mailbox flash writes continue
using standard spi_nor_wait_till_ready() without backoff delay.
Tested: Verified on hardware that hothd mailbox transactions complete
with minimal SPI transfers instead of thousands of tight SR polls, while
non-mailbox flash operations remain unaffected.
Fusion-Link: fusion2 N/A
Google-Bug-Id: 565629335
Change-Id: I17eb681995d38bbcdf4d6015159cb2d9f5eeb13d
Signed-off-by: William A. Kennington III <wak@google.com>
1 file changed