Skip to content

Commit c5ae384

Browse files
committed
[ot] hw/opentitan: ot_spi_device: change end of JEDEC ID buffer to 0s
Expected by spi_passthru_test, see: https://github.com/lowRISC/opentitan/blob/master/sw/host/tests/chip/spi_device/src/spi_passthru.rs#L70-L80 Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent 1298a1a commit c5ae384

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hw/opentitan/ot_spi_device.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,9 @@ static void ot_spi_device_flash_decode_read_jedec(OtSPIDeviceState *s)
995995
*/
996996
f->buffer[f->len++] = (uint8_t)(jedec_device >> 0u);
997997
f->buffer[f->len++] = (uint8_t)(jedec_device >> 8u);
998-
memset(&f->buffer[f->len], (int)SPI_DEFAULT_TX_VALUE,
999-
SPI_FLASH_BUFFER_SIZE - f->len);
998+
/* after the end of JEDEC ID is 0s on OpenTitan */
999+
memset(&f->buffer[f->len], (int)0u, SPI_FLASH_BUFFER_SIZE - f->len);
1000+
f->len = SPI_FLASH_BUFFER_SIZE;
10001001
f->src = f->buffer;
10011002
FLASH_CHANGE_STATE(s, BUFFER);
10021003
}

0 commit comments

Comments
 (0)