使用petalinux构建ZYNQ Linux系统
0、说明
UG1144文档中描述:PetaLinux 是一种嵌入式 Linux 软件开发套件 (SDK),主要用于赛灵思 FPGA 片上系统设计。 其主要是帮助搭建嵌入式端整套固件。完成编译后可产生运行于ZYNQ PS端的uboot、内核、文件系统等。
其实,我并推荐使用这种方式,主要是其编译依赖库太多,编译时间长,磁盘空间要求大、编译中可能由于各种问题导致失败,且调试不方便。或许对于FPGA工程师来说,不太关注PS端的开发者比较适合使用PetaLinux,不过和论坛技术支持聊天说自己单独编译使用可能会遇到ip driver的麻烦。后续章节使用源码独立编译ZYNQ Linux系统专门说明一下如何通过最原始的方法,单独编译uboot、内核、文件系统来构建ZYNQ PS端系统。
1、环境
1.1硬件环境
- Xilinx ZCU104开发板
1.2软件环境
- VM ubuntu 18.04
- windows 10
1.3资源下载准备
https://china.xilinx.com/support/download.html
- 下载PetaLinux 安装工具petalinux-v2021.1-final-installer.run
用于安装PetaLinu工具,之后可以使用PetaLinu相关命令。
- BSP包
- 离线资源包
- 参考文档UG1144
2、安装petalinux
2.1 安装ubuntu基本工具
一下工具是按照PetaLinux及后续编译阶段依赖的工具,需要确认安装成功。不然后续编译报错缺少工具。此处也可以关注最新版UG1144文档中描述的依赖工具。不同版本可能依赖的工具略有不同。
sudo apt-get install -y gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential zlib1g:i386 screen pax gzip gawk
2.2 安装petalinux
- 将petalinux-v2021.1-final-installer.run上传到ubuntu
- chmod +x petalinux-v2021.1-final-installer.run 增加执行权限
- ./petalinux-v2021.1-final-installer.run --dir 安装路径
- source <path-to-installed-PetaLinux>/settings.sh 设置环境变量
petalinux安装相对比较容易,如果执行报错,可以参考UG1144里面,里面根据每一个操作,列出了常见错误及解决方法。比/bin/sh is no tbash需要sudo dpkg-reconfigure dash切换到dash。
输入petalinux-config 可以正常识别命令,说明安装成功了。
3、构建系统
通过BSP创建工程
- petalinux-create -t project -s xilinx-zcu104-v2021.1-final.bsp
配置uboot、内核
- petalinux-config -c uboot
- petalinux-config -c kernel
过程中需要联网,下载依赖的工具及源码
编译
- petalinux-build
同样需要联网,下载依赖的源码。或者配置离线资源包
输出
yangf@ubuntu:~/src/xilinx/zcu104/xilinx-zcu104-2021.1/images/linux$ ls
bl31.bin config pxelinux.cfg ramdisk.tar.gz rootfs.ext4 system.bit u-boot-dtb.elf zynqmp-qemu-arm.dtb
bl31.elf Image ramdisk.cpio.gz rootfs.cpio rootfs.jffs2 system.dtb u-boot.elf zynqmp-qemu-multiarch-arm.dtb
BOOT.BIN image.ub ramdisk.cpio.gz.u-boot rootfs.cpio.gz rootfs.manifest u-boot.bin vmlinux zynqmp-qemu-multiarch-pmu.dtb
boot.scr pmufw.elf ramdisk.manifest rootfs.cpio.gz.u-boot rootfs.tar.gz u-boot-dtb.bin zynqmp_fsbl.elf
yangf@ubuntu:~/src/xilinx/zcu104/xilinx-zcu104-2021.1/images/linux$
SD启动
- 格式化SD:可在ubuntu中通过disks格式化分区,第一分区为fat,第二分区为ext4
- BOOT.BIN、image.ub、 boot.scr拷贝到第一分区
- 解压文件系统到第二分区:tar xvf rootfs.tar.gz -C /media/rootfs
启动日志
Xilinx Zynq MP First Stage Boot Loader
Release 2021.1 Jun 6 2021 - 07:07:32
NOTICE: ATF running on XCZU7EV/silicon v4/RTL5.1 at 0xfffea000
NOTICE: BL31: v2.4(release):v1.1-7609-g851523ea2
NOTICE: BL31: Built : 08:27:07, Apr 28 2021
U-Boot 2021.01 (Jun 01 2021 - 11:54:06 +0000)
Model: ZynqMP ZCU104 RevC
Board: Xilinx ZynqMP
DRAM: 2 GiB
PMUFW: v1.1
EL Level: EL2
Chip ID: zu7ev
NAND: 0 MiB
MMC: mmc@ff170000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Bootmode: LVL_SHFT_SD_MODE1
Reset reason: EXTERNAL
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id
eth0: ethernet@ff0e0000
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2594 bytes read in 15 ms (168 KiB/s)
## Executing script at 20000000
Trying to load boot images from mmc0
14527336 bytes read in 967 ms (14.3 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
Using 'conf-system-top.dtb' configuration
Trying 'kernel-1' kernel subimage
Description: Linux kernel
Created: 2021-06-04 15:57:16 UTC
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x100000f8
Data Size: 9356113 Bytes = 8.9 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x00080000
Entry Point: 0x00080000
Hash algo: sha256
Hash value: 287de5bbc5cd30503aafb8e4ca18d11c0ab014c2a3179466cb92bd30308d1026
Verifying Hash Integrity ... sha256+ OK
## Loading ramdisk from FIT Image at 10000000 ...
Using 'conf-system-top.dtb' configuration
Trying 'ramdisk-1' ramdisk subimage
Description: petalinux-initramfs-image
Created: 2021-06-04 15:57:16 UTC
Type: RAMDisk Image
Compression: uncompressed
Data Start: 0x108f8220
Data Size: 5120976 Bytes = 4.9 MiB
Architecture: AArch64
OS: Linux
Load Address: unavailable
Entry Point: unavailable
Hash algo: sha256
Hash value: 9eee10878a9166c32fa8a2936805d88fb07b5c47321e9bf3aa87dfa87be05d94
Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 10000000 ...
Using 'conf-system-top.dtb' configuration
Trying 'fdt-system-top.dtb' fdt subimage
Description: Flattened Device Tree blob
Created: 2021-06-04 15:57:16 UTC
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x108ec55c
Data Size: 48111 Bytes = 47 KiB
Architecture: AArch64
Hash algo: sha256
Hash value: 0c6d9bda884531e6af70a45b8f4d7b51921f615772deed64e14dd2c82000422a
Verifying Hash Integrity ... sha256+ OK
Booting using the fdt blob at 0x108ec55c
Uncompressing Kernel Image
Loading Ramdisk to 7d82f000, end 7dd113d0 ... OK
Loading Device Tree to 000000007d820000, end 000000007d82ebee ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.10.0-xilinx-v2021.1 (oe-user@oe-host) (aarch64-xilinx-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP Fri Jun 4 15:57:16 UTC 2021
[ 0.000000] Machine model: ZynqMP ZCU104 RevC
[ 0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
[ 0.000000] printk: bootconsole [cdns0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
[ 0.000000] cma: Reserved 1000 MiB at 0x000000003f000000
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000000000000-0x000000007fefffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fefffff]
[ 0.000000] Zeroed struct page in unavailable ranges: 256 pages
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fefffff]
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.2
[ 0.000000] percpu: Embedded 22 pages/cpu s50968 r8192 d30952 u90112
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 515844
[ 0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused init_fatal_sh=1 cma=1000M
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 1004876K/2096128K available (13952K kernel code, 980K rwdata, 3916K rodata, 2112K init, 588K bss, 67252K reserved, 1024000K cma-reserved)
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] irq-xilinx: mismatch in kind-of-intr param
[ 0.000000] irq-xilinx: /amba_pl@0/interrupt-controller@80000000: num_irq=32, sw_irq=0, edge=0x1
[ 0.000000] random: get_random_bytes called from start_kernel+0x31c/0x524 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 100.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[ 0.000003] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[ 0.008364] Console: colour dummy device 80x25
[ 0.012479] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
[ 0.022841] pid_max: default: 32768 minimum: 301
[ 0.027563] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.034785] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.043613] rcu: Hierarchical SRCU implementation.
[ 0.047599] EFI services will not be available.
[ 0.051964] smp: Bringing up secondary CPUs ...
[ 0.056698] Detected VIPT I-cache on CPU1
[ 0.056739] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.057126] Detected VIPT I-cache on CPU2
[ 0.057150] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.057515] Detected VIPT I-cache on CPU3
[ 0.057537] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.057585] smp: Brought up 1 node, 4 CPUs
[ 0.091780] SMP: Total of 4 processors activated.
[ 0.096453] CPU features: detected: 32-bit EL0 Support
[ 0.101556] CPU features: detected: CRC32 instructions
[ 0.106695] CPU: All CPU(s) started at EL2
[ 0.110736] alternatives: patching kernel code
[ 0.116225] devtmpfs: initialized
[ 0.123902] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.128123] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.157571] pinctrl core: initialized pinctrl subsystem
[ 0.158074] DMI not present or invalid.
[ 0.161151] NET: Registered protocol family 16
[ 0.166819] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[ 0.172501] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.180305] audit: initializing netlink subsys (disabled)
[ 0.185710] audit: type=2000 audit(0.128:1): state=initialized audit_enabled=0 res=1
[ 0.193343] cpuidle: using governor menu
[ 0.197285] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.204018] ASID allocator initialised with 65536 entries
[ 0.209430] Serial: AMBA PL011 UART driver
[ 0.238754] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.239805] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[ 0.246479] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.253139] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[ 1.304651] cryptd: max_cpu_qlen set to 1000
[ 1.329581] DRBG: Continuing without Jitter RNG
[ 1.408609] raid6: neonx8 gen() 2143 MB/s
[ 1.476662] raid6: neonx8 xor() 1598 MB/s
[ 1.544733] raid6: neonx4 gen() 2186 MB/s
[ 1.612786] raid6: neonx4 xor() 1565 MB/s
[ 1.680865] raid6: neonx2 gen() 2077 MB/s
[ 1.748916] raid6: neonx2 xor() 1438 MB/s
[ 1.816992] raid6: neonx1 gen() 1775 MB/s
[ 1.885052] raid6: neonx1 xor() 1220 MB/s
[ 1.953116] raid6: int64x8 gen() 1438 MB/s
[ 2.021181] raid6: int64x8 xor() 771 MB/s
[ 2.089248] raid6: int64x4 gen() 1602 MB/s
[ 2.157321] raid6: int64x4 xor() 819 MB/s
[ 2.225399] raid6: int64x2 gen() 1398 MB/s
[ 2.293445] raid6: int64x2 xor() 745 MB/s
[ 2.361523] raid6: int64x1 gen() 1033 MB/s
[ 2.429596] raid6: int64x1 xor() 517 MB/s
[ 2.429634] raid6: using algorithm neonx4 gen() 2186 MB/s
[ 2.433586] raid6: .... xor() 1565 MB/s, rmw enabled
[ 2.438517] raid6: using neon recovery algorithm
[ 2.443589] iommu: Default domain type: Translated
[ 2.448171] SCSI subsystem initialized
[ 2.451803] usbcore: registered new interface driver usbfs
[ 2.457145] usbcore: registered new interface driver hub
[ 2.462417] usbcore: registered new device driver usb
[ 2.467460] mc: Linux media interface: v0.10
[ 2.471664] videodev: Linux video capture interface: v2.00
[ 2.477138] EDAC MC: Ver: 3.0.0
[ 2.480587] zynqmp-ipi-mbox mailbox@ff990400: Registered ZynqMP IPI mbox with TX/RX channels.
[ 2.488880] FPGA manager framework
[ 2.492178] Advanced Linux Sound Architecture Driver Initialized.
[ 2.498424] Bluetooth: Core ver 2.22
[ 2.501673] NET: Registered protocol family 31
[ 2.506075] Bluetooth: HCI device and connection manager initialized
[ 2.512391] Bluetooth: HCI socket layer initialized
[ 2.517234] Bluetooth: L2CAP socket layer initialized
[ 2.522257] Bluetooth: SCO socket layer initialized
[ 2.527342] clocksource: Switched to clocksource arch_sys_counter
[ 2.533289] VFS: Disk quotas dquot_6.6.0
[ 2.537082] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 2.548402] NET: Registered protocol family 2
[ 2.548801] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[ 2.556704] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 2.564651] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[ 2.572009] TCP: Hash tables configured (established 16384 bind 16384)
[ 2.578371] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 2.585002] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 2.592177] NET: Registered protocol family 1
[ 2.596663] RPC: Registered named UNIX socket transport module.
[ 2.602274] RPC: Registered udp transport module.
[ 2.606935] RPC: Registered tcp transport module.
[ 2.611607] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 2.618591] PCI: CLS 0 bytes, default 64
[ 2.622004] Trying to unpack rootfs image as initramfs...
[ 2.863902] Freeing initrd memory: 5000K
[ 2.886317] Initialise system trusted keyrings
[ 2.886449] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[ 2.892246] NFS: Registering the id_resolver key type
[ 2.896594] Key type id_resolver registered
[ 2.900698] Key type id_legacy registered
[ 2.904695] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 2.911352] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 2.953900] NET: Registered protocol family 38
[ 2.953944] xor: measuring software checksum speed
[ 2.961634] 8regs : 2363 MB/sec
[ 2.965302] 32regs : 2799 MB/sec
[ 2.970245] arm64_neon : 2380 MB/sec
[ 2.970435] xor: using function: 32regs (2799 MB/sec)
[ 2.975460] Key type asymmetric registered
[ 2.979522] Asymmetric key parser 'x509' registered
[ 2.984386] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[ 2.991720] io scheduler mq-deadline registered
[ 2.996216] io scheduler kyber registered
[ 3.002208] ps_pcie_dma init()
[ 3.003445] xilinx-frmbuf a0000000.v_frmbuf_rd: Probe deferred due to GPIO reset defer
[ 3.011146] xilinx-frmbuf a0010000.v_frmbuf_wr: Probe deferred due to GPIO reset defer
[ 3.043857] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 3.045655] Serial: AMBA driver
[ 3.049988] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 3.058421] brd: module loaded
[ 3.062890] loop: module loaded
[ 3.063745] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 3.068248] libphy: Fixed MDIO Bus: probed
[ 3.072151] tun: Universal TUN/TAP device driver, 1.6
[ 3.075968] CAN device driver interface
[ 3.080408] usbcore: registered new interface driver asix
[ 3.085100] usbcore: registered new interface driver ax88179_178a
[ 3.091127] usbcore: registered new interface driver cdc_ether
[ 3.096925] usbcore: registered new interface driver net1080
[ 3.102546] usbcore: registered new interface driver cdc_subset
[ 3.108428] usbcore: registered new interface driver zaurus
[ 3.113973] usbcore: registered new interface driver cdc_ncm
[ 3.120427] usbcore: registered new interface driver uas
[ 3.124880] usbcore: registered new interface driver usb-storage
[ 3.131443] rtc_zynqmp ffa60000.rtc: registered as rtc0
[ 3.136023] rtc_zynqmp ffa60000.rtc: setting system clock to 2020-12-22T09:30:33 UTC (1608629433)
[ 3.144869] i2c /dev entries driver
[ 3.149801] usbcore: registered new interface driver uvcvideo
[ 3.153995] USB Video Class driver (1.1.1)
[ 3.158584] Bluetooth: HCI UART driver ver 2.3
[ 3.162474] Bluetooth: HCI UART protocol H4 registered
[ 3.167575] Bluetooth: HCI UART protocol BCSP registered
[ 3.172867] Bluetooth: HCI UART protocol LL registered
[ 3.177959] Bluetooth: HCI UART protocol ATH3K registered
[ 3.183330] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 3.189578] Bluetooth: HCI UART protocol Intel registered
[ 3.194922] Bluetooth: HCI UART protocol QCA registered
[ 3.200122] usbcore: registered new interface driver bcm203x
[ 3.205747] usbcore: registered new interface driver bpa10x
[ 3.211280] usbcore: registered new interface driver bfusb
[ 3.216733] usbcore: registered new interface driver btusb
[ 3.222192] usbcore: registered new interface driver ath3k
[ 3.227683] EDAC MC: ECC not enabled
[ 3.231286] EDAC DEVICE0: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
[ 3.243645] sdhci: Secure Digital Host Controller Interface driver
[ 3.249408] sdhci: Copyright(c) Pierre Ossman
[ 3.253730] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.259664] ledtrig-cpu: registered to indicate activity on CPUs
[ 3.265334] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[ 3.271758] zynqmp_firmware_probe Platform Management API v1.1
[ 3.277519] zynqmp_firmware_probe Trustzone version v1.0
[ 3.308841] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
[ 3.352014] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[ 3.352085] zynqmp_aes firmware:zynqmp-firmware:zynqmp-aes: AES Successfully Registered
[ 3.360097] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[ 3.366231] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[ 3.371744] usbcore: registered new interface driver usbhid
[ 3.377122] usbhid: USB HID core driver
[ 3.383650] ARM CCI_400_r1 PMU driver probed
[ 3.384112] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[ 3.392012] usbcore: registered new interface driver snd-usb-audio
[ 3.398540] pktgen: Packet Generator for packet performance testing. Version: 2.75
[ 3.405850] Initializing XFRM netlink socket
[ 3.409542] NET: Registered protocol family 10
[ 3.414302] Segment Routing with IPv6
[ 3.417689] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 3.423747] NET: Registered protocol family 17
[ 3.427823] NET: Registered protocol family 15
[ 3.432232] can: controller area network core
[ 3.436574] NET: Registered protocol family 29
[ 3.440960] can: raw protocol
[ 3.443900] can: broadcast manager protocol
[ 3.448053] can: netlink gateway - max_hops=1
[ 3.452453] Bluetooth: RFCOMM TTY layer initialized
[ 3.457231] Bluetooth: RFCOMM socket layer initialized
[ 3.462339] Bluetooth: RFCOMM ver 1.11
[ 3.466047] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 3.471319] Bluetooth: BNEP filters: protocol multicast
[ 3.476511] Bluetooth: BNEP socket layer initialized
[ 3.481438] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 3.487324] Bluetooth: HIDP socket layer initialized
[ 3.492366] 9pnet: Installing 9P2000 support
[ 3.496509] Key type dns_resolver registered
[ 3.500926] registered taskstats version 1
[ 3.504801] Loading compiled-in X.509 certificates
[ 3.510477] Btrfs loaded, crc32c=crc32c-generic
[ 3.523211] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 50, base_baud = 6249999) is a xuartps
[ 3.532236] printk: console [ttyPS0] enabled
[ 3.532236] printk: console [ttyPS0] enabled
[ 3.536530] printk: bootconsole [cdns0] disabled
[ 3.536530] printk: bootconsole [cdns0] disabled
[ 3.546295] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 51, base_baud = 6249999) is a xuartps
[ 3.559407] of-fpga-region fpga-full: FPGA Region probed
[ 3.565469] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[ 3.572662] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[ 3.579836] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[ 3.587009] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[ 3.594179] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[ 3.601347] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[ 3.608514] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[ 3.615692] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[ 3.622945] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[ 3.630118] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[ 3.637289] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[ 3.644458] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[ 3.651627] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[ 3.658804] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[ 3.665978] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[ 3.673148] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[ 3.680554] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA engine is probed
[ 3.688678] xilinx-frmbuf a0000000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
[ 3.696131] xilinx-frmbuf a0000000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
[ 3.704820] xilinx-frmbuf a0010000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
[ 3.712268] xilinx-frmbuf a0010000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!
[ 3.721700] zynqmp-display fd4a0000.display: vtc bridge property not present
[ 3.730636] xilinx-dp-snd-codec fd4a0000.display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
[ 3.740789] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[ 3.748923] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[ 3.758228] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: ASoC: no DMI vendor name!
[ 3.767081] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
[ 3.776661] OF: graph: no port node found in /axi/display@fd4a0000
[ 3.783118] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops 0xffff800010efb8e0)
[ 4.867359] zynqmp-display fd4a0000.display: [drm] Cannot find any crtc or sizes
[ 4.874999] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display on minor 0
[ 4.882492] zynqmp-display fd4a0000.display: ZynqMP DisplayPort Subsystem driver probed
[ 4.890871] ahci-ceva fd0c0000.ahci: supply ahci not found, using dummy regulator
[ 4.898421] ahci-ceva fd0c0000.ahci: supply phy not found, using dummy regulator
[ 4.905883] ahci-ceva fd0c0000.ahci: supply target not found, using dummy regulator
[ 4.923788] ahci-ceva fd0c0000.ahci: AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[ 4.932744] ahci-ceva fd0c0000.ahci: flags: 64bit ncq sntf pm clo only pmp fbs pio slum part ccc sds apst
[ 4.943578] scsi host0: ahci-ceva
[ 4.947196] scsi host1: ahci-ceva
[ 4.950633] ata1: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x100 irq 48
[ 4.958546] ata2: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x180 irq 48
[ 4.967197] spi-nor spi0.0: found mt25qu512a, expected m25p80
[ 4.973631] spi-nor spi0.0: trying to lock already unlocked area
[ 4.979636] spi-nor spi0.0: mt25qu512a (65536 Kbytes)
[ 4.984701] 3 fixed-partitions partitions found on MTD device spi0.0
[ 4.991050] Creating 3 MTD partitions on "spi0.0":
[ 4.995835] 0x000000000000-0x000001e00000 : "boot"
[ 5.001460] 0x000001e00000-0x000001e40000 : "bootenv"
[ 5.007193] 0x000001e40000-0x000004000000 : "kernel"
[ 5.015589] macb ff0e0000.ethernet: Not enabling partial store and forward
[ 5.023113] libphy: MACB_mii_bus: probed
[ 5.028559] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 39 (00:0a:35:05:5c:96)
[ 5.038863] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[ 5.045458] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[ 5.051986] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[ 5.058515] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[ 5.086135] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 5.091633] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
[ 5.099388] xhci-hcd xhci-hcd.1.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x0000000002010810
[ 5.108807] xhci-hcd xhci-hcd.1.auto: irq 92, io mem 0xfe200000
[ 5.114944] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 5.123206] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.130417] usb usb1: Product: xHCI Host Controller
[ 5.135285] usb usb1: Manufacturer: Linux 5.10.0-xilinx-v2021.1 xhci-hcd
[ 5.141977] usb usb1: SerialNumber: xhci-hcd.1.auto
[ 5.147142] hub 1-0:1.0: USB hub found
[ 5.150910] hub 1-0:1.0: 1 port detected
[ 5.155024] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 5.160513] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
[ 5.168176] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[ 5.174904] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[ 5.183170] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.190386] usb usb2: Product: xHCI Host Controller
[ 5.195254] usb usb2: Manufacturer: Linux 5.10.0-xilinx-v2021.1 xhci-hcd
[ 5.201952] usb usb2: SerialNumber: xhci-hcd.1.auto
[ 5.207076] hub 2-0:1.0: USB hub found
[ 5.210840] hub 2-0:1.0: 1 port detected
[ 5.216271] pca953x 0-0020: supply vcc not found, using dummy regulator
[ 5.222950] pca953x 0-0020: using no AI
[ 5.227910] at24 2-0054: supply vcc not found, using dummy regulator
[ 5.234776] at24 2-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
[ 5.241506] i2c i2c-0: Added multiplexed i2c bus 2
[ 5.246543] i2c i2c-0: Added multiplexed i2c bus 3
[ 5.267289] random: fast init done
[ 5.284512] ata1: SATA link down (SStatus 0 SControl 330)
[ 5.289924] ata2: SATA link down (SStatus 0 SControl 330)
[ 5.503951] i2c i2c-0: Added multiplexed i2c bus 4
[ 5.509685] i2c i2c-0: Added multiplexed i2c bus 5
[ 5.514595] i2c i2c-0: Added multiplexed i2c bus 6
[ 5.519514] i2c i2c-0: Added multiplexed i2c bus 7
[ 5.524430] i2c i2c-0: Added multiplexed i2c bus 8
[ 5.529349] i2c i2c-0: Added multiplexed i2c bus 9
[ 5.534137] pca954x 0-0074: registered 8 multiplexed busses for I2C switch pca9548
[ 5.541731] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 41
[ 5.548400] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
[ 5.555903] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
[ 5.566394] of_cfs_init
[ 5.568890] of_cfs_init: OK
[ 5.571827] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 5.595359] mmc0: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
[ 5.637622] mmc0: Problem switching card into high-speed mode!
[ 5.644018] mmc0: new SDHC card at address 0001
[ 5.648952] mmcblk0: mmc0:0001 SD16G 14.9 GiB
[ 5.655299] mmcblk0: p1 p2
[ 5.707929] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 5.714456] clk: Not disabling unused clocks
[ 5.718968] ALSA device list:
[ 5.721932] #0: DisplayPort monitor
[ 5.725864] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 5.734474] cfg80211: failed to load regulatory.db
[ 5.739924] Freeing unused kernel memory: 2112K
[ 5.759386] Run /init as init process
rootfs: recovering journal
[ 5.979379] zynqmp-display fd4a0000.display: [drm] Cannot find any crtc or sizes
rootfs: clean, 14862/731520 files, 156910/2926080 blocks
[ 6.434022] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
INIT: version 2.97 booting
Starting udev
[ 7.501353] udevd[334]: starting version 3.2.9
[ 7.534842] random: udevd: uninitialized urandom read (16 bytes read)
[ 7.542678] random: udevd: uninitialized urandom read (16 bytes read)
[ 7.549147] random: udevd: uninitialized urandom read (16 bytes read)
[ 7.631328] udevd[335]: starting eudev-3.2.9
[ 7.786236] zocl: loading out-of-tree module taints kernel.
[ 7.794227] [drm] Probing for xlnx,zocl
[ 7.798439] zocl-drm amba_pl@0:zyxclmm_drm: IRQ index 32 not found
[ 7.804773] [drm] FPGA programming device pcap founded.
[ 7.809997] [drm] PR Isolation addr 0x0
[ 7.810378] [drm] Initialized zocl 0.0.0 00000 for amba_pl@0:zyxclmm_drm on minor 1
[ 7.900557] xilinx-vcu a0140000.vcu: could not find xlnx,vcu-settings: trying direct register access
[ 8.336520] al5d a0120000.al5d: l2 prefetch size:12451840 (bits), l2 color bitdepth:10
[ 8.354350] al5e a0100000.al5e: l2 prefetch size:12451840 (bits), l2 color bitdepth:10
[ 8.877963] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 8.970337] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 9.272790] macb ff0e0000.ethernet eth0: PHY [ff0e0000.ethernet-ffffffff:0c] driver [TI DP83867] (irq=POLL)
[ 9.282573] macb ff0e0000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 11.341085] macb ff0e0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control tx
[ 11.348863] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Starting tcf-agent:
[ 13.673596] random: crng init done
[ 13.677013] random: 7 urandom warning(s) missed due to ratelimiting
OK
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
Build Operating System: Linux
Current Operating System: Linux xilinx-zcu104-2021_1 5.10.0-xilinx-v2021.1 #1 SMP Fri Jun 4 15:57:16 UTC 2021 aarch64
Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused init_fatal_sh=1 cma=1000M
Build Date: 25 August 2020 03:40:19PM
Current version of pixman: 0.40.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Dec 22 09:30:42 2020
(==) Using config file: "/etc/X11/xorg.conf"
[ 13.999312] zocl-drm amba_pl@0:zyxclmm_drm: zocl_create_client: created KDS client for pid(740), ret: 0
[ 14.009883] zocl-drm amba_pl@0:zyxclmm_drm: zocl_destroy_client: client exits pid(740)
root@xilinx-zcu104-2021_1:~#
root@xilinx-zcu104-2021_1:~#
通过XSA创建ZYNQ-7000工程
xas创建ZYNQ工程的时候,需要一个vivado工程,完成设计,并导出xas文件,这里需要指出的是,一个简单的vivado工程也可以来创建petalinux工程,如vivado仅实现了PL的led闪灯和PS的穿串口打印,但是简单的xas配置,只能保证系统可以起来,很多外设可能无法正常使用。需要配置更多PL、PS资源来支持。
在打包BOOT.BIN的时候,会把xsa中的bin文件打包,可以看到petalinux制作好系统后,pl端的led是在闪烁的。
当我们使用更多资源的时候,需要在vivado中完成更多设计,从而使PL配置出更多裸机,且需要PS端对应的驱动支持。
petalinux-create --type project --template zynq --name linux_prj
配置工程信息:
petalinux-config --get-hw-description ../../led_zdyz/ps_uart_wrapper.xsa
配置系统
petalinux-config -c uboot
petalinux-config -c kernel
petalinux-config -c rootfs
产生bin文件
petalinux-package --boot --u-boot --format BIN
制作SD启动
BOOT.BIN、image.ub、 boot.scr拷贝到第一分区
备注:
通过BSP构建的工程,完成petalinux-build后,虽然新产生了image目录,但是要里面的image.ub发现内核编译时间并非新编译的时间,但文件确实是新编译产生的,和petalinux的编译机制有关吧。
4、petalinux工程说明
4.1 DTS自动生成路径
components/plnx_workspace/device-tree/device-tree/下
device-tree.mss include ps7_init.c ps7_init_gpl.h ps7_init.html ps_uart_wrapper.bit system-conf.dtsi zynq-7000.dtsi
hardware_description.xsa pcw.dtsi ps7_init_gpl.c ps7_init.h ps7_init.tcl skeleton.dtsi system-top.dts
其中system-top.dts就是最顶层的dts,同时该目录下也包含了PL的配置文件。
/*
* CAUTION: This file is automatically generated by Xilinx.
* Version:
* Today is: Sat Aug 7 10:22:07 2021
*/
/dts-v1/;
#include "zynq-7000.dtsi"
#include "pcw.dtsi"
/ {
chosen {
bootargs = "earlycon";
stdout-path = "serial0:115200n8";
};
aliases {
serial0 = &uart1;
spi0 = &qspi;
};
memory {
device_type = "memory";
reg = <0x0 0x40000000>;
};
};
#include "system-user.dtsi"
用户后期可自定义补充的设备树文件:system-user.dtsi
(project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi)
4.2 指定使用本地uboot、内核源码
petalinux-config选择Linux Components Selection ---> 中修改源码源为本地源码路径。
附件:
vivado2017在ZYNQ-7000的VIVADO工程(HJ)
- 通过vivado工程配置petalinux工程
- vivado工程实现PL端led流水灯和PS端串口打印,工程如下:
链接:https://pan.baidu.com/s/1qAMd11qfo5_H2L8984FqZA 提取码:r1r1
- petalinux-create --type project --template zynq --name led_peta
- petalinux-config --get-hw-description ../project.sdk
- petalinux-config -c kernel
- petalinux-config -c rootfs
- petalinux-build
- petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga --u-boot --force
- BOOT.BIN 和 image.ub 复制到 sd 卡
vivado2021在ZYNQ-7000的VIVADO工程(ZDYZ)
- 通过vivado工程配置petalinux工程
- vivado工程实现PL端led流水灯和PS端串口打印,工程如下:
链接:https://pan.baidu.com/s/1rmIehi6ZSjmXxk1mAAPhkA
提取码:4jdb
petalinux工程创建参考如上: 通过XSA创建ZYNQ-7000工程 小节
更多推荐
所有评论(0)