Skip to content

Commit 260f9b4

Browse files
committed
[ot] hw/opentitan: ot_spi_device: use SPI_DEFAULT_TX_VALUE rather than hard-coded value
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
1 parent 29236f7 commit 260f9b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hw/opentitan/ot_spi_device.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static_assert((1u << FIFO_PHASE_BIT) >= GENERIC_BUFFER_SIZE,
349349
#define RXFIFO_LEN sizeof(uint32_t)
350350
#define TXFIFO_LEN sizeof(uint32_t)
351351

352-
#define SPI_DEFAULT_TX_VALUE 0xffu
352+
#define SPI_DEFAULT_TX_VALUE ((uint8_t)0xffu)
353353
#define SPI_FLASH_BUFFER_SIZE 256u
354354

355355
typedef enum {
@@ -2243,7 +2243,7 @@ static void ot_spi_device_chr_handle_header(OtSPIDeviceState *s)
22432243

22442244
static void ot_spi_device_chr_send_discard(OtSPIDeviceState *s, unsigned count)
22452245
{
2246-
const uint8_t buf[1u] = { (uint8_t)0xffu };
2246+
const uint8_t buf[1u] = { SPI_DEFAULT_TX_VALUE };
22472247

22482248
while (count--) {
22492249
if (qemu_chr_fe_backend_connected(&s->chr)) {
@@ -2284,7 +2284,7 @@ static void ot_spi_device_chr_recv_flash(OtSPIDeviceState *s,
22842284
static void ot_spi_device_chr_send_generic(OtSPIDeviceState *s, unsigned count)
22852285
{
22862286
if (ot_spi_device_is_tx_fifo_in_reset(s)) {
2287-
uint8_t buf[] = { 0xff };
2287+
uint8_t buf[] = { SPI_DEFAULT_TX_VALUE };
22882288
trace_ot_spi_device_gen_fifo_error("TXF in reset");
22892289
while (count--) {
22902290
qemu_chr_fe_write(&s->chr, buf, sizeof(buf));

0 commit comments

Comments
 (0)