Free firmware for SpacemiT K1 and Spacemit K3

I have mentioned about ore-edk-boot-opi before, which claims to boot OrangePi R2S and OrangePi RV2 having SpacemiT K1 (sold as Ky X1), including RAM initialization, without proprietary blobs.

But now there is at least one more project. Mr Thalles Campagnani shared his clean room reverse engineering efforts for all of the blobs in both SpacemiT K1 and SpacemiT K3. His reference device for SpacemiT K1 was Banana Pi BPI-F3. Here are the links for SpacemiT K1 repositories.

What do you think of those projects? It looks like Purism’s prospects to liberate every bit of Librem 5 v2 up to the RYF standards are much brighter than I first thought.

Well, that was fast. Here are the links for SpacemiT K3:

So, what do you think about this reverse-engeering project?

The work to free the GPU firmware is very impressive. They don’t give any details about their “dirty team” and I wonder if they have some insider who has access to confidential information who is feeding them info.

It wouldn’t surprise me if someone working at SpacemiT is the source of the info for the dirty team, but they are doing this in a way that gives them deniability. It makes sense when you look at SpacemiT’s stated mission. If they want their chips to be able to work on all the standard Linux distros, they need this to happen.

On the other hand, there might be some really smart guys in Brazil, who are very good at reverse engineering, and they are figuring all of this out on their own.

However, it is happening, it makes me very happy to see it, and it makes me a lot more optimistic about the Librem 5 v2 now that we know that it will be using the K3.

OK, but Purism says in the RSS feed

Purism today announced a partnership with SpacemiT that gives Purism advanced access to the SpacemiT K3 processor for the upcoming Librem 5 v2.

so … maybe a partnership means that they don’t need some “insider” “feeding them” “confidential info”. Maybe SpacemiT actually wants this to work.

Do you mean that it is likely that the partnership with SpacemiT means that Purism as a customer of SpacemiT is granted access to the confidential documentation shared by the blobs’ vendors with SpacemiT in order to design Librem 5 v2? In such a case, Purism would be bound by the terms of those vendors, which usually forbid reverse-engineering. Instead, if someone produces a specification for the blobs, a free alternative could be legally produced from scratch by someone else not bound by such terms, which is what NoBlobs project declares doing.

I have no idea. I was just pointing out that Purism chose to use the word “partnership”, which to me implies that both parties get something out of it.

You took the words out of my mouth. :wink:

It is clear from SpacemiT’s announced goal that its chips would be able to run in the major Linux distros with mainline Linux that it wants FOSS drivers and firmware to be created for the K1 and K3. However, it signed contracts with Imagination to use its GPUs and ARM China to use its VPUs, and the terms of those contracts probably prohibit SpacemiT from creating those FOSS drivers and firmware. If SpacemiT is giving special info to Purism about the GPU or VPU, Purism probably would have to sign a contract with the same restrictions, and I doubt that Purism would sign such a contract since it has publicly stated that intends to reverse engineer the blobs.

I suspect what happened is that SpacemiT had no leverage as an unknown startup, so it had to accept the terms that Imagination would offer it with the GPU in the K1. It was the company’s first chip and surviving is the primary goal of a startup. However, when SpacemiT designed the K3, it had a bit more leverage as an established chipmaker that had proven that it could design an SoC. I suspect that SpacemiT negotiated with Imagination that it would only use the BXM-4-64 if Imagination released a FOSS driver for it. Imagination released the FOSS driver, but I suspect that it hid most of the details about its GPU in the proprietary firmware because it wants to limit its exposure to patent lawsuits.

Imagination has long been known as the least open graphics company since there were no FOSS divers for its GPUs, so I don’t think Imagination would have released the Mesa driver for the BXM-4-64 unless it was pressured to do it. However, now it has clients who are very different than Apple, and they want their hardware to run in Linux.

If Thalles Campagnani and his friends were really just some random students from Belo Horizonte, Brazil, I suspect that they would publish all their names and talk publicly about how they are figuring out how the firmware works. It is a really impressive feat and takes a lot of work to dissassemble a blob with a tool like Ghidra and watch the input and output of the GPU to verify what that firmware does and document it.

The facts all suggest that SpacemiT is behind this:

  1. we only know Campagnani’s name, and he is a student in country where it would be hard to sue him,
  2. they are very careful to separate the secret “dirty team” from the “clean team”, which is the legal way to reverse engineer,
  3. they are only focusing on reverse engineering the components used by one company’s processors,
  4. they seem to be making very rapid progress on a lot of components at once

Looking at all the blobs currently required to use the K1 and K3, I doubt that Purism would have chosen these chips if it hadn’t known that reverse engineering the blobs would be possible because No Blobs is going to document how the components work.

If SpacemiT is behind this, then I say more power to them, and I’m glad Purism partnered with them. However, even if SpacemiT has nothing to do with No Blobs, I still like the company because it wants its chips to run on mainline Linux in the major distros. I wish that there were more companies like that.