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
30 changes: 21 additions & 9 deletions docs/opentitan/otptool.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ controller virtual device.
## Usage

````text
usage: otptool.py [-h] [-j HJSON] [-m VMEM] [-l SV] [-o C] [-r RAW]
usage: otptool.py [-h] [-j HJSON] [-m VMEM] [-l SV] [-o FILE] [-r RAW]
[-k {auto,otp,fuz}] [-e BITS] [-C CONFIG] [-c INT] [-i INT]
[-w] [-n] [-s] [-E] [-D] [-U] [--empty PARTITION]
[-w] [-n] [-f PART:FIELD] [--no-version] [-s] [-E] [-D] [-U]
[--empty PARTITION] [--erase PART:FIELD]
[--clear-bit CLEAR_BIT] [--set-bit SET_BIT]
[--toggle-bit TOGGLE_BIT] [--fix-ecc]
[-G {LCVAL,LCTPL,PARTS,REGS}] [-v] [-d]
Expand All @@ -22,7 +23,7 @@ Files:
-j, --otp-map HJSON input OTP controller memory map file
-m, --vmem VMEM input VMEM file
-l, --lifecycle SV input lifecycle system verilog file
-o, --output C output filename for C file generation
-o, --output FILE output filename (default to stdout)
-r, --raw RAW QEMU OTP raw image file

Parameters:
Expand All @@ -34,6 +35,9 @@ Parameters:
-i, --iv INT initialization vector for Present scrambler
-w, --wide use wide output, non-abbreviated content
-n, --no-decode do not attempt to decode OTP fields
-f, --filter PART:FIELD
filter which OTP fields are shown
--no-version do not report the OTP image version

Commands:
-s, --show show the OTP content
Expand All @@ -42,6 +46,7 @@ Commands:
-U, --update update RAW file after ECC recovery or bit changes
--empty PARTITION reset the content of a whole partition, including its
digest if any
--erase PART:FIELD clear out an OTP field
--clear-bit CLEAR_BIT
clear a bit at specified location
--set-bit SET_BIT set a bit at specified location
Expand Down Expand Up @@ -106,6 +111,9 @@ Fuse RAW images only use the v1 type.
* `-e` specify how many bits are used in the VMEM file to store ECC information. Note that ECC
information is not stored in the QEMU RAW file for now.

* `-f` select which partition(s) and partition field(s) should be shown when option `-s` is used.
When not specified, all partitions and fields are reported.

* `-i` specify the initialization vector for the Present scrambler used for partition digests.
This value is "usually" found within the `hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv` OT file,
from the last entry of `RndCnstDigestIV` array, _i.e._ item 0. It is used along with option
Expand Down Expand Up @@ -152,13 +160,20 @@ Fuse RAW images only use the v1 type.
contain long sequence of bytes. If repeated, the empty long fields are also printed in full, as
a sequence of empty bytes.

* `--clear-bit` clears the specified bit in the OTP data. This flag may be repeated. This option is
only intended to corrupt the OTP content so that HW & SW behavior may be exercised should such
a condition exists. See [Bit position syntax](#bit-syntax) for how to specify a bit.

* `--empty` reset a whole parition, including its digest if any and ECC bits. This option is only
intended for test purposes. This flag may be repeated. Partition(s) can be specified either by
their index or their name.

* `--clear-bit` clears the specified bit in the OTP data. This flag may be repeated. This option is
only intended to corrupt the OTP content so that HW & SW behavior may be exercised should such
a condition exists. See [Bit position syntax](#bit-syntax) for how to specify a bit.
* `--erase` reset a specific field within a partition. The flag may be repeated.

* `--no-version` disable OTP image version reporting when `-s` is used.

* `--fix-ecc` may be used to rebuild the ECC values for all slots that have been modified using the
ECC modification operations, and any detected error.

* `--set-bit` sets the specified bit in the OTP data. This flag may be repeated. This option is
only intended to corrupt the OTP content so that HW & SW behavior may be exercised should such
Expand All @@ -168,9 +183,6 @@ Fuse RAW images only use the v1 type.
is only intended to corrupt the OTP content so that HW & SW behavior may be exercised should such
a condition exists. See [Bit position syntax](#bit-syntax) for how to specify a bit.

* `--fix-ecc` may be used to rebuild the ECC values for all slots that have been modified using the
ECC modification operations, and any detected error.

All modification features can only be performed on RAW image, VMEM images are never modified. To
modify RAW file content, either a VMEM file is required in addition to the RAW file as the data
source, or the `-U` is required to tell that the RAW file should be read, modified and written back.
Expand Down
15 changes: 15 additions & 0 deletions docs/opentitan/pyot.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ Sample config for running some non-OpenTitan tests:
timeout: 3
machine: ot-earlgrey,no_epmp_cfg=true
}
virtual:
{
ot-flash: ${BASEDIR}/flash.raw
}
# It would be nice if ELF files could have an .elf extension w/ Cargo
# Let's include everything and exclude non-ELF files
include:
Expand Down Expand Up @@ -395,6 +399,15 @@ Sample config for running some non-OpenTitan tests:
The option names are the same ones as the script option switches, please refer to the Usage
section for details.

* `virtual`
This section defines virtual tests, as a mapping.
Each entry defines the name of the virtual test to create and the actual test binary to execute.

This enables testing the same binary in multiple configurations, using different options and
settings.

Virtual tests can be filtered and configured as any regular tests.

* `include`
This section contains the list of tests to be run.

Expand Down Expand Up @@ -422,6 +435,8 @@ Sample config for running some non-OpenTitan tests:

Note that `include_from` (and `exclude_from`) do not support globalization patterns (`*` and `?`).

Virtual tests cannot be specified in `include_from`, nor `exclude_from` files.

* `exclude`
This section contains the list of tests not to be run.

Expand Down
10 changes: 5 additions & 5 deletions hw/jtag/tap_ctrl_rbb.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,18 @@ static void tap_ctrl_rbb_tap_reset(TapCtrlRbbState *tap)

static void tap_ctrl_rbb_system_reset(TapCtrlRbbState *tap)
{
Object *mc = qdev_get_machine();
ObjectClass *oc = object_get_class(mc);
Object *ms = qdev_get_machine();
ObjectClass *mc = object_get_class(ms);
(void)tap;

if (!object_class_dynamic_cast(oc, TYPE_RESETTABLE_INTERFACE)) {
if (!object_class_dynamic_cast(mc, TYPE_RESETTABLE_INTERFACE)) {
qemu_log_mask(LOG_UNIMP, "%s: Machine %s is not resettable\n", __func__,
object_get_typename(mc));
object_get_typename(ms));
return;
}

trace_tap_ctrl_rbb_system_reset();
resettable_reset(mc, RESET_TYPE_COLD);
resettable_reset(ms, RESET_TYPE_COLD);
}

static TAPState tap_ctrl_rbb_get_next_state(TapCtrlRbbState *tap, bool tms)
Expand Down
Loading
Loading