linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MTD Flash Howto ?
@ 2006-08-04  4:04 David H. Lynch Jr.
  2006-08-04 16:41 ` T Ziomek
  0 siblings, 1 reply; 6+ messages in thread
From: David H. Lynch Jr. @ 2006-08-04  4:04 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]


    I need to put together a filesystem driver for the flash in the Pico
E-12.
    I think I have a pretty good grasp of what I need of the FileSystem
end of things.

    But I am less certain of the peices needed to get from the flash to
the block driver that I assume underly's the FileSystem.
    I have enabled MTD, and configured a starting address and size.
    I got a signon banner. How can I tell if it has really found my
flash and if it actually knows the type of flash it found - in my
    instance Spansion S29GL512N.

    I have found some documentation covering details, I think I am more
interested in something that gives a more zoomed out view.

    Is anyone aware of a relevant howto ? Maybe some web pages on the
end-end process of going from flash devices to filesystems over flash ?

-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein


[-- Attachment #2: Type: text/html, Size: 1873 bytes --]

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

* RE: MTD Flash Howto ?
@ 2006-08-04  7:10 Josu Onandia
  0 siblings, 0 replies; 6+ messages in thread
From: Josu Onandia @ 2006-08-04  7:10 UTC (permalink / raw)
  To: dhlii, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1786 bytes --]

Hi,
 
Even if you dont't use U-Boot as bootloader, I'm sure that the documentation in http://www.denx.de/wiki/DULG/Manual will interest you.
 
Best regards
 
Josu Onandia

-----Mensaje original-----
De: linuxppc-embedded-bounces+jonandia=aotek.es@ozlabs.org [mailto:linuxppc-embedded-bounces+jonandia=aotek.es@ozlabs.org]En nombre de David H. Lynch Jr.
Enviado el: viernes, 04 de agosto de 2006 6:04
Para: linuxppc-embedded
Asunto: MTD Flash Howto ?



    I need to put together a filesystem driver for the flash in the Pico E-12.
    I think I have a pretty good grasp of what I need of the FileSystem end of things.

    But I am less certain of the peices needed to get from the flash to the block driver that I assume underly's the FileSystem.
    I have enabled MTD, and configured a starting address and size.
    I got a signon banner. How can I tell if it has really found my flash and if it actually knows the type of flash it found - in my 
    instance Spansion S29GL512N.

    I have found some documentation covering details, I think I am more interested in something that gives a more zoomed out view.

    Is anyone aware of a relevant howto ? Maybe some web pages on the end-end process of going from flash devices to filesystems over flash ?


-- 

Dave Lynch 					  	    DLA Systems

Software Development:  				         Embedded Linux

717.627.3770 	        dhlii@dlasys.net 	   http://www.dlasys.net

fax: 1.253.369.9244 			           Cell: 1.717.587.7774

Over 25 years' experience in platforms, languages, and technologies too numerous to list.



"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."

Albert Einstein


[-- Attachment #2: Type: text/html, Size: 3403 bytes --]

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

* RE: MTD Flash Howto ?
       [not found] <mailman.2056.1154699657.11183.linuxppc-embedded@ozlabs.org>
@ 2006-08-04 14:20 ` Ned W. Rhodes
  2006-08-04 15:52   ` David H. Lynch Jr.
  2006-08-11 21:26   ` Lee Revell
  0 siblings, 2 replies; 6+ messages in thread
From: Ned W. Rhodes @ 2006-08-04 14:20 UTC (permalink / raw)
  To: 'David H. Lynch Jr.'; +Cc: linuxppc-embedded

The book Building Embedded Linux Systems has a good section on the use of
flash file systems.

When you boot, you will see something like this, depending on the type of
flash driver you have. Make sure you have defined your mtd map in
kernel/drivers/mtd/map.

JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
JFS: nTxBlock = 965, nTxLock = 7720

Then if you have the MTD partitions correctly identified, the kernel will
show you something like:

CBG flash bank 0: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 2 MTD partitions on "CBG flash bank 0":
0x00000000-0x01800000 : "ffw1"
0x01800000-0x02000000 : "filesystem1"

Once booted you can look at /proc/mtd and you should see the partitions
something like:

[root@lbg ]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01800000 00020000 "ffw1"
mtd1: 00800000 00020000 "filesystem1"

Your mileage may vary depending on the type of flash you have and all the
configuration options, but that is basically how to tell that things are
mapped and ready for use.

Ned W. Rhodes
Software System Group
703.812.5072 x100

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

* Re: MTD Flash Howto ?
  2006-08-04 14:20 ` MTD Flash Howto ? Ned W. Rhodes
@ 2006-08-04 15:52   ` David H. Lynch Jr.
  2006-08-11 21:26   ` Lee Revell
  1 sibling, 0 replies; 6+ messages in thread
From: David H. Lynch Jr. @ 2006-08-04 15:52 UTC (permalink / raw)
  To: Ned W. Rhodes, jonandia; +Cc: linuxppc-embedded

    Thanks;

          I looked at the Denx stuff that was a good start. But raised
some questions:

          I have a single device. I presume that means it is 8 bits
wide, and constitutes a single Bank.
          I guess I have to query the Hardware people, on that.
          What exactly drives CONFIG_MTD_I? and CONFIG_MTD_B?

          A hard disk partition is usually reflected by data structures
(a partition table) written to the Disk.
          Am I correct in assuming that these are in drivers/mtd/maps.
          In my instance all the flash belongs to a single file system
There is a single reserved block at the begining,
          but it is reflected in the filesystem structure not the
partitioning.

          So as I understand things I have a single partition.
          When I ran menuconfig, I indicated that I did not need/had a
single partitions - would that be the correct choice ?

          There is a platform ram "map" that seems to allow defining the
flash region in a platform data structure - is that a viable alternative
to a machine specific map file ?
          Is it limited to just RAM.
         
          Prior to loading a filesystem driver shouldn;'t I get some
message indicating that mtd detected my specific type of flash ? or Is
that queriable inside /proc ?




Ned W. Rhodes wrote:
> The book Building Embedded Linux Systems has a good section on the use of
> flash file systems.
>
> When you boot, you will see something like this, depending on the type of
> flash driver you have. Make sure you have defined your mtd map in
> kernel/drivers/mtd/map.
>
> JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
> JFS: nTxBlock = 965, nTxLock = 7720
>
> Then if you have the MTD partitions correctly identified, the kernel will
> show you something like:
>
> CBG flash bank 0: Found 1 x16 devices at 0x0 in 16-bit bank
>  Intel/Sharp Extended Query Table at 0x0031
> Using buffer write method
> cfi_cmdset_0001: Erase suspend on write enabled
> Creating 2 MTD partitions on "CBG flash bank 0":
> 0x00000000-0x01800000 : "ffw1"
> 0x01800000-0x02000000 : "filesystem1"
>
> Once booted you can look at /proc/mtd and you should see the partitions
> something like:
>
> [root@lbg ]# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 01800000 00020000 "ffw1"
> mtd1: 00800000 00020000 "filesystem1"
>
> Your mileage may vary depending on the type of flash you have and all the
> configuration options, but that is basically how to tell that things are
> mapped and ready for use.
>
> Ned W. Rhodes
> Software System Group
> 703.812.5072 x100
>
>   


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

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

* Re: MTD Flash Howto ?
  2006-08-04  4:04 David H. Lynch Jr.
@ 2006-08-04 16:41 ` T Ziomek
  0 siblings, 0 replies; 6+ messages in thread
From: T Ziomek @ 2006-08-04 16:41 UTC (permalink / raw)
  To: linuxppc-embedded, dhlii

The documents we've found helpful are

Linux MTD, JFFS HOWTO
<ftp://ftp.uk.linux.org/pub/people/dwmw2/mtd/cvs/mtd/mtd-jffs-HOWTO.txt>

"Embedded Linux - Managing Flash Memory" (a much better MTD FAQ than the
official one)
<http://www.ssiembedded.com/embedded_linux_managing_memory.html>

"Find your Root File System with MTD" (written for uClinux, but generally
not uClinux-specific)
<http://www.ucdot.org/article.pl?sid=03/01/11/1049210>


Tom
-- 
   /"\  ASCII Ribbon Campaign   |
   \ /                          |   Email to user 'CTZ001'
    X        Against HTML       |             at 'email.mot.com'
   / \     in e-mail & news     |

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

* RE: MTD Flash Howto ?
  2006-08-04 14:20 ` MTD Flash Howto ? Ned W. Rhodes
  2006-08-04 15:52   ` David H. Lynch Jr.
@ 2006-08-11 21:26   ` Lee Revell
  1 sibling, 0 replies; 6+ messages in thread
From: Lee Revell @ 2006-08-11 21:26 UTC (permalink / raw)
  To: Ned W. Rhodes; +Cc: Leonid, linuxppc-embedded

On Fri, 2006-08-04 at 10:20 -0400, Ned W. Rhodes wrote:
> The book Building Embedded Linux Systems has a good section on the use of
> flash file systems.
> 
> When you boot, you will see something like this, depending on the type of
> flash driver you have. Make sure you have defined your mtd map in
> kernel/drivers/mtd/map.
> 
> JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
> JFS: nTxBlock = 965, nTxLock = 7720
> 

Is JFFS2 required to mount MTD devices?

Everything seems to be set up correctly here:

S29GL512N MirrorBit Flash: probing 16-bit flash bus
S29GL512N MirrorBit Flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
S29GL512N MirrorBit Flash: CFI does not contain boot bank location.
Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Creating 2 MTD partitions on "S29GL512N MirrorBit Flash":
0x00000000-0x02a00000 : "Raw Area"
ftl_cs: FTL header not found.
0x02a00000-0x02b80000 : "User FS"
ftl_cs: FTL header not found.
blkmtd: version $Revision: 1.24 $
blkmtd: error: missing `device' name

cat /proc/mtd:

dev:    size   erasesize  name
mtd0: 02a00000 00020000 "Raw Area"
mtd1: 00180000 00020000 "User FS"

cat /proc/partitions:

major minor  #blocks  name

  31     0      43008 mtdblock0
  31     1       1536 mtdblock1

~ # ls -al /dev/mtdblock[01]
brw-r--r--    1 root     0         31,   0 Aug 11 14:27 /dev/mtdblock0
brw-r--r--    1 root     0         31,   1 Aug 11 14:27 /dev/mtdblock1

As you can see the major and minor numbers are correct, but I cannot
mount the MTD partitions:

~ # mount -t minix /dev/mtdblock1 foo
mount: Mounting /dev/mtdblock1 on /foo failed: No such device

What am I doing wrong?

Lee

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

end of thread, other threads:[~2006-08-11 21:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2056.1154699657.11183.linuxppc-embedded@ozlabs.org>
2006-08-04 14:20 ` MTD Flash Howto ? Ned W. Rhodes
2006-08-04 15:52   ` David H. Lynch Jr.
2006-08-11 21:26   ` Lee Revell
2006-08-04  7:10 Josu Onandia
  -- strict thread matches above, loose matches on Subject: below --
2006-08-04  4:04 David H. Lynch Jr.
2006-08-04 16:41 ` T Ziomek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).