Hello Casperites.

Here is a quick howto to get MMC/SD cards working on ROACHs.

First thing to do is program the CPLD with the latest roach_cpld design. You'll find this at:
http://casper.berkeley.edu/svn/trunk/roach/gw/binaries/roach_cpld/roach_cpld_8_0_1588.jed

Then use the latest Roach kernel at:
http://casper.berkeley.edu/svn/trunk/roach/sw/binaries/linux/uImage-rmon-20090904

You can insert the card before booting or at any stage when the kernel running. The insertion detection is a little iffy, a bug in the driver. Sometimes when you plug the card in then out quickly it misses an event. Mostly it is fine though.

You should see a message from the mmc-block driver that a card has been detected, like:
mmc0: new high speed SD card at address b368
mmcblk0: mmc0:b368 SD    993792KiB
mmcblk0: p1

If you don't have an mmc device device file (like /dev/mmcblock1) file you can create one as following:
mknod /dev/mmcblock1 b 179 1
Just make sure you are mounted write-enabled on you root fs.

You can now mount it and do stuff like:
roach:~# mount /dev/mmcblock1 /mnt/mmc/
roach:~# dd if=/dev/zero bs=4096 count=4096 conv=fdatasync > /mnt/mmc/test_data
4096+0 records in
4096+0 records out
16777216 bytes (17 MB) copied, 8.81871 seconds, 1.9 MB/s
roach:~# dd if=/dev/mmcblock of=/dev/null count=40960 bs=4096
40960+0 records in
40960+0 records out
167772160 bytes (168 MB) copied, 37.4179 seconds, 4.5 MB/s

The performance figures you above seem to be about the max, 1.9 MB/s write and 4.5 MB/s read.

Note that the CPU usage is 100% during access (no DMA, lots of polling) so expect reduced performance during access. This is a bit of a pain, but hey - its not bad for a CPLD design.

You can also 'run mmcboot' from uboot (if you are up to date) which will try to boot linux off an attached mmc/sd card. Just remember to install the latest kernel in uboot and install your etch filesystem on an ext2 formatted partition mmc/sd card. (note: you must use the first primary partition).

Cheers.

--
David George
Digital Design Engineer
Karoo Array Telescope
Tel:     +27 21 531-7282
Fax:     +27 21 531-9761
Email:   [email protected]
Web:     www.ska.ac.za


Reply via email to