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
17 changes: 13 additions & 4 deletions docs/opentitan/earlgrey.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Supported version

EarlGrey 2.5.2-RC0
[Earlgrey 1.0.0](https://github.com/lowRISC/opentitan/tree/earlgrey_1.0.0)

## Supported features

Expand All @@ -20,6 +20,9 @@ EarlGrey 2.5.2-RC0
* AON Timer
* CSRNG
* EDN
* Flash controller
* missing ECCs/ICVs, scrambling functionality and alerts
* no modelling of erase suspend
* HMAC
* OTBN
* missing side-loading
Expand All @@ -39,8 +42,6 @@ Devices in this group implement subset(s) of the real HW.
* Manage clock dividers, groups, hints, software configurable clocks
* Propagate clock signals from source (AST, ...) to devices
* Hint management and measurement are not implemented
* Flash controller
* read-only features only
* OTP controller
* read-only features only, ECC is ignored
* Entropy Src
Expand All @@ -53,6 +54,7 @@ Devices in this group implement subset(s) of the real HW.
from Power Manager
* KMAC
* Side loading is not supported
* Masking is not supported
* [ROM controller](rom_ctrl.md)
* SRAM controller
* Initialization and scrambling with dummy key supported
Expand All @@ -77,10 +79,17 @@ features are implemented.

Devices in this group are mostly implemented with a RAM backend or real CSRs but do not implement
any useful feature (only allow guest test code to execute as expected).
Some just use generic `UNIMP` devices to define a memory region.

* Analog Sensor Top
* I2C
* Key manager
* Pattern Generator
* Pinmux
* Sensor
* PWM
* Sensor Control
* System Reset Controller
* USB Device

## Running the virtual machine

Expand Down
6 changes: 5 additions & 1 deletion hw/opentitan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ config OT_DMA
config OT_EDN
bool

config OT_ENTROPY_SRC
config OT_ENTROPY_SRC_EG
select OT_RANDOM_SRC
bool

config OT_ENTROPY_SRC_DJ
select OT_RANDOM_SRC
bool

Expand Down
3 changes: 2 additions & 1 deletion hw/opentitan/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ system_ss.add(when: 'CONFIG_OT_DEV_PROXY', if_true: files('ot_dev_proxy.c'))
system_ss.add(when: 'CONFIG_OT_DM_TL', if_true: files('ot_dm_tl.c'))
system_ss.add(when: 'CONFIG_OT_DMA', if_true: [files('ot_dma.c'), libtomcrypt_dep])
system_ss.add(when: 'CONFIG_OT_EDN', if_true: files('ot_edn.c'))
system_ss.add(when: 'CONFIG_OT_ENTROPY_SRC', if_true: [files('ot_entropy_src.c'), libtomcrypt_dep])
system_ss.add(when: 'CONFIG_OT_ENTROPY_SRC_DJ', if_true: [files('ot_entropy_src_dj.c'), libtomcrypt_dep])
system_ss.add(when: 'CONFIG_OT_ENTROPY_SRC_EG', if_true: [files('ot_entropy_src_eg.c'), libtomcrypt_dep])
system_ss.add(when: 'CONFIG_OT_FLASH', if_true: files('ot_flash.c'))
system_ss.add(when: 'CONFIG_OT_GPIO_DJ', if_true: files('ot_gpio_dj.c'))
system_ss.add(when: 'CONFIG_OT_GPIO_EG', if_true: files('ot_gpio_eg.c'))
Expand Down
14 changes: 13 additions & 1 deletion hw/opentitan/ot_clkmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ struct OtClkMgrState {
char *cfg_swcg;
/* list of software-hintable groups */
char *cfg_hint;
uint8_t version;
};

/*
Expand Down Expand Up @@ -1129,7 +1130,15 @@ static void ot_clkmgr_write(void *opaque, hwaddr addr, uint64_t val64,
s->regs[reg] &= val32;
break;
case R_JITTER_ENABLE:
if (s->regs[R_JITTER_REGWEN]) {
if (s->regs[R_JITTER_REGWEN] ||
s->version == OT_CLKMGR_VERSION_EG_1_0_0) {
if (s->version == OT_CLKMGR_VERSION_EG_1_0_0) {
qemu_log_mask(
LOG_GUEST_ERROR,
"%s: JITTER_ENABLE should be protected w/ REGWEN,\n"
"but is allowed due to a known bug in Earlgrey 1.0.0\n",
__func__);
}
val32 &= R_JITTER_ENABLE_VAL_MASK;
s->regs[reg] = val32;
} else {
Expand Down Expand Up @@ -1265,6 +1274,7 @@ static Property ot_clkmgr_properties[] = {
DEFINE_PROP_STRING("groups", OtClkMgrState, cfg_groups),
DEFINE_PROP_STRING("swcg", OtClkMgrState, cfg_swcg),
DEFINE_PROP_STRING("hint", OtClkMgrState, cfg_hint),
DEFINE_PROP_UINT8("version", OtClkMgrState, version, UINT8_MAX),
DEFINE_PROP_END_OF_LIST(),
};

Expand Down Expand Up @@ -1322,6 +1332,8 @@ static void ot_clkmgr_realize(DeviceState *dev, Error **errp)
g_assert(s->clock_src);
OBJECT_CHECK(IbexClockSrcIf, s->clock_src, TYPE_IBEX_CLOCK_SRC_IF);

g_assert(s->version < OT_CLKMGR_VERSION_COUNT);

ot_clkmgr_parse_top_clocks(s, &error_fatal);
unsigned top_count = g_list_length(s->clocks);
qdev_init_gpio_in_named(DEVICE(s), &ot_clkmgr_clock_input, "clock-in",
Expand Down
Loading