(2) And if this indeed is possible, there probably be some limitations in driver support of in-SoC’s peripherals (media etc) for this Linux image ? Like just some kind of a basic limited set of devices (SD card, what else ?) available.
Jumping on Linux at the bleeding edge, is like trying to jump onto a moving train, while you are still learning how to walk. So most companies grab a single release of the linux kernel typically one of the longterm supported releases, get that working (basically boarding a stationary train) and in parallel submit patches that are added upstream with a lot of back and forth with the kernel maintainers. This upstream process is a much slower process with many many revisions before patches are accepted. And once finally accepted they then need to be maintained.
One thing about selecting a baseline release around a longterm kernel is that if something is not working the cause will never be a change that someone else introduced by adding/removing/modifying code upstream. This speeds up development time by not chasing new problems that were introduced by someone outside your company when trying to get new hardware to work for the first time.
It reduces costs by needing slightly fewer software developers, but there are downsides to doing both at once. The main upside is that SoC (System on Chip) and board features are added now (to a custom kernel with custom drivers) and not in a years plus time after official kernel approval. The delay of going from prepatch(RC) to mainline to stable to longterm kernel could add more than a year in total after a patch is approved.
So yea the latest bleeding edge kernel will probably work, but most new hardware on boards and inside SoC’s will probably be missing for a year, two or longer. Unless another company adds support for some feature that exactly matches faster.
The latest mainline info for the Duo can be found here Home · sophgo/linux Wiki · GitHub
Some patches have newer revisions than the ones linked.
I’ve managed to get USB working on the 6.8 Kernel but the patches are likely to get a few more revisions and sadly things like I2S don’t have any patches yet.
How to run mainline kernel on milk-v duo? That would be appreciated if you can share the method you’re using. For other parts, do you use official duo-buildroot-sdk?
With Yocto, sadly no official support. Check this thread Yocto on milk-v duo
The meta-milkv layer uses the same kernel version as here but you can modify the kas-project.yml file to set the kernel with a line like this near the other machine config.
Beware though that there’s only basic mainline support in that branch, you’ll need to pull in the various patches from the wiki to get things like USB working.
Seems that the image I built according to this could not work on my duo-s, the blue led didn’t blink as expected after type-C connected a while. Also the console output was garbled.
It could be that BSP is only compatible with the CV1800B Duo rather than the SG200x ones? You could try spot the differences in the DTS’s between the two in buildroot and port them across
I have the mainline kernel run to the console on my duo-s finally.
If someone else want to run mainline kernel on duo-s, maybe you can try this way, prepare:
busybox (used to compile into kernel Image as initramfs)
Linux kernel Image (compiled from mainline kernel, i.e. arch/riscv/boot/Image)
Prepare an sd card, and copy 1) 2) 4) to sd card, power on board, wait for u-boot print ’ Hit any key to stop autoboot: 0 ', press any key to enter u-boot command, then you can see the content on sd card with the command ‘ls mmc’, the output would be like: