writing new BBRAM driver

Tobias Otto-Adamczak toa at indakom.de
Mon Dec 16 05:14:41 EST 2002


Alex Pavloff, 2002-12-13, 15:45h:

> Hi there folks.  I've written the struct mtd_info functions for a 128KB
> BBRAM driver for my companies new board.  It's horribly simple, as most of
> it is actually done by a gate array on the board, so from kernel land its
> just poking ioports.  Easy stuff.
>
> Anyway, at this point, I've got that written, but I'm a little hazy as to
> what I do next.  Insmod the driver, and then....?

[I am no expert, but anyway ...]

I think you need at least the mtdcore and mtdblock/mtdblock_ro modules,
too (if you want to have a FS in the BBRAM). When you did the insmod,
have a look at /proc/mtd. If your driver registered okay with the mtd
subsystem, it should appear there. Lets say you find it there as mtd0,
you should then be able to access it as a block device under
/dev/mtdblock0. Then you can do everything with it what you would do
with an unformatted hard disk partition (format it, mount it, use it)

> How do I get a drive to mount?

a) Format you block device or copy a pre-formatted image to the BBRAM.
The latter you can do with a simple
	cat <my_preformatted_image >/dev/mtd0
assuming that your BBRAM is registered as mtd0 partition (check with
"cat /proc/mtd") and you have loaded the mtdchar module.

then do a normal mount, e.g.
	mount -o sync -t minix /dev/mtdblock0 /mnt/bbram

> Also, what FS should I use for this BBRAM?

That depends on your hardware and your applications needs. You may want
to try minix. How much (KB) is your BBRAM, anyway ? Maybe you need no FS
at all ?

Ciao
Tobias





More information about the linux-mtd mailing list