[Astfin-commits] Commit in hardware/ip04/trunk (README.Rev642)

Astfin Subversion Commits svn-commit at astfin.org
Wed May 16 04:15:51 EDT 2007


    Date: Wednesday, May 16, 2007 @ 04:15:49
  Author: david
Revision: 765

updated for NAND/yaffs root instructions

Modified:
  hardware/ip04/trunk/README.Rev642

Modified: hardware/ip04/trunk/README.Rev642
===================================================================
--- hardware/ip04/trunk/README.Rev642	2007-05-14 02:33:14 UTC (rev 764)
+++ hardware/ip04/trunk/README.Rev642	2007-05-16 08:15:49 UTC (rev 765)
@@ -179,4 +179,95 @@
 
 http://docs.blackfin.uclinux.org/doku.php?id=using_nand_flash_with_u-boot_and_linux_kernel&s=boot%20nand
 
+How To set up NAND/yaffs for root
+---------------------------------
 
+This is a little indirect as the user-mode yaffs tools like mkyaffs
+are broken.  These steps were adpated from Frank Hoffman's
+instructions here:
+  
+https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&_forum_action=ForumMessageBrowse&thread_id=8386
+
+1. wget http://www.rowetel.com/ucasterisk/downloads/ip04/uImage.yaffs
+   wget http://www.rowetel.com/ucasterisk/downloads/ip04/copy_root.txt
+
+2. First tftp the uImage and load into the kernel section of NAND.
+
+   In u-boot:
+
+   ip04>tftp 0x1000000 uImage.yaffs
+   ip04>nand erase
+   ip04>nand write 0x1000000 0x0 0x48000
+
+   (see Note (1) in "Writing a uImage to NAND" section above re 0x48000)
+
+   ip04>bootm 0x1000000
+
+3. Now we have the IP04 booted, but using a ram-based ext2 file system
+   for root.  So we need to copy /root into the yaffs file system:
+
+   On the host, use ftp to transfer copy_root.txt to the IP04, the 
+   username/password is root/uClinux:
+
+     ftp> cd /var/log/
+     ftp> send copy_rootfs.txt
+     ftp> quit
+   
+   On the IP04:
+
+     root:~> mount /dev/mtdblock2 /mnt
+     yaffs: dev is 32505858 name is "mtdblock2"
+     yaffs: Attempting MTD mount on 31.2, "mtdblock2"
+     yaffs: auto selecting yaffs2
+     block 669 is bad
+     
+   So now we have yaffs mounted on /mnt.  We use the script to cp
+   all the root files to the yaffs file system.
+
+     root:~> cd /var/log
+     root:~> chmod u+x copy_rootfs.txt
+     root:~> ./copy_rootfs.txt
+     root:/var/log> ./copy_rootfs.txt
+     root:/var/log> ls /mnt/
+     lost+found  lib         root        var         proc
+     bin         tmp         usr         dev         sys
+     etc         home        sbin        mnt
+     root:/var/log> umount /mnt/
+     root:/var/log> reboot
+
+4. Now we set up u-boot to mount root from yaffs:
+
+   ip04>setenv autostart yes
+   ip04>setenv root=/dev/mtdblock2 rw
+   ip04>setenv nandboot=run addnet;nboot 0x2000000 0x0
+   ip04>setenv bootcmd run nandboot
+   ip04>save
+   ip04>reset
+
+Notes:
+
+1/ Don't used mkyaffs, it is very broken for flash chips with 2048
+byte pages, like the one used by the IP04!  It will fail badly.  To
+recover use nand erase in u-boot.
+
+2/ In u-boot 'nand dump' is helpful, for example after a nand erase:
+
+   ip04>nand dump 0x0
+
+   (you should see a flash "page" of 2048 0xff's + 64 OOB 0xffs)
+ 
+   After 'nand write' use nand dump to see the uImage in NAND.
+
+3/ For reference a typical boot sequence is here:
+
+   http://www.rowetel.com/ucasterisk/downloads/ip04/ip04_boot_typical.txt
+
+4/ In his post Frank suggest premature retirement of blocks after a
+   few write cycles.  I havent seen that yet but suspect we will have some more
+   work to do to sort that out.
+
+   This:
+
+   root:~> cat /proc/yaffs
+
+   Gives stats on the yaffs file system such as retired blocks.




More information about the Astfin-commits mailing list