AI Camera - Larger SPI transfers to enable >1MiB input tensors to be injected#7178
Merged
roliver-rpi merged 2 commits intorpi-6.12.yfrom Dec 17, 2025
Merged
Conversation
pelwell
reviewed
Dec 16, 2025
drivers/spi/spi-rp2040-gpio-bridge.c
Outdated
| #define MANIFEST_HEADER_UNITS 1 | ||
| #define MANIFEST_DATA_UNITS \ | ||
| DIV_ROUND_UP(MAX_TRANSFER_SIZE, RP2040_GBDG_BLOCK_SIZE) | ||
| DIV_ROUND_UP((1024U * ONE_KIB), RP2040_GBDG_BLOCK_SIZE) |
Contributor
There was a problem hiding this comment.
Is this an instance where one constant was being used for two different things?
Contributor
Author
There was a problem hiding this comment.
Thanks for highlighting this; MAX_TRANSFER_SIZE is correct here.
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 <richard.oliver@raspberrypi.com>
Remove the arbitrary 1 MiB transfer limit from imx500_spi_write() as the 1 MiB chunk limitation for firmware / network transfers is already upheld by imx500_state_transition(). This allows for larger input tensors to be injected via imx500_inject_input_tensor() (where there is no 1 MiB chunk limitation). Increase the number of poll attempts whilst waiting for the injection handshake register to be TRANS_COMP to allow more time for the checksum of larger input tensors to be calculated. Alter error messages in imx500_inject_input_tensor() so that imx500_spi_write() and imx500_injection_wait_transfer_complete() errors may be more easily differentiated. Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
5510f3d to
da7f1f5
Compare
pelwell
approved these changes
Dec 16, 2025
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Dec 17, 2025
See: raspberrypi/linux#7177 kernel: AI Camera - Larger SPI transfers to enable >1MiB input tensors to be injected See: raspberrypi/linux#7178
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Dec 17, 2025
See: raspberrypi/linux#7177 kernel: AI Camera - Larger SPI transfers to enable >1MiB input tensors to be injected See: raspberrypi/linux#7178
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.