Skip to content

Commit b24057f

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

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

1419-
(void)rx;
1419+
trace_ot_spi_device_flash_transfer(s->ot_id, "->", rx);
14201420

14211421
uint8_t tx = SPI_DEFAULT_TX_VALUE;
14221422

@@ -1468,6 +1468,8 @@ static uint8_t ot_spi_device_flash_transfer(OtSPIDeviceState *s, uint8_t rx)
14681468
g_assert_not_reached();
14691469
}
14701470

1471+
trace_ot_spi_device_flash_transfer(s->ot_id, "<-", tx);
1472+
14711473
return tx;
14721474
}
14731475

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)