Linux – Connect alauda driver to an mtd device

driversflash-memorylinux

I have a USB card reader, an Olympus MAUSB-10. It provides direct flash access to SmartMedia or xD cards, using the Linux alauda driver. This is different from a typical card reader which just exposes it as a standard USB mass storage device.

There's drivers in the Linux kernel that will do the FTL thing and expose this as a standard block device, but I want direct flash access. I was wondering if it's possible to use the various utilities of mtd-tools to read, write, and erase directly to it.

So the device is recognized by lsusb, and drivers aluada and nand_ecc are loaded. But cat /proc/mtd isn't revealing another MTD device available, and I don't see any additional devices in /dev. How do I create a new mtd device and connect it to the alauda driver?

Best Answer

If we look at the source code of driver in the Linux kernel (drivers/mtd/nand/alauda.c), we see that the mtd device should be called "alauda".

For example, in cmx270_nand.c mtd name is cmx270-0. In kernel log information about it, looks like:

Creating 1 MTD partitions on "NAND 512MiB 3,3V 8-bit":
0x00000000-0x20000000 : "cmx270-0"

Check dmesg (grep alauda, MTD), and if your xD card successfully recognized, finally for accessing MTD device you may try create /dev/mtdblockX and /dev/mtdX with mknod.