public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Strange problem related to writing to flash
@ 2002-06-04 19:21 Justin Wojdacki
  2002-06-04 22:29 ` Jim Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: Justin Wojdacki @ 2002-06-04 19:21 UTC (permalink / raw)
  To: linux-mtd

Okay, so here's the problem I'm running into:

On a hard reset, the board I'm working with always comes up fine.
Linux boots, mounts the root filesystem (JFFS2) and all that. It looks
happy. 

If I don't modify the filesystem, Linux boots fine on a soft reset. 

If I modify the filesystem in some way, Linux fails to boot properly
on a soft reset. What happens is the bootstrap loads the kernel from
the JFFS2 partition and boots the kernel. When the kernel probes the
flash, it sees 2 8-bit wide devices instead of the actual 1 16-bit
wide device. JFFS2 then get's really unhappy because it's attempts to
access the flash device fail. 

here are relevant bits of dmesg

First, on success:
AD6489 Residential Gateway flash probe(0x1fc00000,2097152,2): 200000
at 1fc00000
Analog Devices AD6489 Residential Gateway, Rev 2.0: Found 1 x16
devices at 0x0 in 16-bit mode
Found: ST M29W160DB
number of JEDEC chips: 1
0: offset=0x0,size=0x4000,blocks=1
1: offset=0x4000,size=0x2000,blocks=2
2: offset=0x8000,size=0x8000,blocks=1
3: offset=0x10000,size=0x10000,blocks=31
Creating 4 MTD partitions on "Analog Devices AD6489 Residential
Gateway, Rev 2.0":
0x00000000-0x00004000 : "Bootstrap 1"
0x00004000-0x00008000 : "Configuration"
0x00008000-0x00020000 : "Bootstrap 2"
0x00020000-0x00200000 : "Root"

Next, on failure:
AD6489 Residential Gateway flash probe(0x1fc00000,2097152,2): 200000
at 1fc00000
Analog Devices AD6489 Residential Gateway, Rev 2.0: Found 2 x8 devices
at 0x0 in 16-bit mode
Found: ST M29W160DB
number of JEDEC chips: 1
0: offset=0x0,size=0x8000,blocks=1
1: offset=0x8000,size=0x4000,blocks=2
2: offset=0x10000,size=0x10000,blocks=1
3: offset=0x20000,size=0x20000,blocks=31
Creating 4 MTD partitions on "Analog Devices AD6489 Residential
Gateway, Rev 2.0":
0x00000000-0x00004000 : "Bootstrap 1"
0x00004000-0x00008000 : "Configuration"
0x00008000-0x00020000 : "Bootstrap 2"
0x00020000-0x00200000 : "Root"
...
jffs2_scan_empty(): Empty block at 0x0000ffc0 ends at 0x00010000 (with
0x1985e002)! Marking dirty
(message repeats for successive 128KB blocks)
CLEANMARKER node found at 0x00150000, not first node in block
(0x00140000)
jffs2_scan_empty(): Empty block at 0x0016000c ends at 0x00170000 (with
0x19852003)! Marking dirty
CLEANMARKER node found at 0x00170000, not first node in block
(0x00160000)
jffs2_scan_empty(): Empty block at 0x0018000c ends at 0x00190000 (with
0x19852003)! Marking dirty
CLEANMARKER node found at 0x00190000, not first node in block
(0x00180000)
jffs2_scan_empty(): Empty block at 0x001a000c ends at 0x001b0000 (with
0x19852003)! Marking dirty
CLEANMARKER node found at 0x001b0000, not first node in block
(0x001a0000)
jffs2_scan_empty(): Empty block at 0x001c000c ends at 0x001d0000 (with
0x19852003)! Marking dirty
CLEANMARKER node found at 0x001d0000, not first node in block
(0x001c0000)
VFS: Mounted root (jffs2 filesystem).
Freeing unused kernel memory: 40k freed
Waiting for chip to read, status = 7
Waiting for chip to read, status = 7

Any pointers on what to look for here? 

-- 
-------------------------------------------------
Justin Wojdacki        
justin.wojdacki@analog.com         (408) 350-5032
Communications Processors Group -- Analog Devices

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

* Re: Strange problem related to writing to flash
  2002-06-04 19:21 Strange problem related to writing to flash Justin Wojdacki
@ 2002-06-04 22:29 ` Jim Thompson
  2002-06-04 23:41   ` Justin Wojdacki
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Thompson @ 2002-06-04 22:29 UTC (permalink / raw)
  To: justin.wojdacki; +Cc: linux-mtd

I've been seeing similar things (well, worse, the kernel (yes the
kernel) crashes somewhere in the bootloader after a soft reset) on
PowerPC.  If the root filesystem is mounted read-only, things are just
peachy.

In your case, I'd bet that the flash isn't in 'read' mode.  You
probably want to assure that the flash is in 'read' mode before you
soft reset the CPU.

I haven't figured out whats wrong with mine yet.

Justin Wojdacki writes:
> 
> Okay, so here's the problem I'm running into:
> 
> On a hard reset, the board I'm working with always comes up fine.
> Linux boots, mounts the root filesystem (JFFS2) and all that. It looks
> happy. 
> 
> If I don't modify the filesystem, Linux boots fine on a soft reset. 
> 
> If I modify the filesystem in some way, Linux fails to boot properly
> on a soft reset. What happens is the bootstrap loads the kernel from
> the JFFS2 partition and boots the kernel. When the kernel probes the
> flash, it sees 2 8-bit wide devices instead of the actual 1 16-bit
> wide device. JFFS2 then get's really unhappy because it's attempts to
> access the flash device fail. 
> 
> here are relevant bits of dmesg
> 
> First, on success:
> AD6489 Residential Gateway flash probe(0x1fc00000,2097152,2): 200000
> at 1fc00000
> Analog Devices AD6489 Residential Gateway, Rev 2.0: Found 1 x16
> devices at 0x0 in 16-bit mode
> Found: ST M29W160DB
> number of JEDEC chips: 1
> 0: offset=0x0,size=0x4000,blocks=1
> 1: offset=0x4000,size=0x2000,blocks=2
> 2: offset=0x8000,size=0x8000,blocks=1
> 3: offset=0x10000,size=0x10000,blocks=31
> Creating 4 MTD partitions on "Analog Devices AD6489 Residential
> Gateway, Rev 2.0":
> 0x00000000-0x00004000 : "Bootstrap 1"
> 0x00004000-0x00008000 : "Configuration"
> 0x00008000-0x00020000 : "Bootstrap 2"
> 0x00020000-0x00200000 : "Root"
> 
> Next, on failure:
> AD6489 Residential Gateway flash probe(0x1fc00000,2097152,2): 200000
> at 1fc00000
> Analog Devices AD6489 Residential Gateway, Rev 2.0: Found 2 x8 devices
> at 0x0 in 16-bit mode
> Found: ST M29W160DB
> number of JEDEC chips: 1
> 0: offset=0x0,size=0x8000,blocks=1
> 1: offset=0x8000,size=0x4000,blocks=2
> 2: offset=0x10000,size=0x10000,blocks=1
> 3: offset=0x20000,size=0x20000,blocks=31
> Creating 4 MTD partitions on "Analog Devices AD6489 Residential
> Gateway, Rev 2.0":
> 0x00000000-0x00004000 : "Bootstrap 1"
> 0x00004000-0x00008000 : "Configuration"
> 0x00008000-0x00020000 : "Bootstrap 2"
> 0x00020000-0x00200000 : "Root"
> ...
> jffs2_scan_empty(): Empty block at 0x0000ffc0 ends at 0x00010000 (with
> 0x1985e002)! Marking dirty
> (message repeats for successive 128KB blocks)
> CLEANMARKER node found at 0x00150000, not first node in block
> (0x00140000)
> jffs2_scan_empty(): Empty block at 0x0016000c ends at 0x00170000 (with
> 0x19852003)! Marking dirty
> CLEANMARKER node found at 0x00170000, not first node in block
> (0x00160000)
> jffs2_scan_empty(): Empty block at 0x0018000c ends at 0x00190000 (with
> 0x19852003)! Marking dirty
> CLEANMARKER node found at 0x00190000, not first node in block
> (0x00180000)
> jffs2_scan_empty(): Empty block at 0x001a000c ends at 0x001b0000 (with
> 0x19852003)! Marking dirty
> CLEANMARKER node found at 0x001b0000, not first node in block
> (0x001a0000)
> jffs2_scan_empty(): Empty block at 0x001c000c ends at 0x001d0000 (with
> 0x19852003)! Marking dirty
> CLEANMARKER node found at 0x001d0000, not first node in block
> (0x001c0000)
> VFS: Mounted root (jffs2 filesystem).
> Freeing unused kernel memory: 40k freed
> Waiting for chip to read, status = 7
> Waiting for chip to read, status = 7
> 
> Any pointers on what to look for here? 
> 
> -- 
> -------------------------------------------------
> Justin Wojdacki        
> justin.wojdacki@analog.com         (408) 350-5032
> Communications Processors Group -- Analog Devices
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

-- 
"Perl is basically TECO-99."  ---Barry Shein

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

* Re: Strange problem related to writing to flash
  2002-06-04 22:29 ` Jim Thompson
@ 2002-06-04 23:41   ` Justin Wojdacki
  2002-06-05 20:58     ` Justin Wojdacki
  0 siblings, 1 reply; 4+ messages in thread
From: Justin Wojdacki @ 2002-06-04 23:41 UTC (permalink / raw)
  To: Jim Thompson; +Cc: linux-mtd

Jim Thompson wrote:
> 
> I've been seeing similar things (well, worse, the kernel (yes the
> kernel) crashes somewhere in the bootloader after a soft reset) on
> PowerPC.  If the root filesystem is mounted read-only, things are just
> peachy.
> 
> In your case, I'd bet that the flash isn't in 'read' mode.  You
> probably want to assure that the flash is in 'read' mode before you
> soft reset the CPU.
> 
> I haven't figured out whats wrong with mine yet.
> 

That's along the lines of what a few of us discussed here, except for
one issue: 

The bootstrap isn't part of the kernel. So the bootstrap has no
problem running, loading the kernel from flash, and then executing the
kernel. Seems to me that that wouldn't be possible if the flash wasn't
in read mode (unless I'm missing something). The bootstrap being used
has to ID the flash device itself, so if it can ID it and read from it
fine, the kernel should be able to also right? 

-- 
-------------------------------------------------
Justin Wojdacki        
justin.wojdacki@analog.com         (408) 350-5032
Communications Processors Group -- Analog Devices

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

* Re: Strange problem related to writing to flash
  2002-06-04 23:41   ` Justin Wojdacki
@ 2002-06-05 20:58     ` Justin Wojdacki
  0 siblings, 0 replies; 4+ messages in thread
From: Justin Wojdacki @ 2002-06-05 20:58 UTC (permalink / raw)
  To: linux-mtd

Justin Wojdacki wrote:
> 
> That's along the lines of what a few of us discussed here, except for
> one issue:
> 
> The bootstrap isn't part of the kernel. So the bootstrap has no
> problem running, loading the kernel from flash, and then executing the
> kernel. Seems to me that that wouldn't be possible if the flash wasn't
> in read mode (unless I'm missing something). The bootstrap being used
> has to ID the flash device itself, so if it can ID it and read from it
> fine, the kernel should be able to also right?
> 

Some more information:

The flash is clearly in the read state when the kernel boots. 

It looks like the first few passes of cfi_check_qry_or_id() don't
actually get the manufacturer or device ID when this fails. It's not
until the case where interleave = 2 and device_type = 1 that I see a
correct ID happening. I'll post more information when I have more
details into what's going on here. 

-- 
-------------------------------------------------
Justin Wojdacki        
justin.wojdacki@analog.com         (408) 350-5032
Communications Processors Group -- Analog Devices

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

end of thread, other threads:[~2002-06-05 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-04 19:21 Strange problem related to writing to flash Justin Wojdacki
2002-06-04 22:29 ` Jim Thompson
2002-06-04 23:41   ` Justin Wojdacki
2002-06-05 20:58     ` Justin Wojdacki

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