關於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