履歴: 電気回路/z-turn/linux kernel のビルド
各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 11 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます
| 日時 | タイトル | 文字数 | 追加 | 削除 | 内容 | 差分 | 基準 |
|---|---|---|---|---|---|---|---|
| 2017/2/9 0:51:22 | 電気回路/z-turn/linux kernel のビルド 最新版 | 37,352 | +1 | -1 | 表示 | 表示中 | — |
| 2017/2/9 0:51:22 | 電気回路/z-turn/linux kernel のビルド | 37,358 | +3 | -1 | 表示 | 差分 | 選択 |
| 2017/2/8 15:51:22 | 電気回路/z-turn/linux kernel のビルド | 37,291 | +81 | -3 | 表示 | 差分 | 選択 |
| 2017/2/8 10:05:46 | 電気回路/z-turn/linux kernel のビルド | 34,853 | +126 | -2 | 表示 | 差分 | 選択 |
| 2017/2/7 15:35:23 | 電気回路/z-turn/linux kernel のビルド | 29,624 | +5 | -8 | 表示 | 差分 | 選択 |
| 2017/2/7 15:35:23 | 電気回路/z-turn/linux kernel のビルド | 29,779 | +23 | -2 | 表示 | 差分 | 選択 |
| 2017/2/6 13:59:25 | 電気回路/z-turn/linux kernel のビルド | 28,957 | +183 | -520 | 表示 | 差分 | 選択 |
| 2017/2/2 15:53:50 | 電気回路/z-turn/linux kernel のビルド | 40,802 | +380 | -77 | 表示 | 差分 | 選択 |
| 2017/2/2 11:12:05 | 電気回路/z-turn/linux kernel のビルド | 24,904 | +252 | -50 | 表示 | 差分 | 選択 |
| 2017/2/1 18:55:56 | 電気回路/z-turn/linux kernel のビルド | 17,374 | +476 | -10 | 表示 | 差分 | 選択 |
| 2017/2/1 13:19:37 | 電気回路/z-turn/linux kernel のビルド | 2,216 | — | — | 表示 | — | 基準 |
基準: 電気回路/z-turn/linux kernel のビルド (2017/2/1 13:19:37) → 比較: 電気回路/z-turn/linux kernel のビルド (2017/2/9 0:51:22) 最新版
@@ -1,81 +1,213 @@
-[[公開メモ]]
+[[電気回路]]
-* VirtualBox に Debian8 を新規インストール [#v69e44c4]
+#contents
-** VirtualBox の作成 [#z343f177]
+* 概要 [#l079d58c]
-必要なパッケージなどを洗い出すため、まっさらから始めてみます。
+z-turn ボード用に最新の Linux Kernel (uImage) を自分でコンパイルして
+インストールするのが目的です。
-ビルドに linux の開発環境が必要なので、Windows 10 64bit 上の
-Oracle VM VirtualBox に Debian8 (Jessie) をインストールします。
+andreamerello さんのリポジトリに z-turn 用のソースコードがあり、
+それを使うことでそこそこ動作するものを作れました。
-VirtualBox マネージャの [新規] から、Debian8new という VM を作成します。
+ただ現状では不具合も多いようで、z-turn 付属のものを置き換えて常用できるところまでは来ていません。
-&ref(virtualbox-new.png,,66%);
+Peta Linux 付属のカーネルではもう少しうまく行っています~
+>> [[電気回路/zynq/Petalinux のビルド]]
+* クロスコンパイル環境の整備 [#z71faab4]
-- メモリ4G
-- VDI形式の仮想ハードディスク可変型20G
+[[電気回路/z-turn/VirtualBox に Debia8 を入れる]] で用意した
+VirtualBox 上の Debian を使います。
-としました。
+** ツールのインストール [#x6200f1a]
-** インストールディスクのダウンロード&マウント [#xf5ca6f2]
+http://blog.kmckk.com/archives/4777624.html を見ながら
-https://www.debian.org/CD/netinst/
+ LANG:console
+ ### 基本的な開発環境(git と make など)
+ $ sudo apt-get install git-core build-essential
+ ### make menuconfig のため
+ $ sudo apt-get install ncurses-dev
+ ### uImage を作成するため
+ $ sudo apt-get install u-boot-tools
-の amd64 というリンクから、debian-8.7.1-amd64-netinst.iso をダウンロード。
+** 2種類の arm アーキテクチャについて [#ue15614b]
-VirtualBox "Debian8new" を右クリックし、[設定] から [ストレージ] の
-[光学ディスクファイルを選択...] で上記 .iso ファイルをマウント
+Debian の arm 用アーキテクチャは armel と armhf の2種類ある
-&ref(virtualbox-mount-iso.png,,66%);
+https://www.debian.org/releases/stable/armel/release-notes/ch-whats-new.ja.html
+> - ARM EABI ('armel')
+> - ARMv7 (EABI 浮動小数点ハードウェア ABI, 'armhf')
-** 起動 [#d9fe58e5]
+https://japan.xilinx.com/support/documentation/data_sheets/j_ds190-Zynq-7000-Overview.pdf
+> *Zynq‐7000 All Programmable SoC
+> - ARM Cortex ‐ A9 ベース
+> -- ARMv7-A アーキテクチャ
+> -- 単精度および倍精度のベクター浮動小数点ユニット (VFPU)
-&ref(virtualbox-run.png,,66%);
+浮動小数点付き ARMv7 に対応する armhf を使えば良さそう。
-+ [Install]
-+ Select Language => [Japanese]
-+ 場所の選択 => [日本]
-+ キーボードの設定 => [日本語]
-+ [CD の検出とマウント]
-+ ネットワークの設定
--- ホスト名 => [debian8new]
--- ドメイン名 => []
-+ root のパスワード => [********]
-+ 新しいユーザー
--- 本名 => [Osamu Takeuchi]
--- ユーザ名 => [osamu]
--- パスワード => [********]
-+ パーティショニング => [ディスク全体を使う] - [return] x 3 - [YES]
+** 実機のアーキテクチャ名を確認 [#ya3bf49d]
-* u-boot のビルド [#df085745]
+z-turn 付属の SD カードから立ち上げて、
-http://msyksphinz.hatenablog.com/entry/2016/02/27/020000 を見ながら
+ LANG:console
+ # gcc -v
+ Using built-in specs.
+ COLLECT_GCC=gcc
+ COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
+ Target: arm-linux-gnueabihf
+ Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5'
+ --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
+ --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6
+ --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
+ --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
+ --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
+ --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc
+ --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-float=hard
+ --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release
+ --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
+ Thread model: posix
+ gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
+ $ uname -a
+ Linux localhost.localdomain 3.15.0-xilinx #9 SMP PREEMPT Tue May 26 17:26:14 CST 2015 armv7l armv7l armv7l GNU/Linux
+ $ dpkg --print-architecture
+ armhf
-https://github.com/Xilinx/u-boot-xlnx
+armv7l とか armv7-a というアーキテクチャ名と、
+dpkg のアーキテクチャ設定 armhf とが異なるのが気になるけれど、
+パッケージとしては armhf がインストールされていることが分かる。
+** emdebian.org を apt のソースに指定 [#ad3822fc]
+
+以下、http://qiita.com/myahal@github/items/fc332e53713df244518f を見ながら
+クロスコンパイル用のツールチェインをインストールする
+
LANG:console
- $ git clone https://github.com/Xilinx/u-boot-xlnx.git
- Cloning into 'u-boot-xlnx'...
- remote: Counting objects: 455718, done.
- remote: Total 455718 (delta 0), reused 0 (delta 0), pack-reused 455718
- Receiving objects: 100% (455718/455718), 114.43 MiB | 5.26 MiB/s, done.
- Resolving deltas: 100% (364615/364615), done.
- Checking connectivity... done.
- $ ls
- u-boot-xlnx/
- $ cd u-boot-xlnx
- $ git tag
- ..
- xilinx-v2016.2
- xilinx-v2016.3
- xilinx-v2016.4
- xilinx_microblaze
- xilinx_pele_v2010.09
- xilinx_pre_little_endian
- zynq-beta-v2.2
- $ git co xilinx-v2016.4
- Note: checking out 'xilinx-v2016.4'.
+ $ jed /etc/apt/sources.list.d/crosstools.list
+ + deb http://emdebian.org/tools/debian/ jessie main
+ $ curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -
+ -bash: curl: コマンドが見つかりません
+ gpg: 有効なOpenPGPデータが見つかりません。
+ $ sudo apt install curl
+ $ curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -
+
+** armhf アーキテクチャのパッケージ一覧を読み込む [#o3ccc7bf]
+
+ LANG:console
+ $ sudo dpkg --add-architecture armhf
+ $ sudo apt-get update
+
+** crossbuild-essential-armhf をインストール [#m990b6ea]
+
+ LANG:console
+ $ sudo apt-get install crossbuild-essential-armhf
+ 提案パッケージ:
+ binutils-doc gcc-4.9-locales binutils-multiarch gcc-4.9-doc libstdc++6-4.9-dbg:armhf libgcc1-dbg:armhf
+ libgomp1-dbg:armhf libitm1-dbg:armhf libatomic1-dbg:armhf libasan1-dbg:armhf liblsan0-dbg:armhf
+ libtsan0-dbg:armhf libubsan0-dbg:armhf libcilkrts5-dbg:armhf libquadmath-dbg:armhf glibc-doc:armhf locales:armhf
+ manpages-dev:armhf libstdc++-4.9-doc:armhf libyaml-shell-perl
+ $ arm-linux-gnueabihf-gcc --version
+ arm-linux-gnueabihf-gcc ( 4.9.2-10) 4.9.2
+ Copyright (C) 2014 Free Software Foundation, Inc.
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+** 適当なソースをコンパイル [#f74d58d8]
+
+ LANG:console
+ $ mkdir arm-hello
+ $ cd arm-hello
+ $ cat > hello.c
+ #include <stdio.h>
+ void main()
+ {
+ puts("Hello world!");
+ }
+ $ arm-linux-gnueabihf-gcc hello.c -o hello
+ $ file hello
+ a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=94a2aefddb7ebe7a244405372693ca3758564470, not stripped
+
+** エミュレータで動かす [#w38ca88a]
+
+ LANG:console
+ $ sudo apt-get install qemu-user-static
+ $ qemu-arm-static ./hello
+ Hello world!
+
+** 実機で動かす [#q5e9c78b]
+
+Windows 上で SD カードにコピーして z-turn board で動かす
+
+Windows から見えるパーティションはブート領域で、
+z-turn 上では /dev/mmcblk0p1 に来るので、
+これをマウントしてホームにコピーし、実行する。
+
+ LANG:console
+ # lsblk
+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
+ mmcblk0 179:0 0 7.4G 0 disk
+ |-mmcblk0p1 179:1 0 64M 0 part
+ `-mmcblk0p2 179:2 0 7.4G 0 part /
+ mtdblock0 31:0 0 512K 0 disk
+ mtdblock1 31:1 0 128K 0 disk
+ mtdblock2 31:2 0 4.4M 0 disk
+ mtdblock3 31:3 0 4.5M 0 disk
+ mtdblock4 31:4 0 64K 0 disk
+ mtdblock5 31:5 0 6M 0 disk
+ mtdblock6 31:6 0 448K 0 disk
+ # mount /dev/mmcblk0p1 /media/BOOT
+ media-BOOT.mount
+ # cp -r /media/BOOT/arm-hello .
+ # cd arm-hello/
+ # file hello
+ hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=94a2aefddb7ebe7a244405372693ca3758564470, not stripped
+ # ./hello
+ Hello world!
+
+ちゃんと動いた!
+
+* Linux Kernel のビルド [#of5e33a1]
+
+最新ソースから uImage, modules, firmware をビルド&インストールする。
+
+** uImage, zImage, vmlinuz の関係 [#hb0c71b0]
+
+http://fowlrat.hatenablog.com/entry/2014/08/31/011056 ~
+http://aoking.hatenablog.jp/entry/2013/09/30/132325 ~
+> uImage は zImage に
+> -A arm -O linux -C none -T kernel -a 0x40008000 -e 0x40008000 -n 'Linux-3.16.0'
+> といったヘッダ情報を付けたもの
+>
+> zImage は vmlinux から .comment セクションの削除および、シンボルと再配置情報を落としたもの
+>
+> vmlinux がカーネル自身
+>
+> vmlinuz は vmlinux を gzip したものにヘッダ情報を追加したもの
+
+** andreamerello/linux-zynq-stable を使う [#n12e6470]
+
+Xilinx のソースが https://github.com/Xilinx/linux-xlnx にあって、
+こちらを使う例があちこちに上がっているのですが、Debian 標準のツールチェインと
+z-turn 専用設定の無い状況ではこちらを動作させることができませんでした。
+
+そこで、FPGA の部屋にて、z-turn 用の dts が置かれていると書いてあった
+andreamerello さんのリポジトリを使ったところ、初めから z-turn 用設定が
+作成されていたため簡単にカーネルをビルドできました。
+
+http://marsee101.blog19.fc2.com/blog-entry-3485.html
+
+*** ソースツリーを clone する [#vfd7eac6]
+
+ LANG:console
+ $ git clone https://github.com/andreamerello/linux-zynq-stable.git
+ $ cd linux-zynq-stable
+ $ git branch -a | grep zturn
+ remotes/origin/P2016_I03_zturn_rgmii_id
+ remotes/origin/z2016-07-zturn-hdmi
+ $ git checkout remotes/origin/z2016-07-zturn-hdmi
+ Checking out files: 100% (22328/22328), done.
+ Note: checking out 'remotes/origin/z2016-07-zturn-hdmi'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
@@ -86,5 +218,729 @@
git checkout -b new_branch_name
- HEAD is now at 0b94ce5... ARM64: zynqmp: usb1 on zcu100 is not peripheral
+ HEAD is now at 86f1091... drm/bridge: avoid reading edid when setting mode .. use the one stored in connector struct
+ $ git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
+ * 86f1091 - (HEAD, origin/z2016-07-zturn-hdmi) drm/bridge: avoid reading edid when setting mode .. use the one stored in connector struct (8 months ago) <Andrea Merello>
+ * fbcdb6d - drm/bridge: sii902x: fix get edid may fail (8 months ago) <Andrea Merello>
+ * e002b07 - DRM: ocdrm: try to apply HW restrictions for DMA burst len (8 months ago) <Andrea Merello>
+ * f37a83c - DRM: ocdrm: update pixel format on plane update, instead of crtc update (8 months ago) <Andrea Merello>
+ * 8c024053 - DRM/brige: sii902x: change the edid read procedure to more closely match reference code (8 months ago) <Andrea Merello>
+ * 624c0b0 - drm/bridge: sii902x: make the detect function return the actual number of edid modes (8 months ago) <Andrea Merello>
+ * 801fd51 - DRM/bridge: sii902x: possibly fix device screwing up the I2C bus (8 months ago) <Andrea Merello>
+ * d9470bd - DRM: ocdrm: improve mode check (8 months ago) <Andrea Merello>
+ * e317dee - drm:sii902x: add basic check for mode depending by variant (8 months ago) <Andrea Merello>
+ * 740b624 - DRM/bridge: add sii902x driver (8 months ago) <Andrea Merello>
+ * b5230a3 - DRM: add driver for OpenCores LCD/VGA controller (8 months ago) <Andrea Merello>
+ * 6ec8bef - DRM: axi_adi_hdmi: update for 4.6 (8 months ago) <Andrea Merello>
+ * 20c0838 - defconfig: zynq_edl_deconfig: update for 4.6 (8 months ago) <Andrea Merello>
+ * 7b634b1 - config: zynq_edl_defconfig: add support for /proc/config.gz (8 months ago) <Andrea Merello>
+ * 4a6fd8f - config: zynq_edl_defconfig (8 months ago) <Andrea Merello>
+ * 22ebc3b - DT: zynq-zturn-myir: enable uart0 (8 months ago) <Andrea Merello>
+ * 62fbe8d - config: zynq_edl_defconfig: add IIT sound devices (8 months ago) <Andrea Merello>
+ * aa15b8d - sound: add IIT custom driver for gla and group IIT sound drivers in a dedicated subdir (8 months ago) <Andrea Merello>
+ * ad2eb06 - sound: soc: Kconfig: enable ssm2518 to be selected in kernel config (8 months ago) <Andrea Merello>
+ * 145575f - USB reset correctly driven by gpio (8 months ago) <Francesco Diotalevi>
+ * eeb3b2a - defconfig: enable mcp3422 (8 months ago) <Andrea Merello>
+ * 556bf46 - dmaengine: xilinx_dma: don't require dma-channels DT property when multi-channel is false (8 months ago) <Andrea Merello>
+ * 7b5ff65 - dmaengine: xilinx_dma: ensure termination of all pending work before freeing resoruces (8 months ago) <Andrea Merello>
+ * 85d8fe6 - dmaengine: xilinx_dma: no need to reconfigure interrupt so often (8 months ago) <Andrea Merello>
+ * 652909d - dmaengine: xilinx_dma: remove unused var (8 months ago) <Andrea Merello>
+ * 0729f71 - dmaengine: xilinx_dma: fix working on wrong tail segment (8 months ago) <Andrea Merello>
+ * 2e695b8 - dmaengine: xilinx_dma: disable ISR on terminate_all(), and clear pending flags (8 months ago) <Andrea Merello>
+ * 5d8e873 - dmaengine: xilinx_dma: fix error (current descriptor set to zero) after channel reset (8 months ago) <Andrea Merello>
+ * 796e37f - dmaengine: xilinx_dma: avoid completion cb to be called after dma_terminate_all() has been invoked (8 months ago) <Andrea Merello>
+ * a007d64 - xilinx_dma: Avoid "scheduling while atomic". (8 months ago) <Jeremy Trimble>
+ * 9fa2fa8 - dmaengine: xilinx_dma: try to fixup interleaved mode wrt 5ec63a0 (8 months ago) <Andrea Merello>
+ * 7dd0ed2 - dmaengine: xilinx_dma: style fixes (8 months ago) <Andrea Merello>
+ * 54ede0c - xilinx_dma: re-institute use of segment dma_pool (8 months ago) <Jeremy Trimble>
+ * 95e6985 - xilinx_dma: Reset channel if unable to halt. (8 months ago) <Jeremy Trimble>
+ * 8e2abcd - xilinx_dma: Print status word prior to clearing error mask. (8 months ago) <Jeremy Trimble>
+ * 65df81a - xilinx_dma: IrqThreshold set incorrectly, unreliable. (8 months ago) <Jeremy Trimble>
+ * dba8d9c - dmaengine: xilinx_dma: mark channel as "idle" when it has been stopped (8 months ago) <Andrea Merello>
+ * 1735726 - dmaengine: xilinx_dma: autodetect whether the HW supports scatter-gather (8 months ago) <Andrea Merello>
+ * 2223719 - dma: Add support for multi channel DMA (8 months ago) <Kedareswara rao Appana>
+ * 12cf172 - DT: zynq-zturn-myir: add missing clock-freq prop to i2c0 (8 months ago) <Andrea Merello>
+ * 030dcc5 - DT: zynq-zed: fixed serial console (8 months ago) <Andrea Merello>
+ * 4bbd8da - config: updated zynq_edl_defconfig for 4.4.6 (8 months ago) <Andrea Merello>
+ * 9b3c403 - i2c: xiic: fix stuck on transfer timeout (8 months ago) <Andrea Merello>
+ * ba6d32e - i2c: Revert "i2c: xiic: Do not reset controller before every transfer" (8 months ago) <Lars-Peter Clausen>
+ * 7febb25 - i2c: xiic: Do not reset controller before every transfer (8 months ago) <Shubhrajyoti Datta>
+ * 41d2353 - i2c: xiic: move the xiic_process to thread context (8 months ago) <Shubhrajyoti Datta>
+ * 4c55186 - i2c: xiic: Remove the disabling of interrupts (8 months ago) <Shubhrajyoti Datta>
+ * 6197a22 - Added DAI wrapper for using ssm2518 sound chip (8 months ago) <Francesco Diotalevi>
+ * 354e513 - Modifications for having USB disk mass storage fully working (8 months ago) <Francesco Diotalevi>
+ * e39a348 - defconfig: enable module build for AXI DMA test (8 months ago) <Andrea Merello>
+ * 43c036a - dmaengine: Added Xilinx DMA test client (8 months ago) <Andrea Merello>
+ * fbbeb94 - deconfig: zynq_edl: enable in-kernel build of WiFi stack and WiFi dongle driver (8 months ago) <Andrea Merello>
+ * ff33b8a4 - defconfig: zynq_edl: enable DEBUG_FS (8 months ago) <Andrea Merello>
+ * a87fcda - defconfig: zynq_edl: enable Xilinx DMA IP (8 months ago) <Andrea Merello>
+ * bc9c538 - dmaengine: add Xilinx DMA IP driver (8 months ago) <Andrea Merello>
+ * dc4496c - defconfig: zynq-edl: enable ar803x driver (8 months ago) <Andrea Merello>
+ * d5878f0 - defconfig: zynq-edl: more clean ups (8 months ago) <Andrea Merello>
+ * 175015c - defconfig: zynq-edl: clean up (8 months ago) <Andrea Merello>
+ * 1ef3316 - defconfig: zynq-edl: add driver for zedboard RTC pmod (8 months ago) <Andrea Merello>
+ * 4744f80 - DT: rename MYIR in zturn-MYIR (8 months ago) <Andrea Merello>
+ * b5d5fce - DT: MYIR: fix typo (8 months ago) <Andrea Merello>
+ * 956bb29 - defconfig: zynq_edl: enable LM75, that is used on MYIR board (8 months ago) <Andrea Merello>
+ * a9c0ea3 - DT: MYIR: enable temperature sensor (8 months ago) <Andrea Merello>
+ * 9c659a0 - defconfig: zynq_edl_defconfig: enable in-kernel G-Sensor for MYIR (8 months ago) <Andrea Merello>
+ * d7ce7b0 - defconfig: zynq_edl: add GPIO_BEEPER for MYIR (8 months ago) <Andrea Merello>
+ * fc2c988 - DT: MYIR: enable adxl34x G-Sensor (8 months ago) <Andrea Merello>
+ * d1f72e2 - DT: add support for z-turn myir board (8 months ago) <Andrea Merello>
+ ...
+ * 2dcd0af - Linux 4.6 (9 months ago) <Linus Torvalds>
+ ...
$
+
+ここから以下が分かります。
+
+- Linux 4.6 ベースのコードである
+- 2017年2月2日の8か月前に z-turn のサポートを始めた
+- 以下をサポート
+-- DT: adxl34x G-Sensor
+-- defconfig: zynq_edl: GPIO_BEEPER
+-- defconfig: zynq_edl_defconfig: in-kernel G-Sensor
+-- DT: MYIR: temperature sensor
+-- defconfig: zynq_edl: LM75 temperature sensor
+-- dmaengine: Xilinx DMA IP driver
+-- DT: zynq-zturn-myir: clock-freq prop for i2c0
+-- DT: zynq-zturn-myir: enable uart0
+
+*** uImage のビルド [#r4942108]
+
+ LANG:console
+ $ cat .config
+ cat: .config: そのようなファイルやディレクトリはありません
+ $ ls -d arch/arm*
+ arch/arm arch/arm64
+ $ ls arch/arm/configs/* | grep zynq
+ arch/arm/configs/zynq_edl_defconfig
+ $ make ARCH=arm zynq_edl_defconfig
+ $ make ARCH=arm menuconfig
+ $ # Device Drivers --->
+ $ # [*] Userspace I/O drivers --->
+ $ # <*> Userspace I/O platform driver with generic IRQ handling
+ $ export CROSS_COMPILE=arm-linux-gnueabihf-
+ $ make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage
+ ...
+ CC drivers/dma/xilinx/xilinx_dma.o
+ drivers/dma/xilinx/xilinx_dma.c: In function ‘xilinx_dma_prep_dma_cyclic’:
+ drivers/dma/xilinx/xilinx_dma.c:1332:30: warning: ‘segment’ may be used uninitialized in this function [-Wmaybe-uninitialized]
+ last_segment->hw.next_desc = segment->phys;
+ ^
+ ...
+ Image Name: Linux-4.6.0+
+ Created: Thu Feb 2 21:19:15 2017
+ Image Type: ARM Linux Kernel Image (uncompressed)
+ Data Size: 4542272 Bytes = 4435.81 kB = 4.33 MB
+ Load Address: 00008000
+ Entry Point: 00008000
+ Image arch/arm/boot/uImage is ready
+ $ less drivers/dma/xilinx/xilinx_dma.c
+ {
+ struct xilinx_dma_tx_segment *last_segment = segment;
+
+ segment = list_first_entry(&desc->segments,
+ struct xilinx_dma_tx_segment, node);
+ /* Link last segment to first */
+ #ifdef CONFIG_PHYS_ADDR_T_64BIT
+ last_segment->hw.next_desc = lower_32_bits(segment->phys);
+ last_segment->hw.next_desc_msb = upper_32_bits(segment->phys);
+ #else
+ > last_segment->hw.next_desc = segment->phys;
+ #endif
+ }
+
+zynq_edl_defconf の edl というのは何だろう?
+
+CAN の設定で Extended Data Length (EDL) という用語が出てくるけれど、
+これと関係している?
+
+よくわからない。
+
+defconf で z-turn 的な何かを設定しているわけではないのだけれど、
+この git ブランチ自体が z-turn 用なので、たぶんこれでOKなはず。
+
+途中で出る警告も、それほど怪しいものではなさそう。
+
+*** modules もビルドする [#j650070f]
+
+ファイル名が *.ko となっているのがカーネルモジュールの本体
+
+ LANG:console
+ $ make ARCH=arm modules
+ ...
+ CC [M] drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_encoder.o
+ drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_encoder.c: In function ‘get_slave_funcs’:
+ drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_encoder.c:123:2: warning: return discards ‘const’ qualifier from pointer target type
+ return to_encoder_slave(enc)->slave_funcs;
+ ^
+ ...
+
+*** ビルド済みファイルのインストール先 [#x58536c9]
+
+- Kernel は SD カードの第一パーティション(boot領域)へ、
+- modules と firmware は第二パーティション(rootfs領域)の /lib 以下へ、
+-- /lib/firmware/*
+-- /lib/modules/(バージョン番号)/*
+
+それぞれインストールする。
+
+実機から z-turn 付属の SD カードの構成を見てみる。
+
+ LANG:console
+ # lsblk
+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
+ mmcblk0 179:0 0 3.7G 0 disk
+ |-mmcblk0p1 179:1 0 196.1M 0 part /media/boot # SDカードのパーティション1
+ `-mmcblk0p2 179:2 0 3.5G 0 part / # SDカードのパーティション2
+ mtdblock0 31:0 0 512K 0 disk
+ mtdblock1 31:1 0 128K 0 disk
+ mtdblock2 31:2 0 4.4M 0 disk
+ mtdblock3 31:3 0 4.5M 0 disk
+ mtdblock4 31:4 0 64K 0 disk
+ mtdblock5 31:5 0 6M 0 disk
+ mtdblock6 31:6 0 448K 0 disk
+ # ls /media/boot/ # ここに uImage
+ 7z010-hdmi.bit BOOT.bin uEnv-ramdisk.txt
+ 7z010-lcd.bit System Volume Information uEnv-ubuntu.txt
+ 7z010.bit devicetree-7ic.dtb uEnv.txt
+ 7z020-hdmi.bit devicetree-hdmi-1080p.dtb uImage
+ 7z020-lcd.bit devicetree-hdmi-720p.dtb uramdisk.image.gz
+ 7z020.bit devicetree.dtb
+ # ls /lib/modules/3.15.0-xilinx/ # ここに modules.*
+ kernel/ modules.builtin modules.dep.bin modules.softdep
+ modules.alias modules.builtin.bin modules.devname modules.symbols
+ modules.alias.bin modules.dep modules.order modules.symbols.bin
+ # ls /lib/modules/3.15.0-xilinx/kernel/ # ここに *.ko
+ crypto/ drivers/ net/
+ # ls /lib/firmware # ここに *.fw
+ 3com e100 keyspan_pda rtwifi ttusb-budget
+ av7110 edgeport korg sun whiteheat.fw
+ bnx2 emi26 mts_cdma.fw tehuti whiteheat_loader.fw
+ bnx2x emi62 mts_edge.fw ti_3410.fw yam
+ cpia2 ess mts_gsm.fw ti_5052.fw yamaha
+ cxgb3 kaweth rtl8192cufw_TMSC.bin tigon
+
+カーネルの Makefile は
+
+ LANG:console
+ $ make help
+ ...
+ modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
+ firmware_install- Install all firmware to INSTALL_FW_PATH
+ (default: $(INSTALL_MOD_PATH)/lib/firmware)
+ ..
+
+となっている。
+
+実際にモジュールがインストールされるのは~
+ $(INSTALL_MOD_PATH)/lib/modules/$(VERSION)/ ~
+である。
+
+以下は SD カードに直接インストールする場合の話。
+
+*** SD カードのマウント [#s67aaef9]
+
+まず [[電気回路/z-turn/VirtualBox に Debia8 を入れる#g8dc93aa]] の手順で
+ホスト PC の Debian8 から SD カードを認識します。
+
+その後、以下のようにマウントします。
+
+ LANG:console
+ $ lsblk
+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
+ sda 8:0 0 20G 0 disk
+ ├─sda1 8:1 0 19.1G 0 part /
+ ├─sda2 8:2 0 1K 0 part
+ └─sda5 8:5 0 880M 0 part [SWAP]
+ sdf 8:80 1 7.4G 0 disk
+ ├─sdf1 8:81 1 64M 0 part
+ └─sdf2 8:82 1 7.4G 0 part
+ sr0 11:0 1 1024M 0 rom
+ $ sudo mkdir /mnt/sdcard1
+ $ sudo mkdir /mnt/sdcard2
+ $ sudo mount /dev/sdf1 /mnt/sdcard1
+ $ sudo mount /dev/sdf2 /mnt/sdcard2
+
+*** カーネルのインストール [#ed52cd11]
+
+ LANG:console
+ $ ls /mnt/sdcard1
+ 7z020.bit System Volume Information devicetree.dtb uImage
+ 7z020b.bit arm-hello original uramdisk.image.gz
+ BOOT.bin devicetree-wo-uio.dtb uEnv.txt
+ $ sudo mv /mnt/sdcard1/uImage /mnt/sdcard1/uImage-3.15.0-xilinx
+ $ sudo cp arch/arm/boot/uImage /mnt/sdcard1
+
+*** modules のインストール [#va854db2]
+
+ LANG:console
+ $ ls /mnt/sdcard2/lib/modules
+ 3.15.0-xilinx
+ $ sudo make ARCH=arm INSTALL_MOD_PATH=/mnt/sdcard2 modules_install
+ INSTALL crypto/ansi_cprng.ko
+ INSTALL crypto/authenc.ko
+ INSTALL crypto/authencesn.ko
+ INSTALL crypto/cbc.ko
+ INSTALL crypto/deflate.ko
+ INSTALL crypto/echainiv.ko
+ INSTALL drivers/dma/xilinx/axidmatest.ko
+ INSTALL drivers/gpu/drm/adi_axi_hdmi/adi_axi_hdmi.ko
+ INSTALL drivers/i2c/busses/i2c-gpio.ko
+ INSTALL drivers/i2c/i2c-smbus.ko
+ INSTALL drivers/net/can/usb/esd_usb2.ko
+ INSTALL drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8187.ko
+ INSTALL drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.ko
+ INSTALL drivers/usb/serial/ftdi_sio.ko
+ INSTALL drivers/usb/serial/pl2303.ko
+ INSTALL drivers/usb/serial/usbserial.ko
+ INSTALL drivers/video/fbdev/ocfb.ko
+ INSTALL lib/zlib_deflate/zlib_deflate.ko
+ INSTALL net/bluetooth/bluetooth.ko
+ INSTALL net/ipv4/ip_tunnel.ko
+ INSTALL net/ipv4/tunnel4.ko
+ INSTALL net/ipv6/ah6.ko
+ INSTALL net/ipv6/esp6.ko
+ INSTALL net/ipv6/ip6_tunnel.ko
+ INSTALL net/ipv6/ipcomp6.ko
+ INSTALL net/ipv6/ipv6.ko
+ INSTALL net/ipv6/mip6.ko
+ INSTALL net/ipv6/sit.ko
+ INSTALL net/ipv6/tunnel6.ko
+ INSTALL net/ipv6/xfrm6_mode_beet.ko
+ INSTALL net/ipv6/xfrm6_mode_transport.ko
+ INSTALL net/ipv6/xfrm6_mode_tunnel.ko
+ INSTALL net/ipv6/xfrm6_tunnel.ko
+ INSTALL net/xfrm/xfrm_algo.ko
+ INSTALL net/xfrm/xfrm_ipcomp.ko
+ DEPMOD 4.6.0+
+ $ ls /mnt/sdcard2/lib/modules
+ 3.15.0-xilinx 4.6.0+
+
+*** firmware のインストール [#v3d28545]
+
+firmware とは?~
+https://wiki.ubuntu.com/Kernel/Firmware
+
+ LANG:console
+ $ sudo mv /mnt/sdcard2/lib/firmware /mnt/sdcard2/lib/firmware_3.15.0-xilinx
+ $ sudo make ARCH=arm INSTALL_MOD_PATH=/mnt/sdcard2 firmware_install
+
+*** devicetree.dtb を作る [#jdcc44ab]
+
+ LANG:console
+ $ sudo apt-get install device-tree-compiler
+ $ dtc --version
+ Version: DTC 1.4.0
+ $ sudo mv /mnt/sdcard1/devicetree.dtb /mnt/sdcard1/devicetree-old.dtb
+ $ sudo dtc -O dtb -o /mnt/sdcard1/devicetree.dtb arch/arm/boot/dts/zynq-zturn-myir.dts
+ $ ls /mnt/sdcard1/devicetree.dtb
+ /mnt/sdcard1/devicetree.dtb
+
+*** SD カードのアンマウント [#ca122185]
+
+ LANG:console
+ $ sudo umount /mnt/sdcard1
+ $ sudo umount /mnt/sdcard2
+
+** 起動した! [#pf6d92d7]
+
+andreamerello さんのおかげであまり迷うところもなく動作させることができました。
+
+ LANG:console
+ login as: osamu
+ osamu@10.225.225.168's password:
+ New release '16.04.1 LTS' available.
+ Run 'do-release-upgrade' to upgrade to it.
+
+ Last login: Tue Jan 31 05:43:39 2017 from 10.225.225.105
+ Welcome to the Xillinux distribution for Zynq-7000 EPP.
+
+ You may communicate data with standard FPGA FIFOs in the logic fabric by
+ writing to or reading from the /dev/xillybus_* device files. Additional
+ pipe files of that sort can be set up by configuring and downloading a
+ custom IP core from Xillybus' web site (at the IP Core Factory).
+
+ For more information: http://www.xillybus.com.
+
+ To start a graphical X-Windows session, type "startx" at shell prompt.
+
+ $ uname -a
+ Linux localhost.localdomain 4.6.0+ #1 SMP PREEMPT Thu Feb 2 21:19:10 JST 2017 armv7l armv7l armv7l GNU/Linux
+
+hdmi に繋いだディスプレイは見えてない。
+
+カーネルのブランチに hdmi の文字が入っているということは、
+何らかのロジックを入れてやれば画面が出る???
+
+あと、起動メッセージを丁寧に読むといろいろ不穏なことが書いてあり、
+また、なんかうまくいかないことも多い感じ。
+
+
+** 手順まとめ [#ga43ee5b]
+
+ LANG:console
+ $ git clone https://github.com/andreamerello/linux-zynq-stable.git
+ $ cd linux-zynq-stable
+ $ git checkout remotes/origin/z2016-07-zturn-hdmi
+ $ make ARCH=arm zynq_edl_defconfig
+ $ make ARCH=arm menuconfig
+ $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- UIMAGE_LOADADDR=0x8000 uImage
+ $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules
+ $ sudo mount /dev/sdf1 /mnt/sdcard1
+ $ sudo cp arch/arm/boot/uImage /mnt/sdcard1
+ $ sudo umount /mnt/sdcard1
+ $ sudo mount /dev/sdf2 /mnt/sdcard2
+ $ sudo make ARCH=arm INSTALL_MOD_PATH=/mnt/sdcard2 modules_install
+ $ sudo make ARCH=arm INSTALL_MOD_PATH=/mnt/sdcard2 firmware_install
+ $ sudo umount /mnt/sdcard2
+
+** debootstrap で作成したルートファイルシステムへのインストール [#ca67fbe6]
+
+[[こちらの手順で>電気回路/z-turn/Linuxの設定]]
+ホスト PC の Linux ファイルシステム上に z-turn 用のファイルシステムを
+debootstrap で作成済みの場合、
+
+ LANG:console
+ $ sudo make ARCH=arm INSTALL_MOD_PATH=~/z-turn/rootfs modules_install
+ $ sudo make ARCH=arm INSTALL_MOD_PATH=~/z-turn/rootfs firmware_install
+
+などとすれば ~/z-turn/rootfs/lib 以下にインストールされるので、
+[[電気回路/z-turn/Linuxの設定#kac02ea1]] のようにして
+SD カードへファイルシステムを書き込めば、
+modules および firmware のインストールも同時に済みます。
+
+* 現状での不具合 [#g2de4a56]
+
+上記の手順で作ったカーネルで立ち上げた場合、まだいろいろ不具合を抱えているようで、
+z-turn 付属の uImage を置き換えて常用するのは厳しそうです。
+
+ < Linux version 3.15.0-xilinx (tom@dev-server) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #9 SMP PREEMPT Tue May 26 17:26:14 CST 2015
+ > Linux version 4.6.0+ (osamu@debian8new) (gcc version 4.9.2 ( 4.9.2-10) ) #5 SMP PREEMPT Wed Feb 8 04:48:31 JST 2017
+
+ < cma: CMA: reserved 128 MiB at 27800000
+ > cma: Reserved 64 MiB at 0x3c000000
+
+ < PERCPU: Embedded 8 pages/cpu @e719c000 s9088 r8192 d15488 u32768
+ > percpu: Embedded 12 pages/cpu @ef7d5000 s19648 r8192 d21312 u49152
+
+ < Memory: 640460K/786432K available (5236K kernel code, 261K rwdata, 1616K rodata, 200K init, 207K bss, 145972K reserved, 8192K highmem)
+ < Virtual kernel memory layout:
+ < vector : 0xffff0000 - 0xffff1000 ( 4 kB)
+ < fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
+ < vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
+ < lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
+ < pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
+ < modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
+ < .text : 0xc0008000 - 0xc06b9588 (6854 kB)
+ < .init : 0xc06ba000 - 0xc06ec380 ( 201 kB)
+ < .data : 0xc06ee000 - 0xc072f7a0 ( 262 kB)
+ < .bss : 0xc072f7ac - 0xc07634a4 ( 208 kB)
+ > Memory: 964648K/1048576K available (6296K kernel code, 275K rwdata, 2072K rodata, 276K init, 273K bss, 18392K reserved, 65536K cma-reserved, 196608K highmem)
+ > Virtual kernel memory layout:
+ > vector : 0xffff0000 - 0xffff1000 ( 4 kB)
+ > fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
+ > vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
+ > lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
+ > pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
+ > modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
+ > .text : 0xc0008000 - 0xc0834354 (8369 kB)
+ > .init : 0xc0835000 - 0xc087a000 ( 276 kB)
+ > .data : 0xc087a000 - 0xc08bec10 ( 276 kB)
+ > .bss : 0xc08c0000 - 0xc0904780 ( 274 kB)
+ > SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
+
+
+* u-boot のビルド [#df085745]
+
+- http://msyksphinz.hatenablog.com/entry/2016/02/27/020000
+- http://xilinx.wikidot.com/zynq-uboot
+
+を見ながら、リポジトリは andreamerello さんのものを使います。
+
+https://github.com/andreamerello/u-boot-zynq
+
+ LANG:console
+ $ git clone https://github.com/andreamerello/u-boot-zynq.git
+ $ cd u-boot-zynq/
+ $ git branch -a
+ * zynq-zturn
+ remotes/origin/HEAD -> origin/zynq-zturn
+ remotes/origin/from-francesco
+ remotes/origin/from-xlnx
+ remotes/origin/upstream-denx
+ remotes/origin/zynq-zturn
+ remotes/origin/zynq-zturn-for-upstream
+ $ export CROSS_COMPILE=arm-linux-gnueabihf-
+ $ ls configs/zynq*
+ configs/zynq_microzed_defconfig configs/zynq_zc706_defconfig
+ configs/zynq_zc770_xm012_defconfig configs/zynq_zturn_defconfig
+ configs/zynq_picozed_defconfig configs/zynq_zc770_xm010_defconfig
+ configs/zynq_zc770_xm013_defconfig configs/zynq_zybo_defconfig
+ configs/zynq_zc702_defconfig configs/zynq_zc770_xm011_defconfig
+ configs/zynq_zed_defconfig
+ $ make zynq_zturn_defconfig
+ $ make CROSS_COMPILE=arm-linux-gnueabihf- u-boot
+ ...
+ HOSTCC tools/aisimage.o
+ In file included from tools/aisimage.c:10:0:
+ include/image.h:944:27: fatal error: openssl/evp.h: そのようなファイルやディレクトリはありません
+ # include <openssl/evp.h>
+ ^
+ compilation terminated.
+ ...
+ $ sudo apt-get install libssl-dev:armhf
+ 以下の追加パッケージがインストールされます:
+ libssl1.0.0:armhf zlib1g:armhf zlib1g-dev:armhf
+ 推奨パッケージ:
+ libssl-doc:armhf
+ 以下のパッケージが新たにインストールされます:
+ libssl-dev:armhf libssl1.0.0:armhf zlib1g:armhf zlib1g-dev:armhf
+ アップグレード: 0 個、新規インストール: 4 個、削除: 0 個、保留: 0 個。
+ 2,267 kB のアーカイブを取得する必要があります。
+ この操作後に追加で 7,173 kB のディスク容量が消費されます。
+ $ make CROSS_COMPILE=arm-linux-gnueabihf- u-boot
+ ...
+ HOSTCC tools/aisimage.o
+ In file included from include/image.h:944:0,
+ from tools/aisimage.c:10:
+ /usr/include/openssl/evp.h:66:35: fatal error: openssl/opensslconf.h: そのようなファイルやディレクトリはありません
+ # include <openssl/opensslconf.h>
+ ^
+ compilation terminated.
+ ...
+ $ ls -d /usr/include/openssl/ ## アーキテクチャ非依存のヘッダー
+ aes.h comp.h ec.h modes.h rc2.h ssl3.h
+ asn1.h conf.h ecdh.h obj_mac.h rc4.h stack.h
+ asn1_mac.h conf_api.h ecdsa.h objects.h ripemd.h symhacks.h
+ asn1t.h crypto.h engine.h ocsp.h rsa.h tls1.h
+ bio.h des.h err.h opensslv.h safestack.h ts.h
+ blowfish.h des_old.h evp.h ossl_typ.h seed.h txt_db.h
+ bn.h dh.h hmac.h pem.h sha.h ui.h
+ buffer.h dsa.h krb5_asn.h pem2.h srp.h ui_compat.h
+ camellia.h dso.h kssl.h pkcs12.h srtp.h whrlpool.h
+ cast.h dtls1.h lhash.h pkcs7.h ssl.h x509.h
+ cmac.h e_os2.h md4.h pqueue.h ssl2.h x509_vfy.h
+ cms.h ebcdic.h md5.h rand.h ssl23.h x509v3.h
+ $ ls /usr/include/arm-linux-gnueabihf/openssl/
+ opensslconf.h
+ ## アーキテクチャ依存のインクルードパスが正しく反映されていない?
+ $ cd ~/arm-hello
+ $ arm-linux-gnueabihf-gcc -v hello.c
+ ...
+ ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
+ ignoring nonexistent directory "/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
+ #include "..." search starts here:
+ #include <...> search starts here:
+ /usr/lib/gcc/arm-linux-gnueabihf/4.9/include
+ /usr/lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
+ /usr/include/arm-linux-gnueabihf ## ちゃんと入ってる
+ /usr/include
+ End of search list.
+ ...
+ ## 理由が分からないので無理やり通す
+ $ cd ~/u-boot-zynq
+ $ mkdir arch/arm/include/openssl
+ $ ln -s /usr/include/arm-linux-gnueabihf/openssl/opensslconf.h arch/arm/include/openssl/opensslconf.h
+ $ make CROSS_COMPILE=arm-linux-gnueabihf- u-boot
+ ...
+ HOSTLD tools/dumpimage
+ /usr/bin/ld: -lssl が見つかりません
+ /usr/bin/ld: -lcrypto が見つかりません
+ collect2: error: ld returned 1 exit status
+ scripts/Makefile.host:103: recipe for target 'tools/dumpimage' failed
+ make[1]: *** [tools/dumpimage] Error 1
+ Makefile:1215: recipe for target 'tools' failed
+ make: *** [tools] Error 2
+ $ sudo apt-get install libssl-dev
+ パッケージリストを読み込んでいます... 完了
+ 依存関係ツリーを作成しています
+ 状態情報を読み取っています... 完了
+ 以下の追加パッケージがインストールされます:
+ libssl-doc zlib1g-dev
+ 以下のパッケージが新たにインストールされます:
+ libssl-dev libssl-doc zlib1g-dev
+ アップグレード: 0 個、新規インストール: 3 個、削除: 0 個、保留: 0 個。
+ 2,633 kB のアーカイブを取得する必要があります。
+ この操作後に追加で 7,438 kB のディスク容量が消費されます。
+ $ make CROSS_COMPILE=arm-linux-gnueabihf- u-boot
+ ...
+ LDS u-boot.lds
+ LD u-boot
+ $ file u-boot
+ u-boot: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
+
+できた。
+
+後から試したところ、i386 版の libssl-dev:i386 がインストールされていれば
+libssl-dev:armhf は必要ないみたいだった。
+
+** インストール [#ead0c1a5]
+
+Xilinx SDK を使って BOOT.bin にまとめなければならない。
+
+後で試す。
+
+とはいえ、実のところ u-boot を更新する必要性はあまりない気もする???
+
+* z-turn 付属カーネルソースのビルド [#ic5bc4ea]
+
+ LANG:console
+ $ # ファイルを展開
+ $ mkdir ~/linux-zturn
+ $ cd ~/linux-zturn
+ $ tar fxj /media/cdrom/04-Linux_Source/Kernel/linux-xlnx.tar.bz2
+ $ mv linux-xlnx/* linux-xlnx/.* .
+ $ rmdir linux-xlnx
+ $ # 中身を調べる
+ $ git status
+ fatal: Not a git repository (or any of the parent directories): .git
+ $ # うーん、なぜ git 履歴がついていないのか。。。
+ $ head -5 Makefile # Linux 3.15.0
+ VERSION = 3
+ PATCHLEVEL = 15
+ SUBLEVEL = 0
+ EXTRAVERSION =
+ NAME = Shuffling Zombie Juror
+ $ ls .config
+ ls: .config にアクセスできません: そのようなファイルやディレクトリはありません
+ $ ls arch/arm/configs/zynq_zturn_defconfig
+ $ ls arch/arm/boot/dts/zynq-zturn*
+ arch/arm/boot/dts/zynq-zturn-xylon.dtsi arch/arm/boot/dts/zynq-zturn.dts
+ $ grep -lsi myir `find`
+ ./arch/arm/configs/zynq_zturn_defconfig
+ ./arch/arm/boot/dts/zynq-zturn.dts
+ ./arch/arm/boot/Makefile
+ ./drivers/input/touchscreen/ft5x0x.c
+ ./drivers/misc/myir_stlm75x.c
+ ./drivers/misc/Kconfig
+ ./drivers/misc/Makefile
+ ./drivers/video/sii902x/myir_edid.c
+ ./drivers/video/sii902x/Kconfig
+ ./drivers/video/sii902x/myir_edid.h
+ ./drivers/video/sii902x/Makefile
+ ./drivers/video/sii902x/myir_sii902x.c
+ ./drivers/video/Makefile
+ $ grep -lsi zturn `find`
+ ./arch/arm/boot/dts/zynq-zturn.dts
+ ./arch/arm/boot/dts/Makefile
+
+本家の linux-xlnx と比べたい。
+
+ LANG:console
+ $ cd
+ $ git clone https://github.com/Xilinx/linux-xlnx.git
+ $ cd linux-xlnx
+ $ git tag-date | grep v3.15
+ 2014-04-25 zynq-dt-fixes-for-3.15 Michal Simek arm: Xilinx Zynq DT fixes for v3.15
+ 2014-03-17 zynq-cleanup-for-3.15-v2 Michal Simek arm: Xilinx Zynq cleanup patches for v3.15
+ 2014-02-20 zynq-cleanup-for-3.15 Michal Simek arm: Xilinx Zynq cleanup patches for v3.15
+ 2014-02-20 zynq-dt-for-3.15 Michal Simek arm: Xilinx Zynq dt patches for v3.15
+ $ git diff zynq-dt-fixes-for-3.15 zynq-cleanup-for-3.15-v2
+ ...
+ (これはかなり大きな変更)
+ ...
+ (Documentation/ABI/stable/sysfs-firmware-opal-dump was added)
+ $ ls ~/linux-zturn/Documentation/ABI/stable/sysfs-firmware-opal-dump
+ /home/osamu/linux-zturn/Documentation/ABI/stable/sysfs-firmware-opal-dump
+ $ # 少なくとも zynq-dt-fixes-for-3.15 以降を元にしているようだ
+ $ git checkout zynq-dt-fixes-for-3.15
+ $ git status
+ HEAD detached at zynq-dt-fixes-for-3.15
+ nothing to commit, working directory clean
+ $ git checkout -b linux-zturn
+ Switched to a new branch 'linux-zturn'
+ $ cp -rf ../linux-zturn/* .
+ $ git status
+ ...
+ (ものすごい大量のリスト)
+ ...
+ (どうやらこのタグが元になっているわけではなさそう)
+
+どうやら、ぴったりここから、という起点は発見できなさそうな雰囲気です。
+
+- 1860e379 Linux 3.15 は入ってる
+- v3.15 が master にマージされた後に master に対して行われた
+zynq や microblaze 関連のコミット、例えば 351127b などは取り入れられている
+- bf5db2f のブランチはここまで入ってるが、次の 8c770db は入っていない
+
+などなど、コミットごとに個別にチェリーピックしているみたい。
+
+Debian 標準のツールチェインで以下のようにコンパイルし、
+問題なく起動することを確認しました。
+
+ LANG:console
+ $ make ARCH=arm zynq_zturn_defconfig
+ $ make ARCH=arm menuconfig
+ $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- UIMAGE_LOADADDR=0x8000 uImage
+ $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules
+
+カーネルバージョンはそのままになりますが、
+設定を変えてのリコンパイルなどは難しくなくできそうです。
+
+** サンプルファイル [#q958698b]
+
+AXI バスのパフォーマンスモニターのコードだそうです?~
+/home/osamu/linux-zturn/samples/xilinx_apm
+
+** U-BOOT [#wf84462c]
+
+ LANG:console
+ $ # ファイルを展開
+ $ mkdir ~/u-boot-zturn
+ $ cd ~/u-boot-zturn
+ $ tar fxj /media/cdrom/04-Linux_Source/Bootloader/u-boot-xlnx.tar.bz2
+ $ mv u-boot-xlnx/* u-boot-xlnx/.* .
+ $ rmdir u-boot-xlnx
+ $
+
+まだ細かく見ていません。
+
+
+** Toolchain [#v4b76234]
+
+ LANG:console
+ $ # ファイルを展開
+ $ mkdir ~/toolchain-zturn
+ $ cd ~/toolchain-zturn
+ $ tar fxj /media/cdrom/04-Linux_Source/Toolchain/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux.tar.bz2
+ $ mv CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/* .
+ $ rmdir CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/
+ $ rmdir CodeSourcery/
+ $ # 中身を調べる
+ $ ls
+ README-arm-xilinx-linux-gnueabi.html arm-xilinx-linux-gnueabi jre share
+ README-arm-xilinx-linux-gnueabi.txt bin lib uninstall
+ Uninstall_Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux i686-pc-linux-gnu libexec
+ $ cat README-arm-xilinx-linux-gnueabi.txt
+ Sourcery CodeBench
+ ============
+ Sourcery CodeBench contains the complete GNU
+ Toolchain including all of the following components:
+
+ * CodeSourcery Debug Sprite for ARM
+ * GNU Binary Utilities (Binutils)
+ * GNU C Compiler (GCC)
+ * GNU C Library (GLIBC)
+ * GNU C++ Compiler (G++)
+ * GNU C++ Runtime Library (Libstdc++)
+ * GNU Debug Server (GDBServer)
+ * GNU Debugger (GDB)
+
+ Visit:
+ http://www.codesourcery.com
+ to access the Sourcery CodeBench support website.
+ $ ls bin
+ arm-xilinx-linux-gnueabi-addr2line arm-xilinx-linux-gnueabi-gcc arm-xilinx-linux-gnueabi-objcopy
+ arm-xilinx-linux-gnueabi-ar arm-xilinx-linux-gnueabi-gcc-4.6.1 arm-xilinx-linux-gnueabi-objdump
+ arm-xilinx-linux-gnueabi-as arm-xilinx-linux-gnueabi-gcov arm-xilinx-linux-gnueabi-ranlib
+ arm-xilinx-linux-gnueabi-c++ arm-xilinx-linux-gnueabi-gdb arm-xilinx-linux-gnueabi-readelf
+ arm-xilinx-linux-gnueabi-c++filt arm-xilinx-linux-gnueabi-gdbtui arm-xilinx-linux-gnueabi-size
+ arm-xilinx-linux-gnueabi-cpp arm-xilinx-linux-gnueabi-gprof arm-xilinx-linux-gnueabi-sprite
+ arm-xilinx-linux-gnueabi-elfedit arm-xilinx-linux-gnueabi-ld arm-xilinx-linux-gnueabi-strings
+ arm-xilinx-linux-gnueabi-g++ arm-xilinx-linux-gnueabi-nm arm-xilinx-linux-gnueabi-strip
+
+* コメント・質問 [#z9a51bdf]
+
+#article();