Skip to content

Commit 3b0066f

Browse files
committed
[ot] hw/opentitan: ot_spi_device: add trace event for byte transfer
Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent 201dd07 commit 3b0066f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

hw/opentitan/ot_spi_device.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ static uint8_t ot_spi_device_flash_transfer(OtSPIDeviceState *s, uint8_t rx)
13561356
{
13571357
SpiDeviceFlash *f = &s->flash;
13581358

1359-
(void)rx;
1359+
trace_ot_spi_device_flash_transfer(s->ot_id, "->", rx);
13601360

13611361
uint8_t tx = SPI_DEFAULT_TX_VALUE;
13621362

@@ -1408,6 +1408,8 @@ static uint8_t ot_spi_device_flash_transfer(OtSPIDeviceState *s, uint8_t rx)
14081408
g_assert_not_reached();
14091409
}
14101410

1411+
trace_ot_spi_device_flash_transfer(s->ot_id, "<-", tx);
1412+
14111413
return tx;
14121414
}
14131415

hw/opentitan/trace-events

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ ot_spi_device_buf_write_in(const char *id, uint32_t addr, unsigned size, uint32_
543543
ot_spi_device_bus_change_state(const char *id, int line, const char *state, int stateval) "%s: @%d: %s [%d]"
544544
ot_spi_device_chr_handle_packet(const char *id, unsigned count, unsigned eot, char rx, char tx, const char *st) "%s: 0x%x bytes, eot: %u, rx: %csb, tx: %csb, mode:%s"
545545
ot_spi_device_chr_error(const char *id, const char *err) "%s: %s"
546+
ot_spi_device_flash_transfer(const char *id, const char *dir, uint8_t rx) "%s: host %s 0x%02x"
546547
ot_spi_device_flash_byte_unexpected(const char *id, uint8_t rx) "%s: unexpected byte 0x%02x after completed command"
547548
ot_spi_device_flash_change_state(const char *id, int line, const char *prev, int preval, const char *next, int nextval) "%s: @%d: %s[%d] -> %s[%d]"
548549
ot_spi_device_flash_cross_buffer(const char *id, const char *msg, uint32_t addr) "%s: %s 0x%08x"

0 commit comments

Comments
 (0)