Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/nand Make nc_block_pages go aways, its redundant and...



details:   https://anonhg.NetBSD.org/src/rev/efccfe601cf4
branches:  trunk
changeset: 782452:efccfe601cf4
user:      ahoka <ahoka%NetBSD.org@localhost>
date:      Sat Nov 03 12:12:48 2012 +0000

description:
Make nc_block_pages go aways, its redundant and unused.
Print more info on attach including the width.

diffstat:

 sys/dev/nand/nand.c         |  12 +++++-------
 sys/dev/nand/nand.h         |   5 ++---
 sys/dev/nand/nand_micron.c  |   5 ++---
 sys/dev/nand/nand_samsung.c |   6 ++----
 4 files changed, 11 insertions(+), 17 deletions(-)

diffs (121 lines):

diff -r cf83c035d052 -r efccfe601cf4 sys/dev/nand/nand.c
--- a/sys/dev/nand/nand.c       Sat Nov 03 11:48:54 2012 +0000
+++ b/sys/dev/nand/nand.c       Sat Nov 03 12:12:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand.c,v 1.20 2012/11/02 19:50:22 pgoyette Exp $       */
+/*     $NetBSD: nand.c,v 1.21 2012/11/03 12:12:48 ahoka Exp $  */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.20 2012/11/02 19:50:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.21 2012/11/03 12:12:48 ahoka Exp $");
 
 #include "locators.h"
 
@@ -412,11 +412,10 @@
            chip->nc_lun_blocks, chip->nc_num_luns,
            chip->nc_size / 1024 / 1024);
 
-#ifdef NAND_VERBOSE
        aprint_normal_dev(self, "column cycles: %" PRIu8 ", row cycles: %"
-           PRIu8 "\n",
-           chip->nc_addr_cycles_column, chip->nc_addr_cycles_row);
-#endif
+           PRIu8 ", width: %s\n",
+           chip->nc_addr_cycles_column, chip->nc_addr_cycles_row,
+           (chip->nc_flags & NC_BUSWIDTH_16) ? "x16" : "x8");
 
        ecc = chip->nc_ecc = &sc->nand_if->ecc;
 
@@ -563,7 +562,6 @@
            params.param_lunsize * params.param_numluns;
 
        chip->nc_page_size = params.param_pagesize;
-       chip->nc_block_pages = params.param_blocksize;
        chip->nc_block_size = params.param_blocksize * params.param_pagesize;
        chip->nc_spare_size = params.param_sparesize;
        chip->nc_lun_blocks = params.param_lunsize;
diff -r cf83c035d052 -r efccfe601cf4 sys/dev/nand/nand.h
--- a/sys/dev/nand/nand.h       Sat Nov 03 11:48:54 2012 +0000
+++ b/sys/dev/nand/nand.h       Sat Nov 03 12:12:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand.h,v 1.15 2012/11/02 17:14:41 ahoka Exp $  */
+/*     $NetBSD: nand.h,v 1.16 2012/11/03 12:12:48 ahoka Exp $  */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -113,9 +113,7 @@
        uint8_t *nc_ecc_cache;          /* buffer for ecc */
        uint64_t nc_size;               /* storage size in bytes */
        uint32_t nc_page_size;          /* page size in bytes */
-       uint32_t nc_block_pages;        /* block size in pages */
        uint32_t nc_block_size;         /* block size in bytes */
-       uint32_t nc_spare_size;         /* spare (oob) size in bytes */
        uint32_t nc_lun_blocks;         /* LUN size in blocks */
        uint32_t nc_flags;              /* bitfield flags */
        uint32_t nc_quirks;             /* bitfield quirks */
@@ -123,6 +121,7 @@
        uint32_t nc_page_mask;          /* page mask for page alignment */
        uint32_t nc_block_shift;        /* write shift */
        uint32_t nc_block_mask;         /* write mask */
+       uint16_t nc_spare_size;         /* spare (oob) size in bytes */
        uint8_t nc_num_luns;            /* number of LUNs */
        uint8_t nc_manf_id;             /* manufacturer id */
        uint8_t nc_dev_id;              /* device id  */
diff -r cf83c035d052 -r efccfe601cf4 sys/dev/nand/nand_micron.c
--- a/sys/dev/nand/nand_micron.c        Sat Nov 03 11:48:54 2012 +0000
+++ b/sys/dev/nand/nand_micron.c        Sat Nov 03 12:12:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand_micron.c,v 1.7 2012/11/02 17:14:41 ahoka Exp $    */
+/*     $NetBSD: nand_micron.c,v 1.8 2012/11/03 12:12:48 ahoka Exp $    */
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nand_micron.c,v 1.7 2012/11/02 17:14:41 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand_micron.c,v 1.8 2012/11/03 12:12:48 ahoka Exp $");
 
 #include "nand.h"
 #include "onfi.h"
@@ -151,7 +151,6 @@
        if (dp->width == 16)
                chip->nc_flags |= NC_BUSWIDTH_16;
        chip->nc_page_size = MT29FxG_PAGESIZE;
-       chip->nc_block_pages = MT29FxG_BLOCK_PAGES;
        chip->nc_block_size = MT29FxG_BLOCK_PAGES * MT29FxG_PAGESIZE;
        chip->nc_spare_size = MT29FxG_SPARESIZE;
        chip->nc_lun_blocks = dp->lun_blocks;
diff -r cf83c035d052 -r efccfe601cf4 sys/dev/nand/nand_samsung.c
--- a/sys/dev/nand/nand_samsung.c       Sat Nov 03 11:48:54 2012 +0000
+++ b/sys/dev/nand/nand_samsung.c       Sat Nov 03 12:12:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand_samsung.c,v 1.8 2012/11/02 21:38:29 ahoka Exp $   */
+/*     $NetBSD: nand_samsung.c,v 1.9 2012/11/03 12:12:48 ahoka Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nand_samsung.c,v 1.8 2012/11/02 21:38:29 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand_samsung.c,v 1.9 2012/11/03 12:12:48 ahoka Exp $");
 
 #include "nand.h"
 #include "onfi.h"
@@ -122,8 +122,6 @@
                        KASSERTMSG(false, "ID Data parsing bug detected!");
                }
 
-               chip->nc_block_pages = chip->nc_block_size / chip->nc_page_size;
-
                /* 8/16 bytes per 512 bytes! XXX do i get this right? */
                switch ((params2 & NAND_SAMSUNG_SPAREMASK) >> 2) {
                case 0x0:



Home | Main Index | Thread Index | Old Index