Open source ? Really?

I might be completely wrong and I start with apologizing in advance if that is the case. But.
I’ve spent some time digging in middleware folder of SDK and there are ONLY binary blobs (.a and .so) there for multimedia components. The same goes for fsbl as I assume and probably for a lot of other stuff. Now the main product page Milk-V Duo | Extremely Cost-Effective Ultra-Compact Embedded Linux Development Platforms proudly states All chip data is fully open-source.

So how can I obtain sources for multimedia components and other stuff ?

2 Likes

Yeah, I was just starting to fool around with the SAR ADC and noticed that its driver is a loadable kernel module with no source that just gets copied as a blob out of the Middleware directory. Would be nice to see the low level code for that one - no idea why you’d want to protect something as generic as an ADC…

1 Like

if you check the graphic - it specifies some components are “limited open source” (whatever that means)

I’ve mainly found the jpeg decoder and the tuning files for the ISP are closed source (but the ISP drivers are open)

But you need to switch branches for some of the sources. eg, the sg200x-dev branch of fsbl has all the sources needed: GitHub - sophgo/fsbl at sg200x-dev

(same goes for other repositories)

3 Likes

Oh their approach to “Open Source” gets more amusing. Take Pioneer as an example. Their idea of an Open Source (with GPL obligations) Linux distro is a link to a prebuilt binary disk image. It’s very very sad.

1 Like

@Fishwaldo, thanks for the tip, so yeah, I’ve found some parts of what I was looking for in the branch you have pointed me to. But again, let’s take, for example Video Encoder component of SDK: middleware/v2/modules/venc/src/cvi_venc.c at sg200x-dev · sophgo/middleware · GitHub.

So there is a source (cvi_venc.c) for a userspace part of SDK, but I was unable to locate sources for a corresponding kernel module (which does much of the work I’m interested in). Whereas a precompiled binary blobs is available middleware/v2/cv180x/ko at cv18xx-v4.1.x · sophgo/middleware · GitHub (confusingly in other branch). Just like @emeb has wrote a couple of posts above.

If I’m again missing some other places to look for kernel module sources, please correct me. Otherwise it’s still not even close to being stated as opensource, IMO.

1 Like

Just a suggestion: Ghidra is really good at decompiling kernel modules and it works on RISC-V binaries.

3 Likes

Thanks @emeb , will definitely keep that in mind, but for me it’s really a kind of a (sad) last resort.

1 Like

I hope one day it becomes truly opensource.

Kernel modules are split up among the Linux source and another repository. You can find the other “modules” here:

Regarding the video encoder, it appears they licensed it from Chipsnmedia (maybe the wave5 mode?) which has mainline support - there is still a firmware blob that’s loaded by Linux for the codec but the driver itself is open source. (The firmware blob is in the ramdisk repo from memory)

You really need to dig around in the sophgo repositories to find it, which is a pain, but it’s mostly there (apart from JPEG driver)

You might also need to dig in the uboot sources as some kernel drivers have a dependency on uboot setting up the driver before Linux boot (?!?!?!) - eg the Mipi DSI.

2 Likes

@emeb rhe sardac is in that repository as well as documented in the TRM.

2 Likes

@Fishwaldo, huge thanks for thorough explanation. Does all these finds you stated was solely due to your own github sources digging or there is some docs/other forums (Chinese?)/discussion groups etc to look for this kind of information ?

1 Like

Mainly searching. I built a Debian image for the Sophgo 2000/2002 chips so after studying the milk-v buildroot, I went into the Sophgo repositories and found them.

1 Like

The XuanTie C906 used by SG200x has many custom assembly instructions, which may require some additional operations to enable ghidra to recognize these instructions

1 Like