Hook nand_samsung.c into the build, and use it if a legacy chip

from Samsung is found.
This commit is contained in:
riz 2012-10-31 18:58:08 +00:00
parent a1801097ec
commit 11d9652019
3 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.nand,v 1.4 2011/06/28 18:14:11 ahoka Exp $
# $NetBSD: files.nand,v 1.5 2012/10/31 18:58:08 riz Exp $
define nandbus { }
@ -9,6 +9,7 @@ file dev/nand/hamming.c nand
file dev/nand/nand_bbt.c nand
file dev/nand/nand_crc.c nand
file dev/nand/nand_micron.c nand
file dev/nand/nand_samsung.c nand
defpseudodev nandemulator: nandbus
file dev/nand/nandemulator.c nandemulator

View File

@ -1,4 +1,4 @@
/* $NetBSD: nand.c,v 1.17 2012/07/12 03:05:01 matt Exp $ */
/* $NetBSD: nand.c,v 1.18 2012/10/31 18:58:08 riz 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.17 2012/07/12 03:05:01 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.18 2012/10/31 18:58:08 riz Exp $");
#include "locators.h"
@ -332,6 +332,8 @@ nand_fill_chip_structure_legacy(device_t self, struct nand_chip *chip)
switch (chip->nc_manf_id) {
case NAND_MFR_MICRON:
return nand_read_parameters_micron(self, chip);
case NAND_MFR_SAMSUNG:
return nand_read_parameters_samsung(self, chip);
default:
return 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: nand.h,v 1.13 2011/07/15 19:19:57 cliff Exp $ */
/* $NetBSD: nand.h,v 1.14 2012/10/31 18:58:08 riz Exp $ */
/*-
* Copyright (c) 2010 Department of Software Engineering,
@ -428,6 +428,7 @@ extern const struct nand_manufacturer nand_mfrs[];
* Manufacturer specific parameter functions
*/
int nand_read_parameters_micron(device_t, struct nand_chip *);
int nand_read_parameters_samsung(device_t, struct nand_chip *);
/* debug inlines */