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
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ F: pc-bios/vof*
RISC-V Machines
---------------

Earlgrey OpenTitan platform
EarlGrey OpenTitan platform
M: Emmanuel Blot <eblot@rivosinc.com>
M: Loïc Lefort <loic@rivosinc.com>
S: Supported
Expand Down
2 changes: 1 addition & 1 deletion docs/opentitan/checkregs.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ options:

### Examples

* All Earlgrey register files have been copied into `opentitan/regs-251rc1`
* All EarlGrey register files have been copied into `opentitan/regs-251rc1`

````sh
scripts/opentitan/checkregs.py -k -q hw/opentitan ~/opentitan/regs-251rc1/*.h
Expand Down
2 changes: 1 addition & 1 deletion docs/opentitan/earlgrey.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Earlgrey CW310
# EarlGrey CW310

## Supported version

Expand Down
2 changes: 1 addition & 1 deletion docs/opentitan/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ ninja qemu-img
## Supported platforms

* [IbexDemo](ibexdemo.md) built for Digilent Arty7 board
* [Earlgrey](earlgrey.md) build for CW310 "Bergen" board
* [EarlGrey](earlgrey.md) build for CW310 "Bergen" board
8 changes: 4 additions & 4 deletions hw/opentitan/ot_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,8 @@ static uint64_t ot_aes_read(void *opaque, hwaddr addr, unsigned size)
case R_DATA_IN_3:
case R_TRIGGER:
qemu_log_mask(LOG_GUEST_ERROR,
"W/O register 0x%02" HWADDR_PRIx " (%s)\n", addr,
REG_NAME(reg));
"%s: W/O register 0x%02" HWADDR_PRIx " (%s)\n", __func__,
addr, REG_NAME(reg));
val32 = 0u;
break;
case R_IV_0:
Expand Down Expand Up @@ -1085,8 +1085,8 @@ static void ot_aes_write(void *opaque, hwaddr addr, uint64_t val64,
case R_DATA_OUT_3:
case R_STATUS:
qemu_log_mask(LOG_GUEST_ERROR,
"R/O register 0x%02" HWADDR_PRIx " (%s)\n", addr,
REG_NAME(reg));
"%s: R/O register 0x%02" HWADDR_PRIx " (%s)\n", __func__,
addr, REG_NAME(reg));
break;
case R_KEY_SHARE0_0:
case R_KEY_SHARE0_1:
Expand Down
2 changes: 1 addition & 1 deletion hw/opentitan/ot_csrng.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ static bool ot_csrng_expedite_uninstantiation(OtCSRNGInstance *inst)
static void ot_csrng_handle_enable(OtCSRNGState *s)
{
/*
* As per Earlgrey 2.5.2-rc0:
* As per EarlGrey 2.5.2-rc0:
* "CSRNG may only be enabled if ENTROPY_SRC is enabled. CSRNG may only be
* disabled if all EDNs are disabled. Once disabled, CSRNG may only be
* re-enabled after ENTROPY_SRC has been disabled and re-enabled."
Expand Down
16 changes: 13 additions & 3 deletions hw/opentitan/ot_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,16 @@ REG32(RD_FIFO, 0x1b4u)
BANK_INFO_PAGE_CFG_SCRAMBLE_EN_MASK | \
BANK_INFO_PAGE_CFG_ECC_EN_MASK | \
BANK_INFO_PAGE_CFG_HE_EN_MASK)
#define MP_REGION_CFG_MASK \
(MP_REGION_CFG_RD_EN_MASK | \
MP_REGION_CFG_PROG_EN_MASK | \
MP_REGION_CFG_ERASE_EN_MASK | \
MP_REGION_CFG_SCRAMBLE_EN_MASK | \
MP_REGION_CFG_ECC_EN_MASK | \
MP_REGION_CFG_HE_EN_MASK)
#define MP_REGION_MASK \
(MP_REGION_BASE_MASK | \
MP_REGION_SIZE_MASK)
#define CONTROL_MASK \
(R_CONTROL_START_MASK | \
R_CONTROL_OP_MASK | \
Expand Down Expand Up @@ -1157,7 +1167,7 @@ static void ot_flash_regs_write(void *opaque, hwaddr addr, uint64_t val64,
case R_MP_REGION_CFG_7:
if (ot_flash_regs_is_wr_enabled(s, reg - R_MP_REGION_CFG_0 +
R_REGION_CFG_REGWEN_0)) {
val32 &= BANK_INFO_PAGE_CFG_MASK;
val32 &= MP_REGION_CFG_MASK;
s->regs[reg] = val32;
}
break;
Expand All @@ -1171,12 +1181,12 @@ static void ot_flash_regs_write(void *opaque, hwaddr addr, uint64_t val64,
case R_MP_REGION_7:
if (ot_flash_regs_is_wr_enabled(s, reg - R_MP_REGION_0 +
R_REGION_CFG_REGWEN_0)) {
val32 &= BANK_INFO_PAGE_CFG_MASK;
val32 &= MP_REGION_MASK;
s->regs[reg] = val32;
}
break;
case R_DEFAULT_REGION:
val32 &= BANK_INFO_PAGE_CFG_MASK;
val32 &= MP_REGION_CFG_MASK;
s->regs[reg] = val32;
break;
case R_BANK0_INFO0_PAGE_CFG_0:
Expand Down
19 changes: 6 additions & 13 deletions hw/opentitan/ot_kmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,12 +1444,7 @@ void ot_kmac_connect_app(OtKMACState *s, unsigned app_idx,
const OtKMACAppCfg *cfg, ot_kmac_response_fn fn,
void *opaque)
{
if (app_idx >= s->num_app) {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Ignoring connection to invalid app index %u\n",
__func__, app_idx);
return;
}
g_assert(app_idx < s->num_app);

OtKMACApp *app = &s->apps[app_idx];

Expand Down Expand Up @@ -1515,12 +1510,7 @@ static void ot_kmac_start_pending_app(OtKMACState *s)
void ot_kmac_app_request(OtKMACState *s, unsigned app_idx,
const OtKMACAppReq *req)
{
if (app_idx >= s->num_app) {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Ignoring connection to invalid app index %u\n",
__func__, app_idx);
return;
}
g_assert(app_idx < s->num_app);

OtKMACApp *app = &s->apps[app_idx];

Expand Down Expand Up @@ -1609,8 +1599,11 @@ static void ot_kmac_realize(DeviceState *dev, Error **errp)
{
OtKMACState *s = OT_KMAC(dev);

/* make sure num-app property is set */
g_assert(s->num_app > 0);

/* make sure we don't overflow pending_apps bitmask */
g_assert(s->num_app < 32);
g_assert(s->num_app <= 32);

s->apps = g_new0(OtKMACApp, s->num_app);
}
Expand Down
Loading