nand driver: improve comments and docs and shuffle around some define(s).
[bertos.git] / bertos / drv / nand.h
index 5514c9e53088b75e0d6708bc05b4b453a1016360..7d529f1ccc0a918694f687dd55d3de48520fafec 100644 (file)
@@ -29,7 +29,7 @@
 * Copyright 2011 Develer S.r.l. (http://www.develer.com/)
 * -->
 *
-* \brief NAND driver
+* \brief ONFI 1.0 compliant NAND kblock driver
 *
 * \author Stefano Fedrigo <aleph@develer.com>
 *
@@ -42,7 +42,6 @@
 #define DRV_NAND_H
 
 #include "cfg/cfg_nand.h"
-#include <cfg/macros.h>
 #include <io/kblock.h>
 
 
 #define NAND_ERR_ECC       BV(5)   ///< Unrecoverable ECC error
 /** \} */
 
-#define NAND_PAGE_SIZE         (CONFIG_NAND_DATA_SIZE + CONFIG_NAND_SPARE_SIZE)
-#define NAND_BLOCK_SIZE        (CONFIG_NAND_DATA_SIZE * CONFIG_NAND_PAGES_PER_BLOCK)
-
-// Number of usable blocks, and index of first remapping block
-#define NAND_NUM_USER_BLOCKS   (CONFIG_NAND_NUM_BLOCK - CONFIG_NAND_NUM_REMAP_BLOCKS)
-
 
 // NAND commands
 #define NAND_CMD_READ_1               0x00
 #define NAND_CMD_RESET                0xFF
 
 
-// Get block from page
-#define PAGE(blk)            ((blk) * CONFIG_NAND_PAGES_PER_BLOCK)
-
-// Page from block and page in block
-#define BLOCK(page)          ((uint16_t)((page) / CONFIG_NAND_PAGES_PER_BLOCK))
-#define PAGE_IN_BLOCK(page)  ((uint16_t)((page) % CONFIG_NAND_PAGES_PER_BLOCK))
-
-
 /**
  * NAND context.
  */