| 1 | |
| 2 | #ifndef __NAND_H |
| 3 | #define __NAND_H |
| 4 | |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | struct ingenic_dev; |
| 8 | |
| 9 | typedef int (*nand_read_cb_t)(void *userdata, const char *buf, size_t size); |
| 10 | |
| 11 | int nand_query(struct ingenic_dev *dev, uint8_t nand_idx); |
| 12 | int nand_read(struct ingenic_dev *dev, uint8_t nand_idx, int mode, |
| 13 | uint32_t start_page, uint32_t length, uint32_t ram_addr, |
| 14 | nand_read_cb_t callbcallback, void *userdata); |
| 15 | int nand_erase(struct ingenic_dev *dev, uint8_t nand_idx, |
| 16 | uint32_t start_block, uint32_t num_blocks); |
| 17 | int nand_prog(struct ingenic_dev *dev, uint8_t nand_idx, |
| 18 | uint32_t start_page, const char *filename, int mode); |
| 19 | int nand_markbad(struct ingenic_dev *dev, uint8_t nand_idx, uint32_t block); |
| 20 | |
| 21 | #endif |
| 22 | |