-
-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
starfive visionfive2: use mainline kernel #964
base: master
Are you sure you want to change the base?
Conversation
Also please apply: --- a/starfive/visionfive/v2/default.nix
+++ b/starfive/visionfive/v2/default.nix
@@ -8,8 +8,7 @@
inherit (config.boot) kernelPatches;
});
- kernelParams =
- lib.mkDefault [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ];
+ kernelParams = [ "console=tty0" "console=ttyS0,115200n8" "earlycon=sbi" ];
initrd.availableKernelModules = [ "dw_mmc_starfive" ]; Otherwise these kernelParams are overridden by boot.consoleLogLevel. This is why we were not seeing any output on mainline kernel. |
It's working! https://hydra.nichi.co/build/3702 Tested ethernet. USB and PCI-E doesn't seem to work. |
Current state of the PR is also booting for me :) |
I'd prefer fixing the kernel config once and for all :) |
This mainline kernel is also running for nearly a day (except for a short power outage due to flooding). |
33e760f
to
56039df
Compare
@NickCao incooperated your change requests, still seems to boot fine for me :) |
need to figure out how to enable USB support |
@NickCao There's an efi_loader improvement patch up for review that enables EFI-configured (and U-Boot environment variable as fallback) devicetree loading with EFI boot manager (but not global USB host mode broke with the change in devicetree verbiage after Linux Kernel 6.1.x; Slap the devicetree from whatever Linux 5.15 vendor kernel into 6.1.x with an appropriate kernel config and you'll have working USB as a baseline to figure out what changed with the new devicetree verbiage of later kernel releases. |
I think this removes the need to keep u-boot updated (for updated dtb)?
We can have a board specific "firmware updater" and go for the SPL in SPI flash route. And
I'm also leaning towards that.
That's a valid concern, I see no good solution to this.
I believe it's working with the 6.6 branch we were using. |
I added
and tried the new kernel, still no output in this is the dmesg output
I guess the drivers for PCI support are still missing in kernel 6.9? does USB requires working PCI(e) support? Will it be included in Kernel 6.10? https://patchwork.kernel.org/project/linux-riscv/cover/[email protected]/ |
I will see if I can get this to work.
This is twofold:
So far, the kernel.org upstream kernel does not have the PLDA PCIe controller merged yet. |
@orangecms Oh good hint, thank you! So I added:
but still nothing in But some interesting debug stuff
|
Rebase with: PCI: starfive: Add JH7110 PCIe controller https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/microchip This is most of the PCIe host series less patch 22/22 riscv: dts: starfive: add PCIe dts configuration for JH7110. Apply and resolve conflicts as the filenames have changed with the reorganization. Also apply or use as a reference this series for the Kconfig options: v3-riscv-defconfig-Enable-StarFive-JH7110-drivers.patch https://patchwork.kernel.org/project/linux-riscv/list/?series=858940 Not sure about USB yet. I'm reading others' work and did some testing of my own, it does not seem complicated only that StarFive developers had zero motivation to update the documentation and test USB host mode on Linux kernel releases with the new devicetree verbiage as the VisionFive2 product only has this connected on the USB-C port which is used primarily for power and gadget mode. It does not make sense to use that for host mode when they have a VL805 hanging on the PCIe bus which is more capable for USB and is working in upstream. Edit: Note there's some merge conflicts if you want to follow along. Updated build instructions for 6.10.0-rc3* at that one issue I abuse the Update comment button on frequently |
Just to have a better understanding: Is usb the remaining topic that needs fixing for this branch, or is it also planned to backport some upstream patches to get feature parity with the current vendored kernel. E.g. pcie seems to be supported earliest with upstream 6.11 |
usb would be a requirement for me. in case it is possible to backport some patches that would be nice |
0d672e0
to
0cf4b17
Compare
Updated the PR Still depends on NixOS/nixpkgs#316724 backported to 24.05. Otherwise we could also merge this with 24.11 |
Can't we override |
Does htop works for you?
I also can't build bootstrap-tools on mine vf2
|
@misuzu haven't used it that much yet. would like to test nvme boot at the next step |
It works (at least with the upstream u-boot) |
Linux 6.11rc1 is the first Linux release that includes JH7110 PCIe Host functionality, and the riscv64 defconfig was updated apropos to enable this. However, I observe some weird behavior in Debian which is what I'm most familiar with.
Even if there is "lsusb" output you must take action! ...or else it is likely to get broken by drive-by code contributions from people with the least understanding of the problem. 3a. StarFive VisionFive2. The StarFive developer says "VF2 cadence USB is dr mode device" and in my reading of this the meaning is that nobody is interested in testing USB host mode on the USB-C power input port because there is an actual USB host controller VL805. You there! reading this comment... YES, you! And you have VisionFive2? Do you? You DO!? okay... humor me this time and solve this riddle, I'll bet ya a proverbial turkey leg and a stein of beer that the VisionFive2 USB-C connector can act as USB Host... and you win if you conclusively prove me right or prove me wrong, either way! 3b. Pine64 Star64. This is listed at its product page as "1x native USB 3.0 Host Port / 3x shared USB 2.0 Host Port / PCIe x1 Slot". There's a proposed tuning from U-Boot for this, and it requires testing to verify the USB and PCIe functionality, before extending that testing and possible validation to mainline Linux Kernel. 3c. Milk-V Mars needs testing, from all available product documentation there is apparently one USB port exposed connecting with JH7110 Cadence USB. 3d. Milk-V Mars CM / CM Lite is in progress, I have confirmed that USB and PCIe simultaneous function within U-Boot is possible, and each is possible within Linux (both simultaneous are expected but not yet realized); next steps are to extend this and validate with mainline Linux kernel. 3e. ROMA Laptop (JH7110 edition) needs testing, the one Debian enthusiast I know of that has this hardware does not have any time available to give attention to this. 3f. Forlinx OK7110-C, unknown and did not read of anyone with this hardware yet. 3g. Framework Mainboard JH7110 edition, unknown and did not read of anyone with this hardware yet.
Are there more JH7110 boards not named? This is relevant because mostly they are derivatives of the VisionFive2 development board design. You get to add support for many boards at a low cost of planning ahead for these minor differences with your support of the VisionFive2 itself. |
It looks fine with
|
...
Assuming EFI boot method from U-Boot, as a diagnosis step you may try to interrupt U-Boot, and
Weird for me, the mystery is not solved. Nothing needs done then for you though... that looks fine to me. |
For the SPI flash to work, you need
|
Anything else blocking this? USB and MTD both seem to work fine with default kernel config. *on nixos-unstable |
Maybe @0x4A6F can re-test? |
Using the resulting sd-image from this PR results in builds breaking (i.e.
|
going to give 6.11 a try as soon it is stable the next week |
6.11-rc7 seems to fix this issue. |
I can also build
The kernel logs spit out these kinds of messages:
|
In my experience this MMC full buffer error happens with Linux Kernel that is running with devicetree data of internal U-Boot firmware device tree instead of the devicetree for that Linux Kernel. Troubleshooting MMC buffer errors in kernel log for JH7110 board:
|
0cf4b17
to
edfc7f3
Compare
Co-authored-by: NickCao <[email protected]>
edfc7f3
to
a60f705
Compare
Description of changes
Depends on, which is not yet backported to 24.05 NixOS/nixpkgs#316724
Things done
nixos-hardware
andimporting it via
<nixos-hardware>
or Flake input