Running the full and entire upstream kernel

Hello!

I found this forum way after I found the Issue Tickets on Github… So this is effectively a double post. However, a forum is better suited for this, anyway.

For reference: Docs: Possibly missing a value or two? · Issue #135 · starfive-tech/linux · GitHub

The long story short of this is that I have been trying to get an upstream kernel working. Thanks to the instructions on the Debian wikis, I am actually far away from the snapshot and it works stable with the 5.15 kernel; GPU and stuff all shows up and I don’t think it is missing anything. Well, except some modules for DVB and network bridging, which I really want.

So I have been trying my best to build the upstream kernel, minding the notes of required definitions in the README, but so far, no luck (although I am running a build right now, maybe this will work…?)

Did any of you get the upstream kernel booted and working? And if so, what config params were you using in addition to the default ones as required by the README?

Thanks and kind regards,
Ingwie

PS.: I want to use my VF2 as a TV-Server with TVHeadend and alike; so DVB support is cruical, and since I am low on network switches, it’d be neat to just use both of the interfaces on the board instead.

1 Like

If you don’t care about proprietary gpu driver then at least there are some working kernel trees, for example v6.6 and v6.7(I haven’t tested this one).

v6.8 release will possibly bring in WAVE511 decoder, while DRM and HDMI is already available in the tree listed above. Further information is available at Upstream Plan The upstream U-Boot is strongly recommended as well.

FYI: Switch to bootstd-based boot flow on upstream u-boot?

As for the GPU, all I would need is the firmware, no?
This, to be exact: https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel/IMG_GPU/out

For the rest? Yep, I just want a modern kernel I can fool around with and get my DVB stuff working and possibly ethernet bridging.

Thanks for the links, I will see if their configs may give me a hint as to what I am missing. At least, I hope so. ^^’

As for u-boot; I hadn’t thought about upgrading that. Will give it a try before I recompile the kernel - who knows, maybe the 2021 u-boot just isn’t compatible with the 6.6 kernel that I compiled? Worth a try.

Oh, I just realized, you actually linked the exact kernel I was using - or rather, their branch on it. That is the very one I am trying to get to boot. x)

This one, I mean GitHub - starfive-tech/linux at JH7110_VisionFive2_upstream

I compiled it on-device with GCC and the config as seen n the posted issue ticket. The kernel is also there, if you want to give it a look.

Yesterday I also ordered a UART cable; maybe the serial console will give me a hint on what the problem is.

Sure, a UART adapter will give you lots of control over your embedded devices. Better to always have one and keep an eye on the output while playing around.

That specific upstream integration tree already has a defconfig available. Just make it your start point. But there’s note about HDMI support, which requires upstream uboot. I strongly recommend you upgrade the QSPI firmware to the latest release of uboot(2024.x) and opensbi(1.4).

GPU driver no doubt have trouble working on newer kernel as it is released as binary without source code. Just don’t expect it will work. But that should not stop you from having hw-accelerated video decode & display output, once WAVE511 landed.

That 6.6 kernel also has trouble performing clean shutdown. I’ve just successfully plugged jtag onto the board and found it dead-locked but soon realized it worth nothing to debug an integration tree.

At least I’m pretty happy playing with upstream stuffs on JH7110, comparing to any other SoC…

1 Like

Yep, should arrive in two days, I am curious to see what it reports to me!

I am currently stuck in menuconfig hell for u-boot; tried to find their config, and failed :stuck_out_tongue: So i am just trying to enable all the JH7110 settings in upstream (checked out the v2024.01 release) in hopes of it working.

As for the kernel; I did copy their defconfig, and simply went through menuconfig to enable the settings I wanted myself (BRIDGE and several DVB things). So I am quite stumped.

That said; do you know where I can find the VisionFive2’s uboot config? Would be a MUCH better starting point then traversing menuconfig untill im old and grey XD

A little offtopic but…
I LOVE the fact that my MicroSD is effectively my entire bios chip as well. I can f_ck around with virtually and literally anything on this board and it is so much fun. I use a few RockChip devices as well and they don’t give you that kind of control and have so many of their own fancy nicknacks that you basically can not reproduce most of their builds. So, the JH7110 is amazing and I hope to do much more than just a TV server for SAT>IP streaming in the future. ^.^

Heck, I am looking at several products build with riscv CPUs; I think it’s time I learn the ins and outs of that. But first… I want to finish what I started and get a neat TV-Server going with a nice new kernel, ethernet bridging and the ability to do with it as I please. I am sure to be sticking to this forum for a while :stuck_out_tongue:

Wow do I feel blind now… xD (Well, I literally am, I am zoomed in 600% on a 55" TV with a screen magnifier.)
Thanks, will use that!

So I ran the build, dissected the star-tech/VisionFive2 Makefile to generate the .img file and others, and flashed them … only to have no boot at all.

But about a hour, it hit me: I was using the generic GCC from the apt repo; riscv64gc-linux-gcc. But I SHOULD have used riscv64gc-unknown-gcc.

So instead I am working on flipping the star-tech/VisionFive2 Makefile to use more upstream components (opensbi, u-boot for now) and once this works, I will submit it as a PR.

Just wanted to give a little status update. ^^

2 Likes

My self-built upstream u-boot shows this:

U-Boot SPL 2024.01 (Feb 05 2024 - 04:26:41 +0000)
DDR version: dc2e84f0.
Trying to boot from MMC2
spl_fdt_fixup_version_b set prop starfive,tx-use-rgmii-clk fail.

I got my UART cable today, time to debug. :smiley:

Reset SBI and UB to “factory” (from thelr last release) and attempted again to start my 6.6 build kernel. It’s stuck here:

[   11.389573] cadence-qspi 13010000.spi: Cannot claim QSPI clock.
[   11.396820] starfive-wdt 13070000.wdog: error -ENOENT: failed to get apb clock
[   11.404783] starfive-wdt: probe of 13070000.wdog failed with error -2
[   11.413427] vs-dc 29400000.dc8200: error -ENOENT: Failed to get clk 'channel0'
[   11.421386] vs-dc 29400000.dc8200: Failed to get clk controls
[   11.427708] vs-dc: probe of 29400000.dc8200 failed with error -2
[   11.434359] amba 16008000.sec_dma: deferred probe pending
[   11.440315] amba 10060000.spi: deferred probe pending
[   11.445883] platform 10030000.i2c: deferred probe pending
[   11.451827] platform 10050000.i2c: deferred probe pending
[   11.457768] platform 12050000.i2c: deferred probe pending
[   11.463710] platform 12060000.i2c: deferred probe pending
[   11.469653] platform 13040000.gpio: deferred probe pending
[   11.475693] platform 17020000.gpio: deferred probe pending
[   11.481730] platform 120d0000.pwm: deferred probe pending
[   11.487671] platform 2b000000.pcie: deferred probe pending
[   11.493710] platform 2c000000.pcie: deferred probe pending
[   11.499749] platform 16050000.dma-controller: deferred probe pending
[   11.506739] platform 10000000.serial: deferred probe pending
[   11.512972] platform 1600c000.trng: deferred probe pending
[   11.519012] platform 295d0000.mipi: deferred probe pending
[   11.525052] platform 13010000.spi: deferred probe pending
[   11.530993] platform gpio-restart: deferred probe pending
[   11.536934] platform 120e0000.tmon: deferred probe pending
[   11.542973] platform cpufreq-dt: deferred probe pending
[   11.548726] platform soc:snd-card1: deferred probe pending
[   11.554762] platform soc:snd-card3: deferred probe pending
[   11.560799] platform 120b0000.i2stx_4ch0: deferred probe pending
[   11.567407] platform 100b0000.pwmdac: deferred probe pending

So both u-boot and the kernel have troubble aquiring the clocks. Good to know!

If you have any insight here, please do let me know. :slight_smile:

Big update.

By now, I have had the 25th revision of the kernel recompile and had to sometimes switch back to the original 5.15 one in times i forked up my build. But I have almost all the features working now! In fact, the last thing I am struggling with is eBPF features to get containerized apps (podman) working.

Here is the very kernel package I use. Please note, however, that you will have to:

  • Change your uEnv.txt to read fdtfile=starfive/jh7110-starfive-visionfive-2-v1.3b.dtb instead
  • and manually make sure that fdtdirs /dtbs is set in the extlinux config, because update-u-boot will get it wrong completely and entirely. Truely a pain in the butt.
  • Also make sure to copy the DTBs over, they are likely newer than what you have right now.

That said, it boots, has bridging working, works with tailscale perfectly fine and also has all the features I personally needed and supports all the devices I wanted it to, like my Zigbee stick.

In reference, here are the related issue tickets I have been posting elsewhere:

And here is a zip containing the image/headers/libc versions of my kernel:

And within the first linked issue, you will also find a link to the kernel config used.

Hopefuly this helps someone! Once I am done with getting virtualization to work, I will post again.

Now, what doesn’t work?

  • No output through HDMI. My TV recognizes a source, meaning that the device does send and complete the EDID handshake, but that’s about it.
  • The green LED doesn’t blink during activity. I probably forgot an LED setting… my bad.
  • In fact, none of the LEDs are accessible in /sys/class/led.
  • I haven’t tested the GPIO pins. Chances are, they don’t work fully. UART does, though.
  • Sometimes it hangs on shutdown. The console input cuts while shutting down, and then it just… stays that way. It cuts while systemd is de-initializing, so I don’t actually see the error message (if any). Bummer.

Kind regards,
Ingwie

3 Likes

Oh, I forgot!

# Original from image:
#deb https://snapshot.debian.org/archive/debian-ports/20221225T084846Z unstable main

# Gathered via the github repo:
# https://github.com/starfive-tech/Debian/releases
#deb https://snapshot.debian.org/archive/debian-ports/202311<????> unstable main

# Suggested via wiki:
# https://wiki.debian.org/RISC-V#Package_repository
deb https://deb.debian.org/debian sid main contrib non-free non-free-firmware
#deb https://deb.debian.org/debian unreleased main
deb-src https://deb.debian.org/debian sid main

This is my /etc/apt/sources.list :slight_smile: Works super well.

Hi,

I also had the reboot/shutdown “hangs” with various kernels/distributions…

Setting systemd.show_status=no in the kernel command line seems to completely fix it.

4 Likes

Yep, solved the issue.
Had a blackout and the box came right back. Thanks!