MTD driver for MLC NAND chips

z l zql at
Wed Oct 24 10:48:05 EDT 2007

--- z l <zql at> wrote:

> Does current MTD support MLC NAND chips?  I tried
> the
> Samsung K9LAG08U0M (2GiB) on our board with Linux
> kernel but got a invalid pointer 0
> reference
> in the nand_scan function.  The same kernel works
> fine
> without any problem when using Samsung K9F1G08U0M
> (128MiB).  Is there any thing special that must be
> done in the NAND driver for MLC chip?
> Thanks in advance

The interesting thing is the bug would go away if the
MTD debug is enabled.  The debug level doesn't matter

Below is the log when the kernel panics,

................................... done, booting the
Linux version (root at GESBC) (gcc version 4.1.2
20061115 (prerelease) (De
bian 4.1.1-21)) #7 Tue Oct 23 00:54:56 UTC 2007
CPU: ARM920T [41129200] revision 0 (ARMv4T),
Machine: Cirrus Logic EDB9302 Evaluation Board
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte
lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte
lines, 8 sets
Built 1 zonelists.  Total pages: 16144
Kernel command line: console=ttyAM0 root=/dev/ram
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768
Inode-cache hash table entries: 4096 (order: 2, 16384
Memory: 8MB 8MB 8MB 8MB 8MB 8MB 8MB 8MB = 64MB total
Memory: 58744KB available (2740K code, 214K data, 108K
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
ep93xx: PLL1 running at 400 MHz, PLL2 at 192 MHz
ep93xx: FCLK 200 MHz, HCLK 100 MHz, PCLK 50 MHz
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0,
4096 bytes)
TCP established hash table entries: 2048 (order: 3,
40960 bytes)
TCP bind hash table entries: 2048 (order: 3, 40960
TCP: Hash tables configured (established 2048 bind
TCP reno registered
checking if image is isn't (no cpio
magic); looks like an initrd
Freeing initrd memory: 3072K
NetWinder Floating Point Emulator V0.97 (extended
JFFS2 version 2.2. (NAND) AC 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered (default)
ep93xx_wdt: EP93XX watchdog, driver version 0.3
Serial: AMBA driver $Revision: 1.41 $
apb:uart1: ttyAM0 at MMIO 0x808c0000 (irq = 52) is a
apb:uart2: ttyAM1 at MMIO 0x808d0000 (irq = 54) is a
apb:uart3: ttyAM2 at MMIO 0x808e0000 (irq = 55) is a
RAMDISK driver initialized: 16 RAM disks of 12288K
size 1024 blocksize
loop: module loaded
nbd: registered device at major 43
ep93xx-eth version 0.1 loading
eth0: ep93xx on-chip ethernet, IRQ 39,
drivers/net/usb/rtl8150.c: rtl8150 based usb-ethernet
driver v0.6.2 (2004/08/27)
usbcore: registered new interface driver rtl8150
physmap platform flash device: 01000000 at 60000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Searching for RedBoot partition table in
physmap-flash.0 at offset 0xfe0000
5 RedBoot partitions found on MTD device
Creating 5 MTD partitions on "physmap-flash.0":
0x00000000-0x00040000 : "RedBoot"
0x00040000-0x00200000 : "ramdisk"
0x00200000-0x00360000 : "zImage"
0x00fc0000-0x00fc1000 : "RedBoot config"
mtd: partition "RedBoot config" doesn't end on an
erase block -- force read-only
0x00fe0000-0x01000000 : "FIS directory"
Searching for NAND flash...
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd5
(Samsung NAND 2GiB 3,3V 8-bit)
Scanning device for bad blocks
kernel BUG at drivers/mtd/nand/nand_base.c:174!
Unable to handle kernel NULL pointer dereference at
virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 805 [#1]
Modules linked in:
CPU: 0    Not tainted  ( #7)
PC is at __bug+0x20/0x2c
LR is at 0xc02d5554
pc : [<c0027cc4>]    lr : [<c02d5554>]    psr:
sp : c03c5e04  ip : c02d5554  fp : c03c5e10
r10: c128e970  r9 : 00000000  r8 : 00040000
r7 : c128ea28  r6 : 00000000  r5 : 04028800  r4 :
r3 : 00000000  r2 : 00000001  r1 : 00000001  r0 :
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment
Control: c000717f  Table: 00004000  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc03c4258)
Stack: (0xc03c5e04 to 0xc03c6000)
5e00:          c03c5e20 c03c5e14 c0173110 c0027cb4
c03c5e68 c03c5e24 c0175424
5e20: c01730e0 00000040 00000000 c03c5e8c 00000040
00000040 c12ff080 0000007f
5e40: 00040000 00000000 c128e970 00000002 c128ea28
00000000 c02e0c7c c03c5ed4
5e60: c03c5e6c c0175f58 c017526c c03c5e78 c12ff080
0000402a 00000001 00000000
5e80: 00040000 00000000 00000002 00000000 c03c5ebc
00000000 00000040 00000040
5ea0: 00000000 00000000 c12ff080 c128ea28 c128e970
00000000 c02fd9dc c03c4000
5ec0: 00000000 00000000 c03c5f24 c03c5ed8 c0176d40
c0175d9c c0173144 c02e0c7c
5ee0: 00000000 00000000 c007df54 c007dedc c03c5efc
c003dd68 c0306bc0 c128ea28
5f00: c128e970 00000000 c02fd9dc c03c4000 00000000
00000000 c03c5f34 c03c5f28
5f20: c01771d4 c0176cb8 c03c5f50 c03c5f38 c01734fc
c0177120 c128e970 00000001
5f40: c8056000 c03c5f68 c03c5f54 c0174944 c0173124
00000001 c128ea28 c03c5f8c
5f60: c03c5f6c c00196ec c01748f4 00000000 c0020404
00000000 c001f160 00000000
5f80: c03c5ff4 c03c5f90 c0008904 c00195d4 00000000
00000000 00000000 00000000
5fa0: 00000000 c03c5fb0 c0023f24 c0039e2c 00000000
00000000 c000884c c004029c
5fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
5fe0: 00000000 00000000 00000000 c03c5ff8 c004029c
c000885c c03c5ff8 c03c5ff8
[<c0027ca4>] (__bug+0x0/0x2c) from [<c0173110>]
[<c01730d0>] (nand_select_chip+0x0/0x44) from
[<c0175424>] (nand_read_oob+0x1c8/
[<c017525c>] (nand_read_oob+0x0/0x314) from
[<c0175f58>] (create_bbt+0x1cc/0x2c0
[<c0175d8c>] (create_bbt+0x0/0x2c0) from [<c0176d40>]
[<c0176ca8>] (nand_scan_bbt+0x0/0x468) from
[<c01771d4>] (nand_default_bbt+0xc4/
[<c0177110>] (nand_default_bbt+0x0/0xe4) from
[<c01734fc>] (nand_scan_tail+0x3e8
[<c0173114>] (nand_scan_tail+0x0/0x48c) from
[<c0174944>] (nand_scan+0x60/0x6c)
 r6:c8056000 r5:00000001 r4:c128e970
[<c01748e4>] (nand_scan+0x0/0x6c) from [<c00196ec>]
 r5:c128ea28 r4:00000001
[<c00195c4>] (gesbc_nand_init+0x0/0x254) from
[<c0008904>] (kernel_init+0xb8/0x2
 r7:00000000 r6:c001f160 r5:00000000 r4:c0020404
[<c000884c>] (kernel_init+0x0/0x280) from [<c004029c>]
Code: e1a01000 e59f000c eb00581f e3a03000 (e5833000)
Kernel panic - not syncing: Attempted to kill init!

More information about the linux-mtd mailing list