You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

322 lines
8.6 KiB
Markdown

11 months ago
# Table of Contents
1. [Installing via Portage](#org3a6549a)
2. [Installing Manually](#orge000bac)
1. [Prerequisites](#org0fd2701)
1. [Download Libero](#orgbf609ab)
2. [Download SoftConsole](#orgfa083ed)
2. [Install](#orgc791c33)
1. [Setup](#org180e2e4)
2. [Install Libero](#orgfe1c9e4)
3. [Install SoftConsole](#orgc4f7dd5)
3. [Post-Install](#org1aab735)
1. [Installing FlashPro Drivers](#orgcec48c8)
2. [Installing Your License](#org01887da)
3. [Installing the Licensing Daemon](#orgb0a7b68)
3. [Install Yocto Ecosystem](#orgecf7921)
1. [Prerequisites](#org2fca117)
2. [Create the Yocto Workspace](#org2f15271)
3. [Update the repo workspace](#orgce514fa)
4. [Setup the Bitbake environment](#org732eaac)
5. [Optimize your build environment](#orgac0a974)
6. [Build the Disk Image](#orgf5edd26)
4. [Creating a Bootable Yocto Linux Image](#org40b9d56)
1. [Create a workspace (OPTIONAL)](#orga1efcaa)
2. [Update the repo workspace](#org35bd6db)
3. [Set up the Bitbake environment](#org4c59d20)
4. [Building Board Disk Image](#orgbaf8a8f)
1. [Building a Linux Image with a root file system (RootFS)](#org72cdb3e)
2. [Building a RAM-based Root Filestystem](#org1d95b8f)
3. [Building a Linux Image for an external QSPI flash memory](#orgbf5cb99)
4. [Flashing an SD Card](#org1cfcc9a)
5. [References](#org30d3773)
<a id="org3a6549a"></a>
# TODO Installing via Portage
<a id="orge000bac"></a>
11 months ago
2 months ago
# Installing Manually
11 months ago
<a id="org0fd2701"></a>
2 months ago
## Prerequisites
11 months ago
sudo emerge -a sys-apps/lsb-release
<a id="orgbf609ab"></a>
11 months ago
2 months ago
### Download Libero
11 months ago
Download the latest version from [here](https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/fpga/libero-software-later-versions).
11 months ago
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/libero_soc_*.*_web_lin.zip .
unzip libero_soc_*.*_web_lin.zip
<a id="orgfa083ed"></a>
11 months ago
2 months ago
### Download SoftConsole
Download the latest version from [here](https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/soc-fpga/softconsole).
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run .
2 months ago
<a id="orgc791c33"></a>
2 months ago
## Install
<a id="org180e2e4"></a>
2 months ago
### Setup
export INSTALL_DIR=/opt/microchip
sudo mkdir -p $INSTALL_DIR
sudo chown $USER:$USER $INSTALL_DIR
<a id="orgfe1c9e4"></a>
2 months ago
### Install Libero
2 months ago
Installer Directions:
11 months ago
- Install Directory: $INSTALL\_DIR/Libero\_SoC\_<version\_major>.<version\_minor>
- Common Directory: $INSTALL\_DIR/common
2 months ago
- Install Set: Everything
cd ~/Documents/MicrochipInstallers
./Libero_SoC_*.*_Web.bin
2 months ago
1. Gentoo Specific Libero Fixes
When attempting to run `/opt/microchip/Libero_SoC_v2024.1/Libero/bin64/libero`, you will most likely be met with the following error:
Warning: You are running a version of Suse Linux that is not supported.
Please refer to Libero SoC Release Note for the detail of supported operating systems.
/opt/microchip/Libero_SoC_v2024.1/Libero/bin64/libero_bin: /opt/microchip/Libero_SoC_v2024.1/Libero/lib64/rhel/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib64/libicuuc.so.74)
The way I chose to combat this was to delete all of the `libstdc++.so.6` files that came with the tools and then supplying the system&rsquo;s provides files via $LD\_LIBRARY\_PATH. I&rsquo;ve also chosen to do this with git commits so you don&rsquo;t have to start all over if you mess up. The git parts are optional but recommended. (Thanks to sam for helping me figure this out)
cd /opt/microchip/Libero_SoC_*.*
git init
git add .
git commit -m "init"
find . -name "libstdc++.so.6" -type f -or -type l -delete
git add .
git commit -m "removed tool specific libstdc++.so.6 files"
# test it to make sure it launches
LD_LIBRARY_PATH="/usr/lib/gcc/x86_64-pc-linux-gnu/13" ./Libero/bin64/libero
This should launch and then give you an error saying license not found. This is normal and will be fixed later in the guide.
<a id="orgc4f7dd5"></a>
2 months ago
### Install SoftConsole
cd ~/Documents/MicrochipInstallers
./Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run
<a id="org1aab735"></a>
11 months ago
2 months ago
## Post-Install
11 months ago
sudo $INSTALL_DIR/Libero_SoC_*.*/Logs/req_to_install.sh
<a id="orgcec48c8"></a>
11 months ago
2 months ago
### Installing FlashPro Drivers
11 months ago
You need to have the FlashPro device to install these, so ignore this if you don&rsquo;t have a FlashPro device.
11 months ago
2 months ago
1. FlashPro 5
11 months ago
sudo $INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/udev_install
11 months ago
2 months ago
2. FlashPro 6
11 months ago
sudo $INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/fp6_env_install
<a id="org01887da"></a>
11 months ago
2 months ago
### Installing Your License
11 months ago
You can register for a microchip and request a year-long evaluation license here: <https://www.microchipdirect.com/login?redirectTo=%2Ffpga-software-products>
11 months ago
You&rsquo;ll want to get the **LIB-PL-MACID-F-EVAL** license, which is a floating linux license.
11 months ago
mkdir -p $INSTALL_DIR/Libero_SoC_v2023.1/license
cp /path/to/license /opt/microchip/Libero_SoC_v2023/license
<a id="orgb0a7b68"></a>
11 months ago
2 months ago
### Installing the Licensing Daemon
11 months ago
sudo cp scripts/libero-license.service /etc/systemd/user
<a id="orgecf7921"></a>
11 months ago
2 months ago
# Install Yocto Ecosystem
11 months ago
<a id="org2fca117"></a>
2 months ago
## Prerequisites
11 months ago
sudo emerge -pv gawk wget dev-vcs/git diffstat unzip sys-apps/texinfo chrpath socat libsdl xterm bmap-tools repo
sudo emerge -a
2 months ago
<a id="org2f15271"></a>
11 months ago
2 months ago
## Create the Yocto Workspace
11 months ago
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
<a id="orgce514fa"></a>
11 months ago
2 months ago
## Update the repo workspace
repo sync
repo rebase
<a id="org732eaac"></a>
2 months ago
## Setup the Bitbake environment
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
<a id="orgac0a974"></a>
2 months ago
## Optimize your build environment
Yocto builds take a very long time. We can optimize this.
mkdir -p ${HOME}/.local/share/yocto/downloads
mkdir -p ${HOME}/.local/share/yocto/sstate-cache
mkdir -p ${HOME}/.local/share/yocto/persistent
cd <project_root>/build/conf/
echo '
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count() - 1}"
DL_DIR = "${HOME}/.local/share/yocto/downloads"
SSTATE_DIR = "${HOME}/.local/share/yocto/sstate-cache"
PERSISTENT_DIR=${HOME/.local/share/yocto/persistent
SOURCE_MIRROR_URL ?= "file://${HOME}/.local/share/yocto/downloads"
INHERIT += "own-mirrors"
BB_GENERATE_MIRROR_TARBALLS = "1"
# uncomment to test sources
# BB_NO_NETWORK = "1"
# remove static deps
STATICLIBCONF = "--disable-static"
DISABLE_STATIC:pn-openssl = ""
DISABLE_STATIC:pn-openssl-native = ""
DISABLE_STATIC:pn-nativesdk-openssl = ""
DISABLE_STATIC:pn-libtalloc = ""
EXTRA_OECONF += "${STATICLIBCONF}"
' >> local.conf
<a id="orgf5edd26"></a>
2 months ago
## Build the Disk Image
cd $PROOT
bitbake mpfs-dev-cli
<a id="org40b9d56"></a>
11 months ago
2 months ago
# Creating a Bootable Yocto Linux Image
11 months ago
We have two options: Create a new workspace, or we can use this repo as a workspace because this repo is my working workspace.
<a id="orga1efcaa"></a>
11 months ago
2 months ago
## Create a workspace (OPTIONAL)
11 months ago
2 months ago
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
11 months ago
<a id="org35bd6db"></a>
2 months ago
## Update the repo workspace
11 months ago
repo sync
repo rebase
<a id="org4c59d20"></a>
11 months ago
2 months ago
## Set up the Bitbake environment
11 months ago
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
<a id="orgbaf8a8f"></a>
11 months ago
2 months ago
## Building Board Disk Image
11 months ago
<a id="org72cdb3e"></a>
2 months ago
### Building a Linux Image with a root file system (RootFS)
11 months ago
MACHINE=icicle-kit-es bitbake mpfs-dev-cli
<a id="org1d95b8f"></a>
11 months ago
2 months ago
### Building a RAM-based Root Filestystem
11 months ago
MACHINE=icicle-kit-es bitbake -R conf/initramfs.conf mpfs-initramfs-image
<a id="orgbf5cb99"></a>
11 months ago
2 months ago
### Building a Linux Image for an external QSPI flash memory
11 months ago
<a id="org1cfcc9a"></a>
2 months ago
### Flashing an SD Card
zcat build/tmp-glibc/deploy/images/icicle-kit-es/mpfs-dev-cli-icicle-kit-es.wic.gz | sudo dd of=/dev/sdX bs=4096 iflag=fullblock oflag=direct conv=fsync status=progress
<a id="org30d3773"></a>
2 months ago
# References
11 months ago
1. [PolarFire Yocto Github](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)