U-Boot 仅在某些 SD 卡上启动

U-Boot 仅在某些 SD 卡上启动

我遇到了一个问题,我使用的 RK3399 定制板无法从某些 SD 卡启动(使用 U-Boot)。我目前正在使用两张 16GB 卡,一张 Gigastone 卡可以正常工作,另一张 SanDisk 卡在 SPL 之后某个地方死机了。

功能卡的输出如下:

U-Boot TPL 2020.01 (Apr 08 2021 - 16:25:39)
Channel 0: Channel 1: 256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.01 (Apr 08 2021 - 16:25:39 +0000)
Trying to boot from MMC1
NOTICE:  BL31: v1.3(release):
NOTICE:  BL31: Built : 16:24:51, Apr  8 2021
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    plat_rockchip_pmu_init(1331): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2020.01 (Apr 08 2021 - 16:25:39 +0000)

Model: Rockchip RK3399 Firefly Board (Linux Opensource)
DRAM:  3.9 GiB
PMIC:  RK808
Cannot find regulator pwm init_voltage
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff1a0000
Model: Rockchip RK3399 Firefly Board (Linux Opensource)
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:   No ethernet found.
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
92777 bytes read in 12 ms (7.4 MiB/s)
Found EFI removable media binary efi/boot/bootaa64.efi
Scanning disk [email protected]...
Scanning disk [email protected]...
** Unrecognized filesystem type **
Found 4 disks
BootOrder not defined

注意:上面列出的 mmc0 是一个空白的 eMMC 设备,它也位于主板上。

不起作用的卡的输出是:

U-Boot TPL 2020.01 (May 07 2021 - 05:17:53)
Channel 0: Channel 1: 256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.01 (May 07 2021 - 05:17:53 +0000)
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
Trying to boot from MMC1
NOTICE:  BL31: v1.3(release):
NOTICE:  BL31: Built : 05:17:03, May  7 2021
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    plat_rockchip_pmu_init(1331): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9

两张卡的开头都有 32MiB 未分配空间,1GiB ext3 分区用于 UEFI 和 DTB,其余部分有一个 ext3 分区用于 Linux 文件系统。两张卡的设置相同,执行如下。

 2025  sudo dd if=u-boot.itb of=/dev/mmcblk0 seek=$((0x4000))
 2026  sudo dd if=idbloader.img of=/dev/mmcblk0 seek=$((0x40))
 2027  sudo mkdir -p /media/kelliott/BOOT/efi/boot
 2028  sudo mkdir -p /media/kelliott/BOOT/dtb
 2029  sudo cp Image /media/kelliott/BOOT/efi/boot/bootaa64.efi
 2030  sudo cp rk3399-foresys-vcb5.dtb /media/kelliott/BOOT/dtb/
 2031  sudo tar xvf rootfs.tar -C /media/kelliott/ROOT/
 2032  sudo sync

我已经验证了这两张卡都使用 GPT 分区表。它们的扇区/磁道数都是 63,而且在柱面数和总扇区数方面只有细微的差别。我甚至使用 F3 仔细检查了无法正常工作的卡是否是仿制品。我在这里遗漏了什么?我不知道为什么两张看似相同的卡无法以相同的方式启动。

编辑 0:我也尝试过将功能正常的卡直接复制到功能不正常的卡上,但没有成功。

相关内容