在ZC702上运行Linux(1) – 运行Pre-built images

来源:Xilinx 发布时间:[2014-01-29]

  Xilinx针对ZC702提供了Linux Porting。

参考文档在http://wiki.xilinx.com/

源码在http://git.xilinx.com/

拿到板子的第一步当然是先跑一下Pre-built images看看,一者可以验证板子好坏,再者可以看看Linux已经完成了那些功能,做到了哪一步。毕竟,站在巨人的肩膀上才能看的更高,走的更远。

最新的Pre-built images在http://wiki.xilinx.com/zynq-release-14-3

拷贝以下文件到SD卡上,SW16配置成00110,就可以在ZC702上启动Linux了。

BOOT.BIN

devicetree.dtb

uImage

uramdisk.image.gz

串口上的输出如下:

U-Boot 2012.04.01-00304-g7639205 (Oct 23 2012 - 08:29:31)

DRAM: 1 GiB

WARNING: Caches not enabled

MMC: SDHCI: 0

Using default environment

In: serial

Out: serial

Err: serial

Net: zynq_gem

Hit any key to stop autoboot: 0

Copying Linux from SD to RAM...

Device: SDHCI

Manufacturer ID: 3

OEM: 5344

Name: SU08G

Tran Speed: 25000000

Rd Block Len: 512

SD version 2.0

High Capacity: Yes

Capacity: 7.4 GiB

Bus Width: 4-bit

reading uImage

2725416 bytes read

reading devicetree.dtb

4366 bytes read

reading uramdisk.image.gz

5252253 bytes read

## Booting kernel from Legacy Image at 03000000 ...

Image Name: Linux-3.5.0-14.3-build2

Created: 2012-10-23 18:12:23 UTC

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 2725352 Bytes = 2.6 MiB

Load Address: 00008000

Entry Point: 00008000

Verifying Checksum ... OK

## Loading init Ramdisk from Legacy Image at 02000000 ...

Image Name:

Created: 2012-10-03 21:10:37 UTC

Image Type: ARM Linux RAMDisk Image (gzip compressed)

Data Size: 5252189 Bytes = 5 MiB

Load Address: 00800000

Entry Point: 00800000

Verifying Checksum ... OK

## Flattened Device Tree blob at 02a00000

Booting using the fdt blob at 0x02a00000

Loading Kernel Image ... OK

OK

Loading Ramdisk to 1fafd000, end 1ffff45d ... OK

Loading Device Tree to 1faf8000, end 1fafc10d ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Booting Linux on physical CPU 0

Linux version 3.5.0-14.3-build2 (linnj@xsjpsgv107) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #1 SMP PREEMPT Tue Oct 23 11:12:17 PDT 2012

CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZC702

bootconsole [earlycon0] enabled

cma: CMA: reserved 16 MiB at 2e800000

Memory policy: ECC disabled, Data cache writealloc

PERCPU: Embedded 7 pages/cpu @c0e2a000 s6784 r8192 d13696 u32768

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 259840

Kernel command line: console=ttyPS0,115200 root=/dev/ram rw ip=192.168.1.10:::255.255.255.0:ZC702:eth0 earlyprintk

PID hash table entries: 4096 (order: 2, 16384 bytes)

Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)

Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)

Memory: 1024MB = 1024MB total

Memory: 1011624k/1011624k available, 36952k reserved, 270336K 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 - 0xc048e060 (4633 kB)

.init : 0xc048f000 - 0xc04b4a80 ( 151 kB)

.data : 0xc04b6000 - 0xc04f3c20 ( 248 kB)

.bss : 0xc04f3c44 - 0xc051f104 ( 174 kB)

Preemptible hierarchical RCU implementation.

Dump stacks of tasks blocking RCU-preempt GP.

NR_IRQS:128

Zynq clock init

xlnx,ps7-ttc-1.00.a #0 at 0xf0000000, irq=43

sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms

Console: colour dummy device 80x30

Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available

Setting up static identity map for 0x351160 - 0x351194

L310 cache controller enabled

l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72360000, Cache size: 524288 B

Map SLCR registers

CPU1: Booted secondary processor

CPU1: thread -1, cpu 1, socket 0, mpidr 80000001

Brought up 2 CPUs

SMP: Total of 2 processors activated (2664.03 BogoMIPS).

devtmpfs: initialized

NET: Registered protocol family 16

DMA: preallocated 256 KiB pool for atomic coherent allocations

xgpiops e000a000.gpio: gpio at 0xe000a000 mapped to 0xf0008000

registering platform device 'pl330' id 0

registering platform device 'arm-pmu' id 0

registering platform device 'zynq-dvfs' id 0

hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.

hw-breakpoint: maximum watchpoint size is 4 bytes.

MIO pin 47 not assigned(00001220)

xslcr xslcr.0: at 0xF8000000 mapped to 0xF8000000

bio: create slab at 0

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

Linux video capture interface: v2.00

Switching to clocksource xttcpss_timer1

NET: Registered protocol family 2

IP route cache hash table entries: 32768 (order: 5, 131072 bytes)

TCP established hash table entries: 131072 (order: 8, 1048576 bytes)

TCP bind hash table entries: 65536 (order: 7, 786432 bytes)

TCP: Hash tables configured (established 131072 bind 65536)

TCP: reno registered

UDP hash table entries: 512 (order: 2, 16384 bytes)

UDP-Lite hash table entries: 512 (order: 2, 16384 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.

Trying to unpack rootfs image as initramfs...

rootfs image is not initramfs (no cpio magic); looks like an initrd

Freeing initrd memory: 5128K

xscugtimer xscugtimer.0: ioremap fe00c200 to f000a200 with size 400

pl330 dev 0 probe success

highmem bounce pool size: 64 pages

jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.

msgmni has been set to 1489

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

e00console [ttyPS0] enabled, bootconsole disabled

console [ttyPS0] enabled, bootconsole disabled

xdevcfg f8007000.devcfg: ioremap f8007000 to f005e000 with size 100

brd: module loaded

loop: module loaded

xqspips e000d000.spi: master is unqueued, this is deprecated

m25p80 spi1.0: n25q128 (16384 Kbytes)

7 ofpart partitions found on MTD device spi1.0

Creating 7 MTD partitions on "spi1.0":

0x000000000000-0x000000080000 : "qspi-fsbl"

0x000000080000-0x000000100000 : "qspi-u-boot"

0x000000100000-0x000000600000 : "qspi-linux"

0x000000600000-0x000000620000 : "qspi-device-tree"

0x000000620000-0x000000700000 : "qspi-user"

0x000000700000-0x000000800000 : "qspi-scratch"

0x000000800000-0x000001000000 : "qspi-rootfs"

xqspips e000d000.spi: at 0xE000D000 mapped to 0xF0060000, irq=51

GEM: BASEADDRESS hw: e000b000 virt: f0062000

XEMACPS mii bus: probed

eth0, pdev->id -1, baseaddr 0xe000b000, irq 54

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller

xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1

xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000

xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

Xilinx PS USB Device Controller driver (Apr 01, 2011)

mousedev: PS/2 mouse device common for all mice

i2c /dev entries driver

xi2cps e0004000.i2c: 100 kHz mmio e0004000 irq 57

si570 1-005d: registered si570 with default frequency 156250000 Hz

si570 1-005d: set initial output frequency 148500000 Hz

i2c i2c-0: Added multiplexed i2c bus 1

i2c i2c-0: Added multiplexed i2c bus 2

at24 3-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write

i2c i2c-0: Added multiplexed i2c bus 3

i2c i2c-0: Added multiplexed i2c bus 4

rtc-pcf8563 5-0051: chip found, driver version 0.4.3

rtc-pcf8563 5-0051: low voltage detected, date/time is not reliable.

rtc-pcf8563 5-0051: rtc core: registered rtc-pcf8563 as rtc0

i2c i2c-0: Added multiplexed i2c bus 5

i2c i2c-0: Added multiplexed i2c bus 6

i2c i2c-0: Added multiplexed i2c bus 7

i2c i2c-0: Added multiplexed i2c bus 8

pca954x 0-0074: registered 8 multiplexed busses for I2C switch pca9548

gspca_main: v2.14.0 registered

usbcore: registered new interface driver uvcvideo

USB Video Class driver (1.1.1)

mpcore_wdt: MPcore Watchdog Timer: 0.1. mpcore_noboot=0 mpcore_margin=60 sec (nowayout= 0)

xwdtps f8005000.swdt: Xilinx Watchdog Timer at 0xf0068000 with timeout 10s

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

sdhci-pltfm: SDHCI platform and OF driver helper

mmc0: Invalid maximum block size, assuming 512 bytes

mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

TCP: cubic registered

NET: Registered protocol family 17

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

Registering SWP/SWPB emulation handler

rtc-pcf8563 5-0051: low voltage detected, date/time is not reliable.

rtc-pcf8563 5-0051: setting system clock to 2013-07-02 06:48:15 UTC (1372747695)

GEM: lp->tx_bd ee842000 lp->tx_bd_dma 2e842000 lp->tx_skb ee0f5780

GEM: lp->rx_bd ee841000 lp->rx_bd_dma 2e841000 lp->rx_skb ee0f5680

GEM: MAC 0x00350a00, 0x00002201, 00:0a:35:00:01:22

mmc0: new high speed SDHC card at address e624

mmcblk0: mmc0:e624 SU08G 7.40 GiB

mmcblk0: p1 p2

usb 1-1: new full-speed USB device number 2 using xusbps-ehci

hub 1-1:1.0: USB hub found

hub 1-1:1.0: 4 ports detected

usb 1-1.3: new low-speed USB device number 3 using xusbps-ehci

input: PIXART USB OPTICAL MOUSE as /devices/amba.0/e0002000.usb/xusbps-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input0

hid-generic 0003:093A:2510.0001: input: USB HID v1.11 Mouse [PIXART USB OPTICAL MOUSE] on usb-xusbps-ehci.0-1.3/input0

GEM: phydev ee386400, phydev->phy_id 0x1410e40, phydev->addr 0x7

eth0, phy_addr 0x7, phy_id 0x01410e40

eth0, attach [Marvell 88E1116R] phy driver

IP-Config: Complete:

device=eth0, addr=192.168.1.10, mask=255.255.255.0, gw=255.255.255.255

host=ZC702, domain=, nis-domain=(none)

bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=

RAMDISK: gzip image found at block 0

VFS: Mounted root (ext2 filesystem) on device 1:0.

devtmpfs: mounted

Freeing init memory: 148K

Starting rcS...

++ Mounting filesystem

++ Setting up mdev

++ Starting telnet daemon

++ Starting http daemon

++ Starting ftp daemon

++ Starting ssh daemon

rcS Complete

zynq>

zynq> df -h

Filesystem Size Used Available Use% Mounted on

none 504.5M 0 504.5M 0% /tmp

/dev/mmcblk0p1 1.8G 7.9M 1.8G 0% /mnt

zynq>

可以看出:

U-Boot是基于2012.04.01的

Linux kernel版本是3.5.0

GCC tool chain版本是4.6.1

对Cortex-A9,1 BogoMIPS=1 CPU MHz。双核2664.03 BogoMIPS印证了CPU的主频是667MHz。

ZC702 IP地址配置成了static: 192.168.1.10

把ZC702, laptop, 和公司的Ethernet cable接到一个LanSwitch上,给VMPlayer下的Ubuntu配置了static IP: 192.168.1.20,laptop可以正常上网。ZC702和Ubuntu之间可以ping通,延迟大约在0.5-1.2ms范围内。以后跑TFTP和NFS就方便多了。网口线序自适应就是方便啊。

一些需要注意的点:

1. 现在用bootm命令启动Linux,以前是用go命令。

2. ramdisk的名字改成了uramdisk.image.gz (带U-Boot header),以前是ramdisk8M.image.gz

3. Linux kernel缺省情况下(配置文件用的是 xilinx_zynq_defconfig) 不再把device tree硬编码在16 MB,而是在bootm命令参数里面指定。目前kernel还可以把device tree硬编码在固定地址 (16MB),但是未来有可能会移除这个特性。

已知的问题:

根据wiki上的说明,ZC706用是dual QSPI,而Linux没有配置quad enable bit。解决办法是在U-BOOT阶段,用命令"sf probe"修正这个问题。

U-BOOT的配置:

zynq-uboot> pri

baudrate=115200

bootcmd=run modeboot

bootdelay=3

devicetree_image=devicetree.dtb

ethact=zynq_gem

ethaddr=00:0a:35:00:01:22

fdt_high=0x20000000

initrd_high=0x20000000

ipaddr=10.10.70.102

jtagboot=echo TFTPing Linux to RAM...;tftp 0x3000000 ${kernel_image};tftp 0x2A00000 ${devicetree_image};tftp 0x2000000 ${ramdisk_image};bootm 0x3000000 0x2000000 0x2A00000

kernel_image=uImage

kernel_size=0x140000

modeboot=run sdboot

nand_kernel_size=0x400000

nand_ramdisk_size=0x400000

nandboot=echo Copying Linux from NAND flash to RAM...;nand read 0x3000000 0x200000 ${nand_kernel_size};nand read 0x2A00000 0x700000 0x20000;echo Copying ramdisk...;nand read 0x2000000 0x900000 ${nand_ramdisk_size};bootm 0x3000000 0x2000000 0x2A00000

norboot=echo Copying Linux from NOR flash to RAM...;cp 0xE2100000 0x3000000 ${kernel_size};cp 0xE2600000 0x2A00000 0x20000;echo Copying ramdisk...;cp 0xE3000000 0x2000000 ${ramdisk_size};bootm 0x3000000 0x2000000 0x2A00000

qspiboot=echo Copying Linux from QSPI flash to RAM...;cp 0xFC100000 0x3000000 ${kernel_size};cp 0xFC600000 0x2A00000 0x20000;echo Copying ramdisk...;cp 0xFC800000 0x2000000 ${ramdisk_size};bootm 0x3000000 0x2000000 0x2A00000

ramdisk_image=uramdisk.image.gz

ramdisk_size=0x200000

sdboot=echo Copying Linux from SD to RAM...;mmcinfo;fatload mmc 0 0x3000000 ${kernel_image};fatload mmc 0 0x2A00000 ${devicetree_image};fatload mmc 0 0x2000000 ${ramdisk_image};bootm 0x3000000 0x2000000 0x2A00000

serverip=10.10.70.101

stderr=serial

stdin=serial

stdout=serial

Environment size: 1551/65532 bytes

zynq-uboot>

您还未添加分享代码,请到主题选项中,添加百度分享代码!

您可以选择一种方式赞助本站

发表评论

您必须 登录 才能发表留言!