This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Booting from SPI FLASH (based on GP EVM)



各位好!

     发现wiki上的在GP EVM板上从SPI 启动的guide部分需要作些纠正,特此写下启动步骤:

(1)设置PROFILE的2脚为ON,其余脚为OFF,即设置profile为#2

这样在进行sf probe 0时,才会检测到SPI flash的信息

SF: Detected W25Q64 with page size 4 KiB, total 8 MiB

(2)重新编译u-boot

SPI启动的image不同与NAND FLASH 启动,不能使用SDK包中pre-image,需要重新编译

编译命令如下:

 make O=am335x CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm am335x_evm_spiboot

生成生成 MLO.byteswap和u-boot.img

(3)烧写images(bootloader and kernel)

通过如下命令烧写,注意将MLO.byteswap烧写在0地址,u-boot.img烧写在0x20000起始的地址空间

具体命令如下

U-Boot # mmc rescan
U-Boot # sf probe 0
U-Boot # sf erase 0 +80000
U-Boot # fatload mmc 0 ${loadaddr} MLO.byteswap
U-Boot # sf write ${loadaddr} 0 ${filesize}
U-Boot # fatload mmc 0 ${loadaddr} u-boot.img
U-Boot # sf write ${loadaddr} 0x20000 ${filesize}
U-Boot # sf erase 80000 +${spiimgsize}
U-Boot # fatload mmc 0 ${loadaddr} uImage
U-Boot # sf write ${loadaddr} ${spisrcaddr} ${filesize}
 
(4)文件系统
查看linux源码arch/arm/mach-omap2/board-am335xevm.c 的am335x_spi_partitions[]结构体,可以得知,定义的文件系统的偏移量为0x3E2000
 
(5) 设置SYSBOOT开关从SPI启动
 SW3的开关设置为1,4为OFF,2、3、5为ON
设置完成上电,即可从SPI flash启动