mtd: denali: kill the NAND_MAX_PAGESIZE/NAND_MAX_OOBSIZE

This patch kills the NAND_MAX_PAGESIZE/NAND_MAX_OOBSIZE by the following
way:
 1.) change the @buf field of nand_buf{} from an array to a pointer.
     also remove the DENALI_BUF_SIZE macro.

 2.) Before we call the nand_scan_ident, we allocate a temporary buffer
     whose size is PAGE_SIZE.

 3.) After we finish the nand_scan_ident, we have already getten the
     page size and oob size. We will allocate the right buffer size
     again.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
Huang Shijie
2013-12-21 00:02:28 +08:00
committed by Brian Norris
parent a5900554a8
commit e07caa3687
2 changed files with 31 additions and 24 deletions

View File

@@ -455,12 +455,10 @@
#define ECC_SECTOR_SIZE 512
#define DENALI_BUF_SIZE (NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE)
struct nand_buf {
int head;
int tail;
uint8_t buf[DENALI_BUF_SIZE];
uint8_t *buf;
dma_addr_t dma_buf;
};