Skip to content

Commit cb4ca38

Browse files
committed
[ot] hw/opentitan: ot_spi_host: change CS lines into IbexIRQs
Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent 5f7db5c commit cb4ca38

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hw/opentitan/ot_spi_host.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ struct OtSPIHostState {
335335

336336
MemoryRegion mmio;
337337

338-
qemu_irq *cs_lines; /* CS output lines */
338+
IbexIRQ *cs_lines; /* CS output lines */
339339
SSIBus *ssi; /* SPI bus */
340340

341341
uint32_t *regs; /* Registers (except. fifos) */
@@ -529,7 +529,7 @@ static void ot_spi_host_chip_select(OtSPIHostState *s, unsigned csid,
529529
{
530530
if (csid < s->num_cs) {
531531
trace_ot_spi_host_cs(s->ot_id, csid, activate ? "" : "de");
532-
qemu_set_irq(s->cs_lines[csid], !activate);
532+
ibex_irq_set(&s->cs_lines[csid], !activate);
533533
}
534534
}
535535

@@ -1384,10 +1384,10 @@ static void ot_spi_host_realize(DeviceState *dev, Error **errp)
13841384

13851385
g_assert(s->version < OT_SPI_HOST_VERSION_COUNT);
13861386

1387-
s->cs_lines = g_new0(qemu_irq, (size_t)s->num_cs);
1387+
s->cs_lines = g_new0(IbexIRQ, (size_t)s->num_cs);
1388+
1389+
ibex_qdev_init_irqs(OBJECT(dev), &s->cs_lines[0], SSI_GPIO_CS, s->num_cs);
13881390

1389-
qdev_init_gpio_out_named(DEVICE(s), s->cs_lines, SSI_GPIO_CS,
1390-
(int)s->num_cs);
13911391
qdev_init_gpio_in_named(DEVICE(s), &ot_spi_host_clock_input, "clock-in", 1);
13921392

13931393
char busname[16u];

0 commit comments

Comments
 (0)