Progress on running Haiku on VisionFive 2

It should be possible to patch u-boot and make our own custom build to remove this de-initialization? Do they provide the sources for it somewhere?

1 Like

@X512 says in this GitHub issue that the bootloader-exiting-closes-framebuffer problem was caused by this specific commit to starfive’s u-boot repo.

But the u-boot that’s being used on the Mars CM specifically is from GitHub - milkv-mars/mars-buildroot-sdk: Milk-V Mars Official buildroot SDK (from the dev-mars-cm-sdcard branch for the variant of the Mars CM I have). So I guess I’ll have to revert the upstream u-boot commit in this mars-buildroot-sdk repo and try rebuilding and see how that goes.

Looks like it kinda works! The USB1 USB2 ports on the CM4 carrier board aren’t working, though. With that commit reverted in u-boot, I can actually boot all the way to the desktop, although without USB ports I can’t really do anything there at the moment. Still, pretty cool! I can try to upload the u-boot-spl.bin.normal.out and visionfive2_fw_payload.img files somewhere if anybody else wants to try booting Haiku with this setup.

8 Likes

Sounds like that patch didn’t intentionally disable the frame buffer though but was an attempt to make it work? wierd.

I’ll note that I found a user with an initialization boot up to desktop issue using the newer firmware in which the devs mentioned a fix is in place.

  • VF2 firmware 5.10.3+

Could see if this resolves the newer firmware issues with Haiku…

2 Likes

USB Audio sound is working.

Node tree:

Node("Devices Root"): no driver
  Node("Device Manager"): system/device_manager/driver/v1
  Node("Root subnode"): bus_managers/fdt/driver/v1
    Node("Root"): no driver
      Node("osc"): drivers/clock/fixed_clock/driver/v1
      Node("gmac1_rmii_refin"): drivers/clock/fixed_clock/driver/v1
      Node("gmac1_rgmii_rxin"): drivers/clock/fixed_clock/driver/v1
      Node("i2stx_bclk_ext"): drivers/clock/fixed_clock/driver/v1
      Node("i2stx_lrck_ext"): drivers/clock/fixed_clock/driver/v1
      Node("i2srx_bclk_ext"): drivers/clock/fixed_clock/driver/v1
      Node("i2srx_lrck_ext"): drivers/clock/fixed_clock/driver/v1
      Node("tdm_ext"): drivers/clock/fixed_clock/driver/v1
      Node("mclk_ext"): drivers/clock/fixed_clock/driver/v1
      Node("jtag_tck_inner"): drivers/clock/fixed_clock/driver/v1
      Node("bist_apb"): drivers/clock/fixed_clock/driver/v1
      Node("stg_apb"): drivers/clock/fixed_clock/driver/v1
      Node("gmac0_rmii_refin"): drivers/clock/fixed_clock/driver/v1
      Node("gmac0_rgmii_rxin"): drivers/clock/fixed_clock/driver/v1
      Node("clk_rtc"): drivers/clock/fixed_clock/driver/v1
      Node("hdmitx0_pixelclk"): drivers/clock/fixed_clock/driver/v1
      Node("mipitx_dphy_rxesc"): drivers/clock/fixed_clock/driver/v1
      Node("mipitx_dphy_txbytehs"): drivers/clock/fixed_clock/driver/v1
      Node("cpus"): no driver
        Node("cpu@0"): no driver
          Node("interrupt-controller"): no driver
        Node("cpu@1"): no driver
          Node("interrupt-controller"): no driver
        Node("cpu@2"): no driver
          Node("interrupt-controller"): no driver
        Node("cpu@3"): no driver
          Node("interrupt-controller"): no driver
        Node("cpu@4"): no driver
          Node("interrupt-controller"): no driver
      Node("soc"): no driver
        Node("pmu"): no driver
        Node("cache-controller@2010000"): drivers/misc/fu740_cache/driver/v1
        Node("aon_syscon@17010000"): drivers/misc/syscon/driver/v1
        Node("stg_syscon@10240000"): drivers/misc/syscon/driver/v1
        Node("sys_syscon@13030000"): drivers/misc/syscon/driver/v1
        Node("clint@2000000"): no driver
        Node("plic@c000000"): drivers/interrupt_controllers/plic/driver/v1
        Node("clock-controller"): drivers/clock/jh7110_clock/driver/v1
        Node("clock-controller@295C0000"): no driver
        Node("clock-controller@19810000"): no driver
        Node("spi@13010000"): no driver
          Node("nor-flash@0"): no driver
        Node("otp@17050000"): no driver
        Node("usbdrd"): no driver
          Node("usb@10100000"): no driver
        Node("timer@13050000"): no driver
        Node("wdog@13070000"): no driver
        Node("rtc@17040000"): no driver
        Node("pmu@17030000"): no driver
        Node("serial@10000000"): no driver
        Node("serial@10010000"): no driver
        Node("serial@10020000"): no driver
        Node("serial@12000000"): no driver
        Node("serial@12010000"): no driver
        Node("serial@12020000"): no driver
        Node("dma-controller@16050000"): no driver
        Node("gpio@13040000"): no driver
          Node("uart0-0"): no driver
            Node("tx-pins"): no driver
            Node("rx-pins"): no driver
          Node("mmc0-pins"): no driver
            Node("mmc0-pins-rest"): no driver
          Node("sdcard1-pins"): no driver
            Node("sdcard1-pins0"): no driver
            Node("sdcard1-pins1"): no driver
            Node("sdcard1-pins2"): no driver
            Node("sdcard1-pins3"): no driver
            Node("sdcard1-pins4"): no driver
            Node("sdcard1-pins5"): no driver
          Node("pcie0_perst_default"): no driver
            Node("perst-pins"): no driver
          Node("pcie0_perst_active"): no driver
            Node("perst-pins"): no driver
          Node("pcie0_wake_default"): no driver
            Node("wake-pins"): no driver
          Node("pcie0_clkreq_default"): no driver
            Node("clkreq-pins"): no driver
          Node("pcie1_perst_default"): no driver
            Node("perst-pins"): no driver
          Node("pcie1_perst_active"): no driver
            Node("perst-pins"): no driver
          Node("pcie1_wake_default"): no driver
            Node("wake-pins"): no driver
          Node("pcie1_clkreq_default"): no driver
            Node("clkreq-pins"): no driver
          Node("i2c2-0"): no driver
            Node("i2c-pins"): no driver
          Node("i2c5-0"): no driver
            Node("i2c-pins"): no driver
          Node("hdmi-0"): no driver
            Node("cec-pins"): no driver
            Node("hpd-pins"): no driver
        Node("gpio@17020000"): no driver
        Node("trng@1600C000"): no driver
        Node("sec_dma@16008000"): no driver
        Node("crypto@16000000"): no driver
        Node("i2c@12060000"): no driver
        Node("i2c@10030000"): no driver
        Node("i2c@10040000"): no driver
        Node("i2c@10050000"): no driver
          Node("rm68200_panel@45"): no driver
        Node("i2c5@12050000"): no driver
          Node("eeprom@50"): no driver
          Node("axp15060_reg@36"): no driver
        Node("sdio0@16010000"): busses/mmc/designware_mmc/driver/v1
          Node("MMC Bus Manager"): bus_managers/mmc/driver/v1
        Node("sdio1@16020000"): busses/mmc/designware_mmc/driver/v1
          Node("MMC Bus Manager"): bus_managers/mmc/driver/v1
            Node("MMC Device"): drivers/disk/mmc_disk/driver/v1
        Node("vin_sysctl@19800000"): no driver
        Node("jpu@11900000"): no driver
        Node("vpu_dec@130A0000"): no driver
        Node("vpu_enc@130B0000"): no driver
        Node("reset-controller"): drivers/reset/jh7110_reset/driver/v1
        Node("stmmac-axi-config"): no driver
        Node("ethernet@16030000"): drivers/network/dwmac/driver/v1
          Node("ethernet-phy@0"): no driver
          Node("MII Device"): no driver
        Node("ethernet@16040000"): drivers/network/dwmac/driver/v1
          Node("ethernet-phy@1"): no driver
          Node("MII Device"): no driver
        Node("gpu@18000000"): no driver
        Node("can@130d0000"): no driver
        Node("can@130e0000"): no driver
        Node("tdm@10090000"): no driver
        Node("spdif0@100a0000"): no driver
        Node("pwmdac@100b0000"): no driver
        Node("i2stx@100c0000"): no driver
        Node("pdm@100d0000"): no driver
        Node("i2srx_3ch@100e0000"): no driver
        Node("i2stx_4ch0@120b0000"): no driver
        Node("i2stx_4ch1@120c0000"): no driver
        Node("pwm@120d0000"): no driver
        Node("spdif_transmitter"): no driver
        Node("spdif_receiver"): no driver
        Node("pwmdac-transmitter"): no driver
        Node("dmic_codec"): no driver
        Node("spi@10060000"): no driver
        Node("pcie@2B000000"): busses/pci/plda/driver/v1
          Node("PCI Bus Manager"): bus_managers/pci/driver/v1
            Node("PCI Device"): no driver
            Node("PCI Device"): busses/usb/xhci/driver/v1
              Node("USB Bus Manager"): bus_managers/usb/driver/v1
                Node("USB device"): bus_managers/usb/hub/driver/v1
                  Node("USB device"): bus_managers/usb/hub/driver/v1
                    Node("USB device"): busses/hid/usb_hid/driver/v1
                      Node("HID Device"): drivers/input/hid_input/driver/v1
                    Node("USB device"): busses/hid/usb_hid/driver/v1
                      Node("HID Device"): drivers/input/hid_input/driver/v1
                    Node("USB device"): drivers/audio/usb_audio/driver/v1
                Node("USB device"): bus_managers/usb/hub/driver/v1
        Node("pcie@2C000000"): busses/pci/plda/driver/v1
          Node("PCI Bus Manager"): bus_managers/pci/driver/v1
            Node("PCI Device"): no driver
            Node("PCI Device"): drivers/disk/nvme_disk/driver/v1
        Node("mailbox@0"): no driver
        Node("mailbox_client@0"): no driver
        Node("dssctrl@295B0000"): drivers/misc/syscon/driver/v1
        Node("dc8200@29400000"): no driver
          Node("port"): no driver
            Node("endpoint@0"): no driver
            Node("endpoint@1"): no driver
        Node("hdmi@29590000"): no driver
          Node("ports"): no driver
            Node("port"): no driver
              Node("endpoint@0"): no driver
        Node("mipi@295d0000"): no driver
          Node("ports"): no driver
            Node("port"): no driver
              Node("endpoint@0"): no driver
          Node("display-timings"): no driver
            Node("timing0"): no driver
        Node("dsi-host"): no driver
        Node("hdmi-output"): no driver
        Node("mipi-dphy@295e0000"): no driver
        Node("snd-card"): no driver
          Node("simple-audio-card,dai-link@0"): no driver
            Node("cpu"): no driver
            Node("codec"): no driver
        Node("e24@0"): no driver
          Node("dsp@0"): no driver
        Node("dmc@100b0000"): no driver
      Node("aliases"): no driver
      Node("chosen"): no driver
      Node("memory@80000000"): no driver
      Node("reserved-memory"): no driver
        Node("opensbi"): no driver
      Node("gpio-restart"): no driver
      Node("firmware"): no driver
      Node("config"): no driver
      Node("__symbols__"): no driver
  Node("Root subnode"): drivers/null/driver/v1
  Node("Root subnode"): drivers/random/driver/v1
  Node("Root subnode"): drivers/zero/driver/v1
35 Likes

Will this also fix USB audio on other hardware?

EDIT: Nevermind, just saw this thread from waddlesplash.

3 Likes

Has anyone managed to use the GPIOs on the VisionFive 2 ? I don’t own one yet but I have a small fantasy of patching / rewriting Pulse so I can have a case with four CPU bars like this, as a nod to the ancient BeBox Dual 133 :slight_smile:

3 Likes

I must admit that in these weeks I’m trying to modify a BeBox-shaped Raspberry case to fit the dimensions of the VisionFive2 because I liked the idea of having the push buttons.

Maybe we should open a dedicated thread in the forum to talk about the case for VisionFive 2 without cluttering up the software development that is bringing X512

2 Likes

Thank you for this, my VF2 finally arrived and this made some of the initial steps trivial. Would only add that you don’t have to wget the files, you can copy with ssh like this:

ssh root@visionfive2 "cat > u-boot-spl.bin.normal.out" < u-boot-spl.bin.normal.out 
ssh root@visionfive2 "cat > visionfive2_fw_payload.img" < visionfive2_fw_payload.img 

I also copied tha sha256sum file and checked the copies before continuing.

Right now I’m ready to boot Haiku on it in principle but I guess the situation is still that there are no automated builds and nobody has shared a recent image so next I’d have to build my own?

2 Likes

Yep, building your own is the way to go for now.

2 Likes

Eventually got an image built with Clee’s instructions and Haiku booting on the VisionFive 2. Had a hard time finding a mouse that worked but after going through a few I found an old Logitech G700 that did the trick. Very cool to see Haiku running on this little system!

Phone camera shot of screen with neofetch and “About this system” to celebrate:

20 Likes

I don’t wanna sound like a killjoy, but one GiB of ram used with just 18 pkgs installed…?, what’s going on with haiku on RISCV?

I mean, its still in the works.

It’s probably a debug build. Release builds run lighter.

1 Like

No, i think something else is going on, because the x86 nightlies are also debug builds with more pkgs installed and yet they don’t even use half a gig of ram.

The code density of a CISC processor is usually much higher than that of a RISC processor also. When Amiga switched from the 68000 series to PowerPC, the memory usage of the programs from the same C source became 30% bigger and needed 30% bigger caches to get proportional performance per clock.

4 Likes

RISC-V has compressed instructions, so code density should be about as good as for x86.

2 Likes

Honestly the RISC-CISC distinction these days is so blurry, that it doesn’t really matter much at all. Even x86 processors have been RISC at their core for years, implementing a CISC ISA on top.

The hybridization has helped the x86-64 a lot!

Code density should be not a problem for RISC-V vs x86.