From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.197]) by ozlabs.org (Postfix) with ESMTP id 7DA9867B60 for ; Mon, 24 Jul 2006 18:26:14 +1000 (EST) Received: by nz-out-0102.google.com with SMTP id o1so389683nzf for ; Mon, 24 Jul 2006 01:26:13 -0700 (PDT) Message-ID: Date: Mon, 24 Jul 2006 13:54:42 +0530 From: "Arun Kumar" To: bwarren@qstreams.com Subject: Re: problems with mounting JFFS2 using CFI for AM29LV160MT on ppc8245 k2.4.x In-Reply-To: <1153498817.19682.149.camel@saruman.qstreams.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_71518_25325493.1153729482627" References: <1153498817.19682.149.camel@saruman.qstreams.net> Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_71518_25325493.1153729482627 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Ben , Thanks for your reply .It was indeed very comrehensive .I am able to procee= d further But still there is a bit problem . When I try to mknod physically viz mknod /dev/mtd0 ..... It says the node is readonly . Can you please point out the problem . I am attaching a dump of the console . Linux/PPC load: Uncompressing Linux...done. Now booting the kernel .... Memory BAT mapping: BAT2=3D64Mb, BAT3=3D0Mb, residual: 0Mb Linux version 2.4.20_mvl31 (aks@IIB-A1040829) (gcc version 3.3.1 (MontaVist= a 3.3 .1-3.0.10.0300532 2003-12-24)) #368 Mon Jul 24 13:02:13 IST 2006 DBAT0U =3D 0x800001fe DBAT0L =3D 0x8000002a DBAT1U =3D 0xf0001ffe DBAT1L =3D 0xf000002a DBAT2U =3D 0xc00007fe DBAT2L =3D 0x00000002 DBAT3U =3D 0xff8001fe DBAT3L =3D 0xff80002a ET4K Montavista Linux Test Platform Port by Agere Systems On node 0 totalpages: 16384 zone(0): 16384 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: OpenPIC Version 1.2 (1 CPUs and 14 IRQ sources) at fcf40000 Calibrating delay loop... 884.73 BogoMIPS Memory: 62084k available (1000k kernel code, 356k data, 76k init, 0k highmem) Dentry cache hash table entries: 8192 (order: 4, 65536 bytes) Inode cache hash table entries: 4096 (order: 3, 32768 bytes) Mount-cache hash table entries: 1024 (order: 1, 8192 bytes) Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes) Page-cache hash table entries: 16384 (order: 4, 65536 bytes) POSIX conformance testing by UNIFIX PCI: Probing PCI hardware Scanning bus 00 Found 00:00 [1057/0006] 000600 00 PCI:00:00.0 Resource 0 [00000000-ffffffff] is unassigned PCI:00:00.0 Resource 1 [00000000-00000fff] is unassigned PCI:00:00.0 Resource 2 [00000000-ffffffff] is unassigned Found 00:78 [8086/1013] 000200 00 PCI:00:0f.0 Resource 6 [00000000-0000ffff] is unassigned Found 00:f0 [0700/1107] 000600 00 Fixups for bus 00 Bus scan for 00 returning with max=3D00 PCI: bridge rsrc fc000000..fcc00000 (100), parent c011ddd4 PCI: bridge rsrc 80000000..fe000000 (200), parent c011ddf0 PCI:00:0f.0: Resource 0: fdfe0000-fdffffff (f=3D204) PCI:00:0f.0: Resource 2: fdfd0000-fdfdffff (f=3D204) PCI:00:0f.0: Resource 4: fcbfffc0-fcbfffff (f=3D101) PCI:00:1e.0: Resource 0: fc000000-fcffffff (f=3D120c) PCI:00:1e.0: Resource 2: fcbffe00-fcbffeff (f=3D101) Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket LSP Revision 1 Starting kswapd Disabling the Out Of Memory Killer JFFS2 version 2.1. (C) 2001, 2002 Red Hat, Inc., designed by Axis Communications AB. Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI en abled ttyS00 at 0xfcf04500 (irq =3D 13) is a ST16650 RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize AMD_FLASH_INIT called *aks * physmap flash device: 800000 at ff800000 virtual address Number of erase regions : 4 Primary Vendor Command Set: 0002 (AMD/Fujitsu Standard) Primary Algorithm Table at 0040 Alternative Vendor Command Set: 0000 (None) No Alternate Algorithm Table Vcc Minimum: 2.7 V Vcc Maximum: 3.6 V No Vpp line Typical byte/word write timeout: 128 =B5s Maximum byte/word write timeout: 256 =B5s Full buffer write not supported Typical block erase timeout: 1024 ms Maximum block erase timeout: 16384 ms Chip erase not supported Device size: 0x200000 bytes (2 MiB) Flash Device Interface description: 0x0002 - supports x8 and x16 via BYTE# with asynchronous interface Max. bytes in buffer write: 0x1 Number of Erase Block Regions: 4 Erase Region #0: BlockSize 0x4000 bytes, 1 blocks Erase Region #1: BlockSize 0x2000 bytes, 2 blocks Erase Region #2: BlockSize 0x8000 bytes, 1 blocks Erase Region #3: BlockSize 0x10000 bytes, 31 blocks Amd/Fujitsu Extended Query Table v1.3 at 0x0040 number of CFI chips: 4 in amdstd_setup 0: offset=3D0x0,size=3D0x10000,blocks=3D1 1: offset=3D0x10000,size=3D0x8000,blocks=3D2 2: offset=3D0x20000,size=3D0x20000,blocks=3D1 3: offset=3D0x40000,size=3D0x40000,blocks=3D31 4: offset=3D0x800000,size=3D0x10000,blocks=3D1 5: offset=3D0x810000,size=3D0x8000,blocks=3D2 6: offset=3D0x820000,size=3D0x20000,blocks=3D1 7: offset=3D0x840000,size=3D0x40000,blocks=3D31 8: offset=3D0x1000000,size=3D0x10000,blocks=3D1 9: offset=3D0x1010000,size=3D0x8000,blocks=3D2 10: offset=3D0x1020000,size=3D0x20000,blocks=3D1 11: offset=3D0x1040000,size=3D0x40000,blocks=3D31 12: offset=3D0x1800000,size=3D0x10000,blocks=3D1 13: offset=3D0x1810000,size=3D0x8000,blocks=3D2 14: offset=3D0x1820000,size=3D0x20000,blocks=3D1 15: offset=3D0x1840000,size=3D0x40000,blocks=3D31 cfi_cmdset_0002: Disabling fast programming due to code brokenness. aks Enabling * in MTD Partitioning <5>No RedBoot partition table detected in phys_mapped_flash Using physmap partition definition Creating 3 MTD partitions on "phys_mapped_flash": 0x00000000-0x00040000 : "agere-ets0" mtd: Giving out device 0 to agere-ets0 0x00040000-0x00080000 : "agere-ets1" mtd: Giving out device 1 to agere-ets1 0x00080000-0x0007fffe : "agere-ets2" mtd: partition "agere-ets2" doesn't end on an erase block -- force read-onl= y mtd: Giving out device 2 to agere-ets2 NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 4096 bind 8192) IP-Config: No network devices available. NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. /dev/console mapped to mkdev 5: minor: 1 RAMDISK: Compressed image found at block 0 Freeing initrd memory: 1247k freed VFS: Mounted root (ext2 filesystem) readonly. Freeing unused kernel memory: 76k init calling sbin/init init started: BusyBox v1.2.0 (2006.07.12-05:25+0000) multi-call binary init started: BusyBox v1.2.0 (2006.07.12-05:25+0000) multi-call binary Starting pid 8, console /dev/ttyS0: '/bin/ash' BusyBox v1.2.0 (2006.07.12-05:25+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. / $ mknod /dev/mtd0 c 90 0 mknod: /dev/mtd0: Read-only file system / $ also can you point out why it is trying to disable the fast programming ? Thanks, Arun On 7/21/06, Ben Warren wrote: > > Hi Arun, > > On Fri, 2006-07-21 at 20:26 +0530, Arun Kumar wrote: > > Hi , > > Can anyone help me in this naive problem ? > > > Then a naive answer is most fitting... Turns out that's my specialty. > > > # > > # Memory Technology Devices (MTD) > > # > > CONFIG_MTD=3Dy > > CONFIG_MTD_DEBUG=3Dy > > CONFIG_MTD_DEBUG_VERBOSE=3D2 > > CONFIG_MTD_PARTITIONS=3Dy > > CONFIG_MTD_CONCAT=3Dy > > CONFIG_MTD_REDBOOT_PARTS=3Dy > > CONFIG_MTD_CMDLINE_PARTS=3Dy > Probably get rid of REDBOOT if you're not using that bootloader > > > > # > > # User Modules And Translation Layers > > # > > # CONFIG_MTD_CHAR is not set > > # CONFIG_MTD_BLOCK is not set > > # CONFIG_MTD_BLOCK_RO is not set > > # CONFIG_FTL is not set > > # CONFIG_NFTL is not set > > # CONFIG_INFTL is not set > > > You need to enable MTD_CHAR to read/write and MTD_BLOCK to mount > > > Can any happy soul let me know :-- > > > > 1)How to mount jffs2 on this flash and also to test mtd->read/write > > routines ? > Start with the char drivers (/dev/mtd0 etc.). You'll need one for each > partition you want to experiment with. > How about creating the nodes manually? > > mknod /dev/mtd0 c 90 0 > mknod /dev/mtd1 c 90 2 etc. (minor # increments in 2s) > > Add a block device for each partition: > > mknod /dev/mtdblock0 b 31 0 > mknod /dev/mtdblock1 b 31 1 etc. > > Once you clean up #3 below, you should be able to read/write the char > devices using commands like 'cat', or write a simple user-space app > using "open, read, write", etc if you'd rather look at the actual binary > data. > > You can then experiment with mounting the JFFS2. I recommend booting to > an NFS file system then mounting the JFFS2 with something like: > > mount -t jffs2 /dev/mtdblock5 /mnt/temp (Use the correct partition) > > > > > 2) Is it ok not to see mtd0.. partions in /dev directory . > Pretty sure you'll need these > > > > 3 ) Where do I register the mtd partitions to get them noticed > > here ?? > Looks like your partitions are already being found, but are probably not > set up right. I don't know if this is a static definition in your board > init code or passed by command line from the bootloader, but it looks > like the values don't line up with your device: > > ********* > Using physmap partition definition > Creating 3 MTD partitions on "phys_mapped_flash": > 0x00000000-0x00040000 : "foo-ets0" > mtd: Giving out device 0 to foo-ets0 > 0x00040000-0x001e0000 : "foo-ets1" > mtd: partition "agere-ets1" doesn't end on an erase block -- force > read-only > mtd: Giving out device 1 to foo-ets1 > 0x001e0000-0x00200000 : "foo-ets2" > mtd: partition "foo-ets2" doesn't start on an erase block boundary -- > force read-only > ********* > -------------------------------------------------------------------------= - > Hopefully this helps you proceed a little bit. > > regards, > Ben > > --=20 Arun Kumar Singh Tech Lead. Agere India Bangalore ------=_Part_71518_25325493.1153729482627 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Ben ,

Thanks for your reply .It was indeed very comrehensive .I a= m able to proceed further But still there is a bit problem .

When I = try to mknod physically viz mknod /dev/mtd0 .....

It says the node i= s readonly .

Can you please point out the problem . I am attaching a dump of the= console .


Linux/PPC load:
Uncompressing= Linux...done.
Now booting the kernel ....<= /span>
Memory BAT mapping: BAT2=3D64Mb, BA= T3=3D0Mb, residual: 0Mb
Linux version 2.4.20_mvl31 ( aks@IIB-A1040829) (gcc version 3.3.1 (MontaVista 3.3
.1-3.0.10.0300532 2003-12-24)) #368 Mon Jul 24 13:02:13 IST 2006
DBAT0U =3D 0x800001fe
DBAT0L = =3D 0x8000002a
DBAT1U =3D 0xf0001ffe=
DBAT1L =3D 0xf000002a
DBAT2U =3D 0xc00007fe
DBAT2L = =3D 0x00000002
DBAT3U =3D 0xff8001fe=
DBAT3L =3D 0xff80002a
ET4K Montavista Linux Test Platform
Port by Agere Systems
On node= 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line:
OpenPIC = Version=20 1.2 (1 CPUs and 14 IRQ sources) at fcf40000
Calibrating delay loop... 884.73 BogoMIPS
Memory: 62084k available (1000k kernel code, 356k data, 76k init, 0k highme= m)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
Sca= nning bus 00
Found 00:00 [1057/0006] 0006= 00 00
PCI:00:00.0 Resource 0 [0000= 0000-ffffffff] is unassigned
PCI:00:00.0 Resource 1 [0000= 0000-00000fff] is unassigned
PCI:00:00.0 Resource 2 [0000= 0000-ffffffff] is unassigned
Found 00:78 [8086/1013] 0002= 00 00
PCI:00:0f.0 Resource 6 [0000= 0000-0000ffff] is unassigned
Found 00:f0 [0700/1107] 0006= 00 00
Fixups for bus 00
Bus scan for 00 returning with max=3D00
PCI: bridge rsrc fc000000..fcc00000 (100), parent c011= ddd4
PCI: bridge rsrc 80000000..fe000000 (200), parent c011= ddf0
PCI:00:0f.0: Resource 0: fdfe0000-fdffffff (f=3D204)
PCI:00:0f.0: Resource 2: fdfd0000-fdfdffff (f=3D204)
PCI:00:0f.0: Resource 4: fcbfffc0-fcbfffff (f=3D101)
PCI:00:1e.0: Resource 0: fc000000-fcffffff (f=3D120c)<= /span>
PCI:00:1e.0: Resource 2: fcbffe00-fcbffeff (f=3D101)
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039

Initializing RT netlink socket
Starting kswap= d
Disabling the Out Of Memory = Killer
JFFS2 version 2.1. (C) 2001,= 2002 Red Hat, Inc., designed by Axis Communications
 AB.
Serial driver version 5.05c (2001-07-08) with MANY_POR= TS SHARE_IRQ SERIAL_PCI en
abled
ttyS00 at 0xfcf04500 (irq =3D 13) is a ST16650
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize

 AMD_FLASH_INIT called  *aks *
physmap flash device: 800000 at ff800000 virtual addre= ss Number of erase regions
: 4
Primary Vendor Command Set: 0002 (AMD/Fujitsu Standard)
Primary Algorithm Table at 0040
Alternative Vendor Command Set: 0000 (None)
No Alternate Algorithm Table
Vcc Minimum: 2.7 V
Vcc Maximu= m:=20 3.6 V
No Vpp line
Typical byte/word write timeout: 128 =B5s
Maximum byte/word write timeout: 256 =B5s
Full buffer write not supported
Typical block erase timeout: 1024 ms
Maximum block erase timeout: 16384 ms
Chip erase not supported
Device size: 0x200000 bytes (2 MiB)

Flash Device Interface description: 0x0002
  - supports x8 and x16 via BYTE# with asynchronous interface Max. bytes in buffer write: 0x1
Number of Erase Block Regions: 4
  Erase Region #0: BlockSize 0x4000 bytes, 1 blocks
  Erase Region #1: BlockSize 0x2000 bytes, 2 blocks
  Erase Region #2: BlockSize 0x8000 bytes, 1 blocks
  Erase Region #3: BlockSize 0x10000 bytes, 31 blocks
 Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 4

 in amdstd_setup 0: offset=3D0x0,size=3D0x10000,blocks=3D1
1: offset=3D0x10000,size=3D0x8000,blocks=3D2
2: offset=3D0x20000,size=3D0x20000,blocks=3D1

3: offset=3D0x40000,size=3D0x40000,blocks=3D31

4: offset=3D0x800000,size=3D0x10000,blocks=3D1

5: offset=3D0x810000,size=3D0x8000,blocks=3D2

6: offset=3D0x820000,size=3D0x20000,blocks=3D1

7: offset=3D0x840000,size=3D0x40000,blocks=3D31
8: offset=3D0x1000000,size=3D0x10000,blocks=3D1
9: offset=3D0x1010000,size=3D0x8000,blocks=3D2
10: offset=3D0x1020000,size=3D0x20000,blocks=3D1
<= span style=3D"font-style: italic; font-family: times new roman,serif; color= : rgb(51, 0, 153);"> 11: offset=3D0x1040000,size=3D0x40000,blocks=3D31
= 12: offset=3D0x1800000,size=3D0x10000,blocks=3D1
<= span style=3D"font-style: italic; font-family: times new roman,serif; color= : rgb(51, 0, 153);"> 13: offset=3D0x1810000,size=3D0x8000,blocks=3D2
14: offset=3D0x1820000,size=3D0x20000,blocks=3D1
<= span style=3D"font-style: italic; font-family: times new roman,serif; color= : rgb(51, 0, 153);"> 15: offset=3D0x1840000,size=3D0x40000,blocks=3D31
= cfi_cmdset_0002: Disabling fast programming due to code brokenness. aks Ena= bling
*

 in MTD Partitioning <5>No RedBoot partition table detected in p= hys_mapped_flash

Using physmap partition definition
Creating 3 MTD partitions on "phys_mapped_flash&q= uot;:
0x00000000-0x00040000 : "agere-ets0"<= br style=3D"font-style: italic; font-family: times new roman,serif; color: = rgb(51, 0, 153);"> mtd: Giving out device 0 to agere-ets0
0x00040000-0x00080000 : "agere-ets1"<= br style=3D"font-style: italic; font-family: times new roman,serif; color: = rgb(51, 0, 153);"> mtd: Giving out device 1 to agere-ets1
0x00080000-0x0007fffe : "agere-ets2"<= br style=3D"font-style: italic; font-family: times new roman,serif; color: = rgb(51, 0, 153);"> mtd: partition "agere-ets2" doesn't end on a= n erase block -- force read-only
mtd: Giving out device 2 to agere-ets2
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 819= 2)
IP-Config: No network devices available.
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

/dev/console mapped to mkdev 5: minor: 1
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 1247k freed
VFS: Mounted root (ext2 filesystem) readonly. Freeing unused kernel memory: 76k init
calling sbin/init
init started:  BusyBox v1.2.0 (2006.07.12-05:25+0000) multi-call binar= y
init started:  BusyBox v1.2.0 (2006.07.12-05:25+0000) multi-call binar= y
Starting pid 8, console /dev/ttyS0: '/bin/ash'

BusyBox v1.2.0 (2006.07.12-05:25+00= 00) Built-in shell (ash)
Enter 'help' for a list of b= uilt-in commands.

/ $ mknod /dev/mtd0 c 90 0
mk= nod: /dev/mtd0: Read-only file system
/ $


also can you point out why it is trying to disable the fast program= ming ?


Thanks,
Arun


On 7/21/06, Ben Warren < bwarren@qstreams.com> wrote:
Hi Arun,

On Fri, 2006-07-21 at 20:26 +0530,= Arun Kumar wrote:
> Hi ,
> Can anyone help me in this naive problem ?
>Then a naive answer is most fitting...  Turns out that's my spec= ialty.

> #
> # Memory Technology Devices (MTD)
> #> CONFIG_MTD=3Dy
> CONFIG_MTD_DEBUG=3Dy
> CONFIG_MTD_DEBUG_VERBOSE=3D2
> = CONFIG_MTD_PARTITIONS=3Dy
> CONFIG_MTD_CONCAT=3Dy
> CONFIG_MTD_= REDBOOT_PARTS=3Dy
> CONFIG_MTD_CMDLINE_PARTS=3Dy
Probably get rid = of REDBOOT if you're not using that bootloader
>
> #
> # User Modules And Translation Layers
> #<= br>> # CONFIG_MTD_CHAR is not set
> # CONFIG_MTD_BLOCK is not set<= br>> # CONFIG_MTD_BLOCK_RO is not set
> # CONFIG_FTL is not set
> # CONFIG_NFTL is not set
> # CONFIG_INFTL is not set
>=
You need to enable MTD_CHAR to read/write and MTD_BLOCK to mount
> Can any happy soul let me know  :--
>
> 1)How t= o mount jffs2 on this flash and also to test mtd->read/write
> routines ?
Start with the char drivers (/dev/mtd0 etc.). &= nbsp;You'll need one for each
partition you want to experiment with.
= How about creating the nodes manually?

mknod /dev/mtd0 c 90 0
mkn= od /dev/mtd1 c 90 2 etc. (minor # increments in 2s)

Add a block device for each partition:

mknod /dev/mtdblock0 = b 31 0
mknod /dev/mtdblock1 b 31 1 etc.

Once you clean up #3 belo= w, you should be able to read/write the char
devices using commands like= 'cat', or write a simple user-space app
using "open, read, write", etc if you'd rather look at the ac= tual binary
data.

You can then experiment with mounting the JFFS2= .  I recommend booting to
an NFS file system then mounting the= JFFS2 with something like:

mount -t jffs2 /dev/mtdblock5 /mnt/temp    (Use= the correct partition)

>
> 2) Is it ok not to see mtd0.. p= artions in /dev directory .
Pretty sure you'll need these
>
>= ; 3 ) Where do I register the mtd partitions to get them noticed
> here ??
Looks like your partitions are already being found, but= are probably not
set up right.  I don't know if this is a sta= tic definition in your board
init code or passed by command line from th= e bootloader, but it looks
like the values don't line up with your device:

*********
Usi= ng physmap partition definition
Creating 3 MTD partitions on "phys_= mapped_flash":
0x00000000-0x00040000 : "foo-ets0"
mtd: Giving out device 0 to foo-ets0
0x00040000-0x001e0000 : "foo-e= ts1"
mtd: partition "agere-ets1" doesn't end on an erase = block -- force
read-only
mtd: Giving out device 1 to foo-ets1
0x001e0000-0x00200000 : "foo-ets2"
mtd: partition "foo-et= s2" doesn't start on an erase block boundary --
force read-only
= *********
--------------------------------------------------------------= ------------
Hopefully this helps you proceed a little bit.

regards,
Ben



--
Arun Kumar Singh<= br>Tech Lead.
Agere India
Bangalore ------=_Part_71518_25325493.1153729482627--