public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Re: mtd-19990809 including readonly DiskOnChip driver.
@ 1999-08-10  9:03 David Woodhouse
  1999-08-10 16:33 ` Jason Gunthorpe
  0 siblings, 1 reply; 13+ messages in thread
From: David Woodhouse @ 1999-08-10  9:03 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: mtd


jgg@deltatee.com said:
>  I've looked around your new bundle and it looks pretty good, if
> anyone wants to add the CFI probing routing it fits very nicely into
> the mapped.c file, instead of using the flash_jedec routine, a very
> similar routine that does CFI probes needs to be written. 

> I'm not sure the two AMD chips I use support CFI, anyone know off
> hand?

Probably. Try it and find out. The CFI spec is on Intel's web site:
	http://www.pentium.com/design/flcomp/technote/cfi_1_1.htm

> Also, using David's driver as the base driver kinda mucks things up -
> he uses a different erase mechanism with different meanings, and has
> some weird cruft from PCMCIA in there.

Yeah - the idea is that the PCMCIA drivers will be able to use this MTD layer 
when (if) Linus incorporates in into the standard kernel. However, I'd like to 
keep as much of the hardware-specific details _out_ of the MTD layer as 
possible - that's why you'll notice I've moved your mfr and id codes out of 
the struct mtd_info into your own private structure. So if there's PCMCIA 
'cruft' that doesn't need to be there, we can remove it.

Some extra complexity is required for the erases, though, to allow timer-based
operation and retries. I didn't really pay much attention to erases as I pulled
this lot together though - just used what I had last time. So feel free to
point out anything that's not right.


>  Porting the PCMCIA driver and the slram driver to use the mapped
> interface would save alot of code as well, compare:

PCMCIA driver? I haven't started on that yet. If the mapped driver supports 
pageable windows, then the DiskOnChip 1000 driver can use it too. 

> blue{jgg}/tmp/mtd-19990809/kernel#wc -l slram.c octagon-5066.c
>     210 slram.c
>     205 octagon-5066.c

I thought the octagon-5066 driver was yours and already used the mapped 
interface.

> For such a simple device that is quite needlessly long. (mapped
> already implements ram devices)

Yeah - there's definitely scope for removing the redundancy there. The aim of 
this release was mainly to pull all our work together into one codebase, to 
give us a starting point. 

>   I miss devfs support too :<

Sorry, I couldn't test it, and couldn't be sure not to screw it up as I've 
never got round to installing devfs. If you give me a patch which puts it 
back into all the drivers, I'll put it back in.

> Also, do your new NFTL and FTL drivers work over normal block devices?

No. NFTL cannot work over a block device, and can't easily work over most 
memory devices either - you need NAND flash, which has 'out of band' data. 

FTL doesn't either - but there's little need for FTL on block devices. FTL 
_provides_ a block device, not an actual mounted filesystem. So if you want to 
take a duplicate copy of an FTL system, you duplicate the block device not the 
underlying structure.

I'm not sure that running FFS2 from a block device is going to work in the 
long term either - you need access to internal MTD stuff like the erase 
mechanism and erasesize, etc. Your comments in the block device driver and in 
the FFS2 code seem to support that point of view.





> Porting the PCMCIA driver and the slram driver to use the mapped
> interface would save alot of code as well, compare:

> blue{jgg}/tmp/mtd-19990809/kernel#wc -l slram.c octagon-5066.c
>     210 slram.c
>     205 octagon-5066.c

> For such a simple device that is quite needlessly long. (mapped
> already implements ram devices)
>   I miss devfs support too :<

> Also, do your new NFTL and FTL drivers work over normal block devices?
> 



----                                 ----                                 ----
David Woodhouse        David.Woodhouse@mvhi.com       Office: (+44) 1223 810302
 Project Leader,     Process Information Systems      Mobile: (+44) 976 658355
    Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
             finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.




To unsubscribe, send "unsubscribe mtd" to majordomo@imladris.demon.co.uk

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: mtd-19990809 including readonly DiskOnChip driver.
@ 1999-08-13 13:46 David Woodhouse
  0 siblings, 0 replies; 13+ messages in thread
From: David Woodhouse @ 1999-08-13 13:46 UTC (permalink / raw)
  To: David Hinds; +Cc: mtd


dhinds@zen.stanford.edu said:
>  That's certainly true: PCMCIA currently treats cards with no CIS as
> static RAM cards.  Mostly because the issue has never really come up
> for me.  I think that's a bit different from an unqualified "they do
> not work very well at all". 

OK then - would you accept a patch which performs CFI or JEDEC identification 
in the case that there's no CIS, rather than just assuming SRAM? Jason, would 
you be willing to write this and submit it to him?

Also, how would you like us to go about making PCMCIA devices use the MTD 
system? 

>From what I understand of Jason's "mapped" helper, it provides simple way for 
MTD devices with memory windows to SRAM or NOR flash to provide a single 
'change window mapping' routine, and then to be handled automatically. Am I 
right in thinking that most (all?) PCMCIA memory devices work this way? 

If so, I think the best way to get PCMCIA devices to use this system with 
minimal code duplication is to write a new driver for PCMCIA MTDs, which links 
to Jason's helper code. That way, the original drivers aren't littered with 
ifdefs which make them difficult to maintain.

We can provide those drivers separately, as part of our tarball, until such 
time as we get Linus to include the MTD subsystem into his kernel, hopefully 
near the start of the 2.5 series. At that point, they can be imported into 
your PCMCIA tree for conditional compilation when the MTD system is detected 
in the kernel.

How does that sound?



----                                 ----                                 ----
David Woodhouse        David.Woodhouse@mvhi.com       Office: (+44) 1223 810302
 Project Leader,     Process Information Systems      Mobile: (+44) 976 658355
    Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
             finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.




To unsubscribe, send "unsubscribe mtd" to majordomo@imladris.demon.co.uk

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: mtd-19990809 including readonly DiskOnChip driver.
@ 1999-08-13 13:33 David Woodhouse
  0 siblings, 0 replies; 13+ messages in thread
From: David Woodhouse @ 1999-08-13 13:33 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: mtd


jgg@deltatee.com said:
> On Tue, 10 Aug 1999, David Woodhouse wrote:
> > Some extra complexity is required for the erases, though, to allow
> > timer-based operation and retries. I didn't really pay much attention to
> > erases as I pulled this lot together though - just used what I had last
> > time. So feel free to point out anything that's not right. 

>  That should all go into the highest layer, the device stuff doesn't
> need to know it is being called asynchrounously. 

That's what I originally thought. However, erases take a long time, and we 
often don't need them to be done synchronously - mostly we'll keep a spare 
erase block already clean, and the newly-erased ones won't be used immediately.

Also, in multi-chip devices, an erase can be in progress on one chip while 
other things are happening to the other chips. Erases can even be interrupted, 
I believe, to allow reads to be performed. That kind of optimisation isn't 
possible unless we allow asynchronous erases.


>  If the DoC is just an array of normal flash chips with some paging
> mechanism then you could probably [use the mapped driver] quite easially.

The DiskOnChip 1000 is. So it should be quite simple, yes. But I have no access 
to DiskOnChip 1000 hardware at the moment - they're out of production. 
M-Systems are trying to see if they can lay their hands on some for me.
If we can't get them, then I'll probably just pull the DoC1000 driver 
completely.

>  Hum, that's kinda a bummer - Being able to prepare a flash image on
> my desktop and then just bang the whole thing onto device is very
> usefull - that is our primary means of deploying remote upgrades.

>  You still need to format the flash with the FTL information, it is
> convient to just have that pre-available in an image. 

Convenience is just a matter of having the tools readily available. If we 
provide a tool which can take a block device image and dump that to flash, 
formatting an NFTL partition as it does so, then it's just as convenient, 
surely? And we can use a standard loopback mount to create and maintain the 
filesystem for the device.

I agree that formatting and then populating the NFTL partition isn't 
quite as convenient (two command lines instead of one), but even that's 
scriptable.

It's fairly easy to make a dump/restore utility dumps the whole of the flash
intact, but that's of limited usefulness. Blindly duplicating the flash will
copy block erase counts and other such information that then becomes invalid on
the new media. For duplicating onto production systems, you'd do just as well
to use the format-as-you-go approach above.


jgg@deltatee.com said (re FFS2 on block devices):
>  The plan is to make it ask the MTD drive if the device it was mounted
> against is a MTD device and get a pointer to the MTD device block.
> Then it will not speak block or character, it will just directly
> manipulate the device. That solves the problem of having to ensure
> buffer cache consistency during erasures and so on.. 

Good - that's exactly what I was thinking of.

----                                 ----                                 ----
David Woodhouse        David.Woodhouse@mvhi.com       Office: (+44) 1223 810302
 Project Leader,     Process Information Systems      Mobile: (+44) 976 658355
    Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
             finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.




To unsubscribe, send "unsubscribe mtd" to majordomo@imladris.demon.co.uk

^ permalink raw reply	[flat|nested] 13+ messages in thread
* mtd-19990809 including readonly DiskOnChip driver.
@ 1999-08-09 19:52 David Woodhouse
  1999-08-09 20:10 ` Jason Gunthorpe
  1999-08-09 20:28 ` Jason Gunthorpe
  0 siblings, 2 replies; 13+ messages in thread
From: David Woodhouse @ 1999-08-09 19:52 UTC (permalink / raw)
  To: mtd

I've updated the MTD package to include the modifications and new drivers made
by Jason Gunthorpe, and also the current version of my DiskOnChip and NFTL
code. 

It's available at:
	ftp://ftp.linux-mtd.infradead.org/pub/mtd/mtd-19990809.tar.gz

It should contain working drivers for:
	slram		- uncached system memory
	doc1000		- The old DiskOnChip 1000 and ISA flash cards.
	doc2000 	- DiskOnChip2000 (not yet Millennium)
	octagon-5066	- Memory-mapped flash found on a Single Board Computer
	vmax301 	- Likewise.

The devices are presented to the user by default as a character device. 
However, three block devices are available:
	
	ftl		- The original FTL filesystem, as used by PCMCIA
	nftl		- The new (NAND) FTL system, for the DiskOnChip
	mtdblock	- Direct block device access to the MTD

For some reason, the mtdblock_request routine seem to never be called. I'm 
obviously doing something stupid, so I'll let one of you tell me why that is :)

Also included is Jason's FFS2 implementation. The bootloader stuff is also 
present, but commented out in the top-level Makefile because I haven't yet 
upgraded my as86. I'd prefer it if we could make this work without 
bleeding-edge utilites. Jason, is that possible?

Soon, I'm intending to merge Alexander Larsson's 'flash.diff' for onboard 
CFI-compliant memories. Volunteers to do that would be appreciated, because it 
would let me concentrate on completing the DiskOnChip and NFTL code.

Happy Hacking.

----                                 ----                                 ----
David Woodhouse        David.Woodhouse@mvhi.com       Office: (+44) 1223 810302
 Project Leader,     Process Information Systems      Mobile: (+44) 976 658355
    Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
             finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.




To unsubscribe, send "unsubscribe mtd" to majordomo@imladris.demon.co.uk

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

end of thread, other threads:[~1999-08-13 13:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-10  9:03 mtd-19990809 including readonly DiskOnChip driver David Woodhouse
1999-08-10 16:33 ` Jason Gunthorpe
1999-08-10 16:54   ` David Hinds
1999-08-10 20:49     ` Jason Gunthorpe
1999-08-10 21:04       ` David Hinds
1999-08-10 21:20         ` Jason Gunthorpe
1999-08-10 21:29           ` David Hinds
1999-08-11  5:49             ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
1999-08-13 13:46 David Woodhouse
1999-08-13 13:33 David Woodhouse
1999-08-09 19:52 David Woodhouse
1999-08-09 20:10 ` Jason Gunthorpe
1999-08-09 20:28 ` Jason Gunthorpe

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