LoginSignup
0
1

More than 5 years have passed since last update.

Ultra96 向け Debian GNU/Linux (v2018.2版) の構築(BL31編)

Last updated at Posted at 2018-10-26

はじめに

Ultra96 に Debian GNU/Linux (v2018.2版) を構築する方法について、具体的な方法をいくつかに分けて説明します。

この記事では、Ultra96 の Boot Loader で使うための BL31 (ARM Trusted Firmware Boot Loader state 3-1) の構築について説明をします。

注意

Linux Kernel では 起動時に ATF(ARM Trusted Firmware) のバージョンをチェックしています。Debian GNU/Linux (v2018.2版) で構築する Linux Kernel 4.14.0 (xilinx-v2018.2) では ATF(ARM Trusted Firmware) のバージョンは v1.0 である必要があります。これ以外のバージョンでは Kernel が Panic を起こして起動出来ないので注意してください。

必要な環境

  • Vivado SDK 2018.2 または gcc-aarch64-linux-gnu

Boot Loader 構築環境の準備

次の URL から git clone でリポジトリをダウンロードして v2018.2.1 をチェックアウトします。

shell$ git clone git://github.com/ikwzm/ZynqMP-FPGA-Linux
shell$ cd ZynqMP-FPGA-Linux
shell$ git checkout v2018.2.1

ソースコードのダウンロード

ATF(ARM Trusted Firmware) は以下の URL からソースコードをダウンロードします。

shell% cd target/Ultra96/build-v2018.2
shell% git clone https://github.com/Xilinx/arm-trusted-firmware.git

xilinx-v2018.2 をチェックアウト

arm-trusted-firmware の xilinx-v2018.2 というタグをチェックアウトして xilinx-v2018.2-ultrazed-eg-iocc という作業用のブランチを作ります。

shell$ cd arm-trusted-firmware
shell$ git checkout -b xilinx-v2018.2-ultrazed-eg-iocc refs/tags/xilinx-v2018.2

BL31 の構築

shell% cd arm-trusted-firmware
shell% make ERROR_DEPRECATED=1 RESET_TO_BL31=1 CROSS_COMPILE=aarch64-linux-gnu- PLAT=zynqmp bl31

もしかしたら binutils-aarch64-linux-gnu のバージョンによっては次のようなエラーが出て失敗するかもしれません。

Building zynqmp
  AS      bl31/aarch64/runtime_exceptions.S
bl31/aarch64/runtime_exceptions.S: Assembler messages:
bl31/aarch64/runtime_exceptions.S:157: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:165: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:170: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:175: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:189: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:193: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:197: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:201: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:215: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:219: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:223: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:231: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:245: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:249: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:253: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:261: Error: non-constant expression in ".if" statement
Makefile:597: recipe for target 'build/zynqmp/release/bl31/runtime_exceptions.o' failed
make: *** [build/zynqmp/release/bl31/runtime_exceptions.o] Error 1

その場合は Vivado SDK のツールチェインを使って構築すると良いでしょう。

shell% cd arm-trusted-firmware
shell% make CROSS_COMPILE="<SDK PATH>/gnu/aarch64/<lin or nt>/aarch64-linux/bin/aarch64-linux-gnu-" PLAT=zynqmp RESET_TO_BL31=1

<SDK PATH> には Vivado SDK をインストールしたパスを指定します。
<lin or nt> には Vivado SDK を実行するプラットフォームを指定します. lin=linux, nt=windows です。

無事に arm-trusted-firmware/build/zynqmp/release/bl31/bl31.elf が出来たら bl31.elf を target/Ultra96/build-v2018.2 にコピーします。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1