MTD for FPGA framegrabber

Clemens Koller clemens.koller at anagramm.de
Fri Jun 3 09:13:25 EDT 2005


Hello!

Okay, after some more reading and testing, I try to get an overview
of what I am doing :-) I still have some questions which are unclear
in the little documentation I've found... see below.

Well, my goal is to use an MTD to access my SRAM in my FPGA at
0xfc000000, size=0x100000 (1MByte) with direct read and write
operations (and DMA later on). All that should happen on the
Local Bus Controller on an MPC8540 embedded PowerPC CPU.
The goal is to get direct io / bulk data transfers via DMA as
fast as possible. (It looks like I need MTD_WRITEB_WRITEABLE)

Currently, all my stuff is compiled as modules to be able to play
around with all that things.
First, I wrote a little module which sets my Local Bus Windows
to generate the right chipselects and timings... which seems to
work fine.

Then I tried to start the MTD stuff:
# modprobe mtdchar
	loads mtdcore also... okay!
# modprobe map_rom
	loads chipreg also... okay!
# modprobe physmap
	probes my SRAM area via map_rom and adds mtd_to mtdcore, so I get
	two devices: /dev/mtd/0 and /dev/mtd/0ro

Okay, I'm wondering why do I get the 0ro device, too?

Now I can read from 0 and 0ro and I get data read from my SRAM.
But I cannot write to that area.

Okay, I've tried to use mtd_ram instead of mtd_rom, but then I cannot
load physmap:
FATAL: Error inserting physmap (/lib/modules/2.6.11.11/kernel/drivers/mtd/maps/physmap.ko): No such device or address

Hmm... okay, if I look into physmap.c it seems like as it won't use the
mtd_ram probe for my SRAM:

First line of static int __init init_physmap(void):
	static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };

Is that correct?
Can I just use map_ram instead of the others and do I then end up
with a r/w device? Or do I need more?


I also thought about a mixture of the mtdram and physmap driver?
Well, I've had a look at the latest CVS and realized that there
are plenty of drivers available. But do I need to write one of my
own or can I just recycle some other code?
Can you give me a good starting point in the sources?

Maybe some of you can just give me some raw directions or
correct me if I am at the wrong trail with my plans above?!.

Thanks in advance,
best greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19




More information about the linux-mtd mailing list