The intent of this document is to share the hardware setup and source code
build instructions to bring up Fedora 29 GNOME desktop on HiFive Unleased
board. It is assumed that you know how to set up a RISC-V development environment.
If not please follow the instructions below using the freedom-u-sdk.
git clone https://github.com/sifive/freedom-u-sdk.git
cd freedom-u-sdk
git submodule update --init --recursive
make
make qemu (for qemu boot)
Let's get back to the problem at hand i.e. Setup Fedora 29 GNOME desktop on RISC-V!
Here is the hardware used for our setup.
Again, this is the only expansion board available with multiple I/O Support
However, only PCIe, SATA, M.2 SSD connectors are enabled right now.
Radeon HD 6450 GPU card
Any Caicos-based card should be OK, but the kernel config instructs specific firmware to be used. It is recommended to use the above specific GPU as it is verified. In case you want to use any other GPU, load the appropriate firmware accordingly.
x1 PCI Express card connector can be used to provide USB ports for
mouse/keyboard.
SATA Drive(HDD/SSD) or NVMe SSD. This is where the Fedora image will be copied.
It is not recommended to use an image from a micro SD card.
FYI: NVMe SSD should be connected via the NVMe M.2 connector present at the bottom of the expansion card.
The board layout is available here
Project directory:
The current upstream kernel (v4.19-rc2) boots in QEMU for RISC-V. However, it is still
missing some of the HiFive Unleashed specific drivers. That's why the Linux kernel
source tree also has to be hosted out of mainline tree.
riscv-linux-conf:
It contains the required Linux config file for this project. This needs to be copied to freedom-u-sdk conf directory.
N.B. The Linux config file will only work for HiFive Unleashed board with a GPU card. You can't use this in a QEMU setup. Mainline kernel 4.19-rc2 should boot in QEMU without
any issues.
riscv-linux:
It is based on 4.19-rc2 and contains all required drivers and a couple of kernel hacks.
Here is the summary of out-of-tree commits:
-------------------------------------------------
Kernel hacks
-------------------------------------------------
e5b7972a RISCV: Fix end PFN for low memory
aa230e7d RISC-V: Networking fix Hack
-------------------------------------------------
Microsemi expansion board specific driver
-------------------------------------------------
1fd6c8fb pcie-microsemi: added support for the Vera-board root complex
-------------------------------------------------
Unleashed Specific drivers
-------------------------------------------------
e6655fae pwm-sifive: add a driver for SiFive SoC PWM
28447771 gpio-sifive: support GPIO on SiFive SoCs
ca0f9319 u54-prci: driver for core U54 clocks
b7bd3468 u54-prci: driver for core U54 clocks
c61e4295 gemgxl-mgmt: implement clock switch for GEM tx_clk
58f76c1c serial/sifive: initial driver from Paul Walmsley
dc4e19c2 spi-nor: add support for is25wp{32,64,128,256}
f169ce24 spi-sifive: support SiFive SPI controller in Quad-Mode
riscv-pk:
This repository builds the BBL (Berkely Boot Loader) for RISC-V project.
To use the Microsemi expansion board, the DT in HiFive Unleashed board has
to be updated unless you have the latest firmware with updated DT.
In that case, you don't need this change.
All the above patches are copied here in separate directories according to the projects.
resources:
This contains the dmesg, lspci & devicetree output for verification purpose.
Build
The build instructions are based on freedom-u-sdk setup only on Ubuntu 16.04. It may not work correctly if you are using your own toolchain.
If you are using your own toolchain build, you can just compile the riscv-pk and riscv-linux separately and use the bbl.bin image.
You should directly apply these patches on top of your tree as well instead of checkout procedure
explained below. Here is commit head on which patches should be applied.
linux: 57361846 Linux 4.19-rc2
riscv-pk: 5a0e3e55 minit: insert printm as work-around for a race condition
Now the new BBL will add Microsemi specific PCIe entry to the device tree.
You can always verify the device tree entry by adding '--enable-print-device-tree'
option to the root Makefile in freedom-u-sdk as per below diff.
Copy the Linux config from this repo to your freedom-u-sdk directory.
The current config mounts the Fedora image to the first partition of the disk.
The present config file has two options
SATA SSD (root=/dev/sda1)
NVME SSD (root=/dev/nvme0n1p1)
Enable/disable correct CONFIG_CMDLINE config based on your setup.
cd <freedom-u-sdk path>/conf
cp <RISC-V-LInux project>/riscv-linux-conf/config_fedora_success_4.19_demo_sep11 .
cd <freedom-u-sdk path>
Update freedom-u-sdk Makefile to use the just copied config. Apply the below diff
(The drive should be connected to your Desktop/Laptop. If it is recognized as something other than /dev/sda1, please change accordingly.)
Now connect the hard drive in appropriate slot on Expansion board.
Connect the power to the Expansion board only. It powers the unleashed board as well.
Turn on the Unleashed switch.
Turn on the Expansion board switch.
Connect to the serial terminal. If a display is connected, you should Fedora prompt in a while. Once you are done with the initial Fedora setup process in the screen, you may have to reboot the system.
Welcome to RISC-V Fedora Desktop!!
Acknowledgement:
[1] Fedora image instructions are available from this page.
(Responsible for Fedora builds and numerous help over irc)
请发表评论