Skip to content

Commit 42b6933

Browse files
committed
[ot] hw/opentitan: ot_spi_device: DEFAULT_TX_VALUE -> DEFAULT_TX_RX_VALUE
Name is more verbose but matches the usage better, as in `ot_spi_host` Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent c5ae384 commit 42b6933

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hw/opentitan/ot_spi_device.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ REG32(TPM_READ_FIFO, 0x34u)
297297
#define INGRESS_BUFFER_SIZE_WORDS PARAM_SRAM_INGRESS_DEPTH
298298
#define FLASH_READ_BUFFER_SIZE (2u * SPI_SRAM_READ_SIZE)
299299

300-
#define SPI_DEFAULT_TX_VALUE ((uint8_t)0xffu)
301-
#define SPI_FLASH_BUFFER_SIZE 256u
300+
#define SPI_DEFAULT_TX_RX_VALUE ((uint8_t)0xffu)
301+
#define SPI_FLASH_BUFFER_SIZE 256u
302302

303303
typedef enum {
304304
READ_STATUS1,
@@ -1207,7 +1207,7 @@ static uint8_t ot_spi_device_flash_read_buffer(OtSPIDeviceState *s)
12071207

12081208
g_assert(f->src);
12091209

1210-
uint8_t tx = (f->pos < f->len) ? f->src[f->pos] : SPI_DEFAULT_TX_VALUE;
1210+
uint8_t tx = (f->pos < f->len) ? f->src[f->pos] : SPI_DEFAULT_TX_RX_VALUE;
12111211

12121212
f->pos++;
12131213
if (f->pos >= f->len) {
@@ -1425,7 +1425,7 @@ static uint8_t ot_spi_device_flash_transfer(OtSPIDeviceState *s, uint8_t rx)
14251425

14261426
(void)rx;
14271427

1428-
uint8_t tx = SPI_DEFAULT_TX_VALUE;
1428+
uint8_t tx = SPI_DEFAULT_TX_RX_VALUE;
14291429

14301430
switch (f->state) {
14311431
case SPI_FLASH_IDLE:
@@ -2025,7 +2025,7 @@ static void ot_spi_device_chr_handle_header(OtSPIDeviceState *s)
20252025

20262026
static void ot_spi_device_chr_send_discard(OtSPIDeviceState *s, unsigned count)
20272027
{
2028-
const uint8_t buf[1u] = { SPI_DEFAULT_TX_VALUE };
2028+
const uint8_t buf[1u] = { SPI_DEFAULT_TX_RX_VALUE };
20292029

20302030
while (count--) {
20312031
if (qemu_chr_fe_backend_connected(&s->chr)) {

0 commit comments

Comments
 (0)