JUL,21th,2009——SD卡移植
今天成功的搞定了SD卡的移植,SD卡的驱动程序还是用了mini2440的驱动程序,不过因为移植到得内核是Linux2.6.25,所以需要做相应的头文件位置更改,另外在ARCH文件夹中要做如下更改:
SC324XX.C中做如下更改:
void __init s3c244x_map_io(struct map_desc *mach_desc, int size)
{
/* register our io-tables */
iotable_init(s3c244x_iodesc, ARRAY_SIZE(s3c244x_iodesc));
iotable_init(mach_desc, size);
/* rename any peripherals used differing from the s3c2410 */
s3c_device_sdi.name= "s3c2440-sdi";
s3c_device_i2c.name = "s3c2440-i2c";
s3c_device_nand.name = "s3c2440-nand";
s3c_device_usbgadget.name = "s3c2440-usbgadget";
}
在commonsmdk.c中做如下更改:
static struct platform_device __initdata *smdk_devs[] = {
&s3c_device_nand,
&smdk_led4,
&smdk_led5,
&smdk_led6,
&smdk_led7,
& s3c_device_sdi,
};
关于内核配置,一下选项是必须的:
#NATIVE LANGUAGE
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
关于根文件的配置文件如下:
/etc/mountd.conf
## mountd configuration file
## add a mount entry for each mount point to be managed by mountd
mount {
## root block device with partition map or raw FAT file system
block_device /dev/block/mmcblk0p1
这里必须是mmcblk0p1而不是mmcblk0,尽管/dev/block下有这个文件
## mount point for block device
mount_point /sdcard
## true if this mount point can be shared via USB mass storage
enable_ums true
}
/etc/vold.conf
## vold configuration file for the emulator/SDK
volume_sdcard {
## This is the direct uevent device path to the SD slot on the device
##emu_media_path /devices/platform/goldfish_mmc.0/mmc_host/mmc0
emu_media_path /devices/platform/s3c2440-sdi/mmc_host:mmc0
这个可以查询/SYS下得到类似的
media_type mmc
mount_point /sdcard
ums_path /devices/platform/usb_mass_storage/lun0
}
虽然移植上去了,不过对于MMC LAYER 的机制还不清楚,接下来的几天要弄清楚。