Re: StarFive VisionFive 2 support

From: Colin S. Gordon <csgordon_at_fastmail.com>
Date: Tue, 10 Oct 2023 14:08:43 UTC
Thanks for the references! I've actually been using a modified version of Rob's script so far to test additional kernels --- I have the script pause partway through so I can installkernel with DESTDIR set to what ends up as the uzip root. But now that I have (super-hacky) access to the eMMC, I'm hoping to experiment with installing to eMMC and self-hosting (though still using the serial console for now), using ZFS boot environments to iterate faster than cycling through repeatedly rebuilding and re-burning the sd card (the card I've been using is starting to fail, too :-D). Should make debugging the mismatches between the StarFive DTBs and the clock-related properties FreeBSD expects to find much faster (right now the biu and ciu clocks for the mmc devices aren't found by FreeBSD due to those mismatches, and it's deeper than just a missing property).

I'm also aware of Lup's exceptionally detailed posts, which cover a lot of information without me needing to browse the NuttX code --- licensing is one reason why I'm currently focusing on porting OpenBSD's driver's, I'm trying to avoid relying on non-BSD-licensed code references. I found some of the overview of the RISC-V architecture and privilege levels especially illuminating.

And to be clear OpenBSD already runs pretty nicely on the VisionFive2 (https://gist.github.com/csgordon/74658096f7838382b40bd64e11f6983e), Mark Kettenis wrote and/or extended drivers to support many of the devices, including PCIe, USB, and the NICs, with help from a couple others (none of whom were me). The only thing they're currently missing for a self-contained system is working support for video out (via proper display driver or UEFI framebuffer).

-Colin

On Mon, Oct 9, 2023, at 21:52, Tomek CEDRO wrote:
> On Tue, Oct 10, 2023 at 3:03 AM Colin S. Gordon wrote:
> > I've been looking at support for the StarFive VisionFive 2 off and on for the last few weeks, using the OpenBSD support as a reference. Recently it was recommended to me that I check here whether anyone else was working on this before I got too far, to avoid duplicating and work.
> 
> Your posts are famous Colin :-)
> 
> https://discuss.systems/@csgordon/110969847755944311
> 
> 
> After I got my VisionFive2 board in January I have tried FreeBSD boot
> method presented by Rob (CC) on GitHub but it was sllllllooow and no
> drivers were available except for UART pins. Did not go any further
> but I will be more than happy to help testing :-)
> 
> https://github.com/robn/freebsd-vf2
> 
> https://forums.freebsd.org/threads/freebsd-on-visionfive2-board-with-risc-v-rv64gc-starfive-jh7110-soc.87757/
> 
> 
> My friend Lup Yuen Lee (CC) is porting NuttX RTOS to JH7110 and
> already made tons of discoveries that are all documented.. you may
> join forces and share discoveries to make both NuttX and
> FreeBSD/OpenBSD fully available on that new amazing RISC-V platform
> :-)
> 
> https://www.hackster.io/lupyuen/rtos-on-a-risc-v-sbc-star64-jh7110-apache-nuttx-2a7429
> 
> https://lupyuen.github.io/articles/release
> 
> https://www.youtube.com/watch?v=6vQ-TXXojbQ
> 
> 
> Have fun :-)
> 
> -- 
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>