From Fedora Project Wiki
(Update for official F41 image and reorganize)
Line 1: Line 1:
{{admon/warning|Warning|The image used in this guide is an unofficial one, even by the usual standard of the Fedora/RISC-V effort.}}
This page explains how to get Fedora running on the SiFive HiFive Premier P550 board.
This page explains how to get Fedora running on the SiFive HiFive Premier P550 board.


= Requirements =
= Disclaimer =


You need to have upgraded the board's firmware ("bootchain") to the latest release. At the time of writing, that would be:
The image uses [[User:Jmontleon|Jason Montleon]]'s build of the 6.6-based vendor kernel. The configuration should be close to that of a regular Fedora kernel, but obviously the base is significantly older than current mainline and several downstream changes are included.


* [https://github.com/sifive/freedom-u-sdk/releases/tag/2024.11.00-HFP550 <code>2024.11.00-HFP550</code>]
GRUB2 is configured not to display its menu on boot. For whatever reason, the bootloader takes forever to draw its UI on the serial console, so hiding the menu is an effective way to avoid adding a significant delay to each boot. If you need to interact with GRUB2, just press ESC while the countdown is being displayed. Note that the countdown message could be somewhat hard to spot as it might overlap with previous serial output. Just pay attention to where the cursor is and you'll figure it out.


Follow the [https://www.sifive.com/document-file/hifive-premier-p550-image-update-procedure official documentation] for the process; it basically boils down to copying a single file to an ext4-formatted USB stick and running a few commands at the <code>u-boot</code> prompt.
The board's DTB is passed to the kernel via GRUB2 (see `GRUB_DEFAULT_DTB` in `/etc/default/grub`) instead of being automatically loaded off the `/boot` filesystem. Once we have a Fedora build of the firmware ("bootchain") we should be able to drop this hack.


'''Fedora won't boot if you skip this step.'''
= Machine-specific instructions =


= Installing =
== Requirements ==


Download the disk image. The file you want is named <code>Fedora-Server-Minimal-P550-41.YYYYMMDD.riscv64.raw.xz</code>, where <code>YYYYMMDD</code> corresponds to the creation date. At the time of writing, the most recent version is:
=== Firmware ===


* [https://people.redhat.com/abologna/p550/20250111/ <code>20250111</code>]
You need to have upgraded the board's firmware ("bootchain") to the latest release. At the time of writing, that would be:


Uncompress the image with
* [https://github.com/sifive/freedom-u-sdk/releases/tag/2024.11.00-HFP550 <code>2024.11.00-HFP550</code>]


<pre>
Follow the [https://www.sifive.com/document-file/hifive-premier-p550-image-update-procedure official documentation] for the process; it basically boils down to copying a single file to an ext4-formatted USB stick and running a few commands at the <code>u-boot</code> prompt.
$ xz -d Fedora-Server-Minimal-P550-41.YYYYMMDD.riscv64.raw.xz
</pre>


then use <code>dd</code> or whatever tool you're comfortable with to write it to the target media, for example:
'''Fedora won't boot if you skip this step.'''
 
<pre>
$ sudo dd iflag=fullblock oflag=direct status=progress bs=4M if=Fedora-Server-Minimal-P550-41.YYYYMMDD.riscv64.raw of=/dev/sdb
</pre>
 
The command above assumes that you're writing the image to a microSD card connected to your computer via a USB card reader. Adjust as needed, making sure that you're targeting the correct media.


= Booting =
=== Serial console access ===


Pop the prepared media into the board and power it on. After a brief wait, Fedora should come up.
It should be noted however that the board exposes several serial consoles over the USB-C port, and you need to make sure you're connected to the right one.


The root password is <code>linux</code>.
Specifically, the device name that you should use in your configuration file (<code>pu port</code> line) is <code>/dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if02-port0</code>.


The image is fairly minimal, but any additional software you might need is just a short <code>dnf</code> invocation away.
See the [[Architectures/RISC-V/Installing#Serial console access|generic instructions]].


= Software quirks =
=== NVMe support (optional) ===
 
The image uses Jason Montleon's build of the 6.6-based vendor kernel. The configuration should be close to that of a regular Fedora kernel, but obviously the base is significantly older than current mainline and several downstream changes are included.
 
The board's DTB is passed to the kernel via GRUB2 (see `GRUB_DEFAULT_DTB` in `/etc/default/grub`) instead of being automatically loaded off the `/boot` filesystem. Once we have a Fedora build of the firmware ("bootchain") we'll be able to drop this hack.
 
GRUB2 is configured not to display its menu on boot. For whatever reason, the bootloader takes forever to draw its UI on the serial console, so hiding the menu is an effective way to avoid adding a significant delay to each boot. If you need to interact with GRUB2, just press ESC while the countdown is being displayed. Note that the countdown message could be somewhat hard to spot as it might overlap with previous serial output. Just pay attention to where the cursor is and you'll figure it out.
 
= Hardware quirks =
 
== NVMe ==


The board doesn't have a native NVMe slot, but it's still possible to install an NVMe drive by plugging an adapter [https://sabrent.com/products/EC-PCIE such as this one] into the PCIe slot.
The board doesn't have a native NVMe slot, but it's still possible to install an NVMe drive by plugging an adapter [https://sabrent.com/products/EC-PCIE such as this one] into the PCIe slot.
Line 60: Line 40:
=> env default -f -a
=> env default -f -a
## Resetting to default environment
## Resetting to default environment
=> env print boot_targets
=> env print boot_targets
boot_targets=mmc1 usb sata mmc0
boot_targets=mmc1 usb sata mmc0
=> env set boot_targets "mmc1 usb nvme0 sata mmc0"
=> env set boot_targets "mmc1 usb nvme0 sata mmc0"
=> env print boot_targets                     
=> env print boot_targets                     
boot_targets=mmc1 usb nvme0 sata mmc0
boot_targets=mmc1 usb nvme0 sata mmc0
=> env save
=> env save
Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done
Saving Environment to SPIFlash... Erasing SPI flash... Writing to SPI flash... done
OK
OK
</pre>
</pre>
Line 72: Line 56:
From the next time the board is powered on, the NVMe drive will be the preferred internal boot media.
From the next time the board is powered on, the NVMe drive will be the preferred internal boot media.


== Serial console access ==
== Media preparation ==


The board exposes several serial consoles over the USB-C port, and you need to make sure you're connected to the right one.
Disk images can be obtained from:


You can create a configuration file for <code>minicom</code> like so:
* https://dl.fedoraproject.org/pub/alt/risc-v/release/41/Server/riscv64/images/


<pre>
As of this writing, the most recent disk image is:
$ cat <<EOF >~/.minirc.p550
 
pu port            /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if02-port0
* [https://dl.fedoraproject.org/pub/alt/risc-v/release/41/Server/riscv64/images/Fedora-Server-Host-PremierP550-41.20250130.riscv64.raw.xz <code>Fedora-Server-Host-PremierP550-41.20250130.riscv64.raw.xz</code>]
pu baudrate        115200
 
pu bits            8
See the [[Architectures/RISC-V/Installing#Media_preparation|generic instructions]].
pu parity          N
 
pu stopbits        1
== First boot ==
pu rtscts          No
 
EOF
Once the disk image has been written to the target media, you can pop that into your machine and power it on.
</pre>
 
Assuming everything is fine, after a few seconds you should see the usual Linux boot messages scroll by on the serial console.
 
<code>initial-setup</code> is disabled in this image, so after a short wait you'll just be presented with a login prompt.
 
The root password is <code>linux</code>.


Once you've done that, you will be able to connect to the main serial console using
== Post-installation tasks ==


<pre>
See the [[Architectures/RISC-V/Installing#Post-installation tasks|generic instructions]].
$ minicom p550
</pre>


== Fan noise ==
=== Reduce fan noise ===


The CPU fan that comes with the board is quite loud and by default it runs at full speed, resulting in an uncomfortable amount of noise being produced. To mitigate this issue, you can configure the fan so that it runs at a much lower speed, reducing the noise significantly.
The CPU fan that comes with the board is quite loud and by default it runs at full speed, resulting in an uncomfortable amount of noise being produced. To mitigate this issue, you can configure the fan so that it runs at a much lower speed, reducing the noise significantly.

Revision as of 15:08, 31 January 2025

This page explains how to get Fedora running on the SiFive HiFive Premier P550 board.

Disclaimer

The image uses Jason Montleon's build of the 6.6-based vendor kernel. The configuration should be close to that of a regular Fedora kernel, but obviously the base is significantly older than current mainline and several downstream changes are included.

GRUB2 is configured not to display its menu on boot. For whatever reason, the bootloader takes forever to draw its UI on the serial console, so hiding the menu is an effective way to avoid adding a significant delay to each boot. If you need to interact with GRUB2, just press ESC while the countdown is being displayed. Note that the countdown message could be somewhat hard to spot as it might overlap with previous serial output. Just pay attention to where the cursor is and you'll figure it out.

The board's DTB is passed to the kernel via GRUB2 (see GRUB_DEFAULT_DTB in /etc/default/grub) instead of being automatically loaded off the /boot filesystem. Once we have a Fedora build of the firmware ("bootchain") we should be able to drop this hack.

Machine-specific instructions

Requirements

Firmware

You need to have upgraded the board's firmware ("bootchain") to the latest release. At the time of writing, that would be:

Follow the official documentation for the process; it basically boils down to copying a single file to an ext4-formatted USB stick and running a few commands at the u-boot prompt.

Fedora won't boot if you skip this step.

Serial console access

It should be noted however that the board exposes several serial consoles over the USB-C port, and you need to make sure you're connected to the right one.

Specifically, the device name that you should use in your configuration file (pu port line) is /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if02-port0.

See the generic instructions.

NVMe support (optional)

The board doesn't have a native NVMe slot, but it's still possible to install an NVMe drive by plugging an adapter such as this one into the PCIe slot.

Getting the firmware to boot off NVMe requires a small configuration change. At the u-boot prompt, run the following commands:

=> env default -f -a
## Resetting to default environment

=> env print boot_targets
boot_targets=mmc1 usb sata mmc0

=> env set boot_targets "mmc1 usb nvme0 sata mmc0"

=> env print boot_targets                    
boot_targets=mmc1 usb nvme0 sata mmc0

=> env save
Saving Environment to SPIFlash... Erasing SPI flash... Writing to SPI flash... done
OK

From the next time the board is powered on, the NVMe drive will be the preferred internal boot media.

Media preparation

Disk images can be obtained from:

As of this writing, the most recent disk image is:

See the generic instructions.

First boot

Once the disk image has been written to the target media, you can pop that into your machine and power it on.

Assuming everything is fine, after a few seconds you should see the usual Linux boot messages scroll by on the serial console.

initial-setup is disabled in this image, so after a short wait you'll just be presented with a login prompt.

The root password is linux.

Post-installation tasks

See the generic instructions.

Reduce fan noise

The CPU fan that comes with the board is quite loud and by default it runs at full speed, resulting in an uncomfortable amount of noise being produced. To mitigate this issue, you can configure the fan so that it runs at a much lower speed, reducing the noise significantly.

This can be easily achieved by creating a custom systemd unit:

$ cat <<EOF | sudo tee /etc/systemd/system/custom-fan-speed.service
[Unit]
Description=Set custom fan speed

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 20 >/sys/devices/platform/soc/50b50000.fan_control/hwmon/hwmon*/pwm1'

[Install]
WantedBy=multi-user.target
EOF

and enabling it:

$ sudo systemctl daemon-reload
$ sudo systemctl enable --now custom-fan-speed.service

The next time the machine is powered on, the fan will run at full speed for a few seconds before slowing down.

An alternative solution is to purchase a replacement fan such as the AVC DA05015R12H PWM fan. This is a much quieter fan that can be run at full speed while producing very little noise, or at a lower speed while being pretty much completely silent. Note that searching for the model name will yield several results, so make sure you order the one with a 4-pin connector. It's a bit taller than the original fan too, so you're going to need longer screws to hold it in place.