Skip to content

snagrecover: imx: add support for the i.MX95 - #93

Merged
rgantois merged 1 commit into
bootlin:mainfrom
YanAkkI2S:imx95
Sep 3, 2026
Merged

rgantois merged 1 commit into
bootlin:mainfrom
YanAkkI2S:imx95

Conversation

@YanAkkI2S

Copy link
Copy Markdown
Contributor

This adds i.MX95 recovery support, tested on a Variscite DART-MX95 (full ROM → SPL → U-Boot).

It was first modelled on the i.MX91/93 but the i.MX95 needs a bit more:

  1. Its boot ROM expects the SDPS stream on a dedicated interrupt OUT endpoint, which the hidraw backend can't target, so HIDDevice gets a prefer_libusb flag (only set for the i.MX95, so nothing else changes path, but any future SoC that needs the same can simply opt in the same way).
  2. The boot image uses "v2" containers (larger alignment + a V2X tag), so get_container_size() now handles those as well.
  3. Like the i.MX8QM it's a two-stage flow (SDPS to the ROM, then SDPV to the SPL), and the ROM re-enumerates once it has consumed the first container.

I don't have other i.MX9 / i.MX8Q boards on hand, but the HID backend change is gated on the SoC, so existing devices keep their exact current behaviour.

@rgantois rgantois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi, thanks a lot for the contribution! I've requested a few changes and asked some questions in the review. In addition to these, please remove the first commit which merges main into your feature branch. What you should do instead is rebase your feature branch onto main (without the merge commit) and then force push.

Comment thread src/snagrecover/firmware/rom_container.py Outdated
Comment thread src/snagrecover/protocols/hid.py
Comment thread src/snagrecover/protocols/hid.py Outdated
Comment thread src/snagrecover/protocols/fastboot.py Outdated

@rgantois rgantois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Almost good, just one last point to address.

Comment thread src/snagrecover/protocols/hid.py Outdated
Comment thread src/snagrecover/protocols/hid.py Outdated
@UVV-gh

UVV-gh commented Jul 24, 2026 •

Copy link
Copy Markdown

I'd like to try this out. Which build artifacts you placed into flash.bin file? Is it only imx-boot file which is needed?

This is what I got so far:

$ snagrecover -f ~/projects/snagboot/src/snagrecover/templates/imx95-dart-mx95.yaml -s imx95
[INFO] Starting recovery of imx95 board
[WARNING] Failed to get configuration descriptor for device at 1-3.3!

Any suggestions?

Update, nevermind, seems to be a permission issue.

@UVV-gh

UVV-gh commented Jul 27, 2026

Copy link
Copy Markdown

I guess what I'm missing here is the actual steps I need to do to perform the flashing. At least the uuu gives a clear documentation on how to flash the emmc for example. I couldn't find how to do it with the snagflash :(

What I did so far is flashed the imx-boot image, and I see that the board is in the fastboot mode.

@YanAkkI2S
YanAkkI2S force-pushed the imx95 branch 2 times, most recently from a2049d0 to a35e051 Compare August 18, 2026 13:06
@YanAkkI2S
YanAkkI2S requested a review from rgantois August 18, 2026 13:37
@YanAkkI2S

Copy link
Copy Markdown
Contributor Author

I guess what I'm missing here is the actual steps I need to do to perform the flashing. At least the uuu gives a clear documentation on how to flash the emmc for example. I couldn't find how to do it with the snagflash :(

What I did so far is flashed the imx-boot image, and I see that the board is in the fastboot mode.

@UVV-gh Hey sorry for the delay, i was on vacation 😅 So here's the full sequence i'm doing :

  • boot in recovery mode first

lsusb (you have to see 1fc9:015d)
snagrecover -s imx95 -f imx95-dart-mx95.yaml --loglevel info
lsusb (you have to see 1fc9:0152)

  • i think you already arrived at least to this step, and next:

snagflash -P fastboot-uboot -p 1fc9:0152 -I flash-cmds.txt --loglevel info

  • flash-cmds.txt is a file you create to not type the commands everytime such as:

set target mmc0
set fb-addr 0x92800000
flash /path/to/image.rootfs.wic.zst 0

And yes, imx-boot is the only file snagrecover needs

Signed-off-by: AKKOUCHE Yanis <y.akkouche@i2s.fr>
@rgantois

rgantois commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Looks good to me, thanks a lot!

@rgantois
rgantois merged commit 2c5c3cc into bootlin:main Sep 3, 2026
11 checks passed
@YanAkkI2S
YanAkkI2S deleted the imx95 branch September 4, 2026 09:24
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.

3 participants