FC2カウンター FPGAの部屋 ZYBO用のEmbedded Linux チュートリアル8(DTB、RAMDISK、Linux起動)
FC2ブログ

FPGAやCPLDの話題やFPGA用のツールの話題などです。 マニアックです。 日記も書きます。

FPGAの部屋

FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。Xilinx ISEの初心者の方には、FPGAリテラシーおよびチュートリアルのページをお勧めいたします。

ZYBO用のEmbedded Linux チュートリアル8(DTB、RAMDISK、Linux起動)

ZYBO用のEmbedded Linux チュートリアル7(Linuxカーネルのビルド)”の続き。

DTSをDTCでコンパイルしてDTBを作る。
RAMDISKを用意する。
Digilent Linuxを起動する。

Embedded Linux® Hands-on Tutorial for the ZYBO™”の”5 Test Kernel Image with Pre-built File System”をやってみた。

1.使用するDTSファイルは、/home/masaaki/ZYBO/Digilent_Linux_Tutrial/Linux-Digilent-Dev/arch/arm/boot/dts/zynq-zybo.dts だ。
ZYBO_EM_Linux_95_140904.png

2.zynq-zybo.dts を開いた。
ZYBO_EM_Linux_96_140904.png

3.上の図で bootargs = を、”Figure 51. Edit device tree”の通りに書き換えると、no filesystem could mount root が出て Linuxが起動ししない。これは変更せずにそのままとした。(gotz_surf さん、ありがとうございました)

4.ramdisk8M.image.gz が無いので、ZedBoard用のを借用した。
ZedBoard_OOB_Desin のsd_image フォルダにある。
ZYBO_EM_Linux_98_140904.png

5./home/masaaki/ZYBO/Digilent_Linux_Tutrial ディレクトリに、ramdisk8M.image.gz を置いた。
ZYBO_EM_Linux_99_140904.png

6.Digilent_Linux_Tutrial ディレクトリに行って、 Uramdisk Imageを生成した。
cd ..
./u-boot-Digilent-Dev/tools/mkimage -A arm -T ramdisk -c gzip -d ./ramdisk8M.image.gz uramdisk.image.gz
ZYBO_EM_Linux_100_140904.png

7.Digilent_Linux_Tutrial ディレクトリに uramdisk.image.gz が生成された。
ZYBO_EM_Linux_101_140904.png

8.Linux-Digilent-Dev ディレクトリに戻り、zynq-zybo.dts をコンパイルして、devicetree.dtb を生成した。
cd Linux-Digilent-Dev
./scripts/dtc/dtc -I dts -O dtb -o ../devicetree.dtb arch/arm/boot/dts/zynq-zybo.dts
ZYBO_EM_Linux_102_140904.png

9.Digilent_Linux_Tutrial ディレクトリに devicetree.dtb が生成された。
ZYBO_EM_Linux_103_140904.png

10.SDカードを用意して、”ZYBO用のEmbedded Linux チュートリアル6(BOOT.bin の生成)”で生成した BOOT.bin をコピーした。
ZYBO_EM_Linux_104_140904.png

11.UbuntuにSDカードをマウントして、”ZYBO用のEmbedded Linux チュートリアル7(Linuxカーネルのビルド)”で生成した uImage と devicetree.dtb, uramdisk.image.gz をSDカードにコピーした。
これで、SDカードの準備は終了した。

12.ZYBOを用意して、JP5のジャンパーをSDに変更する。これで、SDカードからブートする。

13.PROG UARTポートから、マイクロUSB B - USB AケーブルでパソコンのUSBポートに接続する。

13.Tera-Term を起動して、115,200bps、8btits, No Parity, 1 stop bit に設定する。

14.Linuxの起動画面が表示された。
ZYBO_EM_Linux_106_140904.png

良かった。やっと起動した。

Linuxの起動メッセージを貼っておく。

 0
Device: zynq_sdhci
Manufacturer ID: 74
OEM: 4a45
Name: USD
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.5 GiB
Bus Width: 4-bit
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3987040 bytes read in 350 ms (10.9 MiB/s)
reading devicetree.dtb
7374 bytes read in 16 ms (449.2 KiB/s)
reading uramdisk.image.gz
3694172 bytes read in 324 ms (10.9 MiB/s)
## Booting kernel from Legacy Image at 03000000 ...
Image Name: Linux-3.14.0-xilinx-13567-g906a2
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3986976 Bytes = 3.8 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02000000 ...
Image Name:
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 3694108 Bytes = 3.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
Booting using the fdt blob at 0x2a00000
Loading Kernel Image ... OK
Loading Ramdisk to 1f7a8000, end 1fb2de1c ... OK
Loading Device Tree to 1f7a3000, end 1f7a7ccd ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.14.0-xilinx-13567-g906a2c9 (masaaki@masaaki-VirtualBox) (gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-79) ) #1 SMP PREEMPT Thu Sep 4 04:58:29 JST 2014
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Xilinx Zynq
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] cma: CMA: reserved 128 MiB at 17400000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 8 pages/cpu @dfb9e000 s10752 r8192 d13824 u32768
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: console=ttyPS0,115200 root=/dev/ram rw earlyprintk
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 371776K/524288K available (5144K kernel code, 319K rwdata, 1900K rodata, 202K init, 5339K bss, 152512K reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc06e9600 (7046 kB)
[ 0.000000] .init : 0xc06ea000 - 0xc071ca00 ( 203 kB)
[ 0.000000] .data : 0xc071e000 - 0xc076dde0 ( 320 kB)
[ 0.000000] .bss : 0xc076ddec - 0xc0ca4c08 (5340 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU lockdep checking is enabled.
[ 0.000000] Dump stacks of tasks blocking RCU-preempt GP.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] ps7-slcr mapped to e0802000
[ 0.000000] zynq_clock_init: clkc starts at e0802100
[ 0.000000] Zynq clock init
[ 0.000016] sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 3383112499200ns
[ 0.008493] ps7-ttc #0 at e0804000, irq=43
[ 0.013513] Console: colour dummy device 80x30
[ 0.017858] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.025912] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.029939] ... MAX_LOCK_DEPTH: 48
[ 0.034109] ... MAX_LOCKDEP_KEYS: 8191
[ 0.038530] ... CLASSHASH_SIZE: 4096
[ 0.042882] ... MAX_LOCKDEP_ENTRIES: 16384
[ 0.047353] ... MAX_LOCKDEP_CHAINS: 32768
[ 0.051859] ... CHAINHASH_SIZE: 16384
[ 0.056298] memory used by lock dependency info: 3695 kB
[ 0.061748] per task-struct memory footprint: 1152 bytes
[ 0.067191] Calibrating delay loop... 1292.69 BogoMIPS (lpj=6463488)
[ 0.110945] pid_max: default: 32768 minimum: 301
[ 0.116252] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.122796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.137247] CPU: Testing write buffer coherency: ok
[ 0.143490] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.149135] Setting up static identity map for 0x4de8a0 - 0x4de8f8
[ 0.155508] L310 cache controller enabled
[ 0.159465] l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72760000, Cache size: 512 kB
[ 0.240413] CPU1: Booted secondary processor
[ 0.328273] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.329397] Brought up 2 CPUs
[ 0.342262] SMP: Total of 2 processors activated.
[ 0.346963] CPU: All CPU(s) started in SVC mode.
[ 0.354978] devtmpfs: initialized
[ 0.365397] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[ 0.379551] regulator-dummy: no parameters
[ 0.392368] NET: Registered protocol family 16
[ 0.401194] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.414840] cpuidle: using governor ladder
[ 0.418827] cpuidle: using governor menu
[ 0.446077] syscon f8000000.ps7-slcr: regmap [mem 0xf8000000-0xf8000fff] registered
[ 0.457983] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.465933] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.472171] zynq-ocm f800c000.ps7-ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0880000
[ 0.543450] bio: create slab at 0
[ 0.552956] vgaarb: loaded
[ 0.557430] SCSI subsystem initialized
[ 0.563624] usbcore: registered new interface driver usbfs
[ 0.569496] usbcore: registered new interface driver hub
[ 0.575262] usbcore: registered new device driver usb
[ 0.581743] media: Linux media interface: v0.10
[ 0.586574] Linux video capture interface: v2.00
[ 0.591814] pps_core: LinuxPPS API ver. 1 registered
[ 0.596654] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
[ 0.606207] PTP clock support registered
[ 0.611122] EDAC MC: Ver: 3.0.0
[ 0.617383] Advanced Linux Sound Architecture Driver Initialized.
[ 0.632887] DMA-API: preallocated 4096 debug entries
[ 0.637726] DMA-API: debugging enabled by kernel config
[ 0.643572] Switched to clocksource arm_global_timer
[ 0.706983] NET: Registered protocol family 2
[ 0.714796] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.721908] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
[ 0.730181] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.736807] TCP: reno registered
[ 0.739938] UDP hash table entries: 256 (order: 2, 20480 bytes)
[ 0.746128] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[ 0.753794] NET: Registered protocol family 1
[ 0.759683] RPC: Registered named UNIX socket transport module.
[ 0.765536] RPC: Registered udp transport module.
[ 0.770194] RPC: Registered tcp transport module.
[ 0.774955] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.782367] Trying to unpack rootfs image as initramfs...
[ 0.789226] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.822928] Freeing initrd memory: 3604K (df7a8000 - dfb2d000)
[ 0.829108] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
[ 0.843037] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.856747] jffs2: version 2.2. (NAND) (SUMMARY) c 2001-2006 Red Hat, Inc.
[ 0.864307] msgmni has been set to 989
[ 0.869563] io scheduler noop registered
[ 0.873369] io scheduler deadline registered
[ 0.877910] io scheduler cfq registered (default)
[ 0.902783] dma-pl330 f8003000.ps7-dma: Loaded driver for PL330 DMAC-2364208
[ 0.909753] dma-pl330 f8003000.ps7-dma: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
[ 0.921882] e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 82, base_baud = 3125000) is a xuartps
[ 0.931339] console [ttyPS0] enabled
[ 0.931339] console [ttyPS0] enabled
[ 0.938452] bootconsole [earlycon0] disabled
[ 0.938452] bootconsole [earlycon0] disabled
[ 0.949707] xdevcfg f8007000.ps7-dev-cfg: ioremap 0xf8007000 to e0866000
[ 0.959543] [drm] Initialized drm 1.1.0 20060810
[ 0.997561] brd: module loaded
[ 1.019915] loop: module loaded
[ 1.035839] m25p80 spi0.0: found s25fl128s1, expected n25q128
[ 1.041567] m25p80 spi0.0: s25fl128s1 (16384 Kbytes)
[ 1.047016] 4 ofpart partitions found on MTD device spi0.0
[ 1.052420] Creating 4 MTD partitions on "spi0.0":
[ 1.057268] 0x000000000000-0x000000400000 : "qspi-fsbl-uboot"
[ 1.071384] 0x000000400000-0x000000900000 : "qspi-linux"
[ 1.081670] 0x000000900000-0x000000920000 : "qspi-device-tree"
[ 1.092644] 0x000000920000-0x000001000000 : "qspi-user"
[ 1.112198] e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
[ 1.118096] e1000e: Copyright(c) 1999 - 2013 Intel Corporation.
[ 1.129896] libphy: XEMACPS mii bus: probed
[ 1.136320] xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
[ 1.147144] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.154174] ehci-pci: EHCI PCI platform driver
[ 1.159287] ULPI transceiver vendor/product ID 0x0424/0x0007
[ 1.164925] Found SMSC USB3320 ULPI transceiver.
[ 1.169488] ULPI integrity check: passed.
[ 1.174436] zynq-ehci zynq-ehci.0: Xilinx Zynq USB EHCI Host Controller
[ 1.181706] zynq-ehci zynq-ehci.0: new USB bus registered, assigned bus number 1
[ 1.213688] zynq-ehci zynq-ehci.0: irq 53, io mem 0x00000000
[ 1.233655] zynq-ehci zynq-ehci.0: USB 2.0 started, EHCI 1.00
[ 1.246329] hub 1-0:1.0: USB hub found
[ 1.250301] hub 1-0:1.0: 1 port detected
[ 1.258309] usbcore: registered new interface driver usb-storage
[ 1.267177] mousedev: PS/2 mouse device common for all mice
[ 1.274882] i2c /dev entries driver
[ 1.287419] zynq-edac f8006000.ps7-ddrc: ecc not enabled
[ 1.293669] cpufreq_cpu0: failed to get cpu0 regulator: -19
[ 1.301987] Xilinx Zynq CpuIdle Driver started
[ 1.308353] sdhci: Secure Digital Host Controller Interface driver
[ 1.314691] sdhci: Copyright(c) Pierre Ossman
[ 1.318972] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.325217] mmc0: no vqmmc regulator found
[ 1.329241] mmc0: no vmmc regulator found
[ 1.373598] mmc0: SDHCI controller on e0100000.ps7-sdio [e0100000.ps7-sdio] using ADMA
[ 1.389203] usbcore: registered new interface driver usbhid
[ 1.394824] usbhid: USB HID core driver
[ 1.414006] TCP: cubic registered
[ 1.417256] NET: Registered protocol family 17
[ 1.422070] Registering SWP/SWPB emulation handler
[ 1.429450] regulator-dummy: disabling
[ 1.433795] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 1.450439] mmc0: new high speed SDHC card at address b368
[ 1.458796] mmcblk0: mmc0:b368 USD 7.45 GiB
[ 1.468181] ALSA device list:
[ 1.471439] No soundcards found.
[ 1.471650] mmcblk0: p1 p2
[ 1.479522] RAMDISK: gzip image found at block 0
[ 1.890361] EXT2-fs (ram0): warning: mounting unchecked fs, running e2fsck is recommended
[ 1.898824] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 1.905578] devtmpfs: mounted
[ 1.908884] Freeing unused kernel memory: 200K (c06ea000 - c071c000)
Starting rcS...
++ Mounting filesystem
++ Setting up mdev
++ Configure static IP 192.168.1.10
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting dropbear (ssh) daemon
[ 2.674675] random: dropbear urandom read with 7 bits of entropy available
++ Starting OLED Display
insmod: can't read '/lib/modules/3.14.0-xilinx-13567-g906a2c9/pmodoled-gpio.ko': No such file or directory
++ Exporting LEDs & SWs
rcS Complete
zynq> ls
bin lib lost+found proc sys var
dev licenses mnt root tmp
etc linuxrc opt sbin usr
zynq>


なお、LANケーブルは接続していない。

ZYBO用のEmbedded Linux チュートリアル10(myLedのドライバの構築とデバイス・ツリーへの追加)”に続く。
  1. 2014年09月06日 06:24 |
  2. ZYBO
  3. | トラックバック:0
  4. | コメント:0

コメント

コメントの投稿


管理者にだけ表示を許可する

トラックバック URL
http://marsee101.blog.fc2.com/tb.php/2921-e774c140
この記事にトラックバックする(FC2ブログユーザー)