32 #ifndef __LPC_K9F1G_NANDFLASH_H_
33 #define __LPC_K9F1G_NANDFLASH_H_
46 #define KF91G_NANDFLASH
49 #define K9F1G_PAGE_SIZE (2 << 10)
51 #define K9F1G_SPARE_START_ADDR ( K9F1G_PAGE_SIZE)
53 #define K9F1G_SPARE_SIZE (64)
55 #define K9F1G_PAGES_PER_BLOCK (64)
57 #define K9F1G_BLOCK_COUNT (1024)
62 #define K9F1G_READ_1 0x00
63 #define K9F1G_READ_2 0x30
64 #define K9F1G_READ_ID 0x90
65 #define K9F1G_RESET 0xFF
66 #define K9F1G_PAGE_PROGRAM_1 0x80
67 #define K9F1G_PAGE_PROGRAM_2 0x10
68 #define K9F1G_BLOCK_ERASE_1 0x60
69 #define K9F1G_BLOCK_ERASE_2 0xD0
70 #define K9F1G_READ_STATUS 0x70
79 uint8_t InternalChipNum : 2;
81 uint8_t MaxProgramPageNum : 2;
82 uint8_t InterProgSupport : 1;
83 uint8_t CacheProgSupport : 1;
88 uint8_t BlockSize : 2;
89 uint8_t RedundantSize : 1;
90 uint8_t Organization : 1;
91 uint8_t SeriaAccessMin : 2;
95 uint8_t Reserved0 : 2;
97 uint8_t PlaneSize : 3;
98 uint8_t Reserved1 : 1;
106 #define NANDFLASH_STATUS_PAGE_PROG_FAIL (1 << 0)
107 #define NANDFLASH_STATUS_BLOCK_ERASE_FAIL (1 << 0)
108 #define NANDFLASH_STATUS_DEV_READY (1 << 6)
109 #define NANDFLASH_STATUS_READ_WRITE_NPROTECTED (1 << 7)
115 #define NANDFLASH_PROG_TIME (700 * 1000)
117 #define NANDFLASH_BLOCK_ERASE_TIME (3 * 1000 * 1000)
119 #define NANDFLASH_READ_TIME (25 * 1000)