Skip to content

Conversation

AlexJones0
Copy link
Contributor

@AlexJones0 AlexJones0 commented Oct 7, 2025

See the commit messages for more details - these PRs introduce the relevant opentitantool support for the RESET strapping used by tests (which already existed but just was not defined in the JSON file), and more importantly implements UART RX break for QEMU via the QEMU monitor to allow use of Rescue 1.0 (Serial Break) flows. This is particularly important for e.g. emulating ownership transfer flows via UART.

Note that the implementation of break goes through the QEMU Monitor and not the UART due to QEMU's lack of break support on different CharDev types. Also note that we use a custom implementation on top of these break events to support the toggling of RX break so that we can hold it down like a strap, as the ROM_EXT rescue protocol relies on reading the UART oversampling register to be able to detect serial breaks as rescue like a strap. See more relevant discussion here: lowRISC/qemu#212

To test that this works, this PR implements QEMU environments for all E2E boot service tests (not including ownership transfer, which is separate), except for the boot_service_wakeup test which is not expected to pass because of lacking low power entry/exit pwrmgr emulation in QEMU.

@AlexJones0 AlexJones0 requested review from a team and cfrantz as code owners October 7, 2025 14:41
@AlexJones0 AlexJones0 requested review from jwnrt, pamaury and ziuziakowska and removed request for a team and cfrantz October 7, 2025 14:42
These will be required to support using break for Serial Rescue 1.0 in
the ROM_EXT, as we need to mock values in the oversampled UART `VAL`
register based upon the transmission of break conditions via the QEMU
monitor, which when received are controlled by these properties.

Signed-off-by: Alex Jones <[email protected]>
If any QEMU devices need to hold a reference to the QEMU monitor then
dropping the QEMU transport could result in the monitor being used to
quit QEMU before the devices can cleanup on drop. Instead, quit QEMU via
the monitor when dropping the Monitor.

Signed-off-by: Alex Jones <[email protected]>
Some commands might need to supply optional arguments as some JSON
serialized string. Add an optional `arguments` field to the QEMU
Monitor's `send_cmd` function that supports this functionality.

Signed-off-by: Alex Jones <[email protected]>
This command can be used to send a UART break condition to a CharDev
identified by a given identifier.

Signed-off-by: Alex Jones <[email protected]>
TO support the requires use of Serial Break for rescue via reading the
UART's oversampled `VAL` register in the ROM_EXT, introduce a mechanism
that uses the QEMU monitor to send break conditions to the UART, which
are subsequently tracked by the QEMU UART device to mock the required
behaviour.

Signed-off-by: Alex Jones <[email protected]>
This commit only includes the non-ownership (activate, unlock) tests, as
the ownership tests are separated due to their need for more complicated
test infrastructure.

All tests are supported and passing in QEMU with the exception of the
`boot_service_wakeup` test, which is not expected to work, as QEMU's
pwrmgr currently does not model low power entry/exit.

Signed-off-by: Alex Jones <[email protected]>
@AlexJones0
Copy link
Contributor Author

This has a full passing QEMU CI regression run as well: https://github.com/lowRISC/qemu/actions/runs/18319254765
The sim_qemu_rom_ext E2E boot-service tests are not currently running in this regression, but you can check out this PR and run them manually, e.g.

./bazelisk.sh query //sw/device/silicon_creator/rom_ext/e2e/boot_svc:* | grep ".*sim_qemu.*" | xargs ./bazelisk.sh test --test_output=errors -t-

@AlexJones0 AlexJones0 merged commit 474d6ca into lowRISC:earlgrey_1.0.0 Oct 9, 2025
64 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants