我把MLO.spi和u-boot.img分别烧写到SPI FLASH的0x0和0x20000,然后设置从SPI启动。结果出现了如下的提示信息,一直卡在这里:
U-Boot SPL 2011.09 (Mar 19 2013 – 15:02:01)
Texas Instruments Revision detection unimplemented
Could not probe the EEPROM; something fundamentally wrong on the I2C bus.
read_eeprom() failure. continuing with ddr3
No daughter card present
Did not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter board
SF: Detected W25Q64 with page size 4 KiB, total 8 MiB
我跟进去,找到了函数:spi_boot,然后打印出在内存CONFIG_SYS_TEXT_BASE的内容,和u-boot.img的内容是完全一样的,可是u-boot.img为什么就没有被执行呢?(注:我使用的是自己做的板子,用这个u-boot.img放到SD卡中,是可以被正常执行的)
void spi_boot(void)
{
struct spi_flash *flash;
void (*uboot)(void) __noreturn;
/*
* Load U-Boot image from SPI flash into RAM
*/
flash = spi_flash_probe(CONFIG_SPL_SPI_BUS, CONFIG_SPL_SPI_CS,
CONFIG_SF_DEFAULT_SPEED, SPI_MODE_3);
if (!flash) {
puts("failed.\n");
hang();
}
spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS,
CONFIG_SYS_SPI_U_BOOT_SIZE,
(void *) CONFIG_SYS_TEXT_BASE);
/*
* Jump to U-Boot image
*/
uboot = (void *) CONFIG_SYS_TEXT_BASE;
(*uboot)();
}
Yaoming Qin:
eeprom那部分代码都去掉了么?
Gary Wu:
根据你的log信息,ms没有去掉EEPROM。
read_eeprom() failure. continuing with ddr3
你可以在board/ti/arm335x/evm.c中的board_init()函数中去掉EEPROM的相关操作。
Lee Jiejia:
回复 Gary Wu:
我现在去掉了EEPROM的相关操作了,还是一样的。而且我感觉跟EEPROM没什么关系。程序运行到函数:(*uboot)(),也就是u-boot.img,就过不去了。但是当我make am335x_evm产生的MLO和make am335x_evm_spiboot产生的u-boot.img 一起放到MMC卡,这时候可以正常启动,进入到u-boot命令行:
U-Boot SPL 2011.09 (Mar 19 2013 – 10:08:40)Texas Instruments Revision detection unimplementedCould not probe the EEPROM; something fundamentally wrong on the I2C bus.read_eeprom() failure. continuing with ddr3No daughter card presentDid not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter boardOMAP SD/MMC: 0reading u-boot.img
U-Boot 2011.09 (Mar 20 2013 – 10:01:42)
I2C: readyDRAM: 256 MiBWARNING: Caches not enabledNAND: HW ECC Hamming Code selectedNo NAND device found!!!0 MiBMMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1SF: Detected W25Q64 with page size 4 KiB, total 8 MiB*** Warning – bad CRC, using default environment
Net: cpswHit any key to stop autoboot: 0 U-Boot#
这样的话,应该能表明u-boot.img也没错啊,可是为什么从SPI FLASH读出来后没能正常执行呢?
Yaoming Qin:
回复 Lee Jiejia:
uboot 烧写的地址对么?
Lee Jiejia:
回复 Yaoming Qin:
对的,我打印出来uboot=0x80100000,和Am335x_evm.h里面定义的是一样的。而且我在执行(*uboot)()函数前,把内存起始地址为0x80100000的内容给打印出来,跟下载到SPI FLASH的u-boot.img比较,内容也是完全一样的。
xue su:
回复 Lee Jiejia:
您好,我看了您之前的帖子,您之前没有发现spi
SF: Unsupported manufacturer ffFailed to initialize SPI flash at 0:0
,现在我看您的信息已经发现了SF: Detected W25Q64 with page size 4 KiB, total 8 MiB,您做了什么处理?请指教,我的QQ:348566267
Gary Wu:
回复 xue su:
将EVM 的PROFILE开关2设置为ON,其余设置为OFF
同时需要重新编译u-boot,
重新编译MLO和u-boot:
make O=am335x CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm am335x_evm_spiboot
生成 MLO.byteswap和u-boot.img
xue su:
我也出现了上述现象,一直卡在这里
U-Boot SPL 2011.09 (Apr 16 2013 – 17:09:41)Texas Instruments Revision detection unimplementedNo daughter card presentDid not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter boardSF: Detected W25Q64 with page size 4 KiB, total 8 MiB
请问楼主解决了吗?跪求解决啊
Lee Jiejia:
回复 Gary Wu:
你好,启动方式我是选择对的了。而且我也是用make O=am335x CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm am335x_evm_spiboot 这条命令去生成对应的文件,不过我生成的文件是:MLO.spi和u-boot.img,并没有你说的MLO.byteswap,烧写到SPI FLASH对应的位置是0x0,0x20000
Lee Jiejia:
回复 Lee Jiejia:
解决方法在sitara-linuxsdk-sdg-05.05.00.00.pdf找到了:
U-Boot# sf probe 0U-Boot# sf erase 0 +80000U-Boot# mmc rescanU-Boot# fatload mmc 0 ${loadaddr} MLO.spiU-Boot# sf write ${loadaddr} 0 ${filesize}U-Boot# fatload mmc 0 ${loadaddr} u-boot.binU-Boot# sf write ${loadaddr} 0x20000 ${filesize}
我应当使用u-boot.bin而不是u-boot.img。