feat: add async USB, D21x boot chain and board presets #25
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This can be considered as a separate peripheral, like struct ClintV2 or other names according to its core vendor (like struct THeadClint). Consider using separate structs instead of config features, in case that we don't have to switch between features when run cargo tests or cargo checks.
Is this trait necessary? What will happen if we don't introduce extra interrupt controller traits?
Approved these changes.
LGTM with minor modifications :)
LGTM with minor modifications :)
Splited Clint into ClintV1 and ClintV1 and removed redundant InterruptController trait in latest branch.
luojia65
NanaHigh
Summary
This PR turns the existing D13x SPI-NOR boot path into a multi-media boot
chain, adds async USB upgrade support, introduces a typed DDR driver and
makes firmware packaging board-driven.
It is not only a HAL refactor: the main additions are D21x SPI-NAND boot,
async runtime support, QSPI DMA/quad transfers, retry-safe upgrade storage,
board presets and automatic raw application image generation (not just PBP).
What's new
Multi-media boot chain
DMA channel selection.
Async USB upgrade
ignored.
DDR support
QSPI and flash storage
host can retry.
Board presets and image packaging
AIC.FWimage and a raw NOR/NAND image fordirect flash programming.
Runtime and interrupts
D21x interrupts.
Before / After
| Area | Before | After |
|---|---|---|
| Boot media | D13x SPI-NOR mainly | D13x NOR + D21x NAND |
| Bootloader | Chip-coupled media setup | Media-selected storage backends |
| USB | Existing blocking upgrade path | Async USB upgrade stack |
| Runtime | PBP/app entry only | PBP + app + bootloader entries |
| DDR | No HAL DDR module | Typed DDR bring-up and profiles |
| QSPI | Basic transfer support | DMA + quad transfers |
| Packaging | Per-app TOML/manifest | Board presets + raw images |
| Storage errors | Flush failures ignored | Failures propagated and retryable |
Usage
Build a complete image from a board preset:
Build the boot chain only:
The normal image is for AiBurn/USB upgrade. The generated raw image is for
direct flash programming.
Hardware validation
PBP Dram demo
<img width="467" height="88" alt="07b1e22c82acbbb978e693530f611b94" src="https://github.com/user-attachments/assets/0357fb01-9725-4c5a-9090-13a5611c5d8f" />
D13x NOR quad+dma
<img width="642" height="294" alt="41c591b83a5ffc095f3ee4591fa920c8" src="https://github.com/user-attachments/assets/ced4185f-0442-46ec-82de-e8d5e0ed47c2" />
D21x NAND quad+dma
<img width="634" height="337" alt="b8688cd670e418be33016cd862daabd2" src="https://github.com/user-attachments/assets/604822f6-1fe4-4323-a043-d4bed1e17186" />
[Rx][timestamp]is added by serial port debugging software.Review approach
The PR is intentionally split by subsystem and capability:
Reviewing commit by commit is recommended; the final tree is the validated
configuration.