lowRISC / lowRISC/opentitan

[qemu] Earlgrey 1.0.0 flash info splicing

Open
#28,665 0 comments 0 reactions 0 assignees View on GitHub
Component:QEMU SW:Build System
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

### Description

Follow-on from #28123.

Currently, there are no Bazel mechanisms to support correct splicing of flash info pages for tests which require some initial provisioned (or partially provisioned) starting point (see related issue #21225 for FPGA). As a non-silicon environment, QEMU is making use of the same workarounds as we use for FPGA, but ideally this would be supported so that we can more closely emulate silicon test flows using QEMU long-term.

Additionally, because QEMU does not currently implement flash scrambling, an additional property is used to disable the keymgr key integrity alerts on reading all-1 keys from the uninitialized, unscrambled flash info pages, as otherwise we cannot boot into owner code from ROM_EXT. When QEMU flash info page splicing is supported, this [related workaround](https://github.com/lowRISC/opentitan/blob/c46f0c09ec3eb58456d556495c9898c87ba008a4/rules/opentitan/qemu.bzl#L505-L507) can be removed.

Also, [QEMU](https://github.com/lowRISC/qemu/)'s flash image generation mechanism (`flashgen.py`) currently only supports splicing in arbitrary firmware images into data pages, and does not initialize any flash info page contents. As such, some QEMU development is also required on top of the Bazel support for spliced info pages.

Contributor guide

Open the contributing guide

Research direction

Start with rules/opentitan/qemu.bzl, especially the linked keymgr workaround, and review the approaches in issues #28123 and #21225. Then inspect QEMU's flashgen.py to understand its current data-page splicing. Done means Bazel and QEMU can initialize and splice flash info pages for Earlgrey tests, allowing the workaround to be removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.