cfi: calculate correct timeouts
[fw/openocd] / src / flash / nor / cfi.h
index d55fd34ef5f2335a0f18615d6979c19954ec1603..099a61377cdd894e89611b809cbd14c76cc12162 100644 (file)
@@ -20,8 +20,6 @@
 #ifndef CFI_H
 #define CFI_H
 
-#include "flash.h"
-
 #define CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7 0xE0 /* DQ5..DQ7 */
 #define CFI_STATUS_POLL_MASK_DQ6_DQ7     0xC0 /* DQ6..DQ7 */
 
@@ -37,7 +35,7 @@ struct cfi_flash_bank
        uint16_t manufacturer;
        uint16_t device_id;
 
-       char qry[3];
+       uint8_t qry[3];
 
        /* identification string */
        uint16_t pri_id;
@@ -70,6 +68,12 @@ struct cfi_flash_bank
 
        void *pri_ext;
        void *alt_ext;
+
+       /* calculated timeouts */
+       unsigned word_write_timeout;
+       unsigned buf_write_timeout;
+       unsigned block_erase_timeout;
+       unsigned chip_erase_timeout;
 };
 
 /* Intel primary extended query table
@@ -78,7 +82,7 @@ struct cfi_flash_bank
  */
 struct cfi_intel_pri_ext
 {
-       char pri[3];
+       uint8_t pri[3];
        uint8_t major_version;
        uint8_t minor_version;
        uint32_t feature_support;