]> git.sur5r.net Git - openocd/blobdiff - src/flash/nand.h
Fix signed/unsigned comparison.
[openocd] / src / flash / nand.h
index d0dd7579847b20e68aff80733ad72fa2cfb8b1eb..bd9554c344c4e8ac027189858c9a08792866d588 100644 (file)
@@ -56,6 +56,18 @@ typedef struct nand_block_s
        int is_bad;
 } nand_block_t;
 
+struct nand_oobfree {
+       int offset;
+       int length;
+};
+
+typedef struct nand_ecclayout_s {
+       int eccbytes;
+       int eccpos[64];
+       int oobavail;
+       struct nand_oobfree oobfree[2];
+} nand_ecclayout_t;
+
 typedef struct nand_device_s
 {
        nand_flash_controller_t *controller;
@@ -197,6 +209,7 @@ extern nand_device_t *get_nand_device_by_num(int num);
 extern int nand_read_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 data_size, u8 *oob, u32 oob_size);
 extern int nand_write_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 data_size, u8 *oob, u32 oob_size);
 extern int nand_read_status(struct nand_device_s *device, u8 *status);
+extern int nand_calculate_ecc(struct nand_device_s *device, const u8 *dat, u8 *ecc_code);
 
 extern int nand_register_commands(struct command_context_s *cmd_ctx);
 extern int nand_init(struct command_context_s *cmd_ctx);