Skip to content

Commit

Permalink
[ot] hw/riscv: add SPI device to Earlgrey machine
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Blot <[email protected]>
  • Loading branch information
rivos-eblot authored and loiclefort committed Nov 13, 2023
1 parent 3a88bd0 commit 335013f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions hw/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config OT_EARLGREY
select OT_ROM_CTRL
select OT_RSTMGR
select OT_SENSOR
select OT_SPI_DEVICE
select OT_SPI_HOST
select OT_SRAM_CTRL
select OT_TIMER
Expand Down
22 changes: 19 additions & 3 deletions hw/riscv/ot_earlgrey.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "hw/opentitan/ot_rom_ctrl.h"
#include "hw/opentitan/ot_rstmgr.h"
#include "hw/opentitan/ot_sensor.h"
#include "hw/opentitan/ot_spi_device.h"
#include "hw/opentitan/ot_spi_host.h"
#include "hw/opentitan/ot_sram_ctrl.h"
#include "hw/opentitan/ot_timer.h"
Expand Down Expand Up @@ -319,12 +320,27 @@ static const IbexDeviceDef ot_earlgrey_soc_devices[] = {
)
},
[OT_EARLGREY_SOC_DEV_SPI_DEVICE] = {
.type = TYPE_UNIMPLEMENTED_DEVICE,
.name = "ot-spi_device",
.cfg = &ibex_unimp_configure,
.type = TYPE_OT_SPI_DEVICE,
.memmap = MEMMAPENTRIES(
{ 0x40050000u, 0x2000u }
),
.gpio = IBEXGPIOCONNDEFS(
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(0, PLIC, 65),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(1, PLIC, 66),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(2, PLIC, 67),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(3, PLIC, 68),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(4, PLIC, 69),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(5, PLIC, 70),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(6, PLIC, 71),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(7, PLIC, 72),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(8, PLIC, 73),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(9, PLIC, 74),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(10, PLIC, 75),
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(11, PLIC, 76)
),
.prop = IBEXDEVICEPROPDEFS(
IBEX_DEV_BOOL_PROP("dpsram", true)
),
},
[OT_EARLGREY_SOC_DEV_I2C0] = {
.type = TYPE_UNIMPLEMENTED_DEVICE,
Expand Down

0 comments on commit 335013f

Please sign in to comment.