K230启动流程疑问

Viewed 18

U-Boot SPL 2022.10 (Jun 22 2025 - 07:14:35 +0800)
00000000: PMU Major Msg: End of CA training
00000000: PMU Major Msg: End of initialization
00000000: PMU Major Msg: End of read enable training
00000000: PMU Major Msg: End of fine write leveling
00000000: PMU Major Msg: End of read dq deskew training
00000000: PMU Major Msg: End of MPR read delay center optimization
00000000: PMU Major Msg: End of Write leveling coarse delay
00000000: PMU Major Msg: End of write delay center optimization
00000000: PMU Major Msg: End of read delay center optimization
00000000: PMU Major Msg: End of max read latency training
00000000: PMU Major Msg: Firmware run has completed
Loading Environment from MMC... OK

U-Boot 2022.10 (Jun 22 2025 - 07:14:35 +0800)

CPU: rv64imafdcvsu
Model: kendryte k230 canmv
DRAM: 512 MiB
Core: 25 devices, 13 uclasses, devicetree: embed
MMC: mmc0@91580000: 0, mmc1@91581000: 1
Loading Environment from MMC... OK
In: serial@91400000
Out: serial@91400000
Err: serial@91400000
Net: No ethernet found.
Hit any key to stop autoboot: 0

OpenSBI v0.9
[ 0.000000] Linux version 5.10.4 (rlk@rlk) (riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.6.0 B-20220715) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP Sat Jun 21 23:51:35 CST 2025
[ 0.000000] earlycon: sbi0

上面是启动流程打印,正常在启动的时候是uboot-spl 启动opensbi,opensbi 启动uboot proper, 然后再启动linux内核,但是从打印来看,是uboot-spl启动了uboot proper,然后再启动opensbi,再启动linux 内核,为什么要将opensbi放在uboot proper的后面启动,这样做的好处是啥?

1 Answers

目前启动流程是:

  1. bootrom根据boot管脚读取一级uboot(最大512k)到sram并执行,
  2. 一级boot引导二级uboot(功能比较全的uboot),
  3. opensbi
  4. kernel
  5. app

有2个uboot的原因是因为最开始在sram里面执行程序对程序大小有要求,第1级uboot要小于512K主要是内存初始化。