uramdisk를 사용하지 않도록 U-Boot를 지정하는 방법

uramdisk를 사용하지 않도록 U-Boot를 지정하는 방법

내 램디스크가 Linux 이미지의 일부이기 때문에 U-Boot가 부팅 시 uramdisk를 사용하지 않도록 지정하고 싶습니다. 문제는 수정된 sdboot를 선택하고 "bootm {linux} - {devicetree}"를 호출해도 uramdisk.image.gz 파일이 있는지 확인한다는 점입니다.

편집: 내가 무엇을 하든 sdboot 속성을 재정의하지 않습니다. 내 uEnv.txt를 로드하는 것처럼(다른 이름의 장치 트리 blob을 올바르게 가져오기 때문에 작동함) sdboot 속성을 덮어씁니다.

이것은 내 uEnv.txt 파일입니다.

sdboot=if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && load mmc 0 ${kernel_load_address} ${kernel_image} && echo Copying Device Tree from SD to RAM... && load mmc 0 ${devicetree_load_address} ${devicetree_image} && echo Boot Linux kernel... &&bootm ${kernel_load_address} - ${devicetree_load_address}; fi

이것은 내가 얻은 로그입니다.

U-Boot 2015.07-svn563 (Nov 17 2016 - 17:10:38 +0100)

Model: Zynq ZC702 Development Board
I2C:   ready
DRAM:  ECC disabled 512 MiB
# Malloc address : 0x1F316000
# Malloc size    : 12713984 (0x00c20000)
# CONFIG_SYS_TEXT_BASE       : 0x04000000
# U-Boot relocated in RAM at : 0x1ff36000
MMC:   zynq_sdhci: 0
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

# load_addr = 0x00000000
In:    serial
Out:   serial
Err:   serial
Model: Zynq ZC702 Development Board
Net:   Gem.e000b000
Hit any key to stop autoboot:  0 
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SE32G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
2187 bytes read in 14 ms (152.3 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Copying Linux from SD to RAM...
reading busybox.img
11904111 bytes read in 1003 ms (11.3 MiB/s)
reading mlg-x.dtb
13851 bytes read in 15 ms (901.4 KiB/s)
reading uramdisk.image.gz
** Unable to read file uramdisk.image.gz **
zynq-uboot> 

uramdisk를 사용하여 자동 부팅이 실패하도록 하고 printenv를 사용한 다음 기본 env와 printenv를 다시 재설정하면 전체 추적은 다음과 같습니다.

U-Boot 2015.07-svn563 (Nov 17 2016 - 17:10:38 +0100)

Model: Zynq ZC702 Development Board
I2C:   ready
DRAM:  ECC disabled 512 MiB
# Malloc address : 0x1F316000
# Malloc size    : 12713984 (0x00c20000)
# CONFIG_SYS_TEXT_BASE       : 0x04000000
# U-Boot relocated in RAM at : 0x1ff36000
MMC:   zynq_sdhci: 0
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

# load_addr = 0x00000000
In:    serial
Out:   serial
Err:   serial
Model: Zynq ZC702 Development Board
Net:   Gem.e000b000
Hit any key to stop autoboot:  0 
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SE32G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
381 bytes read in 10 ms (37.1 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Copying Linux from SD to RAM...
reading busybox.img
11904111 bytes read in 1004 ms (11.3 MiB/s)
reading mlg-x.dtb
13839 bytes read in 15 ms (900.4 KiB/s)
reading uramdisk.image.gz
** Unable to read file uramdisk.image.gz **
zynq-uboot> printenv 
baudrate=115200
bitstream_image=system.bit.bin
boot_image=BOOT.bin
boot_size=0xF00000
bootcmd=run $modeboot
bootdelay=3
bootenv=uEnv.txt
devicetree_image=mlg-x.dtb
devicetree_load_address=0x2000000
devicetree_size=0x20000
dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0
dfu_mmc_info=set dfu_alt_info ${kernel_image} fat 0 1\\;${devicetree_image} fat 0 1\\;${ramdisk_image} fat 0 1
dfu_ram=run dfu_ram_info && dfu 0 ram 0
dfu_ram_info=set dfu_alt_info ${kernel_image} ram 0x3000000 0x500000\\;${devicetree_image} ram 0x2A00000 0x20000\\;${ramdisk_image} ram 0x2000000 0x600000
ethact=Gem.e000b000
ethaddr=00:0a:35:00:01:22
fdt_high=0x20000000
filesize=360f
importbootenv=echo Importing environment from SD ...; env import -t ${loadbootenv_addr} $filesize
initrd_high=0x20000000
ipaddr=10.10.70.102
jtagboot=echo TFTPing Linux to RAM... && tftpboot ${kernel_load_address} ${kernel_image} && tftpboot ${devicetree_load_address} ${devicetree_image} && tftpboot ${ramdisk_load_address} ${ramdisk_image} && bootm ${kernel_load_address} ${ra
mdisk_load_address} ${devicetree_load_address}
kernel_image=busybox.img
kernel_load_address=0x2080000
kernel_size=0x500000
loadbit_addr=0x100000
loadbootenv=load mmc 0 ${loadbootenv_addr} ${bootenv}
loadbootenv_addr=0x2000000
mmc_loadbit=echo Loading bitstream from SD/MMC/eMMC to RAM.. && mmcinfo && load mmc 0 ${loadbit_addr} ${bitstream_image} && fpga load 0 ${loadbit_addr} ${filesize}
modeboot=sdboot
nandboot=echo Copying Linux from NAND flash to RAM... && nand read ${kernel_load_address} 0x100000 ${kernel_size} && nand read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... && nand read ${ramdisk_load_
address} 0x620000 ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
norboot=echo Copying Linux from NOR flash to RAM... && cp.b 0xE2100000 ${kernel_load_address} ${kernel_size} && cp.b 0xE2600000 ${devicetree_load_address} ${devicetree_size} && echo Copying ramdisk... && cp.b 0xE2620000 ${ramdisk_load_ad
dress} ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
preboot=if test $modeboot = sdboot && env run sd_uEnvtxt_existence_test; then if env run loadbootenv; then env run importbootenv; fi; fi; 
qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read ${kernel_load_address} 0x100000 ${kernel_size} && sf read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... && sf read ${r
amdisk_load_address} 0x620000 ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
ramdisk_image=uramdisk.image.gz
ramdisk_load_address=0x4000000
ramdisk_size=0x5E0000
rsa_jtagboot=echo TFTPing Image to RAM... && tftpboot 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_nandboot=echo Copying Image from NAND flash to RAM... && nand read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_norboot=echo Copying Image from NOR flash to RAM... && cp.b 0xE2100000 0x100000 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_qspiboot=echo Copying Image from QSPI flash to RAM... && sf probe 0 0 0 && sf read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_sdboot=echo Copying Image from SD to RAM... && load mmc 0 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
sd_uEnvtxt_existence_test=test -e mmc 0 /uEnv.txt
sdboot=if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && load mmc 0 ${kernel_load_address} ${kernel_image} && echo Copying Device Tree from SD to RAM... && load mmc 0 ${devicetree_load_address} ${devicetree_image} &&
 echo Boot Linux kernel... && bootm ${kernel_load_address} - ${devicetree_load_address}; fi
serverip=10.10.70.101
stderr=serial
stdin=serial
stdout=serial
thor_mmc=run dfu_mmc_info && thordown 0 mmc 0
thor_ram=run dfu_ram_info && thordown 0 ram 0
uenvboot=if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
usbboot=if usb start; then run uenvboot; echo Copying Linux from USB to RAM... && load usb 0 ${kernel_load_address} ${kernel_image} && load usb 0 ${devicetree_load_address} ${devicetree_image} && load usb 0 ${ramdisk_load_address} ${ramd
isk_image} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}; fi

Environment size: 4843/131068 bytes
zynq-uboot> env default -f -a
## Resetting to default environment
zynq-uboot> printenv 
baudrate=115200
bitstream_image=system.bit.bin
boot_image=BOOT.bin
boot_size=0xF00000
bootcmd=run $modeboot
bootdelay=3
bootenv=uEnv.txt
devicetree_image=devicetree.dtb
devicetree_load_address=0x2000000
devicetree_size=0x20000
dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0
dfu_mmc_info=set dfu_alt_info ${kernel_image} fat 0 1\\;${devicetree_image} fat 0 1\\;${ramdisk_image} fat 0 1
dfu_ram=run dfu_ram_info && dfu 0 ram 0
dfu_ram_info=set dfu_alt_info ${kernel_image} ram 0x3000000 0x500000\\;${devicetree_image} ram 0x2A00000 0x20000\\;${ramdisk_image} ram 0x2000000 0x600000
ethaddr=00:0a:35:00:01:22
fdt_high=0x20000000
importbootenv=echo Importing environment from SD ...; env import -t ${loadbootenv_addr} $filesize
initrd_high=0x20000000
ipaddr=10.10.70.102
jtagboot=echo TFTPing Linux to RAM... && tftpboot ${kernel_load_address} ${kernel_image} && tftpboot ${devicetree_load_address} ${devicetree_image} && tftpboot ${ramdisk_load_address} ${ramdisk_image} && bootm ${kernel_load_address} ${ra
mdisk_load_address} ${devicetree_load_address}
kernel_image=uImage
kernel_load_address=0x2080000
kernel_size=0x500000
loadbit_addr=0x100000
loadbootenv=load mmc 0 ${loadbootenv_addr} ${bootenv}
loadbootenv_addr=0x2000000
mmc_loadbit=echo Loading bitstream from SD/MMC/eMMC to RAM.. && mmcinfo && load mmc 0 ${loadbit_addr} ${bitstream_image} && fpga load 0 ${loadbit_addr} ${filesize}
nandboot=echo Copying Linux from NAND flash to RAM... && nand read ${kernel_load_address} 0x100000 ${kernel_size} && nand read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... && nand read ${ramdisk_load_
address} 0x620000 ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
norboot=echo Copying Linux from NOR flash to RAM... && cp.b 0xE2100000 ${kernel_load_address} ${kernel_size} && cp.b 0xE2600000 ${devicetree_load_address} ${devicetree_size} && echo Copying ramdisk... && cp.b 0xE2620000 ${ramdisk_load_ad
dress} ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
preboot=if test $modeboot = sdboot && env run sd_uEnvtxt_existence_test; then if env run loadbootenv; then env run importbootenv; fi; fi; 
qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read ${kernel_load_address} 0x100000 ${kernel_size} && sf read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... && sf read ${r
amdisk_load_address} 0x620000 ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
ramdisk_image=uramdisk.image.gz
ramdisk_load_address=0x4000000
ramdisk_size=0x5E0000
rsa_jtagboot=echo TFTPing Image to RAM... && tftpboot 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_nandboot=echo Copying Image from NAND flash to RAM... && nand read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_norboot=echo Copying Image from NOR flash to RAM... && cp.b 0xE2100000 0x100000 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_qspiboot=echo Copying Image from QSPI flash to RAM... && sf probe 0 0 0 && sf read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
rsa_sdboot=echo Copying Image from SD to RAM... && load mmc 0 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
sd_uEnvtxt_existence_test=test -e mmc 0 /uEnv.txt
sdboot=if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && load mmc 0 ${kernel_load_address} ${kernel_image} && load mmc 0 ${devicetree_load_address} ${devicetree_image} && load mmc 0 ${ramdisk_load_address} ${ramdisk_
image} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}; fi
serverip=10.10.70.101
thor_mmc=run dfu_mmc_info && thordown 0 mmc 0
thor_ram=run dfu_ram_info && thordown 0 ram 0
uenvboot=if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
usbboot=if usb start; then run uenvboot; echo Copying Linux from USB to RAM... && load usb 0 ${kernel_load_address} ${kernel_image} && load usb 0 ${devicetree_load_address} ${devicetree_image} && load usb 0 ${ramdisk_load_address} ${ramd
isk_image} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}; fi

Environment size: 4742/131068 bytes
zynq-uboot>

답변1

sdboot내 생각에는 실행 중이 uEnv.txt아니라 sdboot기본 환경에서 실행되고 있는 것 같습니다 .

Copying Device Tree from SD to RAM...이에 대한 증거는 로그 출력에서 ​​볼 수 없는 것입니다.

끝에 다음과 같은 내용을 추가해 보세요 uEnv.txt.

uenvcmd=echo Copying Linux from SD to RAM... && load mmc 0 ${kernel_load_address} ${kernel_image} && echo Copying Device Tree from SD to RAM... && load mmc 0 ${devicetree_load_address} ${devicetree_image} && echo Boot Linux kernel... && bootm ${kernel_load_address} - ${devicetree_load_address}

물론 이것을 테스트할 수는 없지만 로그에 다음이 표시되어야 합니다.

Running uenvcmd ...
Copying Linux from SD to RAM...
...
Copying Device Tree from SD to RAM...
...
Boot Linux kernel...
...

행운을 빌어요!

관련 정보