Repository navigation
Conversation
jacmet
reviewed
Oct 19, 2026
rgantois
requested changes
Nov 18, 2026
rgantois
left a comment
Collaborator
There was a problem hiding this comment.
Hey Thomas, thanks a lot for the PR! I have one small change requested, and there's also the question from Peter which needs to be addressed. Apart from that, all good for me.
tprrt
force-pushed
the
dev/tprrt/th1520-recovery
branch
from
November 19, 2026 13:41
f5c9518 to
a5f9c63
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A critical issue swallows USB errors when writing reboot, allowing recovery to report success without starting the firmware; write failures must propagate and be covered by a test.
1 open issue
What changed in this PR
Adds TH1520 recovery to Snagrecover through the ROM’s USB Fastboot interface, with support tested on BeagleV-Ahead.
Changes:
- Downloads a combined SPL, OpenSBI and U-Boot image to the
rampseudo-partition, then starts it withreboot. - Registers TH1520 device discovery, USB permissions and recovery dispatch.
- Adds a board template, setup documentation and recovery-flow tests.
| File | Description |
|---|---|
tests/recovery_th1520.py |
Tests command sequencing and reboot/flash error handling. |
src/snagrecover/utils.py |
Routes TH1520 recovery to the new implementation. |
src/snagrecover/templates/th1520-beaglev-ahead.yaml |
Provides the BeagleV-Ahead firmware configuration. |
src/snagrecover/supported_socs.yaml |
Lists TH1520 as tested. |
src/snagrecover/recoveries/th1520.py |
Connects to the USB device and launches firmware recovery. |
src/snagrecover/firmware/firmware.py |
Implements the Fastboot download and startup sequence. |
src/snagrecover/config.py |
Adds the TH1520 ROM USB identifier. |
src/snagrecover/50-snagboot.rules |
Grants user access to the TH1520 USB device. |
README.md |
Adds TH1520 to the supported SoC families. |
docs/snagrecover.md |
Documents USB download mode and firmware requirements. |
Review effort: Balanced
The ROM code of the TH1520 exposes a Fastboot interface in USB download mode (2345:7654). Download the image holding SPL, OpenSBI and U-Boot to the "ram" pseudo-partition and start it with "reboot". SPL initializes the DRAM, so no other boot stage is needed. Tested on a BeagleV-Ahead with the vendor U-Boot SPL. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
tprrt
force-pushed
the
dev/tprrt/th1520-recovery
branch
from
November 19, 2026 15:29
a5f9c63 to
af42ef0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The ROM code of the TH1520 exposes a Fastboot interface in USB download mode (2345:7654). Download the image holding SPL, OpenSBI and U-Boot to the "ram" pseudo-partition and start it with "reboot". SPL initializes the DRAM, so no other boot stage is needed.
Tested on a BeagleV-Ahead with the vendor U-Boot SPL.