I use "git" to download u-boot source code.
Porting U-Boot to BeagleBoard-xM
http://elinux.org/BeagleBoard#Linux_kernel
1.The following:
git clone git://git.denx.de/u-boot.git u-boot-main
cd u-boot-main
git checkout --track -b omap3 origin/master
2.Modify:
cd u-boot-main
vim include/configs/omap3_beagle.h
-> Remove //#define CONFIG_GENERIC_MMC 1
-> Add #define CONFIG_OMAP3_MMC 1
-> #define CONFIG_BOOTCOMMAND \
"if mmc init ${mmcdev}; then " \ ...etc
3.Compiler:
make CROSS_COMPILE=arm-none-linux-gnueabi- mrproper
make CROSS_COMPILE=arm-none-linux-gnueabi- omap3_beagle_config
make CROSS_COMPILE=arm-none-linux-gnueabi-
4.Stop Here!!!
Texas Instruments X-Loader 1.4.4ss (Aug 19 2010 - 02:49:27)
Beagle xM Rev A
Reading boot sector
Loading u-boot.bin from mmc
U-Boot 2010.03-dirty (Aug 20 2010 - 20:50:46)
OMAP3630/3730-GP ES1.0, CPU-OPP2, L3-165MHz,
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 512 MB
NAND: 0 MiB
*** Warning - bad CRC or NAND, using default environment
In: serial
Out: serial
Err: serial
Probing for expansion boards, if none are connected you'll see a
harmless I2C error.
No EEPROM on expansion board
Beagle xM Rev A
Die ID #028000001bf00000015739ea07021019
Hit any key to stop autoboot: 0
mmc1 is available
The user button is currently NOT pressed.
reading boot.scr
** Unable to read "boot.scr" from mmc 1:1 **
reading user.scr......................................Stop
Here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5.Trace Source code
I find u-boot to stop in omap3_mmc.c.
_>cd u-boot-main
_>vim drivers/mmc/omap3_mmc.c
Please tell me the this problem.
Thanks everybody.
※mmc_read_data function in omap3_mmc.c
unsigned char mmc_read_data(unsigned int *output_buf)
{
unsigned int mmc_stat;
unsigned int read_count = 0;
/*
* Start Polled Read
*/
while (1) {
do {
mmc_stat = readl(&mmc_base->stat);
} while (mmc_stat == 0);
if ((mmc_stat & ERRI_MASK) != 0)
return (unsigned char) mmc_stat;
//Problem Start -
Darren!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (mmc_stat & BRR_MASK) {
unsigned int k;
writel(readl(&mmc_base->stat) | BRR_MASK,
&mmc_base->stat);
for (k = 0; k < MMCSD_SECTOR_SIZE / 4; k++) {
*output_buf = readl(&mmc_base->stat);
output_buf++;
read_count += 4;
}
}
//Problem End -
Darren!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (mmc_stat & BWR_MASK)
writel(readl(&mmc_base->stat) | BWR_MASK,
&mmc_base->stat);
if (mmc_stat & TC_MASK) {
writel(readl(&mmc_base->stat) | TC_MASK,
&mmc_base->stat);
break;
}
}
return 1;
}