Skip to content

Commit 563e08a

Browse files
committed
[ot] hw/riscv: ot_earlgrey: add Reset Manager
Signed-off-by: Emmanuel Blot <[email protected]>
1 parent aa39462 commit 563e08a

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

hw/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ config OT_EARLGREY
3131
select OT_PINMUX
3232
select OT_PWRMGR
3333
select OT_ROM_CTRL
34+
select OT_RSTMGR
3435
select OT_SENSOR
3536
select OT_SPI_HOST
3637
select OT_SRAM_CTRL

hw/riscv/ot_earlgrey.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "hw/opentitan/ot_pinmux.h"
5151
#include "hw/opentitan/ot_pwrmgr.h"
5252
#include "hw/opentitan/ot_rom_ctrl.h"
53+
#include "hw/opentitan/ot_rstmgr.h"
5354
#include "hw/opentitan/ot_sensor.h"
5455
#include "hw/opentitan/ot_spi_host.h"
5556
#include "hw/opentitan/ot_sram_ctrl.h"
@@ -425,17 +426,25 @@ static const IbexDeviceDef ot_earlgrey_soc_devices[] = {
425426
.memmap = MEMMAPENTRIES(
426427
{ 0x40400000u, 0x80u }
427428
),
429+
.gpio = IBEXGPIOCONNDEFS(
430+
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(0, PLIC, 152)
431+
),
428432
.prop = IBEXDEVICEPROPDEFS(
429433
IBEX_DEV_UINT_PROP("num-rom", 1u)
430434
),
435+
.link = IBEXDEVICELINKDEFS(
436+
OT_EARLGREY_SOC_DEVLINK("rstmgr", RSTMGR)
437+
),
431438
},
432439
[OT_EARLGREY_SOC_DEV_RSTMGR] = {
433-
.type = TYPE_UNIMPLEMENTED_DEVICE,
434-
.name = "ot-rstmgr",
435-
.cfg = &ibex_unimp_configure,
440+
.type = TYPE_OT_RSTMGR,
436441
.memmap = MEMMAPENTRIES(
437442
{ 0x40410000u, 0x80u }
438443
),
444+
.gpio = IBEXGPIOCONNDEFS(
445+
OT_EARLGREY_SOC_SIGNAL(OPENTITAN_RSTMGR_SW_RST, 0, PWRMGR, \
446+
OPENTITAN_PWRMGR_SW_RST_REQ, 0)
447+
),
439448
},
440449
[OT_EARLGREY_SOC_DEV_CLKMGR] = {
441450
.type = TYPE_OT_CLKMGR,
@@ -480,7 +489,13 @@ static const IbexDeviceDef ot_earlgrey_soc_devices[] = {
480489
),
481490
.gpio = IBEXGPIOCONNDEFS(
482491
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(0, PLIC, 155),
483-
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(1, PLIC, 156)
492+
OT_EARLGREY_SOC_GPIO_SYSBUS_IRQ(1, PLIC, 156),
493+
OT_EARLGREY_SOC_SIGNAL(OPENTITAN_AON_TIMER_WKUP, 0, PWRMGR, \
494+
OPENTITAN_PWRMGR_WKUP_REQ, \
495+
OT_PWRMGR_WAKEUP_AON_TIMER),
496+
OT_EARLGREY_SOC_SIGNAL(OPENTITAN_AON_TIMER_BITE, 0, PWRMGR, \
497+
OPENTITAN_PWRMGR_RST_REQ,
498+
OT_PWRMGR_RST_REQ_AON_TIMER)
484499
),
485500
.prop = IBEXDEVICEPROPDEFS(
486501
IBEX_DEV_UINT_PROP("pclk", OT_EARLGREY_AON_CLK_HZ)

0 commit comments

Comments
 (0)