Skip to content
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

Feedback on starfive_visionfive2-riscv64-sidriscv.img #149

Open
danboid opened this issue May 24, 2023 · 6 comments
Open

Feedback on starfive_visionfive2-riscv64-sidriscv.img #149

danboid opened this issue May 24, 2023 · 6 comments

Comments

@danboid
Copy link

danboid commented May 24, 2023

The good news is that starfive_visionfive2-riscv64-sidriscv.img (230321-02) is the best of the five or so Linux distros I've tried on the VF2 so far. It's the only one I've tried that has working 4K HDMI support (albeit unaccelerated) that has survived an apt upgrade so far.

I initially booted it on a 1080p display and the Xorg display was a bit distorted but after an apt update/upgrade/reboot cycle, 1080p output fixed itself and 4K is happy enough too, if a bit jerky with it just being just a fbdev output.

Have you tried enabling / building the mesa (experimental) powervr driver yet? Some build instructions are here:

https://forum.rvspace.org/t/did-anyone-tested-mesa-git-for-current-powervr-status/2676/3

It was a nice surprise to see (hear) that HDMI audio is working already. I wasn't expecting that yet.

I've got a SAMSUNG 980 PRO m.2 disk attached to my VF2 but hdparm says I only get ~155 MB/s. On the rvspace forums I've read of people claiming to get around 280 MB/s, almost twice as fast. Might I need to enable PCIe 2.0 support somehow?

I can use regular USB memory sticks OK with the VF2 but it doesn't seem to provide enough power via its USB to power either an SSD via a USB SATA adapter nor does it provide enough power to use my 2.5" mechanical HD, which I can use via bus power alone on my laptop and TV box etc. I can kinda use a SATA SSD via USB but I only get ~200 KB (KILObytes) per second so its not really usable without external power.

Tomorrow I'll try to get it booting off NVME. I don't know how to mount the regular BTRFS image so I'll have to use rsync to transfer it onto an ext4 partition on my NVMe disk so that I can edit its fstab afterwards.

Great work @hexdump0815! Thanks!

@danboid
Copy link
Author

danboid commented May 24, 2023

I dug out my powered USB 3.0 hub. The USB 3 SATA SSD adapter still only gives me ~200 Kb/s but I can use my 2.5" mechanical USB 3 disk when its plugged into the powered hub and I get about 110 MB/s reads which is pretty much its full speed.

@danboid
Copy link
Author

danboid commented May 24, 2023

I've been looking into gettng the video decoding working. The README for the wave511 driver ( https://github.com/starfive-tech/soft_3rdpart.git ) says:

By default, VDEC uses the cma method to allocate mem from the general CMA space. If you want to specify a reserved space for VDEC, you can reserve it in the dts file. At the same time, in the file code/vdi/linux/driver/vdec.c, open the VPU_SUPPORT_RESERVED_VIDEO_MEMORY macro. Simple example of reservation method:

reserved_memory: reserved-memory {
	#address-cells = <2>;
	#size-cells = <2>;
	ranges;
    vpu_reserved: framebuffer@d8000000 {
        reg = <0x0 0xd8000000 0x0 0x20000000>;
    };
};
vpu_dec:vpu_dec@118F0000 {
    compatible = "starfive,vdec";
    reg = <0 0x118F0000 0 0x10000>;
    memory-region = <&vpu_reserved>;
    interrupt-parent = <&plic>;
    interrupts = <23>;
    clocks = <&vpuclk>;
    clock-names = "vcodec";
    status = "okay";
};

https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel/wave420l

If we can get wave420l to build and load its kernel module it promises realtime encoding of 4K H265, which is very impressive for a ~£100 SBC.

@danboid
Copy link
Author

danboid commented May 25, 2023

I have been able to successfully boot your sid image directly from NVMe but only when manually entering these commands into u-boot:

nvme scan
fatload nvme 0:3 ${kernel_addr_r} vmlinuz-5.15.0-vf2-104+
fatload nvme 0:3 ${ramdisk_addr_r} initrd.img-5.15.0-vf2-104+
fatload nvme 0:3 ${fdt_addr_r} dtb-5.15.0-vf2-104+/starfive/jh7110-visionfive-v2.dtb
setenv bootargs 'root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait'
setenv kernel_comp_addr_r 0x50000000
setenv kernel_comp_size 0x04000000
booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r

I'll update you when I get u-boot configured correctly to directly boot into Debian - its clearly possible.

Let me know if you beat me to it please!

@hexdump0815
Copy link
Owner

sorry for the deleyed response, i'm mostly offline right now - i did not yet look into this - i think i remember a thread in the rvspace forum about it or it was in here maybe? - https://github.com/riscv/meta-riscv/pull/382/files

@danboid
Copy link
Author

danboid commented May 27, 2023

Ignore my comment about vdec and the video driver. I've decompiled the current dts that your kernel is using and it already includes vdec support.

I've not had a proper go at getting the vdec ffmpeg to build yet.

@danboid
Copy link
Author

danboid commented May 29, 2023

I have now got Debian sid automatically booting from my m.2 SSD!

This is a hacky solution because it uses the booti command to load the kernel and initrd instead of using the u-boot sysboot command to parse the extlinux.conf file but its a step in the right direction and proves that direct SSD boot is possible with a current VF2 image.

You might want to run env default -a -f to reset your current u-boot config before running the following u-boot commands:

setenv boot_targets nvme0
setenv preboot 'run chipa_set_uboot;pci enum;nvme scan'
setenv bootargs 'root=/dev/nvme0n1p4 console=tty1 console=ttyS0,115200  debug rootwait  earlycon=sbi'
setenv kernel_comp_addr_r 0x50000000
setenv kernel_comp_size 0x04000000
setenv bootcmd 'fatload nvme 0:3 ${kernel_addr_r} vmlinuz-5.15.0-vf2-104+; fatload nvme 0:3 ${ramdisk_addr_r} initrd.img-5.15.0-vf2-104+; fatload nvme 0:3 ${fdt_addr_r} dtb-5.15.0-vf2-104+/starfive/jh7110-visionfive-v2.dtb; booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r'
saveenv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants