Skip to content

Instantly share code, notes, and snippets.

@Artingl
Created January 27, 2026 21:42
Show Gist options
  • Select an option

  • Save Artingl/c5e7f9fbb0307f7c236e29e4f1fc1f8e to your computer and use it in GitHub Desktop.

Select an option

Save Artingl/c5e7f9fbb0307f7c236e29e4f1fc1f8e to your computer and use it in GitHub Desktop.
Changes in ans with newer firmware and M3

Changes in ans with newer firmware

Firstly, what is different?

When I tried to bring NVMe support on my M3 device, I found that there're references to ans3. I thought that this new coprocessor is M3 specific and is different from the previous ans2, which is why NVMe driver for my M3 was crashing in both m1n1 and linux. But I was pointed out that if you would use an M3 device on previous firmware versions, the same code used for ans2 would work no problem. And with newer version the older M1/M2 NVMe coprocessors also stopped working.

Thus, it is probable that the update for ans in this document would work on that devices too, but I cannot tell for sure since I only have an M3 device. So this is bound for checking.

Main differences

The only key differences I could spot are the register offsets. They're all different for the new ans3.

Here're all the register differences comparing to previous values:

Register Previous addresses New addresses working with M3/ans3
unknown_ctrl 0x24008 0x28130
linear_sq_ctrl 0x24908 0x2813c
db_linear_asq 0x2490c 0x2490c
db_linear_iosq 0x24910 0x24910

Also, I don't know if it is me doing something wrong, or the new ans is stricter with memory. I needed to allow 1TB address space in m1n1 for the new ans to properly initialize, otherwise it would crash.

sart_add_allowed_region(nvme_sart, (void *)0, 0x10000000000UL);

I am sure that's just wrong and needs to be done differently, so again it is bound for proper revision.

One last thing: in the m1n1 drive i updated the cmd.cdw12 value in the nvme_read function. The cmd.cdw12 now should contain 0 instead of 1. Without it the read commands were failing on my side. Found it on pure accident and also not sure whether it is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment