目录
除了原始 NAND 闪存设备外,这个相同的文件可用于任何启动源。它将包含 SPL 映像,配有 BROM 识别的正确签名以及所需的校验和。此外,它将至少包含正确的 U-Boot,或者以传统 U-Boot 映像格式包装,或者以 FIT 映像包装。该板的设备树也包含在内,或者附加到 U-Boot 适当的映像中,或者包含在 FIT 映像中。如果 SoC 需要,此 FIT 文件还将包含其他固件映像。
运行Uboot烧写到TF卡上用读卡器将TF卡插入UBUNTU系统,使用DISKR软件现将TF卡所有分区删除,打开DISK软件,找到TF卡存储设备,点击减号,删除所有分区。
所有 Allwinner SoC 都会尝试在连接到第一个 MMC 控制器的 SD 卡的第 16 扇区 (8KB) 处查找启动映像。要将生成的镜像烧写到 SD 卡,请从任何带有(微型)SD 卡读卡器的 Linux 设备(包括开发板本身),输入:
$ sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1k seek=8
/dev/sdx需要替换为SD卡读卡器的块设备名称。在某些机器上这可能是/dev/mmcblkX。较新的 SoC(从 2014 年的 H3 开始,包括所有 ARM64 SoC)也会查看扇区 256 (128KB) 的签名(在检查了 8KB 位置之后)。在那里安装固件的优点是不与 GPT 分区表重叠。只需将上面的“ seek=8”替换为“ seek=128”即可。
连接UART0串口终端TF卡启动卡制作完成之后,插入开发板TF口,然后通过USB转TTL小板子连接电脑主机和开发板,上位机打开一个串口工具软件,比如ubuntu putty或者windows SecureCRT,使用软件打开串口,确保U转串没问题之后,给开发板上电。
串口连接示意图
如果都没有问题,我们会看到uboot运行起来之后从UART0 串口终端输出的运行日志:
U-Boot SPL 2023.10-rc4-00031-gc0c08be546-dirty (Sep 10 2023 - 01:10:43 0800)
DRAM: 2048 MiB
Trying to boot from MMC1
NOTICE: BL31: v2.9(debug):
NOTICE: BL31: Built : 17:49:06, Sep 9 2023
NOTICE: BL31: Detected Allwinner H6 SoC (1728)
NOTICE: BL31: Found U-Boot DTB at 0xa09ae88, model: OrangePi 3
INFO: ARM GICv2 driver initialized
INFO: Configuring SPC Controller
INFO: PMIC: Probing AXP805 on RSB
INFO: PMIC: aldo1 voltage: 3.300V
INFO: PMIC: aldo2 voltage: 3.300V
INFO: PMIC: aldo3 voltage: 3.300V
INFO: PMIC: bldo1 voltage: 1.800V
INFO: PMIC: bldo2 voltage: 1.800V
INFO: PMIC: cldo1 voltage: 3.300V
INFO: PMIC: dcdcd voltage: 0.960V
INFO: PMIC: dcdce voltage: 1.200V
INFO: BL31: Platform setup done
INFO: BL31: Initializing runtime services
INFO: BL31: cortex_a53: CPU workaround for erratum 855873 was applied
INFO: BL31: cortex_a53: CPU workaround for erratum 1530924 was applied
INFO: PSCI: Suspend is unavailable
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x4a000000
INFO: SPSR = 0x3c9
U-Boot 2023.10-rc4-00031-gc0c08be546-dirty (Sep 10 2023 - 01:10:43 0800) Allwinner Technology
CPU: Allwinner H6 (SUN50I)
Model: OrangePi 3
DRAM: 2 GiB
Core: 63 devices, 17 uclasses, devicetree: separate
WDT: Not starting watchdog@7020400
MMC: mmc@4020000: 0, mmc@4021000: 2, mmc@4022000: 1
Loading Environment from FAT... ** No valid partitions found **
In: serial@5000000
Out: serial@5000000
Err: serial@5000000
Net: No ethernet found.
starting USB...
Bus usb@5101000: USB EHCI 1.00
Bus usb@5101400: USB OHCI 1.0
Bus usb@5200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus usb@5311000: USB EHCI 1.00
Bus usb@5311400: USB OHCI 1.0
scanning bus usb@5101000 for devices... 1 USB Device(s) found
scanning bus usb@5101400 for devices... 1 USB Device(s) found
scanning bus usb@5200000 for devices... 3 USB Device(s) found
scanning bus usb@5311000 for devices... 1 USB Device(s) found
scanning bus usb@5311400 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
** Invalid partition 1 **
Couldn't find partition mmc 0:1
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Card did not respond to voltage select! : -110
No EFI system partition
No EFI system partition
Failed to persist EFI variables
BootOrder not defined
EFI boot manager: Cannot load any image
Device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
Retrieving file: pxelinux.cfg/000000
No ethernet found.
Retrieving file: pxelinux.cfg/00000
No ethernet found.
Retrieving file: pxelinux.cfg/0000
No ethernet found.
Retrieving file: pxelinux.cfg/000
No ethernet found.
Retrieving file: pxelinux.cfg/00
No ethernet found.
Retrieving file: pxelinux.cfg/0
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-sunxi-sunxi
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
No ethernet found.
=>
前面一段可以看出是UBOOT SPL和bl31阶段的log,后面就是UBOOT 2023运行之后的log,这里因为我们没有在任何存储介质提供linux 内核镜像,所以报EFI boot manager: Cannot load any image错误而无法继续加载引导linux,这是正常的。