关于AM335X uboot启动的时候找不到nand的问题
/******************************************************************
* author: 卢浩
* time: 2013.04.01
* environment: ubuntu10.04LTS +TI AM3359
* kernel version: linux-3.2
* QQ Group For Technology Exchange:122879839
******************************************************************/
U-Boot SPL 2011.09 (Apr 01 2013 - 01:29:02)
Texas Instruments Revision detection unimplementedNo daughter card present
Did not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter board
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img
U-Boot 2011.09 (Apr 01 2013 - 01:42:41)
I2C: ready
DRAM: 256 MiB
WARNING: Caches not enabled
Could not probe the EEPROM; something fundamentally wrong on the I2C bus.
NAND: HW ECC Hamming Code selected
No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
Net: cpsw
Hit any key to stop autoboot: 0
U-Boot#
这是TI官方的配置在我板子上跑的打印信息,实际上这并不是nand驱动的问题,ti的板子上有个eeprom,我们自己的板子没有,所有读不到相应的信息,这个时候我们就选择性的把代码里关于读取eeprom的相关代码注释掉就是了。
文件目录是board/ti/am335x/evm.c
int read_eeprom(void)
{
/* Check if baseboard eeprom is available */
if (i2c_probe(I2C_BASE_BOARD_ADDR)) {
printf("Could not probe the EEPROM; something fundamentally "
"wrong on the I2C bus.\n");
return 1;
}
/* read the eeprom using i2c */
if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 2, (uchar *)&header,
sizeof(header))) {
printf("Could not read the EEPROM; something fundamentally"
" wrong on the I2C bus.\n");
return 1;
}
if (header.magic != 0xEE3355AA) {
/* read the eeprom using i2c again, but use only a 1 byte address */
if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 1, (uchar *)&header,
sizeof(header))) {
printf("Could not read the EEPROM; something fundamentally"
" wrong on the I2C bus.\n");
return 1;
}
if (header.magic != 0xEE3355AA) {
printf("Incorrect magic number in EEPROM\n");
return 1;
}
}
return 0;
}
以上是用来读取eeprom的。
我们把707行开始的三句话注释掉:
// if (read_eeprom()) {
// printf("read_eeprom() failure. continuing with ddr3\n");
// }
再把800行开始的两句话注释掉:
// if (read_eeprom())
// goto err_out;
一共注释五句话,保存,编译uboot,收工。把编译好的文件放到板子上运行:
U-Boot SPL 2011.09 (Apr 01 2013 - 01:29:02)
Texas Instruments Revision detection unimplemented
No daughter card present
Did not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter board
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img
U-Boot 2011.09 (Apr 01 2013 - 01:57:52)
I2C: ready
DRAM: 256 MiB
WARNING: Caches not enabled
No daughter card present
Did not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter board
NAND: HW ECC Hamming Code selected
256 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment
Net: cpsw
Hit any key to stop autoboot: 0
SD/MMC found on device 0
reading uEnv.txt