当前位置:   article > 正文

使用petalinux构建ZYNQ Linux系统_ug1144

ug1144

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相关命令。

https://china.xilinx.com/support/download/index.html/content/xilinx/zh/downloadNav/embedded-design-tools.html

  • 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

同样需要联网,下载依赖的源码。或者配置离线资源包

输出

  1. yangf@ubuntu:~/src/xilinx/zcu104/xilinx-zcu104-2021.1/images/linux$ ls
  2. bl31.bin config pxelinux.cfg ramdisk.tar.gz rootfs.ext4 system.bit u-boot-dtb.elf zynqmp-qemu-arm.dtb
  3. bl31.elf Image ramdisk.cpio.gz rootfs.cpio rootfs.jffs2 system.dtb u-boot.elf zynqmp-qemu-multiarch-arm.dtb
  4. BOOT.BIN image.ub ramdisk.cpio.gz.u-boot rootfs.cpio.gz rootfs.manifest u-boot.bin vmlinux zynqmp-qemu-multiarch-pmu.dtb
  5. boot.scr pmufw.elf ramdisk.manifest rootfs.cpio.gz.u-boot rootfs.tar.gz u-boot-dtb.bin zynqmp_fsbl.elf
  6. 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

启动日志

  1. Xilinx Zynq MP First Stage Boot Loader
  2. Release 2021.1 Jun 6 2021 - 07:07:32
  3. NOTICE: ATF running on XCZU7EV/silicon v4/RTL5.1 at 0xfffea000
  4. NOTICE: BL31: v2.4(release):v1.1-7609-g851523ea2
  5. NOTICE: BL31: Built : 08:27:07, Apr 28 2021
  6. U-Boot 2021.01 (Jun 01 2021 - 11:54:06 +0000)
  7. Model: ZynqMP ZCU104 RevC
  8. Board: Xilinx ZynqMP
  9. DRAM: 2 GiB
  10. PMUFW: v1.1
  11. EL Level: EL2
  12. Chip ID: zu7ev
  13. NAND: 0 MiB
  14. MMC: mmc@ff170000: 0
  15. Loading Environment from FAT... *** Warning - bad CRC, using default environment
  16. In: serial
  17. Out: serial
  18. Err: serial
  19. Bootmode: LVL_SHFT_SD_MODE1
  20. Reset reason: EXTERNAL
  21. Net:
  22. ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id
  23. eth0: ethernet@ff0e0000
  24. Hit any key to stop autoboot: 0
  25. switch to partitions #0, OK
  26. mmc0 is current device
  27. Scanning mmc 0:1...
  28. Found U-Boot script /boot.scr
  29. 2594 bytes read in 15 ms (168 KiB/s)
  30. ## Executing script at 20000000
  31. Trying to load boot images from mmc0
  32. 14527336 bytes read in 967 ms (14.3 MiB/s)
  33. ## Loading kernel from FIT Image at 10000000 ...
  34. Using 'conf-system-top.dtb' configuration
  35. Trying 'kernel-1' kernel subimage
  36. Description: Linux kernel
  37. Created: 2021-06-04 15:57:16 UTC
  38. Type: Kernel Image
  39. Compression: gzip compressed
  40. Data Start: 0x100000f8
  41. Data Size: 9356113 Bytes = 8.9 MiB
  42. Architecture: AArch64
  43. OS: Linux
  44. Load Address: 0x00080000
  45. Entry Point: 0x00080000
  46. Hash algo: sha256
  47. Hash value: 287de5bbc5cd30503aafb8e4ca18d11c0ab014c2a3179466cb92bd30308d1026
  48. Verifying Hash Integrity ... sha256+ OK
  49. ## Loading ramdisk from FIT Image at 10000000 ...
  50. Using 'conf-system-top.dtb' configuration
  51. Trying 'ramdisk-1' ramdisk subimage
  52. Description: petalinux-initramfs-image
  53. Created: 2021-06-04 15:57:16 UTC
  54. Type: RAMDisk Image
  55. Compression: uncompressed
  56. Data Start: 0x108f8220
  57. Data Size: 5120976 Bytes = 4.9 MiB
  58. Architecture: AArch64
  59. OS: Linux
  60. Load Address: unavailable
  61. Entry Point: unavailable
  62. Hash algo: sha256
  63. Hash value: 9eee10878a9166c32fa8a2936805d88fb07b5c47321e9bf3aa87dfa87be05d94
  64. Verifying Hash Integrity ... sha256+ OK
  65. ## Loading fdt from FIT Image at 10000000 ...
  66. Using 'conf-system-top.dtb' configuration
  67. Trying 'fdt-system-top.dtb' fdt subimage
  68. Description: Flattened Device Tree blob
  69. Created: 2021-06-04 15:57:16 UTC
  70. Type: Flat Device Tree
  71. Compression: uncompressed
  72. Data Start: 0x108ec55c
  73. Data Size: 48111 Bytes = 47 KiB
  74. Architecture: AArch64
  75. Hash algo: sha256
  76. Hash value: 0c6d9bda884531e6af70a45b8f4d7b51921f615772deed64e14dd2c82000422a
  77. Verifying Hash Integrity ... sha256+ OK
  78. Booting using the fdt blob at 0x108ec55c
  79. Uncompressing Kernel Image
  80. Loading Ramdisk to 7d82f000, end 7dd113d0 ... OK
  81. Loading Device Tree to 000000007d820000, end 000000007d82ebee ... OK
  82. Starting kernel ...
  83. [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
  84. [ 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
  85. [ 0.000000] Machine model: ZynqMP ZCU104 RevC
  86. [ 0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
  87. [ 0.000000] printk: bootconsole [cdns0] enabled
  88. [ 0.000000] efi: UEFI not found.
  89. [ 0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
  90. [ 0.000000] cma: Reserved 1000 MiB at 0x000000003f000000
  91. [ 0.000000] Zone ranges:
  92. [ 0.000000] DMA32 [mem 0x0000000000000000-0x000000007fefffff]
  93. [ 0.000000] Normal empty
  94. [ 0.000000] Movable zone start for each node
  95. [ 0.000000] Early memory node ranges
  96. [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fefffff]
  97. [ 0.000000] Zeroed struct page in unavailable ranges: 256 pages
  98. [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fefffff]
  99. [ 0.000000] psci: probing for conduit method from DT.
  100. [ 0.000000] psci: PSCIv1.1 detected in firmware.
  101. [ 0.000000] psci: Using standard PSCI v0.2 function IDs
  102. [ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
  103. [ 0.000000] psci: SMC Calling Convention v1.2
  104. [ 0.000000] percpu: Embedded 22 pages/cpu s50968 r8192 d30952 u90112
  105. [ 0.000000] Detected VIPT I-cache on CPU0
  106. [ 0.000000] CPU features: detected: ARM erratum 845719
  107. [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 515844
  108. [ 0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused init_fatal_sh=1 cma=1000M
  109. [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
  110. [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
  111. [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
  112. [ 0.000000] Memory: 1004876K/2096128K available (13952K kernel code, 980K rwdata, 3916K rodata, 2112K init, 588K bss, 67252K reserved, 1024000K cma-reserved)
  113. [ 0.000000] rcu: Hierarchical RCU implementation.
  114. [ 0.000000] rcu: RCU event tracing is enabled.
  115. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
  116. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
  117. [ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
  118. [ 0.000000] GIC: Using split EOI/Deactivate mode
  119. [ 0.000000] irq-xilinx: mismatch in kind-of-intr param
  120. [ 0.000000] irq-xilinx: /amba_pl@0/interrupt-controller@80000000: num_irq=32, sw_irq=0, edge=0x1
  121. [ 0.000000] random: get_random_bytes called from start_kernel+0x31c/0x524 with crng_init=0
  122. [ 0.000000] arch_timer: cp15 timer(s) running at 100.00MHz (phys).
  123. [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
  124. [ 0.000003] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
  125. [ 0.008364] Console: colour dummy device 80x25
  126. [ 0.012479] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
  127. [ 0.022841] pid_max: default: 32768 minimum: 301
  128. [ 0.027563] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
  129. [ 0.034785] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
  130. [ 0.043613] rcu: Hierarchical SRCU implementation.
  131. [ 0.047599] EFI services will not be available.
  132. [ 0.051964] smp: Bringing up secondary CPUs ...
  133. [ 0.056698] Detected VIPT I-cache on CPU1
  134. [ 0.056739] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
  135. [ 0.057126] Detected VIPT I-cache on CPU2
  136. [ 0.057150] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
  137. [ 0.057515] Detected VIPT I-cache on CPU3
  138. [ 0.057537] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
  139. [ 0.057585] smp: Brought up 1 node, 4 CPUs
  140. [ 0.091780] SMP: Total of 4 processors activated.
  141. [ 0.096453] CPU features: detected: 32-bit EL0 Support
  142. [ 0.101556] CPU features: detected: CRC32 instructions
  143. [ 0.106695] CPU: All CPU(s) started at EL2
  144. [ 0.110736] alternatives: patching kernel code
  145. [ 0.116225] devtmpfs: initialized
  146. [ 0.123902] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
  147. [ 0.128123] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
  148. [ 0.157571] pinctrl core: initialized pinctrl subsystem
  149. [ 0.158074] DMI not present or invalid.
  150. [ 0.161151] NET: Registered protocol family 16
  151. [ 0.166819] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
  152. [ 0.172501] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
  153. [ 0.180305] audit: initializing netlink subsys (disabled)
  154. [ 0.185710] audit: type=2000 audit(0.128:1): state=initialized audit_enabled=0 res=1
  155. [ 0.193343] cpuidle: using governor menu
  156. [ 0.197285] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
  157. [ 0.204018] ASID allocator initialised with 65536 entries
  158. [ 0.209430] Serial: AMBA PL011 UART driver
  159. [ 0.238754] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
  160. [ 0.239805] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
  161. [ 0.246479] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
  162. [ 0.253139] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
  163. [ 1.304651] cryptd: max_cpu_qlen set to 1000
  164. [ 1.329581] DRBG: Continuing without Jitter RNG
  165. [ 1.408609] raid6: neonx8 gen() 2143 MB/s
  166. [ 1.476662] raid6: neonx8 xor() 1598 MB/s
  167. [ 1.544733] raid6: neonx4 gen() 2186 MB/s
  168. [ 1.612786] raid6: neonx4 xor() 1565 MB/s
  169. [ 1.680865] raid6: neonx2 gen() 2077 MB/s
  170. [ 1.748916] raid6: neonx2 xor() 1438 MB/s
  171. [ 1.816992] raid6: neonx1 gen() 1775 MB/s
  172. [ 1.885052] raid6: neonx1 xor() 1220 MB/s
  173. [ 1.953116] raid6: int64x8 gen() 1438 MB/s
  174. [ 2.021181] raid6: int64x8 xor() 771 MB/s
  175. [ 2.089248] raid6: int64x4 gen() 1602 MB/s
  176. [ 2.157321] raid6: int64x4 xor() 819 MB/s
  177. [ 2.225399] raid6: int64x2 gen() 1398 MB/s
  178. [ 2.293445] raid6: int64x2 xor() 745 MB/s
  179. [ 2.361523] raid6: int64x1 gen() 1033 MB/s
  180. [ 2.429596] raid6: int64x1 xor() 517 MB/s
  181. [ 2.429634] raid6: using algorithm neonx4 gen() 2186 MB/s
  182. [ 2.433586] raid6: .... xor() 1565 MB/s, rmw enabled
  183. [ 2.438517] raid6: using neon recovery algorithm
  184. [ 2.443589] iommu: Default domain type: Translated
  185. [ 2.448171] SCSI subsystem initialized
  186. [ 2.451803] usbcore: registered new interface driver usbfs
  187. [ 2.457145] usbcore: registered new interface driver hub
  188. [ 2.462417] usbcore: registered new device driver usb
  189. [ 2.467460] mc: Linux media interface: v0.10
  190. [ 2.471664] videodev: Linux video capture interface: v2.00
  191. [ 2.477138] EDAC MC: Ver: 3.0.0
  192. [ 2.480587] zynqmp-ipi-mbox mailbox@ff990400: Registered ZynqMP IPI mbox with TX/RX channels.
  193. [ 2.488880] FPGA manager framework
  194. [ 2.492178] Advanced Linux Sound Architecture Driver Initialized.
  195. [ 2.498424] Bluetooth: Core ver 2.22
  196. [ 2.501673] NET: Registered protocol family 31
  197. [ 2.506075] Bluetooth: HCI device and connection manager initialized
  198. [ 2.512391] Bluetooth: HCI socket layer initialized
  199. [ 2.517234] Bluetooth: L2CAP socket layer initialized
  200. [ 2.522257] Bluetooth: SCO socket layer initialized
  201. [ 2.527342] clocksource: Switched to clocksource arch_sys_counter
  202. [ 2.533289] VFS: Disk quotas dquot_6.6.0
  203. [ 2.537082] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
  204. [ 2.548402] NET: Registered protocol family 2
  205. [ 2.548801] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
  206. [ 2.556704] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
  207. [ 2.564651] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
  208. [ 2.572009] TCP: Hash tables configured (established 16384 bind 16384)
  209. [ 2.578371] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
  210. [ 2.585002] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
  211. [ 2.592177] NET: Registered protocol family 1
  212. [ 2.596663] RPC: Registered named UNIX socket transport module.
  213. [ 2.602274] RPC: Registered udp transport module.
  214. [ 2.606935] RPC: Registered tcp transport module.
  215. [ 2.611607] RPC: Registered tcp NFSv4.1 backchannel transport module.
  216. [ 2.618591] PCI: CLS 0 bytes, default 64
  217. [ 2.622004] Trying to unpack rootfs image as initramfs...
  218. [ 2.863902] Freeing initrd memory: 5000K
  219. [ 2.886317] Initialise system trusted keyrings
  220. [ 2.886449] workingset: timestamp_bits=46 max_order=19 bucket_order=0
  221. [ 2.892246] NFS: Registering the id_resolver key type
  222. [ 2.896594] Key type id_resolver registered
  223. [ 2.900698] Key type id_legacy registered
  224. [ 2.904695] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
  225. [ 2.911352] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
  226. [ 2.953900] NET: Registered protocol family 38
  227. [ 2.953944] xor: measuring software checksum speed
  228. [ 2.961634] 8regs : 2363 MB/sec
  229. [ 2.965302] 32regs : 2799 MB/sec
  230. [ 2.970245] arm64_neon : 2380 MB/sec
  231. [ 2.970435] xor: using function: 32regs (2799 MB/sec)
  232. [ 2.975460] Key type asymmetric registered
  233. [ 2.979522] Asymmetric key parser 'x509' registered
  234. [ 2.984386] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
  235. [ 2.991720] io scheduler mq-deadline registered
  236. [ 2.996216] io scheduler kyber registered
  237. [ 3.002208] ps_pcie_dma init()
  238. [ 3.003445] xilinx-frmbuf a0000000.v_frmbuf_rd: Probe deferred due to GPIO reset defer
  239. [ 3.011146] xilinx-frmbuf a0010000.v_frmbuf_wr: Probe deferred due to GPIO reset defer
  240. [ 3.043857] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
  241. [ 3.045655] Serial: AMBA driver
  242. [ 3.049988] cacheinfo: Unable to detect cache hierarchy for CPU 0
  243. [ 3.058421] brd: module loaded
  244. [ 3.062890] loop: module loaded
  245. [ 3.063745] mtdoops: mtd device (mtddev=name/number) must be supplied
  246. [ 3.068248] libphy: Fixed MDIO Bus: probed
  247. [ 3.072151] tun: Universal TUN/TAP device driver, 1.6
  248. [ 3.075968] CAN device driver interface
  249. [ 3.080408] usbcore: registered new interface driver asix
  250. [ 3.085100] usbcore: registered new interface driver ax88179_178a
  251. [ 3.091127] usbcore: registered new interface driver cdc_ether
  252. [ 3.096925] usbcore: registered new interface driver net1080
  253. [ 3.102546] usbcore: registered new interface driver cdc_subset
  254. [ 3.108428] usbcore: registered new interface driver zaurus
  255. [ 3.113973] usbcore: registered new interface driver cdc_ncm
  256. [ 3.120427] usbcore: registered new interface driver uas
  257. [ 3.124880] usbcore: registered new interface driver usb-storage
  258. [ 3.131443] rtc_zynqmp ffa60000.rtc: registered as rtc0
  259. [ 3.136023] rtc_zynqmp ffa60000.rtc: setting system clock to 2020-12-22T09:30:33 UTC (1608629433)
  260. [ 3.144869] i2c /dev entries driver
  261. [ 3.149801] usbcore: registered new interface driver uvcvideo
  262. [ 3.153995] USB Video Class driver (1.1.1)
  263. [ 3.158584] Bluetooth: HCI UART driver ver 2.3
  264. [ 3.162474] Bluetooth: HCI UART protocol H4 registered
  265. [ 3.167575] Bluetooth: HCI UART protocol BCSP registered
  266. [ 3.172867] Bluetooth: HCI UART protocol LL registered
  267. [ 3.177959] Bluetooth: HCI UART protocol ATH3K registered
  268. [ 3.183330] Bluetooth: HCI UART protocol Three-wire (H5) registered
  269. [ 3.189578] Bluetooth: HCI UART protocol Intel registered
  270. [ 3.194922] Bluetooth: HCI UART protocol QCA registered
  271. [ 3.200122] usbcore: registered new interface driver bcm203x
  272. [ 3.205747] usbcore: registered new interface driver bpa10x
  273. [ 3.211280] usbcore: registered new interface driver bfusb
  274. [ 3.216733] usbcore: registered new interface driver btusb
  275. [ 3.222192] usbcore: registered new interface driver ath3k
  276. [ 3.227683] EDAC MC: ECC not enabled
  277. [ 3.231286] EDAC DEVICE0: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
  278. [ 3.243645] sdhci: Secure Digital Host Controller Interface driver
  279. [ 3.249408] sdhci: Copyright(c) Pierre Ossman
  280. [ 3.253730] sdhci-pltfm: SDHCI platform and OF driver helper
  281. [ 3.259664] ledtrig-cpu: registered to indicate activity on CPUs
  282. [ 3.265334] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
  283. [ 3.271758] zynqmp_firmware_probe Platform Management API v1.1
  284. [ 3.277519] zynqmp_firmware_probe Trustzone version v1.0
  285. [ 3.308841] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
  286. [ 3.352014] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
  287. [ 3.352085] zynqmp_aes firmware:zynqmp-firmware:zynqmp-aes: AES Successfully Registered
  288. [ 3.360097] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
  289. [ 3.366231] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
  290. [ 3.371744] usbcore: registered new interface driver usbhid
  291. [ 3.377122] usbhid: USB HID core driver
  292. [ 3.383650] ARM CCI_400_r1 PMU driver probed
  293. [ 3.384112] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
  294. [ 3.392012] usbcore: registered new interface driver snd-usb-audio
  295. [ 3.398540] pktgen: Packet Generator for packet performance testing. Version: 2.75
  296. [ 3.405850] Initializing XFRM netlink socket
  297. [ 3.409542] NET: Registered protocol family 10
  298. [ 3.414302] Segment Routing with IPv6
  299. [ 3.417689] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
  300. [ 3.423747] NET: Registered protocol family 17
  301. [ 3.427823] NET: Registered protocol family 15
  302. [ 3.432232] can: controller area network core
  303. [ 3.436574] NET: Registered protocol family 29
  304. [ 3.440960] can: raw protocol
  305. [ 3.443900] can: broadcast manager protocol
  306. [ 3.448053] can: netlink gateway - max_hops=1
  307. [ 3.452453] Bluetooth: RFCOMM TTY layer initialized
  308. [ 3.457231] Bluetooth: RFCOMM socket layer initialized
  309. [ 3.462339] Bluetooth: RFCOMM ver 1.11
  310. [ 3.466047] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
  311. [ 3.471319] Bluetooth: BNEP filters: protocol multicast
  312. [ 3.476511] Bluetooth: BNEP socket layer initialized
  313. [ 3.481438] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
  314. [ 3.487324] Bluetooth: HIDP socket layer initialized
  315. [ 3.492366] 9pnet: Installing 9P2000 support
  316. [ 3.496509] Key type dns_resolver registered
  317. [ 3.500926] registered taskstats version 1
  318. [ 3.504801] Loading compiled-in X.509 certificates
  319. [ 3.510477] Btrfs loaded, crc32c=crc32c-generic
  320. [ 3.523211] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 50, base_baud = 6249999) is a xuartps
  321. [ 3.532236] printk: console [ttyPS0] enabled
  322. [ 3.532236] printk: console [ttyPS0] enabled
  323. [ 3.536530] printk: bootconsole [cdns0] disabled
  324. [ 3.536530] printk: bootconsole [cdns0] disabled
  325. [ 3.546295] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 51, base_baud = 6249999) is a xuartps
  326. [ 3.559407] of-fpga-region fpga-full: FPGA Region probed
  327. [ 3.565469] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
  328. [ 3.572662] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
  329. [ 3.579836] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
  330. [ 3.587009] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
  331. [ 3.594179] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
  332. [ 3.601347] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
  333. [ 3.608514] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
  334. [ 3.615692] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
  335. [ 3.622945] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
  336. [ 3.630118] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
  337. [ 3.637289] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
  338. [ 3.644458] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
  339. [ 3.651627] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
  340. [ 3.658804] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
  341. [ 3.665978] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
  342. [ 3.673148] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
  343. [ 3.680554] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA engine is probed
  344. [ 3.688678] xilinx-frmbuf a0000000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
  345. [ 3.696131] xilinx-frmbuf a0000000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
  346. [ 3.704820] xilinx-frmbuf a0010000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
  347. [ 3.712268] xilinx-frmbuf a0010000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!
  348. [ 3.721700] zynqmp-display fd4a0000.display: vtc bridge property not present
  349. [ 3.730636] xilinx-dp-snd-codec fd4a0000.display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
  350. [ 3.740789] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
  351. [ 3.748923] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
  352. [ 3.758228] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: ASoC: no DMI vendor name!
  353. [ 3.767081] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
  354. [ 3.776661] OF: graph: no port node found in /axi/display@fd4a0000
  355. [ 3.783118] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops 0xffff800010efb8e0)
  356. [ 4.867359] zynqmp-display fd4a0000.display: [drm] Cannot find any crtc or sizes
  357. [ 4.874999] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display on minor 0
  358. [ 4.882492] zynqmp-display fd4a0000.display: ZynqMP DisplayPort Subsystem driver probed
  359. [ 4.890871] ahci-ceva fd0c0000.ahci: supply ahci not found, using dummy regulator
  360. [ 4.898421] ahci-ceva fd0c0000.ahci: supply phy not found, using dummy regulator
  361. [ 4.905883] ahci-ceva fd0c0000.ahci: supply target not found, using dummy regulator
  362. [ 4.923788] ahci-ceva fd0c0000.ahci: AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl platform mode
  363. [ 4.932744] ahci-ceva fd0c0000.ahci: flags: 64bit ncq sntf pm clo only pmp fbs pio slum part ccc sds apst
  364. [ 4.943578] scsi host0: ahci-ceva
  365. [ 4.947196] scsi host1: ahci-ceva
  366. [ 4.950633] ata1: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x100 irq 48
  367. [ 4.958546] ata2: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x180 irq 48
  368. [ 4.967197] spi-nor spi0.0: found mt25qu512a, expected m25p80
  369. [ 4.973631] spi-nor spi0.0: trying to lock already unlocked area
  370. [ 4.979636] spi-nor spi0.0: mt25qu512a (65536 Kbytes)
  371. [ 4.984701] 3 fixed-partitions partitions found on MTD device spi0.0
  372. [ 4.991050] Creating 3 MTD partitions on "spi0.0":
  373. [ 4.995835] 0x000000000000-0x000001e00000 : "boot"
  374. [ 5.001460] 0x000001e00000-0x000001e40000 : "bootenv"
  375. [ 5.007193] 0x000001e40000-0x000004000000 : "kernel"
  376. [ 5.015589] macb ff0e0000.ethernet: Not enabling partial store and forward
  377. [ 5.023113] libphy: MACB_mii_bus: probed
  378. [ 5.028559] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 39 (00:0a:35:05:5c:96)
  379. [ 5.038863] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
  380. [ 5.045458] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
  381. [ 5.051986] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
  382. [ 5.058515] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
  383. [ 5.086135] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
  384. [ 5.091633] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
  385. [ 5.099388] xhci-hcd xhci-hcd.1.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x0000000002010810
  386. [ 5.108807] xhci-hcd xhci-hcd.1.auto: irq 92, io mem 0xfe200000
  387. [ 5.114944] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
  388. [ 5.123206] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
  389. [ 5.130417] usb usb1: Product: xHCI Host Controller
  390. [ 5.135285] usb usb1: Manufacturer: Linux 5.10.0-xilinx-v2021.1 xhci-hcd
  391. [ 5.141977] usb usb1: SerialNumber: xhci-hcd.1.auto
  392. [ 5.147142] hub 1-0:1.0: USB hub found
  393. [ 5.150910] hub 1-0:1.0: 1 port detected
  394. [ 5.155024] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
  395. [ 5.160513] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
  396. [ 5.168176] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
  397. [ 5.174904] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
  398. [ 5.183170] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
  399. [ 5.190386] usb usb2: Product: xHCI Host Controller
  400. [ 5.195254] usb usb2: Manufacturer: Linux 5.10.0-xilinx-v2021.1 xhci-hcd
  401. [ 5.201952] usb usb2: SerialNumber: xhci-hcd.1.auto
  402. [ 5.207076] hub 2-0:1.0: USB hub found
  403. [ 5.210840] hub 2-0:1.0: 1 port detected
  404. [ 5.216271] pca953x 0-0020: supply vcc not found, using dummy regulator
  405. [ 5.222950] pca953x 0-0020: using no AI
  406. [ 5.227910] at24 2-0054: supply vcc not found, using dummy regulator
  407. [ 5.234776] at24 2-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
  408. [ 5.241506] i2c i2c-0: Added multiplexed i2c bus 2
  409. [ 5.246543] i2c i2c-0: Added multiplexed i2c bus 3
  410. [ 5.267289] random: fast init done
  411. [ 5.284512] ata1: SATA link down (SStatus 0 SControl 330)
  412. [ 5.289924] ata2: SATA link down (SStatus 0 SControl 330)
  413. [ 5.503951] i2c i2c-0: Added multiplexed i2c bus 4
  414. [ 5.509685] i2c i2c-0: Added multiplexed i2c bus 5
  415. [ 5.514595] i2c i2c-0: Added multiplexed i2c bus 6
  416. [ 5.519514] i2c i2c-0: Added multiplexed i2c bus 7
  417. [ 5.524430] i2c i2c-0: Added multiplexed i2c bus 8
  418. [ 5.529349] i2c i2c-0: Added multiplexed i2c bus 9
  419. [ 5.534137] pca954x 0-0074: registered 8 multiplexed busses for I2C switch pca9548
  420. [ 5.541731] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 41
  421. [ 5.548400] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
  422. [ 5.555903] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
  423. [ 5.566394] of_cfs_init
  424. [ 5.568890] of_cfs_init: OK
  425. [ 5.571827] cfg80211: Loading compiled-in X.509 certificates for regulatory database
  426. [ 5.595359] mmc0: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
  427. [ 5.637622] mmc0: Problem switching card into high-speed mode!
  428. [ 5.644018] mmc0: new SDHC card at address 0001
  429. [ 5.648952] mmcblk0: mmc0:0001 SD16G 14.9 GiB
  430. [ 5.655299] mmcblk0: p1 p2
  431. [ 5.707929] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
  432. [ 5.714456] clk: Not disabling unused clocks
  433. [ 5.718968] ALSA device list:
  434. [ 5.721932] #0: DisplayPort monitor
  435. [ 5.725864] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
  436. [ 5.734474] cfg80211: failed to load regulatory.db
  437. [ 5.739924] Freeing unused kernel memory: 2112K
  438. [ 5.759386] Run /init as init process
  439. rootfs: recovering journal
  440. [ 5.979379] zynqmp-display fd4a0000.display: [drm] Cannot find any crtc or sizes
  441. rootfs: clean, 14862/731520 files, 156910/2926080 blocks
  442. [ 6.434022] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
  443. INIT: version 2.97 booting
  444. Starting udev
  445. [ 7.501353] udevd[334]: starting version 3.2.9
  446. [ 7.534842] random: udevd: uninitialized urandom read (16 bytes read)
  447. [ 7.542678] random: udevd: uninitialized urandom read (16 bytes read)
  448. [ 7.549147] random: udevd: uninitialized urandom read (16 bytes read)
  449. [ 7.631328] udevd[335]: starting eudev-3.2.9
  450. [ 7.786236] zocl: loading out-of-tree module taints kernel.
  451. [ 7.794227] [drm] Probing for xlnx,zocl
  452. [ 7.798439] zocl-drm amba_pl@0:zyxclmm_drm: IRQ index 32 not found
  453. [ 7.804773] [drm] FPGA programming device pcap founded.
  454. [ 7.809997] [drm] PR Isolation addr 0x0
  455. [ 7.810378] [drm] Initialized zocl 0.0.0 00000 for amba_pl@0:zyxclmm_drm on minor 1
  456. [ 7.900557] xilinx-vcu a0140000.vcu: could not find xlnx,vcu-settings: trying direct register access
  457. [ 8.336520] al5d a0120000.al5d: l2 prefetch size:12451840 (bits), l2 color bitdepth:10
  458. [ 8.354350] al5e a0100000.al5e: l2 prefetch size:12451840 (bits), l2 color bitdepth:10
  459. [ 8.877963] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
  460. [ 8.970337] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
  461. [ 9.272790] macb ff0e0000.ethernet eth0: PHY [ff0e0000.ethernet-ffffffff:0c] driver [TI DP83867] (irq=POLL)
  462. [ 9.282573] macb ff0e0000.ethernet eth0: configuring for phy/rgmii-id link mode
  463. [ 11.341085] macb ff0e0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control tx
  464. [ 11.348863] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
  465. Starting tcf-agent:
  466. [ 13.673596] random: crng init done
  467. [ 13.677013] random: 7 urandom warning(s) missed due to ratelimiting
  468. OK
  469. X.Org X Server 1.20.9
  470. X Protocol Version 11, Revision 0
  471. Build Operating System: Linux
  472. 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
  473. Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused init_fatal_sh=1 cma=1000M
  474. Build Date: 25 August 2020 03:40:19PM
  475. Current version of pixman: 0.40.0
  476. Before reporting problems, check http://wiki.x.org
  477. to make sure that you have the latest version.
  478. Markers: (--) probed, (**) from config file, (==) default setting,
  479. (++) from command line, (!!) notice, (II) informational,
  480. (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
  481. (==) Log file: "/var/log/Xorg.0.log", Time: Tue Dec 22 09:30:42 2020
  482. (==) Using config file: "/etc/X11/xorg.conf"
  483. [ 13.999312] zocl-drm amba_pl@0:zyxclmm_drm: zocl_create_client: created KDS client for pid(740), ret: 0
  484. [ 14.009883] zocl-drm amba_pl@0:zyxclmm_drm: zocl_destroy_client: client exits pid(740)
  485. root@xilinx-zcu104-2021_1:~#
  486. 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

配置系统

  1. petalinux-config -c uboot
  2. petalinux-config -c kernel
  3. 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/下

  1. device-tree.mss include ps7_init.c ps7_init_gpl.h ps7_init.html ps_uart_wrapper.bit system-conf.dtsi zynq-7000.dtsi
  2. 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的配置文件。

  1. /*
  2. * CAUTION: This file is automatically generated by Xilinx.
  3. * Version:
  4. * Today is: Sat Aug 7 10:22:07 2021
  5. */
  6. /dts-v1/;
  7. #include "zynq-7000.dtsi"
  8. #include "pcw.dtsi"
  9. / {
  10. chosen {
  11. bootargs = "earlycon";
  12. stdout-path = "serial0:115200n8";
  13. };
  14. aliases {
  15. serial0 = &uart1;
  16. spi0 = &qspi;
  17. };
  18. memory {
  19. device_type = "memory";
  20. reg = <0x0 0x40000000>;
  21. };
  22. };
  23. #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工程 小节

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/346146?site
推荐阅读
相关标签
  

闽ICP备14008679号