Skip to content

Commit e0eaa56

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

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
@@ -1418,7 +1418,7 @@ static uint8_t ot_spi_device_flash_transfer(OtSPIDeviceState *s, uint8_t rx)
14181418
{
14191419
SpiDeviceFlash *f = &s->flash;
14201420

1421-
(void)rx;
1421+
trace_ot_spi_device_flash_transfer(s->ot_id, "->", rx);
14221422

14231423
uint8_t tx = SPI_DEFAULT_TX_VALUE;
14241424

@@ -1470,6 +1470,8 @@ static uint8_t ot_spi_device_flash_transfer(OtSPIDeviceState *s, uint8_t rx)
14701470
g_assert_not_reached();
14711471
}
14721472

1473+
trace_ot_spi_device_flash_transfer(s->ot_id, "<-", tx);
1474+
14731475
return tx;
14741476
}
14751477

hw/opentitan/trace-events

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ ot_spi_device_buf_write_in(const char *id, uint32_t addr, unsigned size, uint32_
544544
ot_spi_device_bus_change_state(const char *id, int line, const char *state, int stateval) "%s: @%d: %s [%d]"
545545
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"
546546
ot_spi_device_chr_error(const char *id, const char *err) "%s: %s"
547+
ot_spi_device_flash_transfer(const char *id, const char *dir, uint8_t byte) "%s: host %s 0x%02x"
547548
ot_spi_device_flash_byte_unexpected(const char *id, uint8_t rx) "%s: unexpected byte 0x%02x after completed command"
548549
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]"
549550
ot_spi_device_flash_cross_buffer(const char *id, const char *msg, uint32_t addr) "%s: %s 0x%08x"

0 commit comments

Comments
 (0)