[U-Boot-Users] Regarding non-contiguous support for MMC inu-boot1.3.1
Ken.Fuchs at bench.com
Ken.Fuchs at bench.com
Tue Jul 15 18:23:25 CEST 2008
Naveen Kumar GADDIPATI wrote:
> I'm working for non-contiguous clusters support for MMC in
> u-boot 1.3.1 source code for flashing the linux images.
> We have a u-boot,which is working for contiguous clusters in MMC.
What do mean by clusters in MMC? MMC deals with raw blocks.
> Anybody could clarify the following my doubts in u-boot
> 1)Is FAT16 support is present in this u-boot?
Yes, but ...
The FAT16 support in U-Boot may not be working perfectly.
Check the u-boot-users mailing list for reported issues with
FAT16/32 and any subsequent patches that fix these issues.
> 2)If yes,how to register the MMC device to support for FAT?
In your ./include/configs/<board>.h you should have the following:
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_MMC | CFG_CMD_FAT)
/* MMC */
#define CONFIG_MMC 1
#define MMCI_BASE 0xFFFA8000 /* (void *)AT91C_BASE_MCI */
#define CFG_MMC_CLK_PP 20000000
/* Add FAT filesystem configuration, other than CFG_CMD_FAT */
#define CONFIG_SUPPORT_VFAT
These are from ./include/configs/at91sam9261ek.h, so some of these
MMC (controller) settings may not apply to your board, but other
MMC (controller) settings specific to your board may apply that do
not appear above. (Next time, please mention your board, so help
can provided that is specific to it.)
--- Running U-Boot and accessing MMC & FAT ---
Entering mmcinit at the U-Boot command will cause mmc_init() to
called and it will init the MMC controller and call mmc_bread()
on the first block of the MMC device which should contain an MS-DOS
partition table. Any of the four primary partitions may contain
a FAT16 filesystem (or any other supported filesystem like ext2).
Use fatls command with mmc device to view the root directory of
the FAT16 filesystem. Partitions 1-4 can also be specified.
Use fatload or other fat command as needed by your application ...
--- FAT16 filesystem image creation ---
I recommend using only FAT16 formatted filesystems, preferably
created via "mkdosfs -F 16" via Linux. (FAT32 support is also
present, but seriously broken as of a few months ago.) If the
MMC device is a soldered chip use /dev/loop0 loopback on Linux
and copy the disk image to your MMC chip; write an mmc_bwrite()
if necessary to copy the disk image from RAM to your MMC chip.
> 3)How we could read the FAT information for getting the next cluster?
That should be in the fat.c filesystem code.
Sincerely,
Ken Fuchs
More information about the U-Boot
mailing list