Re: StarFive VisionFive 2 support

From: Colin S. Gordon <csgordon_at_fastmail.com>
Date: Tue, 10 Oct 2023 17:03:08 UTC
I agree some clarity on the licensing issue would be nice. It seems clear that GPL-only licensed code isn't allowed in the kernel, but if MIT-licensed code (and dual-licensed including an MIT option) is then that would simplify things greatly.

I currently don't have proper clock support, though it looks like that part of your work is under BSD, so I'll grab that rather than writing my own from scratch. I haven't hit the DMA bug you noted yet, but I also haven't really done much with the filesystem yet (in particular, I haven't done much *writing* to the disk yet, just basic tests, and haven't built install media yet --- bsdinstall fails for me currently because it can't create files it wants in a read-only memory disk).

I guess the other operative question is: which dtb are you using? I see you have one checked in --- where did it come from? OpenBSD for a while only supported one particular dtb which was *not* one of the ones from the StarFive public releases on Github, and I've been working with the one that I know works for OpenBSD. I can trace lookup failure for the biu and ciu clocks through to a missing property in the dtb I'm using (#clock-names) and then to some kind of misinterpretation I haven't debugged yet when I manually add that property to the mmc nodes.

-Colin

On Tue, Oct 10, 2023, at 10:16, JMT Sihvola wrote:
> 
> Colin S. Gordon wrote:
> >I see some GPL and MIT license headers in your current changes, which I'm trying to avoid, but I'll gladly build on some of the BSD-licensed
> changes.
> 
> So far I've not quite grasped what is FreeBSD's stance on this issue.
> Some of my question on IRC have gone unanswered but I've got a picture
> that some dual-licensed files are used as such. I myself extracted
> some of the most important header code and used it under MIT
> license (naturally giving credits to the original author).
> 
> Colin S. Gordon wrote:
> >It looks like I did at least partly duplicate your work with the dwmmc driver(https://github.com/csgordon/freebsd-starfive2/commit/fd7
> >00cd60e466bacfd60c1dcc3b4 [github.com]), which I mostly adapted from one of the existing drivers.  I'll also take a look at M. Horne's code, I wasn't aware of that myself.
> 
> Oddly enough, for me MMC didn't require any additional code beyond offering 
> clocks, (maybe the reset driver) and fixing that DMA bug which was 
> initially reported here:
> https://reviews.freebsd.org/D34118
> 
> ...and which I re-reported here:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273694
> 
> I don't recall having any issues with biu and ciu clocks, so I'm not
> sure what that is about.
> 
> -Jari
> 
>