DOC 2000 problems on PowerPC

Felix Radensky felix at
Sun May 13 08:57:11 EDT 2001

Hi, all

I'm trying to utilize DOC 2000 (MD2202-D96) on our custom
board based on 405GP PowerPC processor. I'm using the
latest cvs mtd drivers and 2.4.2 kernel from Monta Vista

The DOC size is 96M. It's mapped to the physical address
0xf6000000.  The kernel properly detects the chip:

M-Systems DiskOnChip driver. (C) 1999 Machine Vision Holdings, Inc.
Using configured probe address 0xf6000000
DiskOnChip 2000 found at address 0xF6000000
Flash chip found: Manufacturer ID: 98, Chip ID: 75 (Toshiba
3 flash chips found. Total DiskOnChip size: 96 Mb

The contents of /proc/mtd:

dev:    size   erasesize  name
mtd0: 06000000 00004000 "DiskOnChip 2000"

As you see, the erase size is 16k. After commenting out the 8k erase
size check
in nftl_format.c, I was able to format /dev/mtd0. Here is the output of

NFTL Media Header found at offset 0x00000000:
NumEraseUnits:    6144
FirstPhysicalEUN: 0
Formatted Size:   100597760
UnitSizeFactor:   0xff
Second NFTL Media Header found at offset 0x00004000
EraseMark not present in unit 0: 693c
Unit 0 is free
EraseMark not present in unit 1: 693c
Unit 1 is free

However, I cannot use fdisk to partition /dev/nftla, as nftl driver
reports wrong device geometry:

Command (m for help): p

Disk /dev/nftla: 1 heads, 1 sectors, 96 cylinders
Units = cylinders of 1 * 512 bytes

I suspect that the problem is in find_boot_record() routine of
The following line seems suspicious on big-endian machine:

nftl->numvunits = le32_to_cpu(mh->FormattedSize) / nftl->EraseSize;

so, I've changed it to

nftl->numvunits = mh->FormattedSize / nftl->EraseSize;

Now I get the following error at boot time:

Cannot calculate an NFTL geometry to match size of 0x2ff80.
Using C:1023 H:16 S:12 (== 0x2ff40 sects)
NFTL_setup: cylinders = 1023, heads = 16, sectors = 12
Partition check:
   nftla: unknown partition table

I went on and tried to create a single ext2 partition spanning the
entire  device. But
fdisk complained:

Calling ioctl() to re-read partition table.
    nftla: nftla1
    nftla:end_request: I/O error, dev 5d:00 (unknown), sector 0
    unable to read partition table

Please help.



More information about the linux-mtd mailing list