简介
在该模式下,SPL可以直接加载内核,开机时间较少不少。目前该模式支持的芯片不多,但是TI的AM335x是其中之一,网上资料也不不多。u-boot-2016.09中有两处有关资料。
- doc/README.falcon
- board/ti/am335x/README
开启
如果启动源为Nand,则默认开启该模式。该模式下需设置的环境变量和参数在README.falcon在有详细描述。
设备树
在使用传统的ATAGs传参数时是没有问题的。
但是在使用设备树时,遇到了需问题,而且文档中也描述了说falcon模式在设备树下的功能没有测试过。
tftp 0x88000000 am335x-evm.dtb
tftp 0x82000000 zImage
spl export fdt 0x82000000 - 0x88000000
=> spl export fdt 0x82000000 - 0x88000000
data abort
pc : [<8ffac5de>] lr : [<8ffaf85d>]
reloc pc : [<8080b5de>] lr : [<8080e85d>]
sp : 8ef80cc0 ip : 8ffd1d13 fp : 00000000
r10: 8ef80d5c r9 : 8ef80ed8 r8 : 00000003
r7 : 00000007 r6 : 8ffe71b4 r5 : 00000000 r4 : 8ffe71b4
r3 : 00000000 r2 : 2ff20112 r1 : 00000000 r0 : 8ffd91af
Flags: Nzcv IRQs off FIQs on Mode SVC_32
Resetting CPU ...
这个问题是spl export fdt命令后面只能跟uImage,不支持zImage
uImage = header + zImage,header为长度为0x40的描述信息。
tftp 0x88000000 am335x-evm.dtb
tftp 0x82000000 uImage
spl export fdt 0x82000000 - 0x88000000
=> spl export fdt 0x82000000 - 0x88000000
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux-3.14.0
Created: 2017-08-30 8:13:42 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3582648 Bytes = 3.4 MiB
Load Address: 81ffffc0
Entry Point: 81ffffc0
Verifying Checksum ... OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Kernel Image ... OK
Loading Device Tree to 8ef74000, end 8ef7f696 ... OK
subcommand not supported
subcommand not supported
Loading Device Tree to 8ef65000, end 8ef73696 ... OK
Argument image is now in RAM: 0x8ef65000
nand erase 0x60000 0x20000
nand write.i 0x8ef65000 0x60000 ${filesize}
Nand的分区
0x000000000000-0x000000020000 : "SPL"
0x000000020000-0x000000040000 : "SPL.backup1"
0x000000040000-0x000000060000 : "SPL.backup2"
0x000000060000-0x000000080000 : "SPL.backup3"
0x000000080000-0x000000260000 : "U-Boot"
0x000000260000-0x000000280000 : "U-Boot Env"
0x000000280000-0x000000780000 : "Kernel"
0x000000780000-0x000010000000 : "File System"
setenv nandboot "echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.SPL.backup2; nand read ${loadaddr} NAND.kernel; bootm ${loadaddr} - ${fdtaddr}"
可以看到SPL.backup2存放了non-falcon模式使用的设备树,SPL.backup3存放了falcon模式下使用的设备树。
烧写
其实烧写时,可以直接烧写,不需要export命令。
tftp 0x82000000 am335x-evm.dtb
nand erase 0x40000 0x20000
nand write.i 0x82000000 0x40000 ${filesize}
nand erase 0x60000 0x20000
nand write.i 0x82000000 0x60000 ${filesize}