Hi everyone!
For a few weeks I have been porting Haiku, and its fork RenkuOS, to the Milk-V Mars. It is a RISC-V board the size of a Raspberry Pi, built around the StarFive JH7110 SoC with 4 SiFive U74 cores at 1.5 GHz; mine has 4 GB of RAM. I wanted to share the progress, because the board finally boots to the desktop and is usable.
What already works on the board
- Booting from microSD, without touching the board's SPI flash. You write the image to the card, flip the DIP switch and it starts. This works with both the factory U-Boot and a mainline U-Boot placed on the card.
- Desktop over HDMI, using the framebuffer the firmware sets up. For now the resolution is the firmware's, because there is no real display driver yet.
- microSD card reader, with a driver for the DesignWare MMC controller, started from X512's.
- PCIe and USB 3.0. The firmware leaves the PCIe port with the VL805 USB controller powered off, so the driver brings it up itself. USB mouse and keyboard work.
- JH7110 clocks and resets, with a new driver that the other drivers rely on.
- RenkuOS runs just like Haiku, including Pulse and the demos.
What I have tested so far only in emulation
- Mesa 22 in software (softpipe) and GLU, built for riscv64: GLTeapot runs in QEMU at about 6 FPS. I haven't tried it on the Mars yet.
- Packages built for riscv64: vim, git, Python 3.14, curl, htop, SDL2, LocalSend and more. They add to those HaikuPorts already publishes (nano, perl, make, rsync…). All of them are included in a "full" image with the Haiku applications.
Work in progress, still to be tested on the board
- Ethernet: X512's driver for the DesignWare controller, adapted to RenkuOS. This is the next big step: with networking I can work over SSH instead of moving the microSD back and forth every time.
- The JH7110 hardware random number generator.
- The SoC temperature sensor, also shown in ActivityMonitor.
- The I²C bus, where the board's PMIC sits.
How I work
I don't have a serial adapter, so I read the logs from the screen and from the syslog saved on the microSD. Before every test on the board, the code goes through QEMU and TinyEMU, X512's emulator, which also models the SD controller and the PCIe of the JH7110.
Thanks
A huge thank you to X512 (X547). His work on Haiku for RISC-V and for the VisionFive 2, which uses the same SoC, was the starting point for the MMC, PCIe and Ethernet drivers. Thanks also to the U-Boot and Linux maintainers for the JH7110: their drivers were a valuable reference for the registers and the power-up sequences.
Next steps
I am submitting the system changes as pull requests to RenkuOS: UART, MMC, EFI framebuffer, clocks/resets and PCIe. Ethernet and the rest will follow. Later on, time permitting, a real display driver, so the resolution can be changed, and audio.
If anyone has a Mars or a VisionFive 2 and wants to try, I can share the images. Every test on real hardware is valuable!
See you next time,
atomozero
