Pradeep Sriram wrote:
Great work Dirk! Does this nand driver work with 512MB nand parts which
use 2k page sizes?
Seems that this will become my most often used statement in this
thread: Don't know. ;)
I only can test it on Davinci EVM with 64MB & 512byte pages. Don't
have a board with NAND device you mentioned above. But in theory I
think it should. Sander Huijsen mentioned that he tested on
* ST NAND512R3A (512 Mbit, page size: 512+16 bytes, block size: 16K+512
bytes)
* Samsung K9F1208R0C-JIB0 (512 Mbit, page size: 512+16 bytes, block
size: 16K+512 bytes)
Do you like to test it on your device and send us a report? If it
doesn't work, maybe we can try to fix it together with people on the
list here.
Most probably you have to adapt
{ .name = "User Space",
.offset = 5 * SZ_1M,
.size = 59 * SZ_1M},
in the patch to ".size = 507 * SZ_1M" to use your full 512MB.
Best regards
Dirk
On Jan 5, 2008 1:29 PM, Dirk Behme < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
This patch adds NAND driver to recent git. Tested on DM6446 DVEVM.
It is mainly based on Sander Huijsen <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> work
[1]. Many thanks!
To use/test it, you have to configure DVEVM:
- jumper J4 set to NAND
- S3-1 and S3-2 set to OFF (NAND boot)
- S3-3 set to OFF (8-bit CS2 bus width)
Note that on DVEVM you have only access to NAND if jumper J4 is set to
NAND. Cause of CS2 switching then you have no access to e.g.
bootloader (uboot) in NOR any more. This implies that you have a
bootloader in NAND, e.g. by using tools [2].
Then configure your kernel with
CONFIG_MTD=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_IDS=y
CONFIG_MTD_NAND_DAVINCI=y
and for filesystem e.g.:
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
Booting this kernel you will get something like:
...
DaVinci NAND Controller rev. 2.1
Warning: MUX config for NAND: Set PINMUX0 reg to 0x8001cc1f, was
0x80030c1f, should be done by bootloader.
Warning: NAND config: Set A1CR reg to 0x0432018c, was 0x0432229c,
should be done by bootloader.
NAND device: Manufacturer ID: 0xec, Chip ID: 0x36 (Samsung NAND 64MiB
1,8V 8-bit)
Bad block scan: 0 out of 4096 blocks are bad.
Creating 1 MTD partitions on "NAND 64MiB 1,8V 8-bit":
0x00500000-0x04000000 : "User Space"
...
Once logged in, do something like
...
# ll /dev/mtd0
crw-rw-rw- 1 root root 90, 0 Jul 25 2002 /dev/mtd0
# ll /dev/mtdblock0
brw-rw-rw- 1 root disk 31, 0 Jul 25 2002 /dev/mtdblock0
# cat /proc/mtd
dev: size erasesize name
mtd0: 03b00000 00004000 "User Space"
# flash_eraseall -j /dev/mtd0
Erasing 16 Kibyte @ 3afc000 -- 30 % complete. Cleanmarker written at
3afc000.
# mount -t jffs2 /dev/mtdblock0 /mnt/nand
# ll /mnt/nand/
drwxr-xr-x 3 root root 0 Jan 1 1970 .
drwxr-xr-x 5 root root 1024 Jan 1 12:04 ..
# echo "Hello NAND" > /mnt/nand/test
# ll /mnt/nand/
drwxr-xr-x 3 root root 0 Jan 1 12:05 .
drwxr-xr-x 5 root root 1024 Jan 1 12:04 ..
-rw-r--r-- 1 root root 11 Jan 1 12:05 test
# cat /mnt/nand/test
Hello NAND
# reboot
...
# mount -t jffs2 /dev/mtdblock0 /mnt/nand
# ll /mnt/nand/
drwxr-xr-x 3 root root 0 Jan 1 1970 .
drwxr-xr-x 5 root root 1024 Jan 1 12:00 ..
-rw-r--r-- 1 root root 11 Jan 1 12:05 test
# cat /mnt/nand/test
Best regards
Dirk
[1]
http://linux.omap.com/pipermail/davinci-linux-open-source/2007-December/004788.html
<http://linux.omap.com/pipermail/davinci-linux-open-source/2007-December/004788.html>
[2] http://wiki.davincidsp.com/index.php?title=RBL_UBL_and_host_program
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
<mailto:Davinci-linux-open-source@linux.davincidsp.com>
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source