ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

xilinx FPGA U-boot

2021-04-28 14:04:22  阅读:197  来源: 互联网

标签:FPGA boot Boot 映像 len bootm memory xilinx


U-Boot 命令

在U-Boot提示符下可以访问U-Boot命令列表。键入“帮助”或“?”有关可用命令的完整列表。下面给出一个例子:

?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
date    - get/set/reset date && time
echo    - echo args to console
editenv - edit environment variable
erase   - erase FLASH memory
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fdt     - flattened device tree utility commands
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print command description/usage
iminfo  - print header information for application image
imls    - list all images found in flash
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtest   - simple RAM read/write test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
setenv  - set environment variables
sf      - SPI flash sub-system
sleep   - delay execution for some time
source  - run script from memory
sspi    - SPI utility commands
tftpboot- boot image via network using TFTP protocol
version - print monitor version

 

烧写QSPI Flash

U-Boot提供SF命令来对串行闪存设备进行编程。在所有通过u-boot进行的Xilinx平台上,您都可以使用SF命令对QSPI设备进行编程。这是将图像文件加载到QSPI设备的示例。

uboot> sf
Usage:
sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus and chip select
sf read addr offset len         - read 'len' bytes starting at 'offset' to memory at 'addr'
sf write addr offset len        - write 'len' bytes from memory at 'addr' to flash at 'offset'
sf erase offset [+]len          - erase 'len' bytes from 'offset'; '+len' round up 'len' to block size
sf update addr offset len       - erase and write 'len'bytes from memory at 'addr' to flash at 'offset
  
uboot> sf probe 0 0 0
SF: Detected N25Q128 with page size 256, total 16 MiB
16384 KiB N25Q128 at 0:0 is now current device

引导应用程序映像

U-Boot提供了bootm命令来引导应用程序映像(即Linux),该映像希望这些映像可以使用mkimage用U-Boot特定的标头包装。该命令可用于引导旧的U-Boot映像或新的多组件映像(FIT),如U-Boot中所述。

标准的Linux构建过程将构建包装器uImage,而Petalinux项目默认也会生成多组件FIT图像。

以下U-Boot命令说明了使用bootm命令使用单个映像和FIT映像从SD卡加载Linux映像。

 

u-boot> fatload mmc 0 0x3000000 uImage
u-boot> fatload mmc 0 0x2A00000 devicetree.dtb
u-boot> fatload mmc 0 0x2000000 uramdisk.image.gz
u-boot> bootm 0x3000000 0x2000000 0x2A00000
u-boot> fatload mmc 0 0x1000000 image.ub
u-boot> bootm 0x1000000

使用bootm命令,U-Boot会在引导Linux之前重新定位映像,以使上面的地址可能不是内核看到的地址。

U-Boot还会更改设备树,以告知内核ramdisk映像在内存中的位置(initrd-start和initrd-end)。bootm命令将r2寄存器设置为内存中设备树的地址,而go命令无法完成该操作。

使用booti命令和bootm命令的差异和用例也不断发展。

从U-Boot 2020.01开始,主要区别在于处理U-Boot帮助中所述的未压缩Linux映像文件(在64位Arm平台上常见)与压缩Linux zImage文件(在32位Arm平台上常见)。通常,仅根据Linux映像类型来区分用法,

不是仅基于体系结构来区分。booti-从内存中启动Linux内核“映像”格式。bootm-从内存启动应用程序映像

booti和bootm的完整帮助分别详细说明了用法上的差异。

 

标签:FPGA,boot,Boot,映像,len,bootm,memory,xilinx
来源: https://www.cnblogs.com/changryJB/p/14713708.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有