Skip to content

Conversation

@roliver-rpi
Copy link
Contributor

No description provided.

@roliver-rpi roliver-rpi requested a review from pelwell December 16, 2025 15:43
#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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an instance where one constant was being used for two different things?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@roliver-rpi roliver-rpi force-pushed the dev/roliver/ai_cam_larger_xfers branch from 5510f3d to da7f1f5 Compare December 16, 2025 16:07
@roliver-rpi roliver-rpi merged commit a107374 into rpi-6.12.y Dec 17, 2025
12 checks passed
@roliver-rpi roliver-rpi deleted the dev/roliver/ai_cam_larger_xfers branch December 17, 2025 08:47
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants