Hello all,
I am porting the Davinci linux kernel to another architecture, called Jacinto2.
Currently, I am working on porting the MMC/SD driver. The main difference
between the two devices is that Davinci interfaces with an MSP430 though i2c to
read the MMC's chip detect and read-only signals, while Jacinto2 interfaces
directly with the chip.
I have gotten read/write to work on the Jacinto2 MMC/SD driver, however, I am
having problems mounting and unmounting the device. If the system is booted
with an SD card already in the MMC slot, the kernel will create all of the
device nodes (mmcblk0, mmcblk0p1...etc) and automatically mount the card. At
this point I can read and write to the SD card. However, when I try to unmount
the card, the kernel hangs. Below is the Strace of the umount call.
Also, if the card is not present when the kernel boots, the device nodes are
not created. When I insert the card, manually create the nodes with mknod
(mknod mmcblk0 b 179 0, etc) and try to mount the SD card, the kernel responds
that the device does not exist.
Has anyone experienced problems unmounting the Davinci MMC/SD? What portion of
the driver is required for a clean unmount?
Does the kernel keep polling the MMC Chip Detect signal until it notices a
change?
How does the kernel know to create the device nodes?
I'm using a 2GB Sandisk MicroSD card with an SD adapter. The file system is
FAT32.
Thanks and Regards,
Joe
Result of attempting to mount the SD card:
----------------------------------------------------------------
/dev # mknod mmcblk0p1 b 179 1
/dev # mknod mmcblk0 b 179 0
/dev # mount /dev/mmcblk0p1 /media/card/
mount: mounting /dev/mmcblk0p1 on /media/card/ failed: No such device or address
Strace of the umount call:
---------------------------------------------
/var/volatile # ./strace /bin/umount /media/card
execve("/bin/umount", ["/bin/umount", "/media/card"], [/* 4 vars */]) = 0
brk(0) = 0xaa000
uname({sys="Linux", node="arago", ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4001b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/var/run/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1736, ...}) = 0
mmap2(NULL, 1736, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4001c000
close(3) = 0
open("/lib/libm.so.6", O_RDONLY) = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\2741\0\0004\0\0\0\200"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=644912, ...}) = 0
mmap2(NULL, 676000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x40024000
mprotect(0x400c1000, 28672, PROT_NONE) = 0
mmap2(0x400c8000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9c) = 0x400c8000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\240I\1\0004\0\0\0000"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1086816, ...}) = 0
mmap2(NULL, 1122724, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x400ca000
mprotect(0x401d0000, 28672, PROT_NONE) = 0
mmap2(0x401d7000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x105) = 0x401d7000
mmap2(0x401da000, 8612, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x401da000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4001d000
set_tls(0x4001d4a0, 0x4001e000, 0x4001dbf8, 0x4001db78, 0x40023050) = 0
mprotect(0x401d7000, 8192, PROT_READ) = 0
mprotect(0x400c8000, 4096, PROT_READ) = 0
mprotect(0x40022000, 4096, PROT_READ) = 0
munmap(0x4001c000, 1736) = 0
getpid() = 1714
getuid32() = 0
brk(0) = 0xaa000
brk(0xcc000) = 0xcc000
open("/proc/mounts", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4001c000
read(3, "rootfs / rootfs rw 0 0\n/dev/root "..., 1024) = 487
read(3, ""..., 1024) = 0
close(3) = 0
munmap(0x4001c000, 4096) = 0
lstat64("/media", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat64("/media/card", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
umount("/media/card", 0
-------------------------------- hangs here---------------------------
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source