编程和配置 U-boot
Programming and configuring the U-boot
首先,这个问题与嵌入式操作系统的创建有关,确切地说,Linux kernel + u-boot + FSBL + device tree + FS compiled to 运行 手臂 A9.
上下文:
在 Zynq 设备(特别是 Pynq 板)上启动这个(刚刚创建的)OS 后,Uart 给出这些消息:
No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>
initcall sequence 04061cc0 failed at call 04045e9c (err=-1)
### ERROR ### Please RESET the board ###
问题:
很明显,错误是在u-boot.elf的生成上:它试图使用一个无法找到的设备树,但是在BOOT文件夹中,设备树存在名字 devicetree.dtb
。什么会导致这个问题?我可以尝试修改哪个配置文件以指向正确的设备树?有什么建议吗?
一些细节:
只是为了添加更多信息,
1) 第一阶段引导加载程序似乎工作正常并打印:
Xilinx First Stage Boot Loader
Release 2017.1 Jan 25 2018-18:26:02
Devcfg driver initialized
Silicon Version 3.1
Boot mode is SD
SD: rc= 0
SD Init Done
Flash Base Address: 0xE0100000
Reboot status register: 0x60600000
Multiboot Register: 0x0000C000
Image Start Address: 0x00000000
Partition Header Offset:0x00000C80
Partition Count: 4
Partition Number: 1
Header Dump
Image Word Len: 0x000F6EC0
Data Word Len: 0x000F6EC0
Partition Word Len:0x000F6EC0
Load Addr: 0x00000000
Exec Addr: 0x00000000
Partition Start: 0x000065D0
Partition Attr: 0x00000020
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xFFD14B7E
Bitstream
In FsblHookBeforeBitstreamDload function
PCAP:StatusReg = 0x40000A30
PCAP:device ready
PCAP:Clear done
Level Shifter Value = 0xA
Devcfg Status register = 0x40000A30
PCAP:Fabric is Initialized done
PCAP register dump:
PCAP CTRL 0xF8007000: 0x4C00E07F
PCAP LOCK 0xF8007004: 0x0000001A
PCAP CONFIG 0xF8007008: 0x00000508
PCAP ISR 0xF800700C: 0x0802000B
PCAP IMR 0xF8007010: 0xFFFFFFFF
PCAP STATUS 0xF8007014: 0x00000A30
PCAP DMA SRC ADDR 0xF8007018: 0x00100001
PCAP DMA DEST ADDR 0xF800701C: 0xFFFFFFFF
PCAP DMA SRC LEN 0xF8007020: 0x000F6EC0
PCAP DMA DEST LEN 0xF8007024: 0x000F6EC0
PCAP ROM SHADOW CTRL 0xF8007028: 0xFFFFFFFF
PCAP MBOOT 0xF800702C: 0x0000C000
PCAP SW ID 0xF8007030: 0x00000000
PCAP UNLOCK 0xF8007034: 0x757BDF0D
PCAP MCTRL 0xF8007080: 0x30800100
DMA Done !
FPGA Done !
In FsblHookAfterBitstreamDload function
Partition Number: 2
Header Dump
Image Word Len: 0x0001BB09
Data Word Len: 0x0001BB09
Partition Word Len:0x0001BB09
Load Addr: 0x04000000
Exec Addr: 0x04000000
Partition Start: 0x000FD490
Partition Attr: 0x00000010
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xF7EAF7E3
Application
Partition Number: 3
Header Dump
Image Word Len: 0x00000A05
Data Word Len: 0x00000A05
Partition Word Len:0x00000A05
Load Addr: 0x02A00000
Exec Addr: 0x00000000
Partition Start: 0x00118FA0
Partition Attr: 0x00000012
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xFD4E4FCD
Application
Handoff Address: 0x04000000
In FsblHookBeforeHandoff function
SUCCESSFUL_HANDOFF
FSBL Status = 0x1
No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>
initcall sequence 04061cc0 failed at call 04045e9c (err=-1)
### ERROR ### Please RESET the board ###
2) 我从原始 U-boot 存储库修改的唯一文件是 zynq-common.h
。我这样做是因为我必须使用 Linaro FS 而不是默认的 initfsram
。这里修改了部分文件(当然,正如你所理解的,我使用的是 SD 卡,修改是针对 sdboot
):
/* Default environment */
#ifndef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
"fit_image=fit.itb[=12=]" \
"load_addr=0x2000000[=12=]" \
"fit_size=0x800000[=12=]" \
"flash_off=0x100000[=12=]" \
"nor_flash_off=0xE2100000[=12=]" \
"fdt_high=0x20000000[=12=]" \
"initrd_high=0x20000000[=12=]" \
"loadbootenv_addr=0x2000000[=12=]" \
"bootenv=uEnv.txt[=12=]" \
"bootenv_dev=mmc[=12=]" \
"loadbootenv=load ${bootenv_dev} 0 ${loadbootenv_addr} ${bootenv}[=12=]" \
"importbootenv=echo Importing environment from ${bootenv_dev} ...; " \
"env import -t ${loadbootenv_addr} $filesize[=12=]" \
"bootenv_existence_test=test -e ${bootenv_dev} 0 /${bootenv}[=12=]" \
"setbootenv=if env run bootenv_existence_test; then " \
"if env run loadbootenv; then " \
"env run importbootenv; " \
"fi; " \
"fi; [=12=]" \
"sd_loadbootenv=set bootenv_dev mmc && " \
"run setbootenv [=12=]" \
"usb_loadbootenv=set bootenv_dev usb && usb start && run setbootenv [=12=]" \
"preboot=if test $modeboot = sdboot; then " \
"run sd_loadbootenv; " \
"echo Checking if uenvcmd is set ...; " \
"if test -n $uenvcmd; then " \
"echo Running uenvcmd ...; " \
"run uenvcmd; " \
"fi; " \
"fi; [=12=]" \
"norboot=echo Copying FIT from NOR flash to RAM... && " \
"cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
"bootm ${load_addr}[=12=]" \
"kernel_image=uImage[=12=]" \
"kernel_load_address=0x2080000[=12=]" \
"ramdisk_image=uramdisk.image.gz[=12=]" \
"ramdisk_load_address=0x4000000[=12=]" \
"devicetree_image=devicetree.dtb[=12=]" \
"devicetree_load_address=0x2000000[=12=]" \
"sdboot=if mmcinfo; then " \
"echo Copying Linux from SD to RAM... && " \
"load mmc 0 ${kernel_load_address} ${kernel_image} && " \
"load mmc 0 ${devicetree_load_address} ${devicetree_image} && " \
"bootm ${kernel_load_address} - ${devicetree_load_address}; " \
"fi[=12=]" \
"jtagboot=echo TFTPing FIT to RAM... && " \
"tftpboot ${load_addr} ${fit_image} && " \
"bootm ${load_addr}[=12=]" \
"usbboot=if usb start; then " \
"echo Copying FIT from USB to RAM... && " \
"load usb 0 ${load_addr} ${fit_image} && " \
"bootm ${load_addr}; fi[=12=]" \
DFU_ALT_INFO
#endif
此外,如果需要,我可以分享其他使用的配置文件。
如果您认为 Whosebug 不适合提出此类问题,请告诉我在哪里可以提出问题,我会转到其他论坛。
感谢您花时间阅读问题。
参考link,如果zynq_artyz7_defconfig
用于你的pynq板是的,根据你给出的构建命令查看makefile,你还需要在[中查看CONFIG_SPL_FS_LOAD_PAYLOAD_NAME =14=].h
首先,这个问题与嵌入式操作系统的创建有关,确切地说,Linux kernel + u-boot + FSBL + device tree + FS compiled to 运行 手臂 A9.
上下文:
在 Zynq 设备(特别是 Pynq 板)上启动这个(刚刚创建的)OS 后,Uart 给出这些消息:
No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>
initcall sequence 04061cc0 failed at call 04045e9c (err=-1)
### ERROR ### Please RESET the board ###
问题:
很明显,错误是在u-boot.elf的生成上:它试图使用一个无法找到的设备树,但是在BOOT文件夹中,设备树存在名字 devicetree.dtb
。什么会导致这个问题?我可以尝试修改哪个配置文件以指向正确的设备树?有什么建议吗?
一些细节:
只是为了添加更多信息,
1) 第一阶段引导加载程序似乎工作正常并打印:
Xilinx First Stage Boot Loader
Release 2017.1 Jan 25 2018-18:26:02
Devcfg driver initialized
Silicon Version 3.1
Boot mode is SD
SD: rc= 0
SD Init Done
Flash Base Address: 0xE0100000
Reboot status register: 0x60600000
Multiboot Register: 0x0000C000
Image Start Address: 0x00000000
Partition Header Offset:0x00000C80
Partition Count: 4
Partition Number: 1
Header Dump
Image Word Len: 0x000F6EC0
Data Word Len: 0x000F6EC0
Partition Word Len:0x000F6EC0
Load Addr: 0x00000000
Exec Addr: 0x00000000
Partition Start: 0x000065D0
Partition Attr: 0x00000020
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xFFD14B7E
Bitstream
In FsblHookBeforeBitstreamDload function
PCAP:StatusReg = 0x40000A30
PCAP:device ready
PCAP:Clear done
Level Shifter Value = 0xA
Devcfg Status register = 0x40000A30
PCAP:Fabric is Initialized done
PCAP register dump:
PCAP CTRL 0xF8007000: 0x4C00E07F
PCAP LOCK 0xF8007004: 0x0000001A
PCAP CONFIG 0xF8007008: 0x00000508
PCAP ISR 0xF800700C: 0x0802000B
PCAP IMR 0xF8007010: 0xFFFFFFFF
PCAP STATUS 0xF8007014: 0x00000A30
PCAP DMA SRC ADDR 0xF8007018: 0x00100001
PCAP DMA DEST ADDR 0xF800701C: 0xFFFFFFFF
PCAP DMA SRC LEN 0xF8007020: 0x000F6EC0
PCAP DMA DEST LEN 0xF8007024: 0x000F6EC0
PCAP ROM SHADOW CTRL 0xF8007028: 0xFFFFFFFF
PCAP MBOOT 0xF800702C: 0x0000C000
PCAP SW ID 0xF8007030: 0x00000000
PCAP UNLOCK 0xF8007034: 0x757BDF0D
PCAP MCTRL 0xF8007080: 0x30800100
DMA Done !
FPGA Done !
In FsblHookAfterBitstreamDload function
Partition Number: 2
Header Dump
Image Word Len: 0x0001BB09
Data Word Len: 0x0001BB09
Partition Word Len:0x0001BB09
Load Addr: 0x04000000
Exec Addr: 0x04000000
Partition Start: 0x000FD490
Partition Attr: 0x00000010
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xF7EAF7E3
Application
Partition Number: 3
Header Dump
Image Word Len: 0x00000A05
Data Word Len: 0x00000A05
Partition Word Len:0x00000A05
Load Addr: 0x02A00000
Exec Addr: 0x00000000
Partition Start: 0x00118FA0
Partition Attr: 0x00000012
Partition Checksum Offset: 0x00000000
Section Count: 0x00000001
Checksum: 0xFD4E4FCD
Application
Handoff Address: 0x04000000
In FsblHookBeforeHandoff function
SUCCESSFUL_HANDOFF
FSBL Status = 0x1
No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>
initcall sequence 04061cc0 failed at call 04045e9c (err=-1)
### ERROR ### Please RESET the board ###
2) 我从原始 U-boot 存储库修改的唯一文件是 zynq-common.h
。我这样做是因为我必须使用 Linaro FS 而不是默认的 initfsram
。这里修改了部分文件(当然,正如你所理解的,我使用的是 SD 卡,修改是针对 sdboot
):
/* Default environment */
#ifndef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
"fit_image=fit.itb[=12=]" \
"load_addr=0x2000000[=12=]" \
"fit_size=0x800000[=12=]" \
"flash_off=0x100000[=12=]" \
"nor_flash_off=0xE2100000[=12=]" \
"fdt_high=0x20000000[=12=]" \
"initrd_high=0x20000000[=12=]" \
"loadbootenv_addr=0x2000000[=12=]" \
"bootenv=uEnv.txt[=12=]" \
"bootenv_dev=mmc[=12=]" \
"loadbootenv=load ${bootenv_dev} 0 ${loadbootenv_addr} ${bootenv}[=12=]" \
"importbootenv=echo Importing environment from ${bootenv_dev} ...; " \
"env import -t ${loadbootenv_addr} $filesize[=12=]" \
"bootenv_existence_test=test -e ${bootenv_dev} 0 /${bootenv}[=12=]" \
"setbootenv=if env run bootenv_existence_test; then " \
"if env run loadbootenv; then " \
"env run importbootenv; " \
"fi; " \
"fi; [=12=]" \
"sd_loadbootenv=set bootenv_dev mmc && " \
"run setbootenv [=12=]" \
"usb_loadbootenv=set bootenv_dev usb && usb start && run setbootenv [=12=]" \
"preboot=if test $modeboot = sdboot; then " \
"run sd_loadbootenv; " \
"echo Checking if uenvcmd is set ...; " \
"if test -n $uenvcmd; then " \
"echo Running uenvcmd ...; " \
"run uenvcmd; " \
"fi; " \
"fi; [=12=]" \
"norboot=echo Copying FIT from NOR flash to RAM... && " \
"cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
"bootm ${load_addr}[=12=]" \
"kernel_image=uImage[=12=]" \
"kernel_load_address=0x2080000[=12=]" \
"ramdisk_image=uramdisk.image.gz[=12=]" \
"ramdisk_load_address=0x4000000[=12=]" \
"devicetree_image=devicetree.dtb[=12=]" \
"devicetree_load_address=0x2000000[=12=]" \
"sdboot=if mmcinfo; then " \
"echo Copying Linux from SD to RAM... && " \
"load mmc 0 ${kernel_load_address} ${kernel_image} && " \
"load mmc 0 ${devicetree_load_address} ${devicetree_image} && " \
"bootm ${kernel_load_address} - ${devicetree_load_address}; " \
"fi[=12=]" \
"jtagboot=echo TFTPing FIT to RAM... && " \
"tftpboot ${load_addr} ${fit_image} && " \
"bootm ${load_addr}[=12=]" \
"usbboot=if usb start; then " \
"echo Copying FIT from USB to RAM... && " \
"load usb 0 ${load_addr} ${fit_image} && " \
"bootm ${load_addr}; fi[=12=]" \
DFU_ALT_INFO
#endif
此外,如果需要,我可以分享其他使用的配置文件。
如果您认为 Whosebug 不适合提出此类问题,请告诉我在哪里可以提出问题,我会转到其他论坛。 感谢您花时间阅读问题。
参考link,如果zynq_artyz7_defconfig
用于你的pynq板是的,根据你给出的构建命令查看makefile,你还需要在[中查看CONFIG_SPL_FS_LOAD_PAYLOAD_NAME =14=].h