changeset 2987:c4bb345a216c

synth nand: don't provide BBT data if it's not called for
author Ross Younger <wry@ecoscentric.com>
date Fri, 13 Nov 2009 12:32:40 +0000
parents d98364f14102
children 5cd059c3887b
files packages/devs/nand/synth/current/ChangeLog packages/devs/nand/synth/current/src/nand_synth.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/nand/synth/current/ChangeLog
+++ b/packages/devs/nand/synth/current/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-13  Ross Younger  <wry@ecoscentric.com>
+
+	* Don't provide BBT data if it's not called for.
+
 2009-11-09  Ross Younger  <wry@ecoscentric.com>
 
 	* nand_synth.c: Provide read_part_page function.
--- a/packages/devs/nand/synth/current/src/nand_synth.c
+++ b/packages/devs/nand/synth/current/src/nand_synth.c
@@ -54,6 +54,7 @@
 #include <cyg/hal/hal_endian.h>
 #include <cyg/infra/diag.h>
 #include <cyg/infra/cyg_ass.h>
+#include <pkgconf/io_nand.h>
 #include <pkgconf/devs_nand_synth.h>
 #include <string.h>
 #include <errno.h>
@@ -183,7 +184,9 @@ static int                  last_block_g
 // The bad block table needed by the generic NAND layer.
 // 2 bits per block. This is separate from the bad block table
 // held in the image, which is what gets used by the driver.
+#ifdef CYGSEM_IO_NAND_USE_BBT
 static unsigned char bbtable[BLOCK_COUNT / 4];
+#endif
 
 // ----------------------------------------------------------------------------
 // Interaction with the I/O auxiliary and its nand.tcl script.
@@ -1297,8 +1300,10 @@ static int synth_devinit(cyg_nand_device
     dev->blockcount_bits    = log2u(BLOCK_COUNT);
     dev->chipsize_log       = dev->page_bits + dev->block_page_bits + dev->blockcount_bits;
 
+#ifdef CYGSEM_IO_NAND_USE_BBT
     dev->bbt.datasize       = BLOCK_COUNT / 4;
     dev->bbt.data           = bbtable;
+#endif
     if (SPARE_PER_PAGE >= 64) {
         dev->oob = &nand_mtd_oob_64;
     } else if (SPARE_PER_PAGE >= 16) {