#ifndef __K9F2G08U0A_H__
#define __K9F2G08U0A_H__
#define NAND_LARGE_PAGE
#define NAND_BLOCK_CNT (2048) // 2048 blocks
// In fact, each block of K9F2G08U0A consists of 64 pages and the page size
// is 2k bytes. We simulate it as a small page size nand flash, so the sector
// size is still 512 bytes and each block has 64 * (2048 / 512) = 256 sectors.
// The simulation is necessary for Microsoft up layer(fal, mspart, file
// system) does not support the 2k page size nand flash directly.
#define NAND_SECTOR_CNT (256) // Each Block has 32 Sectors
#define NAND_SECTOR_SIZE (512) // Each Sector has 512 Bytes
#define NAND_SECTORS_PERPAGE (4) // Each Page has 4 Sectors
#define NAND_SPARE_SIZE (16)
#define NAND_BLOCK_SIZE (NAND_SECTOR_CNT * NAND_SECTOR_SIZE)
#define NAND_BBI_OFFSET 5 // Bad block info spare offset
#define NAND_BUS_WIDTH 8 // 8-bit bus
#define NAND_MAKER_CODE 0xEC // Samsung
#define NAND_DEVICE_CODE 0xDA
#define NAND_STATUS_MASK_ERROR (1U << 0) // Status Bit0 indicates error
#define NAND_ID_CODE ((NAND_DEVICE_CODE << 8) | NAND_MAKER_CODE)