Milk-V Mars

Revision 9 as of 2024-04-23 10:00:22

Clear message

U-Boot

The Milk-V Mars board can boot firmware from either of SPI flash, SD-card, eMMC, or UART. The boot source is selected via DIP switches.

GPIO01

GPIO00

0

0

SPI flash

0

1

SD-card

1

0

eMMC

1

1

UART

The vendor U-Boot is not compatible with the EBBR specification and cannot boot Ubuntu without manual changes.

The preinstalled server image comes with U-Boot built from upstream sources. U-Boot SPL and U-Boot are installed in the partitions designated loader1 and loader2. Select the SD-card as boot source via the DIP switches as shown in the photo:

Milk-V Mars boot source selection SD-card.jpg

The next steps are only relevant when using the live installer.

The Ubuntu live installer image which can be used to install to an USB or NVMe drive does not provide U-Boot for the Milk-V Mars board. You will have to update U-Boot on the SPI flash to use it. Package u-boot-starfive contains the U-Boot SPL and main U-Boot binaries. The easiest way to update U-Boot in the SPI flash is by booting the preinstalled image and entering the U-Boot console by pressing enter when seeing the "Hit any key to stop autoboot:" message:

sf probe
load mmc 1:1 $kernel_addr_r /usr/lib/u-boot/starfive_visionfive2/u-boot-spl.bin.normal.out
sf update $kernel_addr_r 0 $filesize
load mmc 1:1 $kernel_addr_r /usr/lib/u-boot/starfive_visionfive2/u-boot.itb               
sf update $kernel_addr_r 0x100000 $filesize

Switch the board off and set the boot source to SPI flash via the DIP switches:

Milk-V Mars boot source selection SPI flash.jpg

After rebooting reset the environment

env default -f -a
env save

Using the preinstalled server image

Copying Ubuntu onto the SD-card

Download the Ubuntu preinstalled server image from https://cdimage.ubuntu.com/releases/24.04/release/ and flash it on your sdcard using:

xzcat ubuntu-24.04-preinstalled-server-riscv64+milk-v-mars.img.xz | sudo dd bs=1M conv=fsync of=/dev/sdX

You will have to replace /dev/sdX by the actual device name of your SD card. Please, be especially cautious not to overwrite the wrong drive as this cannot be undone.

First boot

Connect to the UART using a UART-TTL USB adapter. For accessing the serial console you can use picocom:

picocom -b 115200 /dev/ttyUSB0

Insert the SD card and power on the board.

Enter the U-Boot console by pressing enter when seeing the "Hit any key to stop autoboot:" message to reset the environment:

env default -f -a
env save

Power cycle the board.

When booting the first time wait until you see an output line confirming that cloud-init has finished. Cloud init is responsible for generating the SSH keys and setting the default password. It must have finished before you can log in. Wait for a line like the following appearing:

[   35.682018] cloud-init[909]: Cloud-init v. 24.1.3-0ubuntu3 finished at Tue, 23 Apr 2024 07:44:59 +0000. Datasource DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net].  Up 35.65 seconds

Now you can login with user ubuntu and the default password ubuntu. You will be asked to choose a new password.

Limitations

  • The onboard GPU is not supported.
  • While the 3 USB 3.0 ports are working the USB 2.0 port is not supported by the 6.8 kernel.