Merge with /home/wd/git/u-boot/testing-NAND/ to add new NAND handling.
[platform/kernel/u-boot.git] / include / nand.h
index 6dbaa42..905115b 100644 (file)
@@ -35,12 +35,12 @@ extern nand_info_t nand_info[];
 
 static inline int nand_read(nand_info_t *info, ulong ofs, ulong *len, u_char *buf)
 {
-       return info->read(info, ofs, *len, len, buf);
+       return info->read(info, ofs, *len, (size_t *)len, buf);
 }
 
 static inline int nand_write(nand_info_t *info, ulong ofs, ulong *len, u_char *buf)
 {
-       return info->write(info, ofs, *len, len, buf);
+       return info->write(info, ofs, *len, (size_t *)len, buf);
 }
 
 static inline int nand_block_isbad(nand_info_t *info, ulong ofs)
@@ -50,7 +50,14 @@ static inline int nand_block_isbad(nand_info_t *info, ulong ofs)
 
 static inline int nand_erase(nand_info_t *info, ulong off, ulong size)
 {
-       return 0; /* FIXME */
+       struct erase_info instr;
+
+       instr.mtd = info;
+       instr.addr = off;
+       instr.len = size;
+       instr.callback = 0;
+
+       return info->erase(info, &instr);
 }
 
 #endif