256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader...

23
Intel ® Stratix ® 10 SoC UEFI Boot Loader User Guide UG-20080 2017.06.19 Subscribe Send Feedback

Transcript of 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader...

Page 2: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

Contents

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide....................................................... 31.1 Boot Flow Overview................................................................................................ 31.2 Recommended System Requirements........................................................................ 4

1.2.1 Minimum Hardware Requirements.................................................................41.2.2 Minimum Software Requirements..................................................................4

1.3 Getting Started...................................................................................................... 41.3.1 Download Software Components...................................................................41.3.2 Building the UEFI Boot Loader...................................................................... 4

1.4 Stratix 10 SoC Virtual Platform ................................................................................ 91.4.1 Installing the Stratix 10 SoC Virtual Platform..................................................91.4.2 Installing and Booting a Pre-Built Linux Kernel for the Stratix 10 SoC

Virtual Platform....................................................................................... 101.4.3 Running the SoC Virtual Platform with the UEFI Boot Loader...........................101.4.4 Ping and DHCP Test...................................................................................111.4.5 TFTP....................................................................................................... 131.4.6 Booting Linux From the Pit Stop Console...................................................... 161.4.7 Booting VxWorks from DXE Console.............................................................16

1.5 Booting PXE using Stratix 10 SoC Virtual Platform..................................................... 171.5.1 Network Setup......................................................................................... 181.5.2 Preparing the Boot Image.......................................................................... 191.5.3 Setting up the TFTP Server in Ubuntu.......................................................... 191.5.4 Starting Xinetd Services.............................................................................201.5.5 Disable Firewall........................................................................................ 201.5.6 DHCP Server............................................................................................ 211.5.7 Removing Configuration.............................................................................211.5.8 PXE Client- UEFI....................................................................................... 22

1.6 Revision History of Stratix 10 SoC UEFI Boot Loader User Guide..................................23

Contents

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide2

Page 3: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1 Intel® Stratix® 10 SoC UEFI Boot Loader User GuideThis document provides comprehensive information on Unified Extensible FirmwareInterface (UEFI) boot loader for Intel® Stratix® 10 SoC.

1.1 Boot Flow Overview

The binary image of the UEFI boot loader can be stored on Quad SPI flash, NANDflash, or an SD/MMC card. On board power-up, the secure device manager (SDM)loads the UEFI boot loader directly onto Hard Processor System (HPS) on-chip RAM.

The UEFI boot loader tasks include:

• Initializing DDR SDRAM memory

• Configuring low level hardware such as PLL, IOs, and pin-muxing

• Supporting basic hardware diagnostic features

• Fetching subsequent boot software such as the operating system package orkernel image.

Note: For non-secure boot, the operating system package can include kernel image, devicetree blob and filesystem. For secure boot it can be a secure kernel.

Figure 1. UEFI Boot Flow Overview

Boot ROM

SDM

UEFI

Bare-Metal Application/OS

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel Corporation. All rights reserved. Intel, the Intel logo, Altera, Arria, Cyclone, Enpirion, MAX, Nios, Quartusand Stratix words and logos are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or othercountries. Intel warrants performance of its FPGA and semiconductor products to current specifications inaccordance with Intel's standard warranty, but reserves the right to make changes to any products and servicesat any time without notice. Intel assumes no responsibility or liability arising out of the application or use of anyinformation, product, or service described herein except as expressly agreed to in writing by Intel. Intelcustomers are advised to obtain the latest version of device specifications before relying on any publishedinformation and before placing orders for products or services.*Other names and brands may be claimed as the property of others.

ISO9001:2008Registered

Page 4: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.2 Recommended System Requirements

To load and execute the Stratix 10 SoC Unified Extensible Firmware Interface (UEFI)boot loader, your system must meet the following requirements.

1.2.1 Minimum Hardware Requirements

• Windows PC or Linux workstation with the following configuration:

— Serial termination (Minicom for Linux and Tera Tem for Windows)

— Micro SD card slot or Micro SD card writer or SD capable writer with SD tomicro SD converter

1.2.2 Minimum Software Requirements

• Intel SoC FPGA Embedded Development Suite (SoC EDS) v17.0

• Stratix 10 SoC Virtual Platform v1.3

Related Links

• Stratix 10 SoC Virtual Platform User Guide

• Stratix 10 SoC Virtual Platform Release Notes

1.3 Getting Started

1.3.1 Download Software Components

You must install the Intel SoC FPGA EDS v17.0 on your machine.

Download the SoC EDS from the Download Center.

1.3.2 Building the UEFI Boot Loader

To build a UEFI boot loader, you must obtain the UEFI source code and compile theUEFI source with the supported toolchain.

You can compile the UEFI source code either in a Windows or in a Linux system.

1.3.2.1 Prerequisites

For Windows System

If you are using a Windows system, the following components must be installed onyour machine:

• Git (You can download it from Git)

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide4

Page 5: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

For Linux System

If you are using a Linux system, install packages are required. Depending on yourLinux distribution, the command to install the packages is different:

If you are using a Ubuntu distribution, type:

$ sudo apt-get install uuid-dev build-essential

Note: Intel has verified that the Ubuntu 14.04 Linux distribution and the CommunityEnterprise Operating System (CentOS) 6.8 Linux distribution support the Stratix 10SoC Virtual Platform.

If you using a Fedora distribution, type:

$ sudo yum install uuid-devel libuuid-devel

For building UEFI, the Python package is required. If your host does not have Pythoninstalled, you can obtain it from the SoC EDS installation path, by typing:

export PATH=$SOCEDS_DEST_ROOT/host_tools/python/bin/:$PATH

1.3.2.2 Supported Compiler Toolchain

The supported UEFI compiler toolchain is:

• Linaro*:

— aarch64-linux-gnu-gcc (crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC4.8-2014.04) 4.8.3 20140401 (prerelease)

— If you are using a Linux system, download the gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux.tar.

— If you are using a Windows system, download the gcc-linaro-aarch64-linux-gnu-4.8-2014.04_win32.zip.

1.3.2.3 Obtaining the UEFI Source Code

The UEFI source code is located in GitHub. The following steps show you how to getthe UEFI source code.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide5

Page 6: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1. Open a terminal.

2. Create a new directory path to check out the UEFI source code from the GitHub.

$ mkdir /data/<username>/<Path_to_UEFI_Source_Code>

3. Change your directory to this UEFI working directory and clone the UEFI sourcefrom the git trees.

$ cd /data/<username>/<Path_to_UEFI_Source_Code>$ git clone https://github.com/altera-opensource/uefi-socfpga

4. When completed, change to the uefi-socfpga folder and perform a git checkout.

$ cd uefi-socfpga $ git checkout -b socvp_socfpga_udk2015 – track origin/socvp_socfpga_udk2015

1.3.2.4 Compiling the UEFI Source Code with the Linaro Tool Chain

1.3.2.4.1 Windows System

This section explains how to compile the UEFI source code with the Linaro toolchain ina Windows system:

1. Open the command prompt.

2. Go to your working directory and set the SOCEDS_DEST_ROOT to the location ofyour SoC EDS.

$ cd <your_working_directory>\uefi-socfpga$ set SOCEDS_DEST_ROOT=<your_SOCEDS_location>

3. Set the GCC path to the location of the compiler toolchain.

$ set PATH=<your_Linaro GCC Toolchain_location>;%PATH%

Note: If you encountered GCC error while compiling the UEFI source code aftersetting the path, you can edit the setup.bat file manually by entering thefollowing command to use the full compiler path.

set GCC48_ARM_PREFIX= %DS5_ROOT%\sw\gcc\bin\arm-linux-gnueabihf-set GCC48_AARCH64_PREFIX= <your working directory>\uefi_17v0_window\gcc-linaro-aarch64-linux-gnu-4.8-2014.04_win32\bin\aarch64-linux-gnu-

4. Run the setup command.

$ setup.bat

5. Build the UEFI by entering the following command:

$ make device=s10

6. The command prompt displays "Build Done" message once the UEFI is successfullycompiled.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide6

Page 7: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.3.2.4.2 Linux System

This section explains how to compile the UEFI source code with the Linaro toolchain ina Linux system:

1. Open a terminal and enter the following command:

$ cd <your_uefi_directory>/uefi-socfpga$ export PATH=<your gcc directory>/gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux/bin:$PATH

2. Clean the entire <your_uefi_directory>/uefi-socfpga/Build/ folder andBaseTools folder by entering the following command:

$ make clean

3. Compile the UEFI boot loader for the Stratix 10 SoC device by entering thefollowing command:

$ make DEVICE=s10

4. Your terminal displays a "Build Done" message once the UEFI is successfullycompiled.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide7

Page 8: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.3.2.5 UEFI Generated Files

Compiling the UEFI source code creates the following files in the<your_uefi_directory>/uefisocfpga/Build/Stratix10SoCPkg/RELEASE_GCC48 folder:

Table 1. UEFI Generated Files

File Description

~ /uefi-socfpga/Build/Stratix10SoCPkg/RELEASE_GCC48/PEI.256(256KB)

This is the main UEFI boot loader file.It contains the device tree for the HPSand the code that initializes the HPS.After initialization, the HPS can boot toBare Metal application, RTOS, andLinux. You can extend the UEFI bootphase to boot from the DriverExecution Environment ROM(DXE.ROM) file and configure the UEFInetwork and shell support.The UEFI boot loader file is generatedfrom the mkpimage tool by adding aheader to the original file located at ~/uefisocfpga/Build/Stratix10SoCPkg/RELEASE_GCC48/FV/ALTERA_HPS_OCRAM_EFI_PART1.fd.Because the file size is 256 KB, it loadsdirectly into the HPS on-chip usingARM DS-5* Development Studio.This file generates the Pre EFIInitialization ROM (PEI.ROM) file. ThePEI.ROM file contains four duplicateimages of the UEFI boot loader.

~ /uefi-socfpga/Build/Stratix10SoCPkg/RELEASE_GCC48/PEI.ROM(1MB = 256KB X 4)

This file is programmed onto the flashdaughter card. The size of this file isfour times bigger because the bootROM can support up to four backupimages. For example, if the first image(256KB) is corrupted, the boot ROMloads the second image and so on.

~ /uefi-socfpga/Build/Stratix10SoCPkg/RELEASE_GCC48/load_uefi_fw.ds

This is the DS-5 script template. It isimported to the DS-5 tool and loadsthe UEFI firmware for debug anddevelopment purposes. This scriptloads the debug symbols for the user.Currently, it only supports the GCCcompiler. ARMCC is not supported.

~ /uefi-socfpga/Build/Stratix10SoCPkg/RELEASE_GCC48/DXE.ROM This file loads the optional secondstage of the UEFI boot loader whenyou want to boot the UEFI shell andutilize the TFTP feature or run a UEFIapplication.The difference between thePEI.ROM file and the DXE.ROM fileare:

continued...

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide8

Page 9: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

File Description

• The PEI.ROM file loads andexecutes from the HPS on-chipRAM. The DXE.ROM file executesfrom the DDR SDRAM.

• The PEI.ROM file generallyinitializes the HPS while theDXE.ROM file targets the EthernetMAC and PHY providing full networkstack support.

1.4 Stratix 10 SoC Virtual Platform

1.4.1 Installing the Stratix 10 SoC Virtual Platform

You must have an account to gain access to the Download Center. You must also belogged in to continue.

You can download and install the Stratix 10 SoC Virtual Platform from Intel's softwaresite.

1. Download the Stratix 10 SoC Virtual Platform tar file (Stratix10_vp.tgz) fromthe Stratix 10 SoC Virtual Platform Download page to your chosen directory.

2. Uncompress the virtual platform by typing the following command:

tar zxvf Stratix10_vp.tgz

This command creates a directory named Stratix10_vp which contains aninstaller named install.sh.

install.sh is a simple script that runs install_s10socvp.exe for you.install_s10socvp.exe installs the virtual platform to your directory.

3. Install the Stratix 10 SoC Virtual Platform, using one of two methods:

Note: The directory ./altera should not exist prior to installation because theinstaller will not overwrite an existing directory.

• Method 1: Type the following command if you would like to read the End UserLicense Agreement before installation:

./Stratix10_vp/install.sh ./altera

The installer displays the following message:

Please press return to display the End User License Agreement

After the license agreement is displayed, answer y or n to the prompt:

Do you accept this End User License Agreement? [y/n]:

• Method 2: Type the following command if you would like to accept the EndUser License Agreement in advance:

./Stratix10_vp/install.sh -a ./altera

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide9

Page 10: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

The Stratix 10 SoC Virtual Platform is now installed in ./altera.

1.4.2 Installing and Booting a Pre-Built Linux Kernel for the Stratix 10SoC Virtual Platform

You can use the pre-built Linux kernel provided on RocketBoards.org to boot theStratix 10 SoC Virtual Platform.

1. Open a console and go to the directory where your virtual platform is installed:

cd <PATH_TO_VP_INSTALL_DIR>

2. At the Linux prompt, type the following command to download the Stratix 10 SoCVirtual Platform Linux images:

wget --no-cache http://rocketboards.org/foswiki/pub/Documentation/\Stratix10SoCVPLinux/linux-stratix10swvp-socfpga-4.5-angstrom-v2014.12-\swvp-1.3.tgz

3. Uncompress the tgz file by typing the following command:

tar xvzf ./linux-stratix10swvp-socfpga-4.5-angstrom-v2014.12-swvp-1.3.tgz

This command creates the following files under <PATH_TO_VP_INSTALL_DIR>:

• ./sd-angstrom-v2014.12-stratix10swvp.img: contains the SD/MMCroot file system image

• ./linux-system-sd.elf: contains the Linux kernel image

Note: If the .img file is not writeable, you will see this error message:

Cannot insert disk, file not found: ./sd-angstrom-v2014.12-stratix10swvp.img

4. To run the Stratix 10 SoC Virtual Platform with the default pre-built Linux binaries,type the following command:

cd <PATH_TO_VP_INSTALL_DIR>./run.exe

After the command completes, an Ångström prompt appears and you are at thelogin prompt. Login with a username of “root” and leave the password field blankto enter the root directory.

1.4.3 Running the SoC Virtual Platform with the UEFI Boot Loader

Follow these steps to run the Stratix 10 SoC Virtual Platform with the UEFI bootloader:

1. Go to SoC Virtual Platform installation directory, edit parameters.txt file toenable GNU debugger (GDB) session. You can enable the GBD session byuncommenting gdbstub_port=1234 statement in parameters.txt file.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide10

Page 11: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

2. Change your directory to the directory where your virtual platform is installed andlaunch the run.exe.

$ cd <your SoCVP directory> $ ./run.exe

3. Open a new terminal and launch a debugger by typing the following commands:

$ cd <Path to linaro toolchain>/ gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux/bin$ ./aarch64-linux-gnu-gdb

4. Type the following commands at the GDB debugger prompt:

$ target remote:1234$ restore <Path to UEFI source code>/Build/Stratix10SoCPkg/RELEASE_GCC48/PEI.256 binary 0xffe00000$ set var $pc=0xffe00000

5. Run the SoC Virtual Platform by typing the following command:

$ continue

1.4.4 Ping and DHCP Test

This section describes how to use basic standard network commands: ifconfig andping.

1.4.4.1 Ping Test

You can perform a ping test to verify network connectivity and communications. Followthese steps to perform the ping test. This test requires that you have installed the SoCVirtual Platform.

1. Launch the GNU debugger (GDB) using the instructions in the "Running the SoCVirtual Platform with the UEFI Boot Loader" section.

2. Enter the following commands at the GDB console:

$ target remote:1234$ restore <Path to UEFI source code>/Build/Stratix10SoCPkg/RELEASE_GCC48/PEI.256 binary 0xffe00000

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide11

Page 12: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

$ restore <Path to UEFI source code>/Build/Stratix10SoCPkg/RELEASE_GCC48/DXE.ROM binary 0x02000000$ set var $pc=0xffe00000

3. Run the SoC Virtual Platform by typing the following command:

$ continue

4. Enter the following commands at the DXE console:

$ ifconfig -s eth0 static 192.168.0.9 255.255.255.0 192.168.0.1$ ifconfig -l eth0$ ping -n 2 192.169.0.1

Figure 2. Ping Test- DXE Console

Related Links

Running the SoC Virtual Platform with the UEFI Boot Loader on page 10

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide12

Page 13: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.4.4.2 DHCP Test

You can perform a DHCP test to the IP address of the DHCP server. Follow these stepsto perform the DHCP test:

1. Launch the DXE console using the instructions in the "Ping Test" section.

2. Type the following command at the DXE console:

$ ifconfig -s eth0 dhcp$ ifconfig -l eth0

3. The target console looks similar to the view below:

Figure 3. DHCP Test- Target Console

Note: A startup.nsh script is compiled when you build the boot loader. Thisscript executes the commands automatically when DXE phase is entered.

Related Links

Ping Test on page 11

1.4.5 TFTP

This section describes how to install a TFTP server and verify its functionality.

Note: You can perform the TFTP test only in a Linux based SoC Virual Platform environment.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide13

Page 14: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.4.5.1 Installing a TFTP Server at the CentOS Host Machine

Follow these steps to install a TFTP server at the CentOS host machine:

1. Install the required packages by typing the following command:

$ sudo yum install httpd xinetd syslinux tftp-server

2. Edit the /etc/xinetd.d/tftp file by typing following command:

$ vi /etc/xinetd.d/tftp

3. Enable the TFTP server by changing the disable=yes to no. You can change theserver path to your desired location.

4. Change the TFTP port from 69 to 70 in the services.txt file to enable thetransfer of the UDP packets.

$ sudo vi /etc/services

5. To start the TFTP server, type the following command:

$ sudo service xinetd stop$ sudo service xinetd start

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide14

Page 15: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.4.5.2 Running the TFTP on the Client Side

To run the TFTP on the client side follow these steps:

1. Boot to DXE phase using the instructions in the "Ping Test" section.

2. To apply the static IPv4 address configuaration for Ethernet interface, enter thefollowing command at the DXE console:

$ ifconfig -s eth0 static 192.168.0.9 255.255.255.0 192.168.0.1$ ifconfig -l eth0

3. Perform the TFTP test by typing the following commands:

$ fs 1:$ tftp -r 70 192.168.0.1 <file located in the based directory of TFTP server>

4. Once the TFTP test is completed, ensure that the file is successfully transferred bytyping the following command:

$ ls

Related Links

Ping Test on page 11

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide15

Page 16: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.4.6 Booting Linux From the Pit Stop Console

The following section describes how to boot Linux from the Pit Stop console. The PitStop Utility is a lightweight command-line interpreter that provides debug supportthrough a fixed list of commands.

Note: Ensure that you have downloaded the SoC Virtual Platform.

1. Run the SoC Virtual Platform with the UEFI boot loader images using theinstructions in "Running the SoC Virtual Platform with the UEFI Boot Loader"section.

2. Once UEFI boot loader is loaded, press any key to enter Pit Stop Utility.

3. To boot Linux from RAM enter the following command:

$ bootr

Related Links

Running the SoC Virtual Platform with the UEFI Boot Loader on page 10

1.4.7 Booting VxWorks from DXE Console

Follow these steps to boot VxWorks from DXE Console:

1. Run the SoC Virtual Platform and open the DXE console using the instructions inthe "Ping Test" section.

2. Using the DXE console, move the VxWorks image into your FAT partition. You cantransfer the VxWorks image to your FAT partition in one of two ways:

• Use TFTP

• Include the VxWorks image in the SDM image you create

The following steps describe the TFTP method. You can configure your TFTP serverand run the TFTP on the client side using the instructions in the "TFTP" section.

3. After the file transfer is complete, run the following commands at the DXE consoleto boot VxWorks.

$ runaxf vxWorks

Figure 4. Booting VxWorks at the DXE Console

4. VxWorks boots on the console. The target console looks similar to the view below:

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide16

Page 17: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

Figure 5. Target Console

Related Links

• Ping Test on page 11

• TFTP on page 13This section describes how to install a TFTP server and verify its functionality.

1.5 Booting PXE using Stratix 10 SoC Virtual Platform

The following section describes how to setup a Preboot Execution Environment (PXE)boot for the Stratix 10 SoC Virtual Platform on a dedicated Ubuntu machine.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide17

Page 18: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.5.1 Network Setup

1.5.1.1 Dependencies

1. To set up a PXE server on an Ubuntu machine, you must install certaindependencies. Type the following command:

$ sudo aptitude install bridge-utils iproute2

2. Ensure that the "tun" kernel module is in place.

$ sudo modprobe tun

1.5.1.2 Setup Internet via eth0 and Bridge through DHCP

For this configuration, you must establish an Internet connection through WiFi (wlan0interface), which is on an external network. The IP address is obtained from anexternal DHCP server. The figure below depicts the Internet connection as a separatesubnetwork.

You must also create a local sub-network with a local DHCP network. Local DHCPoffers IP addresses to bridge interface br0. The PXE server (next server) is a bridgeitself. The UEFI boot loader communicates with the PXE server through the TAPinterface tap0. The Stratix 10 SoC UEFI boot loader obtains IP address for its eth0interface from the DHCP server on br0 through tap0.

Figure 6. Setting up Internet

Related Links

Host Setup for Networking

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide18

Page 19: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.5.1.3 Configuration

1. To configure the network, you must create a script with the following commands.Ensure that you edit the user variable properly.

user=your-user-nametap=tap0bridge=br0nic=eth0echo "---> Creating taps..."ip tuntap add dev $tap mode tap user $userip link set dev $tap upecho "---> Creating bridge..."brctl addbr $bridgebrctl setfd $bridge 0brctl addif $bridge $nicbrctl addif $bridge $tapecho "---> Bringing interfaces and bridge up..."ifconfig $tap 192.168.0.4 promisc upifconfig $nic 192.168.0.9 promisc upifconfig $bridge 192.168.0.1 netmask 255.255.255.0 upecho "---> Restart DHCP server"service isc-dhcp-server restart

2. Run the next script from root. Be sure to use 192.168.0.1 as a PXE server IPaddress.

Note: If your "isc-dhcp-server" package wasn't installed correctly (with errormessage [FAIL] Starting ISC DHCP server: dhcpd[....] checksyslog for diagnostics), be sure to run next command afterexecuting script above: $ sudo dpkg –configure isc-dhcp-server

1.5.2 Preparing the Boot Image

A standard EFI application is required to prepare a boot image for PXE test. UseHelloWorld.efi located at Build\Stratix10SoCPkg\RELEASE_GCC48\AARCH64\HelloWorld.efi

Copy the HelloWorld.efi file to the TFTP boot file path by typing the followingcommand:

$ cp HelloWorld.efi /var/lib/tftpboot

1.5.3 Setting up the TFTP Server in Ubuntu

Follow these steps to enable file transfer over the network:

1. Install the TFTP server by typing the following command:

$ sudo apt-get install tftpd-hpa tftp

2. Edit the /etc/default/tftpd-hpa file.

TFTP_USERNAME="tftp"TFTP_DIRECTORY="/var/lib/tftpboot"TFTP_ADDRESS="0.0.0.0:70"TFTP_OPTIONS="--secure"

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide19

Page 20: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

1.5.4 Starting Xinetd Services

You can run tftp daemon by two different ways:

• Allow tftpd to run continuously by specifying RUN_DAEMON="yes" in tftpd-hpaconfiguration file.

• Allow super-server to handle tftpd starting.

"Xinetd" is super-server daemon. It receives incoming requests over a network andlaunches the appropriate service for that request. In this case, Xinetd starts tftpdservice when it caches TFTP request over the network. Follow these steps to startXinetd services:

1. Install Xinetd by typing the following command:

$ sudo apt-get install xinetd

2. Create an /etc/xinetd.d/ftp file by entering the following commands:

service tftp{protocol = udpport = 70socket_type = dgramwait = yesuser = rootserver = /usr/sbin/in.tftpdserver_args = --secure /var/lib/tftpbootdisable = no}

Note: The ftp file contains the following arguments:

• server_args= -- secure: Use relative patches (not absolute).

• server_args=/var/lib/tftpboot: Path to TFTP files.

• disable=no: Enable spawning TFTPD process.

You may see the "man tftpd" for more details.

3. Once the configuration is modified, restart the Xinetd by typing the followingcommand:

$ sudo service xinetd restart

1.5.5 Disable Firewall

Disable the firewall to ensure that it is not blocking DHCP/TFTP traffic (UDP).

1. You can turn off the firewall by entering the following commands:

$ iptables -F$ iptables -X$ iptables -P INPUT ACCEPT$ iptables -P FORWARD ACCEPT$ iptables -P OUTPUT ACCEPT$ iptables -t mangle -F

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide20

Page 21: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

$ iptables -t mangle -X$ iptables -t nat -F$ iptables -t nat -X

2. Check the iptables by running the following command:

$ iptables-save

1.5.6 DHCP Server

The DHCP server assigns IP addresses to clients.

Follow these steps to setup the DHCP server:

1. Install the DHCP server by entering the following command:

$ sudo apt-get install isc-dhcp-server

Note: If installation wasn't completed due to error, you can complete this after thenetwork bridge is up. You can complete the "isc-dhcp-server" packageinstallation using the sudo dpkg - - configure command.

2. You must edit the etc/default/isc-dhcp-server file with the followingcommand:

INTERFACES=”br0”

3. Modify the etc/dhcp/dhcpd.conf file with the following commands:

allow booting;allow bootp;subnet 192.168.0.0 netmask 255.255.255.0 {range 192.168.0.100 192.168.0.253;}next-server 192.168.01;filename “HelloWorld.efi”;

Note: The dhcpd.conf file contains the following arguments:

• next-server: IP address of PXE server for that PC.

• filename: Boot loader file to be offered via TFTP.

1.5.7 Removing Configuration

You must create a script with the following commands to remove the configurationcompleted in the previous section.

tap=tap0bridge=br0nic=eth0if ! brctl show | grep $bridge >/dev/null; thenecho -n "TAP Bridge $bridge does not exist "echo "and no FMNetwork to stop."exit 1fi# take down the bridgeifdown $bridge

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide21

Page 22: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

# remove the interfaces from the bridgefor tap in $taps; dobrctl delif $bridge $tapifconfig $tap down# tapctrl -n $tap -a delete -t tapip link set dev $tap downip tuntap del dev $tap mode tapdonebrctl delif $bridge $nic# delete the bridgeifconfig $bridge downbrctl delbr $bridge# unset promiscuous modeifconfig $nic -promiscifup $nic

1.5.8 PXE Client- UEFI

This section describes how to setup a PXE client with the UEFI boot loader running onthe Stratix 10 SoC Virtual Platform and perform PXE boot.

1.5.8.1 SOC Virtual Platform Setting

The parameter.txt file must be modified with the following settings to enable theTAP interface for SoC Virtual Platform:

vlan:type = tap#vlan:ifname = tap0 #This is default valueeth_mac = D0:67:E5:48:F4:49multicast_passthrough = 1 #enable multicast messaging

Note: eth_mac is the MAC address of bridge br0.

1.5.8.2 Boot UEFI

Follow these steps to boot the next stage image with PXE boot:

1. Use the instructions in the "Ping Test" section to boot from the DXE console.

2. Press any key to choose the boot selection.

3. At the DXE console:

a. Enter 3 to choose the Boot Manager.

b. Enter 1 to choose the Add Boot Device Entry.

c. Enter 3 to choose the boot device which is PXE on MAC Address:02:11:22:33:44:55.

d. Enter y to select an EFI application.

e. Type pxe as the Description for this new Entry.

f. Enter 7 to Return to main menu.

g. pxe appears in the boot selection menu. Enter 2 to boot from the PXE.

4. The console displays "Hello World" when the board is booted up successfully fromthe PXE.

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide22

Page 23: 256 10 SoC UEFI Boot Loader User Guide - Intel FPGA … 1 Intel ® Stratix 10 SoC UEFI Boot Loader User Guide 3 1.1 Boot Flow Overview 3 1.2 Recommended System Requirements ...

Figure 7. Display Console

Related Links

Ping Test on page 11

1.6 Revision History of Stratix 10 SoC UEFI Boot Loader User Guide

Date Version Changes

June 2017 2017.06.19 Initial release

1 Intel® Stratix® 10 SoC UEFI Boot Loader User Guide

Intel® Stratix® 10 SoC UEFI Boot Loader User Guide23