Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions hw/opentitan/ot_gpio_dj.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@ static void ot_gpio_dj_chr_receive(void *opaque, const uint8_t *buf, int size)
} else if (cmd == 'I') {
s->data_ib = data_in;
ot_gpio_dj_update_data_in(s);
} else if (cmd == 'Q') {
char qbuf[64u];
int qlen = snprintf(qbuf, sizeof(qbuf),
"M:%08x\r\nI:%08x\r\nH:%08x\r\n",
s->data_bi, s->data_ib, 0u);
qemu_chr_fe_write(&s->chr, (const uint8_t *)qbuf, qlen);
} else if (cmd == 'R') {
ot_gpio_dj_update_backend(s, true);
} else {
Expand Down Expand Up @@ -742,13 +748,6 @@ static void ot_gpio_dj_chr_event_hander(void *opaque, QEMUChrEvent event)
}

ot_gpio_dj_update_backend(s, true);

/* query backend for current input status */
char buf[16u];
int len = snprintf(buf, sizeof(buf), "Q:%08x\r\n", s->data_oe);
qemu_chr_fe_write(&s->chr, (const uint8_t *)buf, len);
buf[MIN((unsigned)len - 1, sizeof(buf) - 1u)] = '\0';
trace_ot_gpio_backend_send(s->ot_id, buf);
}
}

Expand Down
13 changes: 6 additions & 7 deletions hw/opentitan/ot_gpio_eg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,12 @@ static void ot_gpio_eg_chr_receive(void *opaque, const uint8_t *buf, int size)
ot_gpio_eg_update_data_in(s);
ot_gpio_eg_send_input_ack(s);
ot_gpio_eg_update_backend(s, false);
} else if (cmd == 'Q') {
char qbuf[64u];
int qlen = snprintf(qbuf, sizeof(qbuf),
"M:%08x\r\nI:%08x\r\nH:%08x\r\n",
s->data_bi, s->data_ib, s->host_pull);
qemu_chr_fe_write(&s->chr, (const uint8_t *)qbuf, qlen);
} else if (cmd == 'R') {
s->sync_seq = data_in;
timer_mod(s->sync_timer,
Expand Down Expand Up @@ -1521,13 +1527,6 @@ static void ot_gpio_eg_chr_event_hander(void *opaque, QEMUChrEvent event)
}

ot_gpio_eg_update_backend(s, true);

/* query backend for current input status */
char buf[16u];
int len = snprintf(buf, sizeof(buf), "Q:%08x\r\n", s->data_oe);
qemu_chr_fe_write(&s->chr, (const uint8_t *)buf, len);
buf[MIN((unsigned)len - 1, sizeof(buf) - 1u)] = '\0';
trace_ot_gpio_backend_send(s->ot_id, buf);
}
}

Expand Down
Loading