読者です 読者をやめる 読者になる 読者になる

ぼくの技術日誌

日誌って銘打っていますが、更新頻度が…

PetaLinuxプロジェクトの新規作成

zinq xilinx linux

はじめに

前回はPetaLinuxをビルドしてZedboardで起動を確認しました。
今回はPetaLinux Reference GuideにあるPetaLinuxプロジェクトの新規作成方法を試します。


この記事の実行環境は下記のとおりです。

使用した環境は前回構築したものとほぼ同じですが、ターゲットボードをZedboardからZyboに変えてみました。
ZynqのSoC自体はPLのロジックセル数が違うだけなので起動はするはず。
というか動かされている方がいらっしゃいます。


先に作業概要をまとめておきます。基本はPetaLinux Reference Guideに沿って作業をしています。

  1. 準備(VivadoでHDFを作成)
  2. PetaLinuxプロジェクトの作成
  3. HDFをPetaLinuxプロジェクトにインポート
  4. PetaLinuxのビルド
  5. BOOT.BONの作成・起動:bitstreamとFSBLはPetaLinuxプロジェクトが作ってくれる?ダメならVivadoとXSDKで作成
  6. Ethernetのドライバの変更
  7. PetaLinuxBSPの作成

準備

Digilentのサポートページからxdcとboardfileをダウンロードし、Vivadoのインストール先に配置します(手順が公開されているので説明しません)。
いつの間にかサポートページのレイアウトが変わっています。ちょっと前はPetaLiuxのBSPとかもダウンロードできたような。
Vivadoで適当なプロジェクトを作成し、Export Hardwareで HDFを作成します。

PetaLinuxプロジェクトの作成

mypetaprojectという名前でPetaLinuxプロジェクトを作成します。

root@yosuke-vm:/opt/petalinux/build# petalinux-create --type project --template zynq --name mypetaproject
INFO: Create project: mypetaproject
INFO: New project successfully created in /opt/petalinux/build/mypetaproject
root@yosuke-vm:/opt/petalinux/build# 

HDFをPetaLinuxプロジェクトにインポート

次に準備段階で作成したHDFをPetaLinuxプロジェクトへインポートします。

petalinux-configコマンドの--get-hw-descriptionオプションでHDFがあるディレクトリを指定します。
menuconfigが開きますので、変更の必要がなければそのまま閉じます。

root@yosuke-vm:/opt/petalinux/build# cd mypetaproject
root@yosuke-vm:/opt/petalinux/build/mypetaproject# petalinux-config --get-hw-description=/home/yosuke/workspace_vivado/sw_interrupt/sw_interrupt.sdk/design_sw_interrupt_wrapper_hw_platform_0/
INFO: Checking component...
INFO: Getting hardware description...

****** hsi v2015.4 (64-bit)
  **** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015
    ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.

source /opt/petalinux/build/mypetaproject/build/linux/hw-description/hw-description.tcl -notrace
INFO: [Common 17-206] Exiting hsi at Sun Feb 14 01:11:00 2016...
INFO: Config linux
[INFO ] config linux


Your configuration changes were NOT saved.

[INFO ] generate DTS to /opt/petalinux/build/mypetaproject/subsystems/linux/configs/device-tree
INFO: [Hsi 55-1698] elapsed time for repository loading 4 seconds
WARNING: ps7_ethernet_0: No reset found
INFO: [Common 17-206] Exiting hsi at Sun Feb 14 01:14:05 2016...
[INFO ] generate BSP for zynq_fsbl
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
INFO: [Common 17-206] Exiting hsi at Sun Feb 14 01:14:18 2016...
INFO: Config linux/kernel
[INFO ] oldconfig linux/kernel
INFO: Config linux/rootfs
[INFO ] oldconfig linux/rootfs
INFO: Config linux/u-boot
[INFO ] generate linux/u-boot configuration files
[INFO ] generate linux/u-boot board header files
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
INFO: [Common 17-206] Exiting hsi at Sun Feb 14 01:14:33 2016...
[INFO ] oldconfig linux/u-boot
root@yosuke-vm:/opt/petalinux/build/mypetaproject# 

以上でプロジェクトがビルドできる状態になりました。

PetaLinuxのビルド

PetaLinuxのビルドを行います。LANG=Cを忘れずに!

root@yosuke-vm:/opt/petalinux/build/mypetaproject# LANG=C petalinux-build
INFO: Checking component...
INFO: Generating make files and build linux
INFO: Generating make files for the subcomponents of linux
INFO: Building linux
[INFO ] pre-build linux/rootfs/fwupgrade
[INFO ] pre-build linux/rootfs/peekpoke
[INFO ] build system.dtb
[INFO ] build linux/kernel
[INFO ] generate linux/u-boot configuration files
[INFO ] update linux/u-boot source
[INFO ] build linux/u-boot
[INFO ] build zynq_fsbl
[INFO ] Setting up stage config
[INFO ] Setting up rootfs config
[INFO ] Updating for cortexa9-vfp-neon
[INFO ] Updating package manager
[INFO ] Expanding stagefs
[INFO ] build linux/rootfs/fwupgrade
[INFO ] build linux/rootfs/peekpoke
[INFO ] build kernel in-tree modules
[INFO ] modules linux/kernel
[INFO ] post-build linux/rootfs/fwupgrade
[INFO ] post-build linux/rootfs/peekpoke
[INFO ] pre-install linux/rootfs/fwupgrade
[INFO ] pre-install linux/rootfs/peekpoke
[INFO ] install system.dtb
[INFO ] install linux/kernel
[INFO ] generate linux/u-boot configuration files
[INFO ] update linux/u-boot source
[INFO ] build linux/u-boot
[INFO ] install linux/u-boot
[INFO ] Expanding rootfs
[INFO ] install sys_init
[INFO ] install linux/rootfs/fwupgrade
[INFO ] install linux/rootfs/peekpoke
[INFO ] install kernel in-tree modules
[INFO ] modules_install linux/kernel
[INFO ] post-install linux/rootfs/fwupgrade
[INFO ] post-install linux/rootfs/peekpoke
[INFO ] package rootfs.cpio to /opt/petalinux/build/mypetaproject/images/linux
[INFO ] Update and install vmlinux image
[INFO ] vmlinux linux/kernel
[INFO ] install linux/kernel
[INFO ] package zImage
[INFO ] zImage linux/kernel
[INFO ] install linux/kernel
[INFO ] Package HDF bitstream
root@yosuke-vm:/opt/petalinux/build/mypetaproject# 

BOOT.BONの作成・起動

BOOT.BINを作成します。以前にも行っていたと思うのですが、前回記事に手順を記載していませんでした…
BOOT.BINは以下のようにpetalinux-packageコマンドでbitstreamとFSBLを引数に指定することで作成できます。
PetaLinuxプロジェクトの./images/linuxディレクトリにビルドでできたbitstreamとFSBLがあるのでこれらを指定します。
bitstreamとFSBLはそれぞれVivadoとXSDKで作成できますが、PetaLinuxプロジェクトはビルド時に作成してくれるようです。

root@yosuke-vm:/opt/petalinux/build/mypetaproject# petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/design_sw_interrupt_wrapper.bit --u-boot
INFO: File in BOOT BIN: "/opt/petalinux/build/mypetaproject/images/linux/zynq_fsbl.elf"
INFO: File in BOOT BIN: "/opt/petalinux/build/mypetaproject/images/linux/design_sw_interrupt_wrapper.bit"
INFO: File in BOOT BIN: "/opt/petalinux/build/mypetaproject/images/linux/u-boot.elf"
INFO: Generating zynq binary package BOOT.BIN...
INFO: Binary is ready.
root@yosuke-vm:/opt/petalinux/build/mypetaproject# 

しかし、petalinux-packageコマンドを実行した際、以下のようなエラーが起こりました。
コマンド実行次行のようにXSDKのパスを追加することでコマンドを実行できるようになりました。

root@yosuke-vm:/opt/petalinux/build/mypetaproject# petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/design_sw_interrupt_wrapper.bit --u-boot
ERROR: This tool requires 'bootgen' and it is missing. Please source Xilinx Tools settings first
root@yosuke-vm:/opt/petalinux/build/mypetaproject# export PATH=$PATH:/opt/Xilinx/SDK/2015.4/bin/
root@yosuke-vm:/opt/petalinux/build/mypetaproject# 

BOOT.BINとimage.ubができたので、MicroSDカードに書き込んで起動させてみます。
Zybo上の起動選択ジャンパをSDカードに変更し、電源を投入します。UARTはブートログとログインコンソールの表示に使用できます。
以下に起動時の出力ログを示します。

U-Boot 2015.07 (Feb 14 2016 - 01:21:00 +0900)

DRAM:  ECC disabled 512 MiB
MMC:   zynq_sdhci: 0
SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

## Error: flags type check failure for "serverip" <= "AUTO" (type: i)
himport_r: can't insert "serverip=AUTO" into hash table
In:    serial
Out:   serial
Err:   serial
Net:   Gem.e000b000
U-BOOT for mypetaproject

Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Gem.e000b000: No link.
Hit any key to stop autoboot:  0 
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SU04G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading image.ub
6394800 bytes read in 551 ms (11.1 MiB/s)
## Loading kernel from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@1' kernel subimage
     Description:  PetaLinux Kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x010000f0
     Data Size:    6379217 Bytes = 6.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    crc32
     Hash value:   ff38efef
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x016158a8
     Data Size:    14283 Bytes = 13.9 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   ea722246
   Verifying Hash Integrity ... crc32+ OK
   Booting using the fdt blob at 0x16158a8
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 07ff9000, end 07fff7ca ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.0.0-xilinx (root@yosuke-vm) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.06
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: mypetaproject
bootconsole [earlycon0] enabled
cma: Reserved 16 MiB at 0x1f000000
Memory policy: Data cache writealloc
PERCPU: Embedded 11 pages/cpu @debcf000 s12672 r8192 d24192 u45056
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyPS0,115200 earlyprintk
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 493252K/524288K available (4759K kernel code, 223K rwdata, 1708K rodata, 3028K init, 2)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc0658efc   (6468 kB)
      .init : 0xc0659000 - 0xc094e000   (3028 kB)
      .data : 0xc094e000 - 0xc0985de0   ( 224 kB)
       .bss : 0xc0985de0 - 0xc09ba0f4   ( 209 kB)
Preemptible hierarchical RCU implementation.
        Additional per-CPU info printed with stalls.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
slcr mapped to e0804000
zynq_clock_init: clkc starts at e0804100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 3383112499200ns
timer #0 at e0808000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop... 1292.69 BogoMIPS (lpj=6463488)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x481788 - 0x4817e0
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2591.94 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0880000
GPIO IRQ not connected
XGpio: /amba_pl/gpio@41200000: registered, base is 902
XGpio: /amba_pl/gpio@41210000: registered, base is 898
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 6250000) is a xuartps
�console [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e081a000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:1e:)
macb e000b000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e000b000.ethe)
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
Xilinx Zynq CpuIdle Driver started
Driver 'mmcblk' needs updating - please use bus_type methods
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-arasan e0100000.sdhci: No vmmc regulator found
sdhci-arasan e0100000.sdhci: No vqmmc regulator found
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
/opt/petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0/drivers/rtc/hctosys.c: unable to)
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 3028K (c0659000 - c094e000)
INIT: mmc0: new high speed SDHC card at address e624
version 2.88 booting mmcblk0: p1B 

Creating /dev/flash/* device nodes
random: dd urandom read with 1 bits of entropy available
Starting internet superserver: inetd.
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
 Removing any system startup links for run-postinsts ...
INIT: Entering runlevel: 5
Configuring network interfaces... udhcpc (v1.23.1) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
done.

Built with PetaLinux v2015.4 (Yocto 1.8) mypetaproject /dev/ttyPS0
mypetaproject login: 

ZyboやZedboardは電源投入後にシリアル接続を行う都合上、電源投入直後のログは目視確認ができません。
なので、一度リセットするためにログインして再起動をさせています。
リセットボタンがない?ので確認がちょっとしづらいですね。

Ethernetのドライバの変更

zynq / zybo > ZyboにてPetalinuxでEthernetを使うまでの手順 - Qiitaを参考にEthernetデバイスドライバを有効にします。

起動時ログからIPアドレスが取得できていることがわかります。

U-Boot 2015.07 (Feb 13 2016 - 00:32:58 +0900)                                   
                                                                                
DRAM:  ECC disabled 512 MiB                                                     
MMC:   zynq_sdhci: 0                                                            
SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 1B
*** Warning - bad CRC, using default environment                                
                                                                                
## Error: flags type check failure for "serverip" <= "AUTO" (type: i)           
himport_r: can't insert "serverip=AUTO" into hash table                         
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   Gem.e000b000                                                             
U-BOOT for mypetaproject                                                        
                                                                                
Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !    
Gem.e000b000: No link.                                                          
Hit any key to stop autoboot:  0                                                
Device: zynq_sdhci                                                              
Manufacturer ID: 3                                                              
OEM: 5344                                                                       
Name: SU04G                                                                     
Tran Speed: 50000000                                                            
Rd Block Len: 512                                                               
SD version 3.0                                                                  
High Capacity: Yes                                                              
Capacity: 3.7 GiB                                                               
Bus Width: 4-bit                                                                
Erase Group Size: 512 Bytes                                                     
reading image.ub                                                                
6394540 bytes read in 551 ms (11.1 MiB/s)                                       
## Loading kernel from FIT Image at 01000000 ...                                
   Using 'conf@1' configuration                                                 
   Verifying Hash Integrity ... OK                                              
   Trying 'kernel@1' kernel subimage                                            
     Description:  PetaLinux Kernel                                             
     Type:         Kernel Image                                                 
     Compression:  gzip compressed                                              
     Data Start:   0x010000f0                                                   
     Data Size:    6378959 Bytes = 6.1 MiB                                      
     Architecture: ARM                                                          
     OS:           Linux                                                        
     Load Address: 0x00008000                                                   
     Entry Point:  0x00008000                                                   
     Hash algo:    crc32                                                        
     Hash value:   9522884d                                                     
   Verifying Hash Integrity ... crc32+ OK                                       
## Loading fdt from FIT Image at 01000000 ...                                   
   Using 'conf@1' configuration                                                 
   Trying 'fdt@1' fdt subimage                                                  
     Description:  Flattened Device Tree blob                                   
     Type:         Flat Device Tree                                             
     Compression:  uncompressed                                                 
     Data Start:   0x016157a4                                                   
     Data Size:    14283 Bytes = 13.9 KiB                                       
     Architecture: ARM                                                          
     Hash algo:    crc32                                                        
     Hash value:   ea722246                                                     
   Verifying Hash Integrity ... crc32+ OK                                       
   Booting using the fdt blob at 0x16157a4                                      
   Uncompressing Kernel Image ... OK                                            
   Loading Device Tree to 07ff9000, end 07fff7ca ... OK                         
                                                                                
Starting kernel ...                                                             
                                                                                
Booting Linux on physical CPU 0x0                                               
Linux version 4.0.0-xilinx (root@yosuke-vm) (gcc version 4.9.2 (Sourcery CodeBe6
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d                 
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache        
Machine model: mypetaproject                                                    
bootconsole [earlycon0] enabled                                                 
cma: Reserved 16 MiB at 0x1f000000                                              
Memory policy: Data cache writealloc                                            
PERCPU: Embedded 11 pages/cpu @debcf000 s12672 r8192 d24192 u45056              
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048     
Kernel command line: console=ttyPS0,115200 earlyprintk                          
PID hash table entries: 2048 (order: 1, 8192 bytes)                             
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)                 
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)                  
Memory: 493252K/524288K available (4759K kernel code, 224K rwdata, 1708K rodata)
Virtual kernel memory layout:                                                   
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)                               
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)                               
    vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)                               
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)                               
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)                               
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)                               
      .text : 0xc0008000 - 0xc0658f18   (6468 kB)                               
      .init : 0xc0659000 - 0xc094e000   (3028 kB)                               
      .data : 0xc094e000 - 0xc0986020   ( 225 kB)                               
       .bss : 0xc0986020 - 0xc09ba334   ( 209 kB)                               
Preemptible hierarchical RCU implementation.                                    
        Additional per-CPU info printed with stalls.                            
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.                    
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2                    
NR_IRQS:16 nr_irqs:16 16                                                        
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000           
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000        
L2C-310 erratum 769419 enabled                                                  
L2C-310 enabling early BRESP for Cortex-A9                                      
L2C-310 full line of zeros enabled for Cortex-A9                                
L2C-310 ID prefetch enabled, offset 1 lines                                     
L2C-310 dynamic clock gating enabled, standby mode enabled                      
L2C-310 cache controller enabled, 8 ways, 512 kB                                
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001                               
slcr mapped to e0804000                                                         
zynq_clock_init: clkc starts at e0804100                                        
Zynq clock init                                                                 
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 3383112499200ns     
timer #0 at e0808000, irq=17                                                    
Console: colour dummy device 80x30                                              
Calibrating delay loop... 1292.69 BogoMIPS (lpj=6463488)                        
pid_max: default: 32768 minimum: 301                                            
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)                     
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)                
CPU: Testing write buffer coherency: ok                                         
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000                                
Setting up static identity map for 0x4817f0 - 0x481848                          
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001                                
Brought up 2 CPUs                                                               
SMP: Total of 2 processors activated (2591.94 BogoMIPS).                        
CPU: All CPU(s) started in SVC mode.                                            
devtmpfs: initialized                                                           
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4         
pinctrl core: initialized pinctrl subsystem                                     
NET: Registered protocol family 16                                              
DMA: preallocated 256 KiB pool for atomic coherent allocations                  
cpuidle: using governor ladder                                                  
cpuidle: using governor menu                                                    
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.     
hw-breakpoint: maximum watchpoint size is 4 bytes.                              
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0880000                     
GPIO IRQ not connected                                                          
XGpio: /amba_pl/gpio@41200000: registered, base is 902                          
XGpio: /amba_pl/gpio@41210000: registered, base is 898                          
vgaarb: loaded                                                                  
SCSI subsystem initialized                                                      
usbcore: registered new interface driver usbfs                                  
usbcore: registered new interface driver hub                                    
usbcore: registered new device driver usb                                       
media: Linux media interface: v0.10                                             
Linux video capture interface: v2.00                                            
pps_core: LinuxPPS API ver. 1 registered                                        
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@>
PTP clock support registered                                                    
EDAC MC: Ver: 3.0.0                                                             
Advanced Linux Sound Architecture Driver Initialized.                           
Switched to clocksource arm_global_timer                                        
NET: Registered protocol family 2                                               
TCP established hash table entries: 4096 (order: 2, 16384 bytes)                
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)                       
TCP: Hash tables configured (established 4096 bind 4096)                        
TCP: reno registered                                                            
UDP hash table entries: 256 (order: 1, 8192 bytes)                              
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)                         
NET: Registered protocol family 1                                               
RPC: Registered named UNIX socket transport module.                             
RPC: Registered udp transport module.                                           
RPC: Registered tcp transport module.                                           
RPC: Registered tcp NFSv4.1 backchannel transport module.                       
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available    
futex hash table entries: 512 (order: 3, 32768 bytes)                           
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.                 
io scheduler noop registered                                                    
io scheduler deadline registered                                                
io scheduler cfq registered (default)                                           
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized                              
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330                    
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Eve6
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 6250000) is s
�console [ttyPS0] enabled                                                       
console [ttyPS0] enabled                                                        
bootconsole [earlycon0] disabled                                                
bootconsole [earlycon0] disabled                                                
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e081a000                         
[drm] Initialized drm 1.1.0 20060810                                            
brd: module loaded                                                              
loop: module loaded                                                             
CAN device driver interface                                                     
libphy: MACB_mii_bus: probed                                                    
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 ()
macb e000b000.ethernet eth0: attached PHY driver [RTL8211E Gigabit Ethernet] (m)
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k                              
e1000e: Copyright(c) 1999 - 2014 Intel Corporation.                             
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver                      
ehci-pci: EHCI PCI platform driver                                              
usbcore: registered new interface driver usb-storage                            
mousedev: PS/2 mouse device common for all mice                                 
i2c /dev entries driver                                                         
Xilinx Zynq CpuIdle Driver started                                              
Driver 'mmcblk' needs updating - please use bus_type methods                    
sdhci: Secure Digital Host Controller Interface driver                          
sdhci: Copyright(c) Pierre Ossman                                               
sdhci-pltfm: SDHCI platform and OF driver helper                                
sdhci-arasan e0100000.sdhci: No vmmc regulator found                            
sdhci-arasan e0100000.sdhci: No vqmmc regulator found                           
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA            
ledtrig-cpu: registered to indicate activity on CPUs                            
usbcore: registered new interface driver usbhid                                 
usbhid: USB HID core driver                                                     
TCP: cubic registered                                                           
NET: Registered protocol family 17                                              
can: controller area network core (rev 20120528 abi 9)                          
NET: Registered protocol family 29                                              
can: raw protocol (rev 20120528)                                                
can: broadcast manager protocol (rev 20120528 t)                                
can: netlink gateway (rev 20130117) max_hops=1                                  
Registering SWP/SWPB emulation handler                                          
/opt/petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0/drivers/rtc/hctos)
mmc0: new high speed SDHC card at address e624                                  
mmcblk0: mmc0:e624 SU04G 3.69 GiB                                               
 mmcblk0: p1                                                                    
ALSA device list:                                                               
  No soundcards found.                                                          
Freeing unused kernel memory: 3028K (c0659000 - c094e000)                       
INIT: version 2.88 booting                                                      
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt.
Creating /dev/flash/* device nodes                                              
random: dd urandom read with 1 bits of entropy available                        
Starting internet superserver: inetd.                                           
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)    
 Removing any system startup links for run-postinsts ...                        
INIT: Entering runlevel: 5                                                      
Configuring network interfaces... udhcpc (v1.23.1) started                      
Sending discover...                                                             
Sending discover...                                                             
Sending discover...                                                             
macb e000b000.ethernet eth0: link up (100/Full)                                 
No lease, forking to background                                                 
done.                                                                           
                                                                                
Built with PetaLinux v2015.4 (Yocto 1.8) mypetaproject /dev/ttyPS0              
mypetaproject login: 

PetaLinuxBSPの作成

自作PetaLinuxプロジェクトをBSPにします。
詳細は公式リファレンスガイド P48に載ってますが、コマンドひとつで作成できます。

root@yosuke-vm:/opt/petalinux/build/mypetaproject# cd ../
root@yosuke-vm:/opt/petalinux/build# petalinux-package --bsp -p ./mypetaproject --output mypetaproject.bsp
/opt/petalinux/build/mypetaproject.bsp
INFO: Target BSP "/opt/petalinux/build/mypetaproject.bsp" will contain the following projects
INFO: PetaLinux project: /opt/petalinux/build/mypetaproject
INFO: 	Copying /opt/petalinux/build/mypetaproject/hw-description
INFO: 	Copying /opt/petalinux/build/mypetaproject/subsystems
INFO: 	Copying /opt/petalinux/build/mypetaproject/config.project
INFO: 	Copying /opt/petalinux/build/mypetaproject/.petalinux
INFO: 	Copying /opt/petalinux/build/mypetaproject/.gitignore
INFO: Checking selected components...
INFO: Copying component:
INFO: 	* /opt/petalinux/build/mypetaproject/components/bootloader/zynq_fsbl
INFO: Creating BSP
INFO: Generating package mypetaproject.bsp...
INFO: BSP is ready
root@yosuke-vm:/opt/petalinux/build# ls
mypetaproject  mypetaproject.bsp
root@yosuke-vm:/opt/petalinux/build# 

さいごに

今回はPetaLinuxプロジェクトを作成し、ZyboでPetaLinuxが起動することが確認できました。
また、前回やってみたいと書いたVivadoによるbitstream生成とPetaLinuxBSPの作成ができるようになりました。
そろそろ具体的にFPGA部分を使用したり、Linuxデバイスドライバの作成したりしてみたいところです。