Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Import the Flash and NAND subsytem code contributed by the U...



details:   https://anonhg.NetBSD.org/src/rev/f4dce1486119
branches:  trunk
changeset: 762734:f4dce1486119
user:      ahoka <ahoka%NetBSD.org@localhost>
date:      Sat Feb 26 18:07:13 2011 +0000

description:
Import the Flash and NAND subsytem code contributed by the University
of Szeged, Hungary.

The commit includes:
 - Flash layer, which gives a common API to access flash devices
 - NAND controller subsystem for the flash layer
 - An example OMAP driver which is used on BeagleBoard or alike ARM boards

diffstat:

 distrib/sets/lists/base/mi        |     3 +-
 distrib/sets/lists/comp/mi        |     6 +-
 distrib/sets/lists/man/mi         |     5 +-
 distrib/sets/lists/modules/mi     |     8 +-
 doc/CHANGES                       |     5 +-
 doc/RESPONSIBLE                   |     4 +-
 etc/MAKEDEV.tmpl                  |     9 +-
 etc/etc.amd64/MAKEDEV.conf        |     3 +-
 etc/etc.evbarm/MAKEDEV.conf       |     4 +-
 etc/etc.evbmips/MAKEDEV.conf      |     4 +-
 etc/etc.evbppc/MAKEDEV.conf       |     3 +-
 etc/etc.hpcarm/MAKEDEV.conf       |     4 +-
 etc/etc.hpcmips/MAKEDEV.conf      |     4 +-
 etc/etc.i386/MAKEDEV.conf         |     3 +-
 share/man/man4/Makefile           |     4 +-
 share/man/man4/flash.4            |    69 +
 share/man/man9/Makefile           |     6 +-
 share/man/man9/flash.9            |    84 ++
 sys/arch/arm/omap/files.omap2     |     7 +-
 sys/arch/arm/omap/omap2_nand.c    |   517 ++++++++++++
 sys/arch/evbarm/conf/BEAGLEBOARD  |    15 +-
 sys/arch/i386/conf/ALL            |    12 +-
 sys/conf/files                    |    13 +-
 sys/dev/flash/files.flash         |     9 +
 sys/dev/flash/flash.c             |   695 +++++++++++++++++
 sys/dev/flash/flash.h             |   168 ++++
 sys/dev/nand/files.nand           |    16 +
 sys/dev/nand/hamming.c            |   232 +++++
 sys/dev/nand/hamming.h            |    56 +
 sys/dev/nand/nand.c               |  1478 +++++++++++++++++++++++++++++++++++++
 sys/dev/nand/nand.h               |   465 +++++++++++
 sys/dev/nand/nand_bbt.c           |   250 ++++++
 sys/dev/nand/nand_bbt.h           |    58 +
 sys/dev/nand/nand_crc.c           |    63 +
 sys/dev/nand/nand_crc.h           |    42 +
 sys/dev/nand/nand_io.c            |   373 +++++++++
 sys/dev/nand/nandemulator.c       |   779 +++++++++++++++++++
 sys/dev/nand/nandemulator.h       |     5 +
 sys/dev/nand/onfi.h               |   180 ++++
 sys/modules/Makefile              |     5 +-
 sys/modules/flash/Makefile        |    11 +
 sys/modules/flash/flash.ioconf    |     9 +
 sys/modules/nand/Makefile         |    15 +
 sys/modules/nand/nand.ioconf      |     9 +
 sys/modules/nand/opt_nand.h       |     3 +
 sys/modules/nandemulator/Makefile |    11 +
 sys/sys/Makefile                  |     4 +-
 sys/sys/flashio.h                 |   116 ++
 usr.sbin/Makefile                 |     6 +-
 usr.sbin/flashctl/Makefile        |    10 +
 usr.sbin/flashctl/flashctl.c      |   249 ++++++
 51 files changed, 6079 insertions(+), 30 deletions(-)

diffs (truncated from 6613 to 300 lines):

diff -r 4051ceb77122 -r f4dce1486119 distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Sat Feb 26 17:11:23 2011 +0000
+++ b/distrib/sets/lists/base/mi        Sat Feb 26 18:07:13 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.921 2011/02/08 03:20:13 haad Exp $
+# $NetBSD: mi,v 1.922 2011/02/26 18:07:13 ahoka Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -1163,6 +1163,7 @@
 ./usr/sbin/iprop-log                           base-krb5-bin           kerberos
 ./usr/sbin/faithd                              base-router-bin         inet6
 ./usr/sbin/fixmount                            base-nfsclient-bin
+./usr/sbin/flashctl                            base-sysutil-bin
 ./usr/sbin/flush                               base-obsolete           obsolete
 ./usr/sbin/fsinfo                              base-sysutil-bin
 ./usr/sbin/fssconfig                           base-sysutil-bin
diff -r 4051ceb77122 -r f4dce1486119 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Sat Feb 26 17:11:23 2011 +0000
+++ b/distrib/sets/lists/comp/mi        Sat Feb 26 18:07:13 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1589 2011/02/17 19:58:34 rmind Exp $
+#      $NetBSD: mi,v 1.1590 2011/02/26 18:07:14 ahoka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2055,6 +2055,7 @@
 ./usr/include/sys/file.h                       comp-c-include
 ./usr/include/sys/filedesc.h                   comp-c-include
 ./usr/include/sys/filio.h                      comp-c-include
+./usr/include/sys/flashio.h                    comp-c-include
 ./usr/include/sys/float_ieee.h                 comp-obsolete           obsolete
 ./usr/include/sys/float_ieee754.h              comp-c-include
 ./usr/include/sys/fnv_hash.h                   comp-obsolete           obsolete
@@ -9369,6 +9370,7 @@
 ./usr/share/man/cat9/firmware_malloc.0         comp-sys-catman         .cat
 ./usr/share/man/cat9/firmware_open.0           comp-sys-catman         .cat
 ./usr/share/man/cat9/firmware_read.0           comp-sys-catman         .cat
+./usr/share/man/cat9/flash.0                   comp-sys-catman         .cat
 ./usr/share/man/cat9/fork1.0                   comp-sys-catman         .cat
 ./usr/share/man/cat9/format_bytes.0            comp-sys-catman         .cat
 ./usr/share/man/cat9/fownsignal.0              comp-sys-catman         .cat
@@ -15303,6 +15305,7 @@
 ./usr/share/man/html9/firmware_malloc.html     comp-sys-htmlman        html
 ./usr/share/man/html9/firmware_open.html       comp-sys-htmlman        html
 ./usr/share/man/html9/firmware_read.html       comp-sys-htmlman        html
+./usr/share/man/html9/flash.html               comp-sys-htmlman        html
 ./usr/share/man/html9/fork1.html               comp-sys-htmlman        html
 ./usr/share/man/html9/format_bytes.html                comp-sys-htmlman        html
 ./usr/share/man/html9/fownsignal.html          comp-sys-htmlman        html
@@ -21388,6 +21391,7 @@
 ./usr/share/man/man9/firmware_malloc.9         comp-sys-man            .man
 ./usr/share/man/man9/firmware_open.9           comp-sys-man            .man
 ./usr/share/man/man9/firmware_read.9           comp-sys-man            .man
+./usr/share/man/man9/flash.9                   comp-sys-man            .man
 ./usr/share/man/man9/fork1.9                   comp-sys-man            .man
 ./usr/share/man/man9/format_bytes.9            comp-sys-man            .man
 ./usr/share/man/man9/fownsignal.9              comp-sys-man            .man
diff -r 4051ceb77122 -r f4dce1486119 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sat Feb 26 17:11:23 2011 +0000
+++ b/distrib/sets/lists/man/mi Sat Feb 26 18:07:13 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1295 2011/02/24 14:20:28 jruoho Exp $
+# $NetBSD: mi,v 1.1296 2011/02/26 18:07:15 ahoka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -967,6 +967,7 @@
 ./usr/share/man/cat4/fd.0                      man-sys-catman          .cat
 ./usr/share/man/cat4/fea.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/finsio.0                  man-sys-catman          .cat
+./usr/share/man/cat4/flash.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/fms.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/fmv.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/fpa.0                     man-sys-catman          .cat
@@ -3734,6 +3735,7 @@
 ./usr/share/man/html4/fd.html                  man-sys-htmlman         html
 ./usr/share/man/html4/fea.html                 man-sys-htmlman         html
 ./usr/share/man/html4/finsio.html              man-sys-htmlman         html
+./usr/share/man/html4/flash.html               man-sys-htmlman         html
 ./usr/share/man/html4/fms.html                 man-sys-htmlman         html
 ./usr/share/man/html4/fmv.html                 man-sys-htmlman         html
 ./usr/share/man/html4/fpa.html                 man-sys-htmlman         html
@@ -6276,6 +6278,7 @@
 ./usr/share/man/man4/fd.4                      man-sys-man             .man
 ./usr/share/man/man4/fea.4                     man-sys-man             .man
 ./usr/share/man/man4/finsio.4                  man-sys-man             .man
+./usr/share/man/man4/flash.4                   man-sys-man             .man
 ./usr/share/man/man4/fms.4                     man-sys-man             .man
 ./usr/share/man/man4/fmv.4                     man-sys-man             .man
 ./usr/share/man/man4/fpa.4                     man-sys-man             .man
diff -r 4051ceb77122 -r f4dce1486119 distrib/sets/lists/modules/mi
--- a/distrib/sets/lists/modules/mi     Sat Feb 26 17:11:23 2011 +0000
+++ b/distrib/sets/lists/modules/mi     Sat Feb 26 18:07:13 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.20 2010/12/29 13:05:42 jmcneill Exp $
+# $NetBSD: mi,v 1.21 2011/02/26 18:07:15 ahoka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -48,6 +48,8 @@
 ./@MODULEDIR@/ffs/ffs.kmod                     base-kernel-modules     kmod
 ./@MODULEDIR@/filecore                         base-kernel-modules     kmod
 ./@MODULEDIR@/filecore/filecore.kmod           base-kernel-modules     kmod
+./@MODULEDIR@/flash                            base-kernel-modules     kmod
+./@MODULEDIR@/flash/flash.kmod                 base-kernel-modules     kmod
 ./@MODULEDIR@/fss                              base-kernel-modules     kmod
 ./@MODULEDIR@/fss/fss.kmod                     base-kernel-modules     kmod
 ./@MODULEDIR@/hfs                              base-kernel-modules     kmod
@@ -70,6 +72,10 @@
 ./@MODULEDIR@/mqueue/mqueue.kmod               base-kernel-modules     kmod
 ./@MODULEDIR@/msdos                            base-kernel-modules     kmod
 ./@MODULEDIR@/msdos/msdos.kmod                 base-kernel-modules     kmod
+./@MODULEDIR@/nand                             base-kernel-modules     kmod
+./@MODULEDIR@/nand/nand.kmod                   base-kernel-modules     kmod
+./@MODULEDIR@/nandemulator                     base-kernel-modules     kmod
+./@MODULEDIR@/nandemulator/nandemulator.kmod   base-kernel-modules     kmod
 ./@MODULEDIR@/nfs                              base-kernel-modules     kmod
 ./@MODULEDIR@/nfs/nfs.kmod                     base-kernel-modules     kmod
 ./@MODULEDIR@/nfsserver                                base-kernel-modules     kmod
diff -r 4051ceb77122 -r f4dce1486119 doc/CHANGES
--- a/doc/CHANGES       Sat Feb 26 17:11:23 2011 +0000
+++ b/doc/CHANGES       Sat Feb 26 18:07:13 2011 +0000
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1514 $>
+# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1515 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -872,3 +872,6 @@
                DIGEST-MD5, EXTERNAL, GSSAPI, LOGIN, PLAIN [christos 20110221]
        alc(4): Add a driver for Atheros AR813x/AR815x Ethernet.
                [jmcneill 20110222]
+       flash(9): Add subsystem to handle Flash devices. [ahoka 20110226]
+       nand(9): Add subsystem to handle NAND controllers. [ahoka 20110226]
+       evbarm: Add driver for OMAP NAND controllers. [ahoka 20110226]
diff -r 4051ceb77122 -r f4dce1486119 doc/RESPONSIBLE
--- a/doc/RESPONSIBLE   Sat Feb 26 17:11:23 2011 +0000
+++ b/doc/RESPONSIBLE   Sat Feb 26 18:07:13 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: RESPONSIBLE,v 1.94 2010/06/09 21:54:21 tron Exp $
+#      $NetBSD: RESPONSIBLE,v 1.95 2011/02/26 18:07:15 ahoka Exp $
 
 List of sections of the system, and who is responsible for them (or at
 least considered an expert on them).
@@ -103,12 +103,14 @@
 audio          augustss, jmcneill
 cgd            elric
 firewire       jmc
+flash          ahoka
 gpio           mbalmer
 ide/atapi      bouyer
 irda           augustss, kenh
 isdn           martin
 keylock                mbalmer
 mca            jdolecek
+nand           ahoka
 net80211       dyoung
 onewire                riz
 podulebus      bjh21
diff -r 4051ceb77122 -r f4dce1486119 etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl  Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/MAKEDEV.tmpl  Sat Feb 26 18:07:13 2011 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: MAKEDEV.tmpl,v 1.137 2011/01/26 01:18:47 pooka Exp $
+#      $NetBSD: MAKEDEV.tmpl,v 1.138 2011/02/26 18:07:16 ahoka Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1042,6 +1042,13 @@
        %MKDISK% $name $unit $blk $chr
        ;;
 
+flash*)
+       unit=${i#flash}
+       flash=flash$unit
+       mkdev flash$unit b %flash_blk% $unit
+       mkdev rflash$unit c %flash_chr% $unit
+       ;;
+
 altmem*)
        name=altmem; unit=${i#altmem}; blk=%altmem_blk%; chr=%altmem_chr%
        %MKDISK% $name $unit $blk $chr
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.amd64/MAKEDEV.conf
--- a/etc/etc.amd64/MAKEDEV.conf        Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.amd64/MAKEDEV.conf        Sat Feb 26 18:07:13 2011 +0000
@@ -1,10 +1,11 @@
-# $NetBSD: MAKEDEV.conf,v 1.16 2008/11/04 14:25:10 joerg Exp $
+# $NetBSD: MAKEDEV.conf,v 1.17 2011/02/26 18:07:16 ahoka Exp $
 
 # As of 2003-04-17, the "init" case must not create more than 890 entries.
 all_md)
        makedev std wscons wt0 fd0 fd1
        makedev wd0 wd1 wd2 wd3 wd4 wd5 wd6 wd7
        makedev sd0 sd1 sd2 sd3 sd4
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty0 tty1 tty2 tty3
        makedev st0 st1 ch0 cd0 cd1 mcd0 vnd0
        makedev bpf
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.evbarm/MAKEDEV.conf
--- a/etc/etc.evbarm/MAKEDEV.conf       Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.evbarm/MAKEDEV.conf       Sat Feb 26 18:07:13 2011 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: MAKEDEV.conf,v 1.3 2008/09/13 11:46:18 tsutsui Exp $
+# $NetBSD: MAKEDEV.conf,v 1.4 2011/02/26 18:07:16 ahoka Exp $
 
 all_md)
        makedev wscons fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty0 tty1 st0 st1 ch0 cd0 cd1
        makedev uk0 uk1 ss0
        makedev lpa0 lpt0
@@ -17,6 +18,7 @@
 
 ramdisk|floppy)
        makedev std fd0 fd1 wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty0 tty1 opty
        makedev st0 st1 cd0 cd1
        ;;
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.evbmips/MAKEDEV.conf
--- a/etc/etc.evbmips/MAKEDEV.conf      Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.evbmips/MAKEDEV.conf      Sat Feb 26 18:07:13 2011 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: MAKEDEV.conf,v 1.4 2007/01/15 23:35:11 hubertf Exp $
+# $NetBSD: MAKEDEV.conf,v 1.5 2011/02/26 18:07:16 ahoka Exp $
 
 all_md)
        makedev wscons sd0 sd1 sd2 sd3 sd4
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev st0 st1 ch0 cd0 cd1
        makedev ss0 ss1 uk0 uk1
        makedev ld0 ld1 ld2 ld3
@@ -21,5 +22,6 @@
        makedev std
        makedev sd0 sd1 sd2 sd3 opty st0 st1 ch0 cd0 cd1 ccd0 ccd1 md0
        makedev wd0 wd1 fd0 fd1
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty00 tty01 ttyE0 ttyE1 wsmouse0 wskbd0 ttyEcfg
        ;;
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.evbppc/MAKEDEV.conf
--- a/etc/etc.evbppc/MAKEDEV.conf       Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.evbppc/MAKEDEV.conf       Sat Feb 26 18:07:13 2011 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: MAKEDEV.conf,v 1.6 2008/09/13 11:46:18 tsutsui Exp $
+# $NetBSD: MAKEDEV.conf,v 1.7 2011/02/26 18:07:16 ahoka Exp $
 
 all_md)
        makedev wscons sd0 sd1 sd2 st0 st1 cd0 cd1 wd0 wd1
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev ss0 ch0 uk0 uk1
        makedev mlx0 ld0 ld1 ld2 ld3
        makedev tty00 tty01
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.hpcarm/MAKEDEV.conf
--- a/etc/etc.hpcarm/MAKEDEV.conf       Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.hpcarm/MAKEDEV.conf       Sat Feb 26 18:07:13 2011 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: MAKEDEV.conf,v 1.11 2010/08/01 04:08:27 tsutsui Exp $
+# $NetBSD: MAKEDEV.conf,v 1.12 2011/02/26 18:07:17 ahoka Exp $
 
 all_md)
        makedev wscons std_hpcarm fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty0 tty1 st0 st1 ch0 cd0 cd1
        makedev uk0 uk1 ss0
        makedev ttyS0
@@ -26,6 +27,7 @@
 
 ramdisk|floppy)
        makedev std std_hpcarm fd0 fd1 wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty0 tty1 opty
        makedev st0 st1 cd0 cd1
        makedev ld0
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.hpcmips/MAKEDEV.conf
--- a/etc/etc.hpcmips/MAKEDEV.conf      Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.hpcmips/MAKEDEV.conf      Sat Feb 26 18:07:13 2011 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: MAKEDEV.conf,v 1.4 2007/01/15 23:35:12 hubertf Exp $
+# $NetBSD: MAKEDEV.conf,v 1.5 2011/02/26 18:07:17 ahoka Exp $
 
 all_md)
        makedev wscons fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 sd4
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev tty0 tty1 tty2
        makedev st0 st1 ch0 cd0 cd1
        makedev ss0 ch0 uk0 uk1
@@ -17,6 +18,7 @@
 
 floppy)
        makedev std fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1 tty2
+       makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
        makedev st0 st1 cd0 cd1 opty
        ;;
 
diff -r 4051ceb77122 -r f4dce1486119 etc/etc.i386/MAKEDEV.conf
--- a/etc/etc.i386/MAKEDEV.conf Sat Feb 26 17:11:23 2011 +0000
+++ b/etc/etc.i386/MAKEDEV.conf Sat Feb 26 18:07:13 2011 +0000
@@ -1,10 +1,11 @@



Home | Main Index | Thread Index | Old Index