Milk-V Mars

Differences between revisions 6 and 7
Revision 6 as of 2024-04-23 09:28:18
Size: 2515
Editor: xypron
Comment:
Revision 7 as of 2024-04-23 09:39:49
Size: 3244
Editor: xypron
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
'''The next steps are only relevant when using the live installer.'''
Line 26: Line 28:
U-Boot SPL and main U-Boot binaries. U-Boot SPL and main U-Boot binaries. The easiest way to update U-Boot in the
SPI flash is by booting form 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.

After rebooting reset the environment

{{{
env default -f -a
env save
}}}

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 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 vendor U-Boot is not compatible with the EBBR specification and cannot boot Ubuntu.

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 form 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.

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.

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. Cloud init itself will also need a few minutes. The line to wait for will look similar to

[  150.053340] cloud-init[1274]: Cloud-init v. 23.1.1-0ubuntu2 finished at Mon, 03 Apr 2023 11:14:35 +0000. Datasource DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net].  Up 150.00 seconds

Now you can login with user ubuntu and the default password ubuntu and 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
    • 6.8 kernel.

RISC-V/Milk-V Mars (last edited 2024-04-23 12:43:29 by xypron)