public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Adding devices at runtime
@ 2002-11-01  2:06 Pavel Roskin
  2002-11-01  3:30 ` Jörn Engel
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2002-11-01  2:06 UTC (permalink / raw)
  To: linux-mtd

Hello!

If I understand correctly, the MTD driver allows to define two devices in
predefined memory areas - one using the CFI driver (CONFIG_MTD_PHYSMAP),
the other using the MTDRAM driver (CONFIG_MTD_MTDRAM).

What if I want more MTD devices in the known memory areas?  Can I register
them at runtime, when the kernel is loaded?  Is it possible to do it
without using modules?  Can I do it without changing the kernel (I mean 
something like "echo 200000 20000 2 >/proc/mtd").

I realize that the question is very basic, but my search for "add" and
"register" in the HOWTO from CVS didn't bring any positive results.

Can it be that I want something wrong?  I simply want to boot from one
flash device and be able to access (and possibly rewrite) that device and
another device.  Both are supported by the JEDEC driver
(CONFIG_MTD_JEDECPROBE), but they use different (not adjacent) memory
areas.  (Of course I hacked drivers/mtd/maps/physmap.c to probe
"jedec_probe", but I know that it's already done right in MTD CVS.)

Right now I have to use the MTDRAM driver on the boot device, so the I
cannot rewrite it (I haven't tried, but I don't expect it to work).  I can
only rewrite the other chip.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding devices at runtime
  2002-11-01  2:06 Adding devices at runtime Pavel Roskin
@ 2002-11-01  3:30 ` Jörn Engel
  2002-11-01  5:45   ` Pavel Roskin
  0 siblings, 1 reply; 4+ messages in thread
From: Jörn Engel @ 2002-11-01  3:30 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-mtd

On Thu, 31 October 2002 21:06:51 -0500, Pavel Roskin wrote:
> If I understand correctly, the MTD driver allows to define two devices in
> predefined memory areas - one using the CFI driver (CONFIG_MTD_PHYSMAP),
> the other using the MTDRAM driver (CONFIG_MTD_MTDRAM).
> 
> What if I want more MTD devices in the known memory areas?  Can I register
> them at runtime, when the kernel is loaded?  Is it possible to do it
> without using modules?  Can I do it without changing the kernel (I mean 
> something like "echo 200000 20000 2 >/proc/mtd").
> 
> I realize that the question is very basic, but my search for "add" and
> "register" in the HOWTO from CVS didn't bring any positive results.
> 
> Can it be that I want something wrong?  I simply want to boot from one
> flash device and be able to access (and possibly rewrite) that device and
> another device.  Both are supported by the JEDEC driver
> (CONFIG_MTD_JEDECPROBE), but they use different (not adjacent) memory
> areas.  (Of course I hacked drivers/mtd/maps/physmap.c to probe
> "jedec_probe", but I know that it's already done right in MTD CVS.)
> 
> Right now I have to use the MTDRAM driver on the boot device, so the I
> cannot rewrite it (I haven't tried, but I don't expect it to work).  I can
> only rewrite the other chip.

Could you be a little more verbose on what your problem is? What kind
of mtd devices do you have, what do you want to do with them, why
register one of them at runtime,...

Something really high level would be nice, too. "I want to run linux
on a d-box and write some data to a cf-card once a day.", something
like that.

It is possible to register devices at runtime. But I don't know of any
driver that gives you an interface to do so without insmod'ing it. A
question of some 50 lines of code to add that functionality.

Jörn

-- 
If System.PrivateProfileString("",
"HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") <>
"" Then  CommandBars("Macro").Controls("Security...").Enabled = False
-- from the Melissa-source

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding devices at runtime
  2002-11-01  3:30 ` Jörn Engel
@ 2002-11-01  5:45   ` Pavel Roskin
  2002-11-01  5:50     ` Jörn Engel
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2002-11-01  5:45 UTC (permalink / raw)
  To: Jörn Engel; +Cc: linux-mtd

Hello!

> > Right now I have to use the MTDRAM driver on the boot device, so the I
> > cannot rewrite it (I haven't tried, but I don't expect it to work).  I can
> > only rewrite the other chip.
> 
> Could you be a little more verbose on what your problem is? What kind
> of mtd devices do you have, what do you want to do with them, why
> register one of them at runtime,...

Sorry, I cannot be more verbose about the device.  I was saying "at
runtime" because I don't need the second chip for the boot process.  I
don't care if it's done at runtime or I hardcode the address into the
kernel.  However, I did check the Config.in and I know that the kernel
only takes parameters for one chip and one MTDRAM device.

> It is possible to register devices at runtime. But I don't know of any
> driver that gives you an interface to do so without insmod'ing it. A
> question of some 50 lines of code to add that functionality.

I have those lines (perhaps they are not very pretty), but I was wondering
if there is "the right way" to do it.  I gather from your that it's called
insmod.  That's fine.

I guess another solution would be writing a map for the device, just like
those little C files under drivers/mtd/maps/

Thank you for reply!

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding devices at runtime
  2002-11-01  5:45   ` Pavel Roskin
@ 2002-11-01  5:50     ` Jörn Engel
  0 siblings, 0 replies; 4+ messages in thread
From: Jörn Engel @ 2002-11-01  5:50 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-mtd

On Fri, 1 November 2002 00:45:59 -0500, Pavel Roskin wrote:
> Sorry, I cannot be more verbose about the device.  I was saying "at
> runtime" because I don't need the second chip for the boot process.  I
> don't care if it's done at runtime or I hardcode the address into the
> kernel.  However, I did check the Config.in and I know that the kernel
> only takes parameters for one chip and one MTDRAM device.
> 
> > It is possible to register devices at runtime. But I don't know of any
> > driver that gives you an interface to do so without insmod'ing it. A
> > question of some 50 lines of code to add that functionality.
> 
> I have those lines (perhaps they are not very pretty), but I was wondering
> if there is "the right way" to do it.  I gather from your that it's called
> insmod.  That's fine.
> 
> I guess another solution would be writing a map for the device, just like
> those little C files under drivers/mtd/maps/

Yes, yet another mapping driver sound like the way to go, judging from
the information you provided.

Jörn

-- 
I can say that I spend most of my time fixing bugs even if I have lots
of new features to implement in mind, but I give bugs more priority.
-- Andrea Arcangeli, 2000

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-01  5:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-01  2:06 Adding devices at runtime Pavel Roskin
2002-11-01  3:30 ` Jörn Engel
2002-11-01  5:45   ` Pavel Roskin
2002-11-01  5:50     ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox