1 From be5f1d59341e48dbe0730253417c52bf79c6c3a7 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Mon, 12 Aug 2013 14:14:49 -0300
4 Subject: [PATCH 116/203] mtd: nand: pxa3xx: Allow to set/clear the 'spare
7 Some commands (such as the ONFI parameter page read) need to
8 clear the 'spare enable' bit. This commit allows to set/clear
9 depending on the prepared command, instead of having it always
12 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
13 Tested-by: Daniel Mack <zonque@gmail.com>
14 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
15 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 drivers/mtd/nand/pxa3xx_nand.c | 7 +++++++
18 1 file changed, 7 insertions(+)
20 --- a/drivers/mtd/nand/pxa3xx_nand.c
21 +++ b/drivers/mtd/nand/pxa3xx_nand.c
22 @@ -185,6 +185,7 @@ struct pxa3xx_nand_info {
24 int use_ecc; /* use HW ECC ? */
25 int use_dma; /* use DMA ? */
26 + int use_spare; /* use spare ? */
29 unsigned int page_size; /* page size of attached chip */
30 @@ -325,6 +326,11 @@ static void pxa3xx_nand_start(struct pxa
34 + if (info->use_spare)
35 + ndcr |= NDCR_SPARE_EN;
37 + ndcr &= ~NDCR_SPARE_EN;
41 /* clear status bits and run */
42 @@ -526,6 +532,7 @@ static int prepare_command_pool(struct p
46 + info->use_spare = 1;
47 info->use_dma = (use_dma) ? 1 : 0;
49 info->retcode = ERR_NONE;