Module Name: src Committed By: ahoka Date: Fri Nov 2 21:38:29 UTC 2012
Modified Files: src/sys/dev/nand: nand_samsung.c Log Message: Hah! Size is actually in megaBIT! To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 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_samsung.c diff -u src/sys/dev/nand/nand_samsung.c:1.7 src/sys/dev/nand/nand_samsung.c:1.8 --- src/sys/dev/nand/nand_samsung.c:1.7 Fri Nov 2 21:27:46 2012 +++ src/sys/dev/nand/nand_samsung.c Fri Nov 2 21:38:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: nand_samsung.c,v 1.7 2012/11/02 21:27:46 ahoka Exp $ */ +/* $NetBSD: nand_samsung.c,v 1.8 2012/11/02 21:38:29 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.7 2012/11/02 21:27:46 ahoka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nand_samsung.c,v 1.8 2012/11/02 21:38:29 ahoka Exp $"); #include "nand.h" #include "onfi.h" @@ -164,31 +164,32 @@ nand_read_parameters_samsung(device_t se KASSERTMSG(false, "ID Data parsing bug detected!"); } + /* This one reads in megabit for some reason */ uint64_t planesize = 0; switch ((params3 & NAND_SAMSUNG_PLANESIZEMASK) >> 4) { case 0x0: - planesize = 64 * 1024 * 1024; + planesize = 64 * 1024 * 1024 / 8; break; case 0x1: - planesize = 128 * 1024 * 1024; + planesize = 128 * 1024 * 1024 / 8; break; case 0x2: - planesize = 256 * 1024 * 1024; + planesize = 256 * 1024 * 1024 / 8; break; case 0x3: - planesize = 512 * 1024 * 1024; + planesize = 512 * 1024 * 1024 / 8; break; case 0x4: - planesize = 1024 * 1024 * 1024; + planesize = 1024 * 1024 * 1024 / 8; break; case 0x5: - planesize = 2ul * 1024 * 1024 * 1024; + planesize = 2ul * 1024 * 1024 * 1024 / 8; break; case 0x6: - planesize = 4ul * 1024 * 1024 * 1024; + planesize = 4ul * 1024 * 1024 * 1024 / 8; break; case 0x7: - planesize = 8ul * 1024 * 1024 * 1024; + planesize = 8ul * 1024 * 1024 * 1024 / 8; break; default: KASSERTMSG(false, "ID Data parsing bug detected!");