chinese直男口爆体育生外卖, 99久久er热在这里只有精品99, 又色又爽又黄18禁美女裸身无遮挡, gogogo高清免费观看日本电视,私密按摩师高清版在线,人妻视频毛茸茸,91论坛 兴趣闲谈,欧美 亚洲 精品 8区,国产精品久久久久精品免费

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

AMD Xilinx U-Boot 2020.2啟動失敗問題原因和解決辦法

jf_pJlTbmA9 ? 來源:jf_pJlTbmA9 ? 作者:jf_pJlTbmA9 ? 2023-07-10 15:49 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

U-Boot 2020.2 啟動問題

最近有客戶反饋,U-Boot 2020.2 啟動有問題。 SD卡里有BOOT.BIN, image.ub等文件,也不能正常啟動。

下面是常見的啟動信息。 U-Boot報告多個錯誤,最主要的錯誤是“Wrong image format for "source" command”。

U-Boot 2020.01 (Nov 20 2020 - 19:24:17 +0000)

Model: ZynqMP ZCU106 RevA
Board: Xilinx ZynqMP
DRAM: 4 GiB
PMUFW: v1.1
EL Level: EL2
Chip ID: zu7ev
NAND: 0 MiB
MMC: mmc@ff170000: 0
In: serial@ff000000
Out: serial@ff000000
Err: serial@ff000000
Bootmode: LVL_SHFT_SD_MODE1
Reset reason: EXTERNAL
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id

Warning: ethernet@ff0e0000 using MAC address from ROM
eth0: ethernet@ff0e0000
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
JTAG: Trying to boot script at 0x20000000
## Executing script at 20000000
Wrong image format for "source" command
JTAG: SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
MMC Device 1 not found
no mmc device at slot 1
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
device 0 offset 0x3e80000, size 0x80000
SF: 524288 bytes @ 0x3e80000 Read: OK
QSPI: Trying to boot script at 0x20000000
## Executing script at 20000000
Wrong image format for "source" command
QSPI: SCRIPT FAILED: continuing...

no devices available
NAND: SCRIPT FAILED: continuing...
starting USB...
Bus dwc3@fe200000: usb maximum-speed not found
Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus dwc3@fe200000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device

Device 1: unknown device
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc apst

Device 0: unknown device
BOOTP broadcast 1
DHCP client bound to address 10.164.16.148 (166 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-00-0a-35-04-d2-38
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0AA41094
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0AA4109
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0AA410
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0AA41
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0AA4
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0AA
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm-zynqmp-zynqmp
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm-zynqmp
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default
*** ERROR: `serverip' not set
Config file not found
BOOTP broadcast 1
DHCP client bound to address 10.164.16.148 (164 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
BOOTP broadcast 1
DHCP client bound to address 10.164.16.148 (176 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET

問題原因和解決辦法

上述問題是在啟動設(shè)備里沒有文件“boot.scr”導致的。 如果在SD卡里,提供文件 boot.scr,就能正常啟動。

U-Boot 2020.01 (Nov 20 2020 - 19:24:17 +0000)

Model: ZynqMP ZCU106 RevA
Board: Xilinx ZynqMP
DRAM: 4 GiB
PMUFW: v1.1
EL Level: EL2
Chip ID: zu7ev
NAND: 0 MiB
MMC: mmc@ff170000: 0
In: serial@ff000000
Out: serial@ff000000
Err: serial@ff000000
Bootmode: LVL_SHFT_SD_MODE1
Reset reason: EXTERNAL
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id

Warning: ethernet@ff0e0000 using MAC address from ROM
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
1718 bytes read in 21 ms (79.1 KiB/s)
## Executing script at 20000000
124511736 bytes read in 8225 ms (14.4 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
Using 'conf@system-top.dtb' configuration
Trying 'kernel@1' kernel subimage
......

U-Boot 2020.2 啟動流程分析

U-Boot 文檔
U-Boot為了支持各種Linux發(fā)行版,增加通用性,增加了啟動時的Script的功能。 詳細信息可以參考文檔文件doc/develop/distro.rst和Generic Distro Configuration Concept。

U-Boot對Script是逐步完善的。軟件代碼文件“include/config_distro_bootcmd.h”在2015.01就已經(jīng)存在。文檔文件“doc/develop/distro.rst”在2022.01里加入。

業(yè)界對Script功能也逐步接受,目前很多芯片都都已經(jīng)默認使能,比如AMDMPSoC的U-Boot。

如果不想使用Script功能,可以禁止選項CONFIG_DISTRO_DEFAULTS。

U-Boot啟動命令
沒有人工參與的自動啟動,或者直接執(zhí)行命令“boot”, U-Boot啟動命令都是“bootcmd”。

超時啟動代碼

下面是沒有人工參與,超時啟動時選擇啟動命令的代碼。

const char *bootdelay_process(void)
{
char *s;
int bootdelay;

bootcount_inc();

s = env_get("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;

if (IS_ENABLED(CONFIG_OF_CONTROL)) {
bootdelay = ofnode_conf_read_int("bootdelay", bootdelay);
}

debug("### main_loop entered: bootdelay=%dnn", bootdelay);

if (IS_ENABLED(CONFIG_AUTOBOOT_MENU_SHOW)) {
bootdelay = menu_show(bootdelay);
}
bootretry_init_cmd_timeout();

#ifdef CONFIG_POST
if (gd->flags & GD_FLG_POSTFAIL) {
s = env_get("failbootcmd");
} else
#endif /* CONFIG_POST */
if (bootcount_error()) {
s = env_get("altbootcmd");
} else {
s = env_get("bootcmd");
}

if (IS_ENABLED(CONFIG_OF_CONTROL)) {
process_fdt_options(gd->fdt_blob);
}
stored_bootdelay = bootdelay;

return s;
}

命令“boot”的啟動代碼

下面是直接執(zhí)行命令“boot”選擇啟動命令的代碼。

int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return run_command(env_get("bootcmd"), flag);
}

U_BOOT_CMD(
boot, 1, 1, do_bootd,
"boot default, i.e., run 'bootcmd'",
""
);

/* keep old command name "bootd" for backward compatibility */
U_BOOT_CMD(
bootd, 1, 1, do_bootd,
"boot default, i.e., run 'bootcmd'",
""
);

命令distro_bootcmd

啟動命令“bootcmd”通常是“run distro_bootcmd”。 它在“bootKconfig”中定義,能在配置U-Boot時更改。

config BOOTCOMMAND
string "bootcmd value"
depends on USE_BOOTCOMMAND && !USE_DEFAULT_ENV_FILE
default "run distro_bootcmd" if DISTRO_DEFAULTS
help
This is the string of commands that will be used as bootcmd and if
AUTOBOOT is set, automatically run.

“distro_bootcmd”的定義在includeConfig_distro_bootcmd.h里。

"distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT
BOOTENV_SET_NVME_NEED_INIT
BOOTENV_SET_IDE_NEED_INIT
BOOTENV_SET_VIRTIO_NEED_INIT
"for target in ${boot_targets}; do "
"run bootcmd_${target}; "
"done?"

在U-Boot啟動時,使用鍵盤進入U-Boot的命令行界面,使用命令“printenv”也可以查看真實的“distro_bootcmd”。 與“distro_bootcmd”相關(guān)的環(huán)境變量如下:

boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}

boot_scripts=boot.scr.uimg boot.scr

boot_targets=mmc0 jtag mmc0 mmc1 qspi0 nand0 usb0 usb1 scsi0 pxe dhcp

bootcmd=run distro_bootcmd

bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;

bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot

bootcmd_qspi0=sf probe 0 0 0 && sf read $scriptaddr $script_offset_f $script_size_f && echo QSPI: Trying to boot script at ${scriptaddr} && source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;

distro_bootcmd=scsi_need_init=; for target in ${boot_targets}; do run bootcmd_${target}; done

mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
modeboot=sdboot

scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;

scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist

scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done

script_offset_f=3e80000
script_size_f=0x80000
scriptaddr=0x20000000

可以看到,U-Boot會依次執(zhí)行bootcmd_mmc0, bootcmd_jtag, bootcmd_mmc0, bootcmd_mmc1, bootcmd_qspi0,與上述的錯誤信息中的設(shè)備啟動順序一致。也說明U-Boot能從各種設(shè)備啟動Linux。

另外bootcmd_mmc0會依次調(diào)用mmc_boot, scan_dev_for_boot_part, scan_dev_for_boot, scan_dev_for_scripts。最后scan_dev_for_scripts檢查U-Boot script,也就是前述的“boot.scr”。如果發(fā)現(xiàn),就會輸出“Found U-Boot script”,并執(zhí)行“boot_a_script”。 對于ZCU106單板,mmc0就是SD卡。 如果沒有前述的“boot.scr”,就會嘗試后續(xù)的啟動設(shè)備。

因此,默認的U-Boot啟動過程中,需要“boot.scr”。如果不想使用“boot.scr”,可以在配置U-Boot時禁止選項CONFIG_DISTRO_DEFAULTS,或者把替換啟動命令“bootcmd”成直接從某個固定設(shè)備啟動Linux的命令。當然,也可以在運行時,直接修改U-Boot環(huán)境變量中的命令“bootcmd”,讓它直接從某個固定設(shè)備啟動Linux。

審核編輯:湯梓紅

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學習之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • amd
    amd
    +關(guān)注

    關(guān)注

    25

    文章

    5589

    瀏覽量

    136383
  • Linux
    +關(guān)注

    關(guān)注

    87

    文章

    11511

    瀏覽量

    213847
  • Xilinx
    +關(guān)注

    關(guān)注

    73

    文章

    2185

    瀏覽量

    125377
  • 文件
    +關(guān)注

    關(guān)注

    1

    文章

    579

    瀏覽量

    25376
  • u-boot
    +關(guān)注

    關(guān)注

    0

    文章

    122

    瀏覽量

    38839
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評論

    相關(guān)推薦
    熱點推薦

    U-Boot介紹

    在移植 Linux之前我們需要先移植一個 bootloader 代碼,這個 bootloader 代碼用于啟動 Linux 內(nèi)核, bootloader有很多,常用的就是 U-Boot。
    的頭像 發(fā)表于 10-08 10:50 ?4813次閱讀

    U-boot的基本介紹

    從本文開始,將陸續(xù)推送“手把手教你移植U-boot”系列文章,目標是由淺入深地講解U-boot的工作流程、原理、配置方法和移植方法,手把手教你完成U-boot的移植工作,默認硬件開發(fā)平臺為ARM,操作系統(tǒng)為Linux。
    發(fā)表于 07-14 16:52 ?3632次閱讀
    <b class='flag-5'>U-boot</b>的基本介紹

    U-Boot啟動及移植分析

    bootloader 開發(fā)是嵌入式系統(tǒng)必不可少而且十分重要的部分,U-Boot 為功能強大的bootloader 開發(fā)軟件。本文詳細分析了U-Boot啟動流程,并結(jié)合其源碼,闡述了U-Bo
    發(fā)表于 09-01 16:34 ?27次下載

    嵌入式U-BOOT啟動流程及移植

    摘要:嵌入式系統(tǒng)一般沒有通用的bootloader,u-boot是功能強大的bootloader開發(fā)軟件,但相對也比較復雜。文中對u-boot啟動流程作了介紹,詳細給出了u-boot
    發(fā)表于 02-25 16:00 ?59次下載

    WinCE啟動失敗原因解決辦法

    本文通過對以上因素進行分析,并提出相應的解決辦法。但由于WinCE啟動失敗會非常取決于硬件平臺,因此在具體應用時需要綜合考慮和分析。
    發(fā)表于 02-26 11:10 ?2075次閱讀

    基于ARM9的U-Boot自動識別啟動實現(xiàn)

    嵌入式ARM9系列處理器支持U-Boot從Nor FLASH或者Nand FLASH啟動,也支持U-Boot直接下載到內(nèi)存中調(diào)試運行,根據(jù)U-Boot在不同
    發(fā)表于 03-04 16:23 ?91次下載
    基于ARM9的<b class='flag-5'>U-Boot</b>自動識別<b class='flag-5'>啟動</b>實現(xiàn)

    u-boot簡介

    U-Boot,全稱 Universal Boot Loader,是遵循GPL條款的開放源碼項目。U-Boot的作用是系統(tǒng)引導。U-Boot從FADSROM、8xxROM、PPCBOOT
    發(fā)表于 10-14 11:17 ?3738次閱讀

    詳解U-Boot引導內(nèi)核分析

    bootm命令是用來引導經(jīng)過U-Boot的工具mkimage打包后的kernel image的。U-Boot源代碼的tools/目錄下有mkimage工具,這個工具可以用來制作不壓縮或者壓縮的多種可啟動映象文件。
    的頭像 發(fā)表于 04-13 15:22 ?5497次閱讀
    詳解<b class='flag-5'>U-Boot</b>引導內(nèi)核分析

    如何使用Xilinx SDK調(diào)試u-boot代碼

    了解如何使用Xilinx SDK調(diào)試u-boot代碼。 概述了技術(shù)以獲得重定位偏移量,以便可以在SDK中應用它。
    的頭像 發(fā)表于 11-27 06:36 ?4553次閱讀

    fireflyFace-RK3399主板U-Boot模式啟動

    RK U-Boot 基于開源的 U-Boot 進行開發(fā),工作模式有啟動加載模式和下載模式。
    的頭像 發(fā)表于 12-04 08:52 ?4950次閱讀
    fireflyFace-RK3399主板<b class='flag-5'>U-Boot</b>模式<b class='flag-5'>啟動</b>

    fireflyAIO-3399C主板U-Boot介紹

    RK U-Boot 基于開源的 U-Boot 進行開發(fā),工作模式有啟動加載模式和下載模式。
    的頭像 發(fā)表于 12-04 10:31 ?1628次閱讀

    fireflyAIO-3288C主板U-Boot介紹

    RK U-Boot 基于開源的 U-Boot 進行開發(fā),工作模式有啟動加載模式和下載模式。
    的頭像 發(fā)表于 12-16 13:52 ?1370次閱讀
    fireflyAIO-3288C主板<b class='flag-5'>U-Boot</b>介紹

    fireflyAIO-3288J主板U-Boot使用簡介

    RK U-Boot 基于開源的 U-Boot 進行開發(fā),工作模式有啟動加載模式和下載模式。
    的頭像 發(fā)表于 12-20 10:06 ?1829次閱讀
    fireflyAIO-3288J主板<b class='flag-5'>U-Boot</b>使用簡介

    fireflyAIO-3399J主板U-Boot使用介紹

    RK U-Boot 基于開源的 U-Boot 進行開發(fā),工作模式有啟動加載模式和下載模式。
    的頭像 發(fā)表于 12-24 10:00 ?2032次閱讀
    fireflyAIO-3399J主板<b class='flag-5'>U-Boot</b>使用介紹

    u-boot在匯編啟動階段的相關(guān)操作介紹

    u-boot在匯編啟動階段對系統(tǒng)的一些初始化 當cpu交由u-boot接管進入u-boot后, 首先會到_start符號處開始執(zhí)行初始化, 并在此期間完成一些必要的系統(tǒng)寄存器相關(guān)的初始
    的頭像 發(fā)表于 12-07 11:22 ?981次閱讀