Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions drivers/media/i2c/imx500.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@ static void imx500_clear_fw_network(struct imx500 *imx500)
static int __must_check imx500_spi_write(struct imx500 *state, const u8 *data,
size_t size)
{
if (size % 4 || size > ONE_MIB)
if (size % 4)
return -EINVAL;

if (!state->spi_device)
Expand All @@ -1957,7 +1957,7 @@ static int imx500_injection_wait_transfer_complete(struct imx500 *imx500)

/* Continue polling until we reach the final TRANS_COMP state */
while (hndsk_reg.val != IMX500_DD_DAT_INJECTION_HNDSK_TRANS_COMP) {
ret = imx500_poll_status_reg(imx500, &hndsk_reg, 5);
ret = imx500_poll_status_reg(imx500, &hndsk_reg, 10);
if (ret) {
dev_err(&client->dev,
"Handshake register did not update from state %llu\n",
Expand Down Expand Up @@ -2085,7 +2085,7 @@ static int imx500_inject_input_tensor(struct imx500 *imx500, const u32 *data,

ret = imx500_injection_wait_transfer_complete(imx500);
if (ret) {
dev_err(&client->dev, "SPI transfer of input tensor failed\n");
dev_err(&client->dev, "Input tensor transfer failed to complete\n");
return ret;
}

Expand Down
13 changes: 11 additions & 2 deletions drivers/spi/spi-rp2040-gpio-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@
#define RP2040_GBDG_BLOCK_SIZE (RP2040_GBDG_FLASH_BLOCK_SIZE - MD5_SUFFIX_SIZE)

/*
* 1MiB transfer size is an arbitrary limit
* Max value is 4173330 (using a single manifest)
*
* Internal page-size is 8KiB - 9 = 8183 bytes
* Manifests address data by a series of 16-byte MD5 sums (following a 16-byte
* manifest header)
*
* Max permissible data using a single manifest:
* 8183 * (8183//16 - 1) = 4173330
*
* CMD_DAT_EMIT in fast_xfer/bypass_cache mode could potentially allow a max
* transfer size of 4GiB, but this is not currently implemented.
*/
#define MAX_TRANSFER_SIZE (1024U * ONE_KIB)
#define MAX_TRANSFER_SIZE 4173330

#define HALF_BUFFER (4U * ONE_KIB)

Expand Down