+/*
+ * Trim cycle count measurements
+ */
+#define MAX_NR_BLOCK_INFOS 8192
+#define BLOCK_INFO_STATE_SHIFT 29
+#define BLOCK_INFO_TRIMS(block_info) \
+ ((block_info) & ((1 << BLOCK_INFO_STATE_SHIFT) - 1))
+#define BLOCK_INFO_STATE(block_info) \
+ ((block_info) >> BLOCK_INFO_STATE_SHIFT)
+#define BLOCK_INFO(state, trim_cycles) \
+ ((trim_cycles) | ((state) << BLOCK_INFO_STATE_SHIFT))
+#define BLOCK_INFO_SET_STATE(block_info, state) \
+ BLOCK_INFO(state, BLOCK_INFO_TRIMS(block_info))
+enum block_info_state {
+ BLOCK_STATE_UNINIT,
+ BLOCK_STATE_TRIMMED,
+ BLOCK_STATE_WRITTEN,
+ BLOCK_STATE_TRIM_FAILURE,
+ BLOCK_STATE_WRITE_FAILURE,
+ BLOCK_STATE_COUNT,
+};
+