Skip to content

Commit 5a2415a

Browse files
roliver-rpipelwell
authored andcommitted
spi: rp2040-gpio-bridge: Grow MAX_TRANSFER_SIZE
Increase the maximum SPI transfer size from an arbitrary 1 MiB to ~4 MiB (the amount of data that can be referenced by a single manifest). Signed-off-by: Richard Oliver <[email protected]>
1 parent 435c5fd commit 5a2415a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/spi/spi-rp2040-gpio-bridge.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,19 @@
3131
#define RP2040_GBDG_BLOCK_SIZE (RP2040_GBDG_FLASH_BLOCK_SIZE - MD5_SUFFIX_SIZE)
3232

3333
/*
34-
* 1MiB transfer size is an arbitrary limit
3534
* Max value is 4173330 (using a single manifest)
35+
*
36+
* Internal page-size is 8KiB - 9 = 8183 bytes
37+
* Manifests address data by a series of 16-byte MD5 sums (following a 16-byte
38+
* manifest header)
39+
*
40+
* Max permissible data using a single manifest:
41+
* 8183 * (8183//16 - 1) = 4173330
42+
*
43+
* CMD_DAT_EMIT in fast_xfer/bypass_cache mode could potentially allow a max
44+
* transfer size of 4GiB, but this is not currently implemented.
3645
*/
37-
#define MAX_TRANSFER_SIZE (1024U * ONE_KIB)
46+
#define MAX_TRANSFER_SIZE 4173330
3847

3948
#define HALF_BUFFER (4U * ONE_KIB)
4049

0 commit comments

Comments
 (0)