NAND bad blocks

From Openmoko

(Difference between revisions)
Jump to: navigation, search
 
m (how to deal with NAND flash)
Line 9: Line 9:
 
The solution is split into various pieces
 
The solution is split into various pieces
  
=== Bootloader ===
+
=== Boot loader ===
  
The bootloader itself contains a small first-stage bootloader for the [[Steppingstone]].  
+
The boot loader itself contains a small first-stage boot loader for the [[Steppingstone]].  
  
 
This code (which Harald wrote in ARM assembly) needs to be altered to detect and skip bad blocks.  At this time, the bootloader could itself extend over bad blocks.  However, how do we first flash the bootloader into NAND? The JTAG flashing program has no support for detecting bad blocks.
 
This code (which Harald wrote in ARM assembly) needs to be altered to detect and skip bad blocks.  At this time, the bootloader could itself extend over bad blocks.  However, how do we first flash the bootloader into NAND? The JTAG flashing program has no support for detecting bad blocks.
Line 23: Line 23:
 
command.  Those two variants (as opposed to their non-".e"-postfixed versions) simply skip bad blocks
 
command.  Those two variants (as opposed to their non-".e"-postfixed versions) simply skip bad blocks
  
=== Root Filesystem ==
+
=== Root Filesystem ===
  
 
The root filesystem uses JFFS2, which is already bad block tolerant.  It, too, has to be written using the
 
The root filesystem uses JFFS2, which is already bad block tolerant.  It, too, has to be written using the
 
  nand write.e
 
  nand write.e
 
command in [[u-boot]]
 
command in [[u-boot]]

Revision as of 18:36, 8 January 2007

Contents

Problem

NAND memory apparently gets shipped with blocks that are already bad. The vendor just marks those blocks as bad, thus resulting in higher yield and lower per-unit cost.

There is some number of blocks at the beginning which are guaranteed to be good. That number is currently unknown for our NAND chip.

Solution

The solution is split into various pieces

Boot loader

The boot loader itself contains a small first-stage boot loader for the Steppingstone.

This code (which Harald wrote in ARM assembly) needs to be altered to detect and skip bad blocks. At this time, the bootloader could itself extend over bad blocks. However, how do we first flash the bootloader into NAND? The JTAG flashing program has no support for detecting bad blocks.

Kernel

The kernel is contained in its own partiton QT2410#NAND. We have to flash it using the

nand write.e

command, and read it later again via

nand read.e

command. Those two variants (as opposed to their non-".e"-postfixed versions) simply skip bad blocks

Root Filesystem

The root filesystem uses JFFS2, which is already bad block tolerant. It, too, has to be written using the

nand write.e

command in u-boot

Personal tools

Problem

NAND memory apparently gets shipped with blocks that are already bad. The vendor just marks those blocks as bad, thus resulting in higher yield and lower per-unit cost.

There is some number of blocks at the beginning which are guaranteed to be good. That number is currently unknown for our NAND chip.

Solution

The solution is split into various pieces

Bootloader

The bootloader itself contains a small first-stage bootloader for the Steppingstone.

This code (which Harald wrote in ARM assembly) needs to be altered to detect and skip bad blocks. At this time, the bootloader could itself extend over bad blocks. However, how do we first flash the bootloader into NAND? The JTAG flashing program has no support for detecting bad blocks.

Kernel

The kernel is contained in its own partiton QT2410#NAND. We have to flash it using the

nand write.e

command, and read it later again via

nand read.e

command. Those two variants (as opposed to their non-".e"-postfixed versions) simply skip bad blocks

= Root Filesystem

The root filesystem uses JFFS2, which is already bad block tolerant. It, too, has to be written using the

nand write.e

command in u-boot