Module Name: src
Committed By: ahoka
Date: Sat Nov 3 12:12:48 UTC 2012
Modified Files:
src/sys/dev/nand: nand.c nand.h nand_micron.c nand_samsung.c
Log Message:
Make nc_block_pages go aways, its redundant and unused.
Print more info on attach including the width.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/nand/nand.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/nand/nand.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/nand/nand_micron.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/nand/nand_samsung.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.20 src/sys/dev/nand/nand.c:1.21
--- src/sys/dev/nand/nand.c:1.20 Fri Nov 2 19:50:22 2012
+++ src/sys/dev/nand/nand.c Sat Nov 3 12:12:48 2012
@@ -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 @@ nand_scan_media(device_t self, struct na
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 @@ nand_fill_chip_structure(device_t self,
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;
Index: src/sys/dev/nand/nand.h
diff -u src/sys/dev/nand/nand.h:1.15 src/sys/dev/nand/nand.h:1.16
--- src/sys/dev/nand/nand.h:1.15 Fri Nov 2 17:14:41 2012
+++ src/sys/dev/nand/nand.h Sat Nov 3 12:12:48 2012
@@ -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 @@ struct nand_chip {
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 @@ struct nand_chip {
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 */
Index: src/sys/dev/nand/nand_micron.c
diff -u src/sys/dev/nand/nand_micron.c:1.7 src/sys/dev/nand/nand_micron.c:1.8
--- src/sys/dev/nand/nand_micron.c:1.7 Fri Nov 2 17:14:41 2012
+++ src/sys/dev/nand/nand_micron.c Sat Nov 3 12:12:48 2012
@@ -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 @@ mt29fxgx_parameters(device_t self, struc
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;
Index: src/sys/dev/nand/nand_samsung.c
diff -u src/sys/dev/nand/nand_samsung.c:1.8 src/sys/dev/nand/nand_samsung.c:1.9
--- src/sys/dev/nand/nand_samsung.c:1.8 Fri Nov 2 21:38:29 2012
+++ src/sys/dev/nand/nand_samsung.c Sat Nov 3 12:12:48 2012
@@ -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 @@ nand_read_parameters_samsung(device_t se
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: