You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ot] hw/opentitan: ot_spi_device: simplify commands and slot matching
This commit simplifies command slot definitions and the associated state
and control flow.
The HW CFG and the HW STA commands have been combined into just HW
commands, as in flash mode they are handled in hardware by some way and
should therefore share the same data path. For passthrough mode, a
subset of these HW commands can be intercepted (all except for WREN and
WRDI).
As the matched command slot number determines whether the command is a
SW or HW command, the `OtSpiFlashCommand` enum has been removed in
favour of using `is_sw_command` to return the boolean.
Command slot matching has been brought out into its own function,
`match_command_slot`, which returns whether an opcode was matched in the
command info registers. The decoded slot number is only valid if this
returns true.
Also a bug is fixed in `ot_spi_device_exec_command` where hardcoded
opcodes for read commands were used instead of the opcodes in the
associated command slot.
Signed-off-by: Alice Ziuziakowska <[email protected]>
0 commit comments