Skip to content

Conversation

jwnrt
Copy link
Contributor

@jwnrt jwnrt commented Oct 2, 2025

Adds an interface to the GPIO block and enables bootstrapping.

Bootstrapping is fairly slow, so I have set up the exec env to skip it by default and load a pre-prepared drive. You can opt in by adding bootstrap = True to the qemu_params or manually bootstrapping in a test harness.

Currently blocked on a QEMU change.

@jwnrt jwnrt force-pushed the earlgrey-1.0.0-qemu-gpio branch 4 times, most recently from cceb1c8 to 8e93c3f Compare October 8, 2025 14:06
@jwnrt jwnrt requested a review from AlexJones0 October 8, 2025 16:05
Comment on lines 129 to 131
/// * `I:<value>`: the Inputs to the device's pads are now `<value>`.
/// * `M:<value>`: the inputs are Masked with `<value>`, meaning connected.
/// * `R:00000000`: ask QEMU to Repeat the last `d` and `o` frames (see [`process_frames`]).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could be clearer?

Suggested change
/// * `I:<value>`: the Inputs to the device's pads are now `<value>`.
/// * `M:<value>`: the inputs are Masked with `<value>`, meaning connected.
/// * `R:00000000`: ask QEMU to Repeat the last `d` and `o` frames (see [`process_frames`]).
/// * `I:<value>`: the inputs to the device's pads are now `<value>`, if driven.
/// * `M:<value>`: the inputs are masked with `<value>`, meaning driven/connected.
/// * `R:00000000`: ask QEMU to repeat the last `D` and `O` frames (see [`process_frames`]).

Copy link
Contributor

@AlexJones0 AlexJones0 Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed some of the last line here (extra spacing, and capitalization).

# If real bootstrapping is requested then prepare the correct command, otherwise we need
# to prepare a QEMU drive containing flash contents.
if param["bootstrap"] and json.decode(param["bootstrap"]):
test_script_fmt |= {"flash": ""}
Copy link
Contributor

@AlexJones0 AlexJones0 Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this maybe still prepare a blank flash image via flashgen, as presumably if we add info page splicing via flashgen in the future we will still want do this? This will also ensure that the flash image flows are the same for bootstrapping vs splicing firmware.

@jwnrt jwnrt force-pushed the earlgrey-1.0.0-qemu-gpio branch from 5f3e548 to 8555d22 Compare October 9, 2025 13:48
@jwnrt jwnrt marked this pull request as ready for review October 9, 2025 14:25
@jwnrt jwnrt requested review from cfrantz and a team as code owners October 9, 2025 14:25
@jwnrt jwnrt requested review from pamaury and removed request for a team and cfrantz October 9, 2025 14:25
jwnrt added 5 commits October 9, 2025 15:28
Includes fixes for GPIO over reset and SPI payload uploading.

Signed-off-by: James Wainwright <[email protected]>
@jwnrt jwnrt force-pushed the earlgrey-1.0.0-qemu-gpio branch from 8555d22 to de9b601 Compare October 9, 2025 14:28

mode: Cell<PinMode>,

/// Pull mod of the current pin.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Pull mod of the current pin.
/// Pull mode of the current pin.

if param["bootstrap"] and json.decode(param["bootstrap"]):
test_script_fmt |= {"flash": ""}
bootstrap_cmd = "bootstrap --clear-uart=true --reset-delay 1000ms {firmware}".format(**param)
param["bootstrap_cmd"] = '--exec="{}"'.format(bootstrap_cmd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a fail if we try to give a bootstrap = True when using a custom test harness?

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