update readme

unstable
penguin 8 months ago
parent 59c295d959
commit 1065c778e5

@ -1,93 +1,202 @@
---
author: Penguin
date: 06/19/23
title: PolarFire SoC FPGA
---
# Table of Contents
# About the Board
1. [About the Board](#orgd72d6fe)
2. [Creating a Bootable Yocto Linux Image](#org320b6b1)
1. [Create a workspace (OPTIONAL)](#org3ac88ae)
2. [Update the repo workspace](#orgf613432)
3. [Set up the Bitbake environment](#org5551fb8)
4. [Building Board Disk Image](#orge48b62d)
1. [Building a Linux Image with a root file system (RootFS)](#org260c449)
2. [Building a RAM-based Root Filestystem](#org920972e)
3. [Building a Linux Image for an external QSPI flash memory](#org31f047f)
4. [Flashing an SD Card](#org0ce15e7)
3. [References](#org47ba498)
<img src="./doc/img/PolarFire-Board.png"
style="width:50.0%;height:50.0%" />
# Installing Libero (via portage)
# Installing Libero (MANUAL)
<a id="orgd72d6fe"></a>
## Prerequisites
# About the Board
## Installation Process
![img](./doc/img/PolarFire-Board.png)
``` bash
sudo mkdir -p /opt/Microchip
sudo chown $USER:$USER /opt/Microchip
unzip
```
Installer Directions:
<a id="org320b6b1"></a>
- Install Directory: /opt/Microchip/Libero_SoC_v2023.1
- Common Directory: /opt/Microchip/common
- Install Set: Everything
# Creating a Bootable Yocto Linux Image
## Post-Install
We have two options: Create a new workspace, or we can use this repo as a workspace because this repo is my working workspace.
``` bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Logs/req_to_install.sh
```
### Installing FlashPro Drivers
<a id="org3ac88ae"></a>
You need to have the FlashPro device to install these, so ignore this if
you don't have a FlashPro device.
## Create a workspace (OPTIONAL)
1. FlashPro 5
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
``` bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/udev_install
```
2. FlashPro 6
<a id="orgf613432"></a>
``` bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/fp6_env_install
```
## Update the repo workspace
### Installing Your License
repo sync
repo rebase
You can register for a Microchip and request a year-long evaluation
license here:
<https://www.microchipdirect.com/login?redirectTo=%2Ffpga-software-products>
You'll want to get the **LIB-PL-MACID-F-EVAL** license, which is a
floating linux license. If you're on windows, just get whatever license
works for you.
<a id="org5551fb8"></a>
``` bash
mkdir -p /opt/Microchip/Libero_SoC_v2023.1/license
cp /path/to/license /opt/Microchip/Libero_SoC_v2023/license
```
## Set up the Bitbake environment
### Installing the Licensing Daemon
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
``` bash
# install lsb-core
sudo apt install lsb-core
sudo cp scripts/libero-license.service /etc/systemd/user
```
# Install Yocto Ecosystem
<a id="orge48b62d"></a>
## Prerequisites
## Building Board Disk Image
``` bash
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm bmap-utils python3-distutils repo
```
## Create the Yocto Workspace
<a id="org260c449"></a>
``` bash
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
```
### Building a Linux Image with a root file system (RootFS)
## Update the repo workspace
``` bash
repo sync
repo rebase
```
## Setup the Bitbake environment
``` bash
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
```
## Optimize your build environment
Yocto builds take a very long time. We can optimize this.
``` bash
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
```
## Build the Disk Image
``` bash
cd $PROOT
bitbake mpfs-dev-cli
```
MACHINE=icicle-kit-es bitbake mpfs-dev-cli
# References
[PolarFire Yocto
Github](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)
# Creating a Bootable Yocto Linux Image
<a id="org920972e"></a>
We have two options: Create a new workspace, or we can use this repo as
a workspace because this repo is my working workspace.
### Building a RAM-based Root Filestystem
## Create a workspace (OPTIONAL)
MACHINE=icicle-kit-es bitbake -R conf/initramfs.conf mpfs-initramfs-image
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
## Update the repo workspace
<a id="org31f047f"></a>
``` bash
repo sync
repo rebase
```
### Building a Linux Image for an external QSPI flash memory
## Set up the Bitbake environment
``` bash
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
```
<a id="org0ce15e7"></a>
## Building Board Disk Image
### Flashing an SD Card
### Building a Linux Image with a root file system (RootFS)
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
``` bash
MACHINE=icicle-kit-es bitbake mpfs-dev-cli
```
### Building a RAM-based Root Filestystem
<a id="org47ba498"></a>
``` bash
MACHINE=icicle-kit-es bitbake -R conf/initramfs.conf mpfs-initramfs-image
```
# References
### Building a Linux Image for an external QSPI flash memory
1. [PolarFire SoC Yocto](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)
### Flashing an SD Card
``` bash
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
```
# References
**\*\***
[PolarFire SoC
Yocto](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)
**\*\***

@ -8,7 +8,125 @@
#+attr_html: :height 50%
[[./doc/img/PolarFire-Board.png]]
* Installing Libero
* Installing Libero (via portage)
* Installing Libero (MANUAL)
** Prerequisites
** Installation Process
#+begin_src bash
sudo mkdir -p /opt/Microchip
sudo chown $USER:$USER /opt/Microchip
unzip
#+end_src
Installer Directions:
- Install Directory: /opt/Microchip/Libero_SoC_v2023.1
- Common Directory: /opt/Microchip/common
- Install Set: Everything
** Post-Install
#+begin_src bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Logs/req_to_install.sh
#+end_src
*** Installing FlashPro Drivers
You need to have the FlashPro device to install these, so ignore this if you don't have a FlashPro device.
**** FlashPro 5
#+begin_src bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/udev_install
#+end_src
**** FlashPro 6
#+begin_src bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/fp6_env_install
#+end_src
*** Installing Your License
You can register for a Microchip and request a year-long evaluation license here: https://www.microchipdirect.com/login?redirectTo=%2Ffpga-software-products
You'll want to get the *LIB-PL-MACID-F-EVAL* license, which is a floating linux license. If you're on windows, just get whatever license works for you.
#+begin_src bash
mkdir -p /opt/Microchip/Libero_SoC_v2023.1/license
cp /path/to/license /opt/Microchip/Libero_SoC_v2023/license
#+end_src
*** Installing the Licensing Daemon
# TODO: Replace these ubuntu instructions with gentoo instructions
#+begin_src bash
# install lsb-core
sudo apt install lsb-core
sudo cp scripts/libero-license.service /etc/systemd/user
#+end_src
* Install Yocto Ecosystem
** Prerequisites
#+begin_src bash
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm bmap-utils python3-distutils repo
#+end_src
** Create the Yocto Workspace
#+begin_src bash
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
#+end_src
** Update the repo workspace
#+begin_src bash
repo sync
repo rebase
#+end_src
** Setup the Bitbake environment
#+begin_src bash
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
#+end_src
** Optimize your build environment
Yocto builds take a very long time. We can optimize this.
#+begin_src bash
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
#+end_src
** Build the Disk Image
#+begin_src bash
cd $PROOT
bitbake mpfs-dev-cli
#+end_src
* References
**** [[https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp][PolarFire Yocto Github]]
* Creating a Bootable Yocto Linux Image
We have two options: Create a new workspace, or we can use this repo as a workspace because this repo is my working workspace.

Loading…
Cancel
Save