diff options
author | Huang Shijie <b32955@freescale.com> | 2014-01-13 01:27:12 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-03-11 01:42:22 -0400 |
commit | f02ea4e6a47d50a38f5baadbe87f5087dd337db0 (patch) | |
tree | 512c46fb2f1761c456cb5eedf02e06d57f50fb63 /include/linux/mtd | |
parent | 3ea5b037e750274659648b58fb97426566a90373 (diff) |
mtd: nand: kill the the NAND_MAX_PAGESIZE/NAND_MAX_OOBSIZE for nand_buffers{}
The patch converts the arrays to buffer pointers for nand_buffers{}.
The cafe_nand.c is the only NAND_OWN_BUFFERS user which allocates
nand_buffers{} itself.
This patch disables the DMA for nand_scan_ident, and restores the DMA
status after we finish the nand_scan_ident. This way, we can get page
size and OOB size and use them to allocate cafe->dmabuf.
Since the cafe_nand.c uses the NAND_ECC_HW_SYNDROME ECC mode, we do not
allocate the buffers for @ecccalc and @ecccode.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/nand.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 32f8612469d8..520ebca11f5d 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -435,17 +435,17 @@ struct nand_ecc_ctrl { | |||
435 | 435 | ||
436 | /** | 436 | /** |
437 | * struct nand_buffers - buffer structure for read/write | 437 | * struct nand_buffers - buffer structure for read/write |
438 | * @ecccalc: buffer for calculated ECC | 438 | * @ecccalc: buffer pointer for calculated ECC, size is oobsize. |
439 | * @ecccode: buffer for ECC read from flash | 439 | * @ecccode: buffer pointer for ECC read from flash, size is oobsize. |
440 | * @databuf: buffer for data - dynamically sized | 440 | * @databuf: buffer pointer for data, size is (page size + oobsize). |
441 | * | 441 | * |
442 | * Do not change the order of buffers. databuf and oobrbuf must be in | 442 | * Do not change the order of buffers. databuf and oobrbuf must be in |
443 | * consecutive order. | 443 | * consecutive order. |
444 | */ | 444 | */ |
445 | struct nand_buffers { | 445 | struct nand_buffers { |
446 | uint8_t ecccalc[NAND_MAX_OOBSIZE]; | 446 | uint8_t *ecccalc; |
447 | uint8_t ecccode[NAND_MAX_OOBSIZE]; | 447 | uint8_t *ecccode; |
448 | uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE]; | 448 | uint8_t *databuf; |
449 | }; | 449 | }; |
450 | 450 | ||
451 | /** | 451 | /** |