Skip to content

Import latest changes from Darjeeling #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 69 commits into
base: ot-earlgrey-9.2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b0021eb
[ot] scripts/opentitan: spidevflash.py: add a connection idle option
rivos-eblot Jan 31, 2025
2ff99a4
[ot] scripts/opentitan: timelog.py: new script to filter log time info
rivos-eblot Feb 11, 2025
c0faf82
[ot] Revert "[ot] target/riscv: fix circular dependency of header fil…
rbradford Feb 10, 2025
eaa9fb8
[ot] meson: disable check for strchrnul on macOS
rivos-eblot Apr 3, 2025
041f09e
[ot] hw/riscv: ot_darjeeling, ot_earlgrey: disable dedicated Ibex Wra…
rivos-eblot Apr 8, 2025
60993bd
[ot] hw/opentitan: ot_ibex_wrapper: unify EarlGrey and Darjeeling imp…
rivos-eblot Apr 7, 2025
da25906
[ot] hw/riscv: ot_darjeeling, ot_earlgrey: use the unified Ibex Wrapp…
rivos-eblot Apr 8, 2025
b4c2965
[ot] hw/opentitan: ot_earlgrey: ignore LC state status to execute code
rivos-eblot Apr 8, 2025
c89c715
[ot] hw/opentitan: ot_ibex_wrapper: remove Ibex Wrapper old implement…
rivos-eblot Apr 7, 2025
7276533
[ot] target/riscv: cpu: make get_physical_address a virtual function.
rivos-eblot Mar 31, 2025
24097e7
[ot] target/riscv: cpu: add an option to use virtual address with PMP
rivos-eblot Apr 3, 2025
0cdfa12
[ot] hw/opentitan: ot_vmapper: create new device to handle address tr…
rivos-eblot Apr 9, 2025
1755ee5
[ot] hw/opentitan: ot_ibex_wrapper: add a link to the virtual remapper
rivos-eblot Apr 8, 2025
4fe58b5
[ot] hw/opentitan: ot_darjeeling, ot_earlgrey: new virtual remapper
rivos-eblot Apr 1, 2025
3d6a10d
[ot] hw/opentitan: ot_ibex_wrapper: add new address translation imple…
rivos-eblot Apr 14, 2025
e0d0af4
[ot] docs/opentitan: ot_darjeeling, ot_earlgrey: document remapping f…
rivos-eblot Apr 8, 2025
add4e83
[ot] hw/opentitan: ot_dma: fix memory range checks, trigger a BUS err…
rivos-eblot Apr 10, 2025
281ecb2
[ot] hw/opentitan: ot_dma: fix SHA message digest byte order.
rivos-eblot Apr 10, 2025
2c88cb3
[ot] hw/opentitan: ot_rstmgr: reset all but one registers on reset
rivos-eblot Apr 11, 2025
6db86d1
[ot] hw/riscv: dm: discard exception signal when hart is not defined.
rivos-eblot Apr 14, 2025
468447f
[ot] hw/opentitan: ot_lc_ctrl: fix an out-of-bound buffer access.
rivos-eblot Apr 14, 2025
89a5d38
[ot] hw/opentitan: ot_spi_host: fix an out-of-bound buffer access.
rivos-eblot Apr 14, 2025
80fbc1c
[ot] hw/opentitan: ot_spi_device: fix JEDEC ID byte sequence generation
rivos-eblot Apr 15, 2025
1b9d41b
[ot] hw/opentitan: ot_otp_dj: fix invalid ECC memory buffer reference.
rivos-eblot Apr 15, 2025
265c5c7
[ot] hw/opentitan: ot_otp: rename OtOTPStateClass as OtOTPClass
rivos-eblot Apr 15, 2025
ef6f68a
[ot] hw/opentitan: ot_otp: replace legacy reset API with Resettable API
rivos-eblot Apr 15, 2025
fe8af2b
[ot] hw/opentitan: ot_otp: ensure OTP content is reloaded on each reset.
rivos-eblot Apr 15, 2025
bd54235
[ot] hw/opentitan: ot_spi_device: emulate byte inversion in JEDEC ID.
rivos-eblot Apr 16, 2025
10f69b1
[ot] hw/opentitan: ot_aes: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
921068b
[ot] hw/opentitan: ot_alert: replace legacy reset API with Resettable…
rivos-eblot Apr 16, 2025
14b775d
[ot] hw/opentitan: ot_aon_timer: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
17d0f25
[ot] hw/opentitan: ot_ast_dj: replace legacy reset API with Resettabl…
rivos-eblot Apr 16, 2025
50615b1
[ot] hw/opentitan: ot_ast_eg: replace legacy reset API with Resettabl…
rivos-eblot Apr 16, 2025
b9379f8
[ot] hw/opentitan: ot_clkmgr: replace legacy reset API with Resettabl…
rivos-eblot Apr 16, 2025
6475533
[ot] hw/opentitan: ot_csrng: replace legacy reset API with Resettable…
rivos-eblot Apr 16, 2025
b01033d
[ot] hw/opentitan: ot_dev_proxy: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
da428d9
[ot] hw/opentitan: ot_dm_tl: replace legacy reset API with Resettable…
rivos-eblot Apr 16, 2025
b9f2cc4
[ot] hw/opentitan: ot_dma: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
9ddd9ec
[ot] hw/opentitan: ot_edn: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
a203f8f
[ot] hw/opentitan: ot_entropy_src: replace legacy reset API with Rese…
rivos-eblot Apr 16, 2025
687ac86
[ot] hw/opentitan: ot_flash: replace legacy reset API with Resettable…
rivos-eblot Apr 16, 2025
a7fa937
[ot] hw/opentitan: ot_gpio: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
352faaa
[ot] hw/opentitan: ot_hmac: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
04c8b20
[ot] hw/opentitan: ot_i2c_dj: replace legacy reset API with Resettabl…
rivos-eblot Apr 16, 2025
bc80e84
[ot] hw/opentitan: ot_kmac: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
de4597b
[ot] hw/opentitan: ot_lc_ctrl: replace legacy reset API with Resettab…
rivos-eblot Apr 16, 2025
1504cc1
[ot] hw/opentitan: ot_mbx: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
4f1e686
[ot] hw/opentitan: ot_otbn: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
79d7b80
[ot] hw/opentitan: ot_otp_ot_be: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
eb29832
[ot] hw/opentitan: ot_pinmux_dj: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
38687e5
[ot] hw/opentitan: ot_pinmux_eg: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
8271236
[ot] hw/opentitan: ot_plic_ext: replace legacy reset API with Resetta…
rivos-eblot Apr 16, 2025
28b06ee
[ot] hw/opentitan: ot_rstmgr: replace legacy reset API with Resettabl…
rivos-eblot Apr 16, 2025
4974994
[ot] hw/opentitan: ot_sensor: replace legacy reset API with Resettabl…
rivos-eblot Apr 16, 2025
37ef224
[ot] hw/opentitan: ot_soc_proxy: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
09ec278
[ot] hw/opentitan: ot_socdbg_ctrl: replace legacy reset API with Rese…
rivos-eblot Apr 16, 2025
2b4a959
[ot] hw/opentitan: ot_spi_device: replace legacy reset API with Reset…
rivos-eblot Apr 16, 2025
8ef3905
[ot] hw/opentitan: ot_spi_host: update Resettable API implementation
rivos-eblot Apr 16, 2025
1c080c6
[ot] hw/opentitan: ot_sram_ctrl: replace legacy reset API with Resett…
rivos-eblot Apr 16, 2025
820edbf
[ot] hw/opentitan: ot_timer: replace legacy reset API with Resettable…
rivos-eblot Apr 16, 2025
131c08f
[ot] hw/opentitan: ot_uart: replace legacy reset API with Resettable API
rivos-eblot Apr 16, 2025
c403347
[ot] hw/opentitan: ot_pwrmgr: add missing BH cancellation on reset
rivos-eblot Apr 16, 2025
292a61e
[ot] hw/opentitan: ot_otp_dj: add missing BH cancellation on reset
rivos-eblot Apr 16, 2025
5a133f1
[ot] hw/opentitan: ot_dma: abort on IDLE should raise the ABORT flag
rivos-eblot Apr 17, 2025
82c854e
[ot] hw/opentitan: ot_earlgrey: remove double device identification
rivos-eblot Apr 17, 2025
c5328d1
[ot] hw/opentitan: ot_darjeeling, ot_earlgrey: use OT_COMMON_DEV_ID
rivos-eblot Apr 17, 2025
de016d8
[ot] hw/opentitan: use OT_COMMON_DEV_ID in OT device properties
rivos-eblot Apr 17, 2025
05be3d3
[ot] hw/opentitan: all: remove default ot_id string creation.
rivos-eblot Apr 18, 2025
1e17ee0
[ot] scripts/opentitan: pyot: add MMU trace option.
rivos-eblot Apr 18, 2025
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
22 changes: 18 additions & 4 deletions docs/opentitan/darjeeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ any useful feature (only allow guest test code to execute as expected).

````sh
qemu-system-riscv32 -M ot-darjeeling,no_epmp_cfg=true -display none -serial mon:stdio \
-global ot-ibex_wrapper-dj.lc-ignore=on -kernel hello.elf
-global ot-ibex_wrapper.lc-ignore=on -kernel hello.elf
````
See the section "Useful execution options" for documentation about the `no_epmp_cfg` and
`ot-ibex_wrapper-dj.lc-ignore=on` option.
`ot-ibex_wrapper.lc-ignore=on` option.

### Boot sequence ROM, ROM_EXT, BLO

Expand Down Expand Up @@ -149,14 +149,14 @@ See [`tools.md`](tools.md)
to update the vCPU reset vector at startup. When this option is used, with `-kernel` option for
example, the application is loaded in memory but the default machine reset vector is used.

* `-global ot-ibex_wrapper-dj.lc-ignore=on` should be used whenever no OTP image is provided, or if
* `-global ot-ibex_wrapper.lc-ignore=on` should be used whenever no OTP image is provided, or if
the current LifeCycle state stored in the OTP image does not allow the Ibex core to fetch data.
This switch forces the Ibex core to execute whatever the LifeCycle broadcasted signal, which
departs from the HW behavior but maybe helpful to run the machine without a full OTP set up. The
alternative to allow the Ibex core to execute guest code is to provide a valid OTP image with one
of the expected LifeCycle state, such as TestUnlock*, Dev, Prod or RMA.

* `-global ot-ibex_wrapper-dj.lc-ignore-ids=<ids>` acts as `lc-ignore`, enabling the selection of
* `-global ot-ibex_wrapper.lc-ignore-ids=<ids>` acts as `lc-ignore`, enabling the selection of
specific ibex wrapper instance based on their unique identifiers. See `ot_id` property in the
machine definition file for a list of valid identifiers. `<ids>` should be defined as a comma-
separated list of valid identifiers. It is only possible to ignore LifeCycle states with this
Expand Down Expand Up @@ -205,6 +205,20 @@ virtual machine. It contains three ASCII chars `QMU` followed with a configurabl
the MSB, whose meaning is not defined. It can be any 8-byte value, and defaults to 0x0. To configure
this version field, use the `qemu_version` property of the Ibex Wrapper device.

There are two modes to handle address remapping, with different limitations:

- default mode: use an MMU-like implementation (via ot_vmapper) to remap addresses. This mode
enables to remap instruction accesses and data accesses independently, as the real HW. However,
due to QEMU limitations, addresses and mapped region sizes should be aligned and multiple of 4096
bytes, i.e. a standard MMU page size. This is the recommended mode.

- legacy mode: This mode has no address nor size limitations, however it cannot distinguish
instruction accesses from data accesses, which means that both kind of accesses must be defined
for each active remapping slot for the remapping to be enabled. Moreover it relies on MemoryRegion
aliasing and may not be as robust as the default mode. It is recommended to use the default mode
whenever possible. To enable this legacy mode, set the `alias-mode` property to true:
`-global ot-ibex_wrapper.alias-mode=true`

### OTBN

* `-global ot-otbn.logfile=<filename>` dumps executed instructions on OTBN core into the specified
Expand Down
21 changes: 21 additions & 0 deletions docs/opentitan/earlgrey.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,27 @@ See [`tools.md`](tools.md)
Note: MTD bus 2 is assigned to the internal controller with the embedded flash storage. See also
the SPI Host section.

### Ibex Wrapper

The `FPGA_INFO` register of the Ibex Wrapper device is used to report that the HW platform is a QEMU
virtual machine. It contains three ASCII chars `QMU` followed with a configurable _version_ field in
the MSB, whose meaning is not defined. It can be any 8-byte value, and defaults to 0x0. To configure
this version field, use the `qemu_version` property of the Ibex Wrapper device.

There are two modes to handle address remapping, with different limitations:

- default mode: use an MMU-like implementation (via ot_vmapper) to remap addresses. This mode
enables to remap instruction accesses and data accesses independently, as the real HW. However,
due to QEMU limitations, addresses and mapped region sizes should be aligned and multiple of 4096
bytes, i.e. a standard MMU page size. This is the recommended mode.

- legacy mode: This mode has no address nor size limitations, however it cannot distinguish
instruction accesses from data accesses, which means that both kind of accesses must be defined
for each active remapping slot for the remapping to be enabled. Moreover it relies on MemoryRegion
aliasing and may not be as robust as the default mode. It is recommended to use the default mode
whenever possible. To enable this legacy mode, set the `alias-mode` property to true:
`-global ot-ibex_wrapper.alias-mode=true`

### OTBN

* `-global ot-otbn.logfile=<filename>` output OTBN execution message to the specified logfile. When
Expand Down
9 changes: 7 additions & 2 deletions docs/opentitan/spidevflash.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

````text
usage: spidevflash.py [-h] -f FILE [-a ADDRESS] [-S SOCKET] [-R RETRY_COUNT]
[-T SYNC_TIME] [-r HOST] [-p PORT] [--log-udp UDP_PORT]
[-v] [-d]
[-T SYNC_TIME] [--idle DELAY] [-t] [-r HOST] [-p PORT]
[--log-udp UDP_PORT] [-v] [-d]

SPI device flasher tool.

Expand All @@ -21,6 +21,8 @@ options:
connection retry count (default: 1)
-T, --sync-time SYNC_TIME
synchronization max time (default: 5.0s)
--idle DELAY stay idle before establish connection
-t, --terminate terminate QEMU VM on completion
-r, --host HOST remote host name (default: localhost)
-p, --port PORT remote host TCP port (default: 8004)
--log-udp UDP_PORT Log to a local UDP logger
Expand Down Expand Up @@ -52,6 +54,9 @@ options:

* `-v` can be repeated to increase verbosity of the script, mostly for debug purpose.

* `--idle` wait for the specified delay in seconds before attempting a connection to the QEMU SPI
device socket

* `--log-udp` specify a UDP port on the local host to redirect log messages,

### Examples
Expand Down
12 changes: 4 additions & 8 deletions hw/opentitan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,7 @@ config OT_I2C_DJ
bool

config OT_IBEX_WRAPPER
bool

config OT_IBEX_WRAPPER_DJ
select OT_IBEX_WRAPPER
bool

config OT_IBEX_WRAPPER_EG
select OT_IBEX_WRAPPER
select OT_VMAPPER
bool

config OT_KMAC
Expand Down Expand Up @@ -167,4 +160,7 @@ config OT_UART
config OT_UNIMP
bool

config OT_VMAPPER
bool

source otbn/Kconfig
4 changes: 2 additions & 2 deletions hw/opentitan/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ system_ss.add(when: 'CONFIG_OT_GPIO_EG', if_true: files('ot_gpio_eg.c'))
system_ss.add(when: 'CONFIG_OT_HMAC', if_true: [files('ot_hmac.c'), libtomcrypt_dep])
system_ss.add(when: 'CONFIG_OT_I2C_DJ', if_true: files('ot_i2c_dj.c'))
system_ss.add(when: 'CONFIG_OT_IBEX_WRAPPER', if_true: files('ot_ibex_wrapper.c'))
system_ss.add(when: 'CONFIG_OT_IBEX_WRAPPER_DJ', if_true: files('ot_ibex_wrapper_dj.c'))
system_ss.add(when: 'CONFIG_OT_IBEX_WRAPPER_EG', if_true: files('ot_ibex_wrapper_eg.c'))
system_ss.add(when: 'CONFIG_OT_KMAC', if_true: [files('ot_kmac.c'), libtomcrypt_dep])
system_ss.add(when: 'CONFIG_OT_LC_CTRL', if_true: files('ot_lc_ctrl.c'))
system_ss.add(when: 'CONFIG_OT_MBX', if_true: files('ot_mbx.c'))
Expand Down Expand Up @@ -55,4 +53,6 @@ system_ss.add(when: 'CONFIG_OT_TIMER', if_true: files('ot_timer.c'))
system_ss.add(when: 'CONFIG_OT_UART', if_true: files('ot_uart.c'))
system_ss.add(when: 'CONFIG_OT_UNIMP', if_true: files('ot_unimp.c'))

riscv_ss.add(when: 'CONFIG_OT_VMAPPER', if_true: files('ot_vmapper.c'))

subdir('otbn')
56 changes: 46 additions & 10 deletions hw/opentitan/ot_aes.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* QEMU OpenTitan AES device
*
* Copyright (c) 2022-2024 Rivos, Inc.
* Copyright (c) 2022-2025 Rivos, Inc.
* Copyright (c) 2025 lowRISC contributors.
*
* Author(s):
Expand Down Expand Up @@ -256,6 +256,11 @@ struct OtAESState {
bool fast_mode;
};

struct OtAESClass {
SysBusDeviceClass parent_class;
ResettablePhases parent_phases;
};

#ifdef DEBUG_AES
static const char *ot_aes_hexdump(OtAESState *s, const uint8_t *buf,
size_t size)
Expand Down Expand Up @@ -1284,18 +1289,18 @@ static const MemoryRegionOps ot_aes_regs_ops = {
.impl.max_access_size = 4u,
};

static void ot_aes_reset(DeviceState *dev)
static void ot_aes_reset_enter(Object *obj, ResetType type)
{
OtAESState *s = OT_AES(dev);
OtAESRegisters *r = s->regs;
OtAESClass *c = OT_AES_GET_CLASS(obj);
OtAESState *s = OT_AES(obj);
OtAESEDN *e = &s->edn;
OtAESRegisters *r = s->regs;

timer_del(s->retard_timer);

g_assert(e->device);
g_assert(e->ep != UINT8_MAX);
if (c->parent_phases.enter) {
c->parent_phases.enter(obj, type);
}

s->prng = ot_prng_allocate();
timer_del(s->retard_timer);

memset(s->ctx, 0, sizeof(*s->ctx));
memset(r, 0, sizeof(*r));
Expand All @@ -1312,11 +1317,36 @@ static void ot_aes_reset(DeviceState *dev)
for (unsigned ix = 0; ix < PARAM_NUM_ALERTS; ix++) {
ibex_irq_set(&s->alerts[ix], 0);
}
}

static void ot_aes_reset_exit(Object *obj, ResetType type)
{
OtAESClass *c = OT_AES_GET_CLASS(obj);
OtAESState *s = OT_AES(obj);

if (c->parent_phases.exit) {
c->parent_phases.exit(obj, type);
}

qemu_bh_cancel(s->process_bh);

trace_ot_aes_reseed("reset");
ot_aes_handle_trigger(s);
}

static void ot_aes_realize(DeviceState *dev, Error **errp)
{
OtAESState *s = OT_AES(dev);
OtAESEDN *e = &s->edn;

(void)errp;

g_assert(e->device);
g_assert(e->ep != UINT8_MAX);

s->prng = ot_prng_allocate();
}

static void ot_aes_init(Object *obj)
{
OtAESState *s = OT_AES(obj);
Expand Down Expand Up @@ -1349,16 +1379,22 @@ static void ot_aes_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
(void)data;

device_class_set_legacy_reset(dc, &ot_aes_reset);
dc->realize = &ot_aes_realize;
device_class_set_props(dc, ot_aes_properties);
set_bit(DEVICE_CATEGORY_MISC, dc->categories);

ResettableClass *rc = RESETTABLE_CLASS(klass);
OtAESClass *ac = OT_AES_CLASS(klass);
resettable_class_set_parent_phases(rc, &ot_aes_reset_enter, NULL,
&ot_aes_reset_exit, &ac->parent_phases);
}

static const TypeInfo ot_aes_info = {
.name = TYPE_OT_AES,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(OtAESState),
.instance_init = &ot_aes_init,
.class_size = sizeof(OtAESClass),
.class_init = &ot_aes_class_init,
};

Expand Down
26 changes: 21 additions & 5 deletions hw/opentitan/ot_alert.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* QEMU OpenTitan Alert handler device
*
* Copyright (c) 2023-2024 Rivos, Inc.
* Copyright (c) 2023-2025 Rivos, Inc.
*
* Author(s):
* Emmanuel Blot <eblot@rivosinc.com>
Expand Down Expand Up @@ -237,6 +237,11 @@ struct OtAlertState {
uint8_t n_classes;
};

struct OtAlertClass {
SysBusDeviceClass parent_class;
ResettablePhases parent_phases;
};

/* clang-format off */
#define ST_NAME_ENTRY(_name_) [STATE_##_name_] = stringify(_name_)
#define ST_NAME(_st_) ((_st_) < ARRAY_SIZE(ST_NAMES) ? ST_NAMES[(_st_)] : "?")
Expand Down Expand Up @@ -955,7 +960,7 @@ static void ot_alert_fill_access_table(OtAlertState *s)
}

static Property ot_alert_properties[] = {
DEFINE_PROP_STRING("ot_id", OtAlertState, ot_id),
DEFINE_PROP_STRING(OT_COMMON_DEV_ID, OtAlertState, ot_id),
DEFINE_PROP_UINT16("n_alerts", OtAlertState, n_alerts, 0),
DEFINE_PROP_UINT8("n_lpg", OtAlertState, n_low_power_groups, 1u),
DEFINE_PROP_UINT8("n_classes", OtAlertState, n_classes, 4u),
Expand All @@ -973,11 +978,17 @@ static const MemoryRegionOps ot_alert_regs_ops = {
.impl.max_access_size = 4u,
};

static void ot_alert_reset(DeviceState *dev)
static void ot_alert_reset_enter(Object *obj, ResetType type)
{
OtAlertState *s = OT_ALERT(dev);
OtAlertClass *c = OT_ALERT_GET_CLASS(obj);
OtAlertState *s = OT_ALERT(obj);

if (c->parent_phases.enter) {
c->parent_phases.enter(obj, type);
}

for (unsigned ix = 0; ix < s->n_classes; ix++) {
qemu_bh_cancel(s->schedulers[ix].esc_releaser);
timer_del(&s->schedulers[ix].timer);
}

Expand Down Expand Up @@ -1150,16 +1161,21 @@ static void ot_alert_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
(void)data;

device_class_set_legacy_reset(dc, &ot_alert_reset);
dc->realize = &ot_alert_realize;
device_class_set_props(dc, ot_alert_properties);
set_bit(DEVICE_CATEGORY_MISC, dc->categories);

ResettableClass *rc = RESETTABLE_CLASS(klass);
OtAlertClass *ac = OT_ALERT_CLASS(klass);
resettable_class_set_parent_phases(rc, &ot_alert_reset_enter, NULL, NULL,
&ac->parent_phases);
}

static const TypeInfo ot_alert_info = {
.name = TYPE_OT_ALERT,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(OtAlertState),
.class_size = sizeof(OtAlertClass),
.class_init = &ot_alert_class_init,
};

Expand Down
Loading
Loading