* Please help, nftl question
@ 2003-06-17 8:12 Luca Contini
2003-06-17 8:51 ` David Woodhouse
0 siblings, 1 reply; 11+ messages in thread
From: Luca Contini @ 2003-06-17 8:12 UTC (permalink / raw)
To: linux-mtd-request@lists.infradead.org
Hi all,
does anybody know wich is the role of the nftl in the nand flash driver
stack?
I konw there ere for layers:
1. File system layer (e.g. JFFS2 or DOS-FAT)
2. MTD
3. Nand generic driver
4. Hardware specific driver
where can the nftl be located in the stack?
is nftl a filesystem or a low level driver?
thanx
Luca Contini
-------------------------------------------------------
Mediatech s.r.l.
System Engineer
Office: (+39) 070 2466 5503
Mobile: (+39) 328 911 6656
Fax: (+39) 070 2466 5111
luca.contini@mediaenabling.com
URL: http://www.mediaenabling.com
--------------------------------------------------------
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-17 8:12 Please help, nftl question Luca Contini
@ 2003-06-17 8:51 ` David Woodhouse
2003-06-18 11:55 ` Luca Contini
0 siblings, 1 reply; 11+ messages in thread
From: David Woodhouse @ 2003-06-17 8:51 UTC (permalink / raw)
To: Luca Contini; +Cc: linux-mtd-request@lists.infradead.org
On Tue, 2003-06-17 at 09:12, Luca Contini wrote:
> Hi all,
> does anybody know wich is the role of the nftl in the nand flash driver
> stack?
> I konw there ere for layers:
> 1. File system layer (e.g. JFFS2 or DOS-FAT)
> 2. MTD
> 3. Nand generic driver
> 4. Hardware specific driver
>
> where can the nftl be located in the stack?
You are confused about the file system layer.
See http://www.linux-mtd.infradead.org/tech/mtd-upper-layers.fig
(there's a JPEG for the xfig-challenged at
http://www.linux-mtd.infradead.org/~dwmw2/mtd-upper-layers.jpeg )
Atop the MTD layer there is _either_ a real file system such as JFFS2 or
YAFFS, which uses MTD devices directly and presents itself as a file
system to the operating system, or there can be a 'translation layer'
which is a kind of pseudo-filesystem which pretends to be a standard
disk drive. The translation layer could be FTL, NFTL, INFTL or the very
simplistic 'mtdblock'. The translation layer registers a block device
with the Linux block layer, and on top of that you can mount 'normal'
file systems such as cramfs, ext3 and FAT (and all the others).
Also, you can access the 'translated' block devices through their device
nodes (/dev/ftl*, /dev/nftl*, /dev/mtdblock*), and you can access the
MTD devices directly to issue read/write/erase commands via the
/dev/mtdX character device nodes.
See http://www.linux-mtd.infradead.org/tech/mtd-upper-layers.fig
(there's a JPEG for the xfig-challenged at
http://www.linux-mtd.infradead.org/~dwmw2/mtd-upper-layers.jpeg )
I've omitted the lower layers. The whole point of the MTD code is that
you shouldn't need to consider the devices and the 'users' of those
devices in the same breath. If you have a question about what's _below_
the 'Linux MTD layer' level, ask it separately. It's actually a little
messier and more fluid.
> is nftl a filesystem or a low level driver?
No. :)
--
dwmw2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-17 8:51 ` David Woodhouse
@ 2003-06-18 11:55 ` Luca Contini
2003-06-18 11:59 ` David Woodhouse
0 siblings, 1 reply; 11+ messages in thread
From: Luca Contini @ 2003-06-18 11:55 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd-request@lists.infradead.org
Thank you David.
One more question: I want to put a vfat filesystem on top of nftl (actually
i'd like to read from a smartmedia formatted with fat12 by a digital
camera).
Should I create a dev node (e.g. nftla) using major number 93 (the one
corresponding to nftl driver) and format this device befor mounting it?
thank you very much again
Luca
----- Original Message -----
From: "David Woodhouse" <dwmw2@infradead.org>
To: "Luca Contini" <luca.contini@mediaenabling.com>
Cc: "linux-mtd-request@lists.infradead.org" <linux-mtd@lists.infradead.org>
Sent: Tuesday, June 17, 2003 10:51 AM
Subject: Re: Please help, nftl question
> On Tue, 2003-06-17 at 09:12, Luca Contini wrote:
> > Hi all,
> > does anybody know wich is the role of the nftl in the nand flash driver
> > stack?
> > I konw there ere for layers:
> > 1. File system layer (e.g. JFFS2 or DOS-FAT)
> > 2. MTD
> > 3. Nand generic driver
> > 4. Hardware specific driver
> >
> > where can the nftl be located in the stack?
>
> You are confused about the file system layer.
>
> See http://www.linux-mtd.infradead.org/tech/mtd-upper-layers.fig
> (there's a JPEG for the xfig-challenged at
> http://www.linux-mtd.infradead.org/~dwmw2/mtd-upper-layers.jpeg )
>
> Atop the MTD layer there is _either_ a real file system such as JFFS2 or
> YAFFS, which uses MTD devices directly and presents itself as a file
> system to the operating system, or there can be a 'translation layer'
> which is a kind of pseudo-filesystem which pretends to be a standard
> disk drive. The translation layer could be FTL, NFTL, INFTL or the very
> simplistic 'mtdblock'. The translation layer registers a block device
> with the Linux block layer, and on top of that you can mount 'normal'
> file systems such as cramfs, ext3 and FAT (and all the others).
>
> Also, you can access the 'translated' block devices through their device
> nodes (/dev/ftl*, /dev/nftl*, /dev/mtdblock*), and you can access the
> MTD devices directly to issue read/write/erase commands via the
> /dev/mtdX character device nodes.
>
> See http://www.linux-mtd.infradead.org/tech/mtd-upper-layers.fig
> (there's a JPEG for the xfig-challenged at
> http://www.linux-mtd.infradead.org/~dwmw2/mtd-upper-layers.jpeg )
>
> I've omitted the lower layers. The whole point of the MTD code is that
> you shouldn't need to consider the devices and the 'users' of those
> devices in the same breath. If you have a question about what's _below_
> the 'Linux MTD layer' level, ask it separately. It's actually a little
> messier and more fluid.
>
> > is nftl a filesystem or a low level driver?
>
> No. :)
>
> --
> dwmw2
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-18 11:55 ` Luca Contini
@ 2003-06-18 11:59 ` David Woodhouse
2003-06-20 9:41 ` Luca Contini
0 siblings, 1 reply; 11+ messages in thread
From: David Woodhouse @ 2003-06-18 11:59 UTC (permalink / raw)
To: Luca Contini; +Cc: linux-mtd-request@lists.infradead.org
On Wed, 2003-06-18 at 12:55, Luca Contini wrote:
> Thank you David.
> One more question: I want to put a vfat filesystem on top of nftl (actually
> i'd like to read from a smartmedia formatted with fat12 by a digital
> camera).
A digital camera will not be using NFTL. NFTL is only used on the
M-Systems DiskOnChip, and outside the Free World patents enforce that
restriction.
You want the SmartMedia translation layer, which isn't yet implemented
and merged, although I do believe I recall seeing code for it at one
point. It would fit into the diagram I showed you alongside mtdblock,
FTL, NFTL etc.
--
dwmw2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-18 11:59 ` David Woodhouse
@ 2003-06-20 9:41 ` Luca Contini
2003-06-20 9:42 ` David Woodhouse
0 siblings, 1 reply; 11+ messages in thread
From: Luca Contini @ 2003-06-20 9:41 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd-request@lists.infradead.org
Thanx,
so I have to modify the NFTL to comply with smartmedia fat format.
I thought NFTL was a translation layer from smartmedia to CHS hdd like
structure.
regards
----- Original Message -----
From: "David Woodhouse" <dwmw2@infradead.org>
To: "Luca Contini" <luca.contini@mediaenabling.com>
Cc: "linux-mtd-request@lists.infradead.org" <linux-mtd@lists.infradead.org>
Sent: Wednesday, June 18, 2003 1:59 PM
Subject: Re: Please help, nftl question
> On Wed, 2003-06-18 at 12:55, Luca Contini wrote:
> > Thank you David.
> > One more question: I want to put a vfat filesystem on top of nftl
(actually
> > i'd like to read from a smartmedia formatted with fat12 by a digital
> > camera).
>
> A digital camera will not be using NFTL. NFTL is only used on the
> M-Systems DiskOnChip, and outside the Free World patents enforce that
> restriction.
>
> You want the SmartMedia translation layer, which isn't yet implemented
> and merged, although I do believe I recall seeing code for it at one
> point. It would fit into the diagram I showed you alongside mtdblock,
> FTL, NFTL etc.
>
>
>
> --
> dwmw2
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-20 9:41 ` Luca Contini
@ 2003-06-20 9:42 ` David Woodhouse
2003-06-26 9:01 ` Luca Contini
0 siblings, 1 reply; 11+ messages in thread
From: David Woodhouse @ 2003-06-20 9:42 UTC (permalink / raw)
To: Luca Contini; +Cc: linux-mtd-request@lists.infradead.org
On Fri, 2003-06-20 at 10:41, Luca Contini wrote:
> Thanx,
> so I have to modify the NFTL to comply with smartmedia fat format.
> I thought NFTL was a translation layer from smartmedia to CHS hdd like
> structure.
NFTL is a pseudo-filesystem used to emulate HDD-like structure on a
DiskOnChip. You need to implement an _entirely_ separate
pseudo-filesystem to emulate HDD-like structure on SmartMedia. The
layout on the flash and all the data-structures are _entirely_
different.
--
dwmw2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-20 9:42 ` David Woodhouse
@ 2003-06-26 9:01 ` Luca Contini
[not found] ` <1056618945.27553.38.camel@passion.cambridge.redhat.com>
0 siblings, 1 reply; 11+ messages in thread
From: Luca Contini @ 2003-06-26 9:01 UTC (permalink / raw)
To: David Woodhouse; +Cc: Barone Tonino, linux-mtd-request@lists.infradead.org
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
Hi,
can You please check whether my diagram is correct or not?
Can you please suggest me some paper to read about fat on smartmedia and
linux?
I would really appreciate that
thanx
Luca
----- Original Message -----
From: "David Woodhouse" <dwmw2@infradead.org>
To: "Luca Contini" <luca.contini@mediaenabling.com>
Cc: "linux-mtd-request@lists.infradead.org" <linux-mtd@lists.infradead.org>
Sent: Friday, June 20, 2003 11:42 AM
Subject: Re: Please help, nftl question
> On Fri, 2003-06-20 at 10:41, Luca Contini wrote:
> > Thanx,
> > so I have to modify the NFTL to comply with smartmedia fat format.
> > I thought NFTL was a translation layer from smartmedia to CHS hdd like
> > structure.
>
> NFTL is a pseudo-filesystem used to emulate HDD-like structure on a
> DiskOnChip. You need to implement an _entirely_ separate
> pseudo-filesystem to emulate HDD-like structure on SmartMedia. The
> layout on the flash and all the data-structures are _entirely_
> different.
>
> --
> dwmw2
>
>
>
[-- Attachment #2: layers.jpg --]
[-- Type: image/jpeg, Size: 124178 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
[not found] ` <1056618945.27553.38.camel@passion.cambridge.redhat.com>
@ 2003-06-27 8:14 ` Luca Contini
2003-06-27 8:16 ` David Woodhouse
0 siblings, 1 reply; 11+ messages in thread
From: Luca Contini @ 2003-06-27 8:14 UTC (permalink / raw)
To: linux-mtd-request@lists.infradead.org, David Woodhouse; +Cc: Barone Tonino
Hi,
which is difference between nftlcore and nftlmount ?
What kind of functions should SFTL export so that a filesystem can be put
on?
regards
Luca
----- Original Message -----
From: "David Woodhouse" <dwmw2@infradead.org>
To: "Luca Contini" <luca.contini@mediaenabling.com>
Cc: "Barone Tonino" <tonino.barone@tecneitalia.com>
Sent: Thursday, June 26, 2003 11:15 AM
Subject: Re: Please help, nftl question
> On Thu, 2003-06-26 at 10:01, Luca Contini wrote:
> > Hi,
> > can You please check whether my diagram is correct or not?
>
> Your diagram looks correct except that you've drawn arrows on it.
>
> Those arrows represent only _one_ of the many ways in which it can be
> used. If writing the SmartMedia 'SFTL' code, please don't do it while
> thinking about FAT or about any specific hardware driver. It should work
> with _any_ file system or hardware.
>
> > Can you please suggest me some paper to read about fat on smartmedia and
> > linux?
>
> Ignore FAT for the moment; it's not relevant.
>
> See http://www.ssfdc.or.jp/english/common/f_spec_down.htm
>
> Ignore the 'Logical Format Specifications' and look at the 'Physical
> Format Specifications'.
>
> --
> dwmw2
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-27 8:14 ` Luca Contini
@ 2003-06-27 8:16 ` David Woodhouse
2003-06-30 10:37 ` Luca Contini
0 siblings, 1 reply; 11+ messages in thread
From: David Woodhouse @ 2003-06-27 8:16 UTC (permalink / raw)
To: Luca Contini; +Cc: Barone Tonino, linux-mtd-request@lists.infradead.org
On Fri, 2003-06-27 at 09:14, Luca Contini wrote:
> Hi,
> which is difference between nftlcore and nftlmount ?
nftlmount is the code which does and examines a flash device, looking
for signs of the NFTL format on it, and then builds up all the relevant
data structures for the NFTL code.
nftlcore is the code which actually handles read/write access to the
translation layer.
You don't really need to worry about this -- it just seemed slightly
nicer to split it NFTL two files. FTL and mtdblock are not split.
> What kind of functions should SFTL export so that a filesystem can be put
> on?
You need to provide a 'struct mtd_blktrans_ops', as defined in
include/mtd/blktrans.h and implemented in mtdblock.c
Don't look at NFTL, it'll just confuse you. Look at mtdblock.c instead.
Take a copy of it, make the read and write functions just return errors.
Add code to your 'add_mtd' routine to go and check for a valid
SmartMedia TL on any device which is added. Then make the read function
work properly -- finding the appropriate part of the flash containing
whichever 'logical' block number is requested, and reading it.
Then move on to writing...
--
dwmw2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-30 10:37 ` Luca Contini
@ 2003-06-30 10:36 ` David Woodhouse
0 siblings, 0 replies; 11+ messages in thread
From: David Woodhouse @ 2003-06-30 10:36 UTC (permalink / raw)
To: Luca Contini; +Cc: Barone Tonino, linux-mtd-request@lists.infradead.org
it.
stop
Please
understand.
to
difficult
hence
and
top-posting
are
You
CVS.
in
is
want
you
file
The
--
dwmw2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Please help, nftl question
2003-06-27 8:16 ` David Woodhouse
@ 2003-06-30 10:37 ` Luca Contini
2003-06-30 10:36 ` David Woodhouse
0 siblings, 1 reply; 11+ messages in thread
From: Luca Contini @ 2003-06-30 10:37 UTC (permalink / raw)
To: David Woodhouse; +Cc: Barone Tonino, linux-mtd-request@lists.infradead.org
Hi David,
thank you very much for your help.
Things are definitely much clear now.
I'v been looking for 'struct mtd_blktrans_ops' but with no result.
Also for "include/mtd/blktrans.h" that I suppose is
"include/linux/mtd/blktrans.h", but I can't find any "blktrans.h".
Right now I'm trying to understand the code for mtdblock.
Regards
Luca
----- Original Message -----
From: "David Woodhouse" <dwmw2@infradead.org>
To: "Luca Contini" <luca.contini@mediaenabling.com>
Cc: "linux-mtd-request@lists.infradead.org" <linux-mtd@lists.infradead.org>;
"Barone Tonino" <tonino.barone@tecneitalia.com>
Sent: Friday, June 27, 2003 10:16 AM
Subject: Re: Please help, nftl question
> On Fri, 2003-06-27 at 09:14, Luca Contini wrote:
> > Hi,
> > which is difference between nftlcore and nftlmount ?
>
> nftlmount is the code which does and examines a flash device, looking
> for signs of the NFTL format on it, and then builds up all the relevant
> data structures for the NFTL code.
>
> nftlcore is the code which actually handles read/write access to the
> translation layer.
>
> You don't really need to worry about this -- it just seemed slightly
> nicer to split it NFTL two files. FTL and mtdblock are not split.
>
> > What kind of functions should SFTL export so that a filesystem can be
put
> > on?
>
> You need to provide a 'struct mtd_blktrans_ops', as defined in
> include/mtd/blktrans.h and implemented in mtdblock.c
>
> Don't look at NFTL, it'll just confuse you. Look at mtdblock.c instead.
>
> Take a copy of it, make the read and write functions just return errors.
> Add code to your 'add_mtd' routine to go and check for a valid
> SmartMedia TL on any device which is added. Then make the read function
> work properly -- finding the appropriate part of the flash containing
> whichever 'logical' block number is requested, and reading it.
>
> Then move on to writing...
>
> --
> dwmw2
>
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2003-06-30 10:36 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-17 8:12 Please help, nftl question Luca Contini
2003-06-17 8:51 ` David Woodhouse
2003-06-18 11:55 ` Luca Contini
2003-06-18 11:59 ` David Woodhouse
2003-06-20 9:41 ` Luca Contini
2003-06-20 9:42 ` David Woodhouse
2003-06-26 9:01 ` Luca Contini
[not found] ` <1056618945.27553.38.camel@passion.cambridge.redhat.com>
2003-06-27 8:14 ` Luca Contini
2003-06-27 8:16 ` David Woodhouse
2003-06-30 10:37 ` Luca Contini
2003-06-30 10:36 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox