summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-11-09 19:43:20 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-18 04:52:47 +0000
commitaf71b33619fdd9ec4f787c829b8fdde326ab1920 (patch)
tree53a0a6dab96d142d6707fdbbab73160e6f81ccac /include
parent7bba0b1edb635806250fe617043f93d2f8b0541c (diff)
downloadchrome-ec-af71b33619fdd9ec4f787c829b8fdde326ab1920.tar.gz
Revert "EFS: Switch active slot when current slot is invalid"
This reverts commit 729a4ba2bdc20675e24ed9e7d0a98d19934d72f8. BUG=b:200823466 TEST=make buildall -j Change-Id: I850e674c9bc347520effd97611878ea3e3153a56 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273448 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/flash.h25
-rw-r--r--include/system.h37
2 files changed, 34 insertions, 28 deletions
diff --git a/include/flash.h b/include/flash.h
index e2c572d38f..d21decdc2c 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -102,6 +102,31 @@ enum flash_region {
FLASH_REGION_COUNT
};
+/**
+ * Get active slot
+ *
+ * Active slot contains an image which is being executed or will be executed
+ * after sysjump.
+ *
+ * @return Active slot index
+ */
+enum flash_rw_slot flash_get_active_slot(void);
+
+/**
+ * Get updatable (non-active) slot
+ *
+ * @return Updatable slot index
+ */
+enum flash_rw_slot flash_get_update_slot(void);
+
+/**
+ * Translate slot index to image index
+ *
+ * @param slot Slot index to convert.
+ * @return Image index converted from <slot>
+ */
+enum system_image_copy_t flash_slot_to_image(enum flash_rw_slot slot);
+
/*****************************************************************************/
/* Low-level methods, for use by flash_common. */
diff --git a/include/system.h b/include/system.h
index 6702b1583b..f2941556b1 100644
--- a/include/system.h
+++ b/include/system.h
@@ -548,37 +548,18 @@ static inline void system_print_extended_version_info(void)
*/
int system_can_boot_ap(void);
-/**
- * Get active image copy
- *
- * Active slot contains an image which is being executed or will be executed
- * after sysjump.
- *
- * @return Active copy index
- */
-enum system_image_copy_t system_get_active_copy(void);
-
-/**
- * Get updatable (non-active) image copy
- *
- * @return Updatable copy index
- */
-enum system_image_copy_t system_get_update_copy(void);
-
-/**
- * Set active image copy
- *
- * @param copy Copy id to be activated.
- * @return Non-zero if error.
- */
-int system_set_active_copy(enum system_image_copy_t copy);
+enum flash_rw_slot {
+ /* Must be 0 and 1 because they are converted by 1 - slot_x. */
+ FLASH_RW_SLOT_A = 0,
+ FLASH_RW_SLOT_B = 1,
+};
/**
- * Get flash offset of a RW copy
+ * Get flash offset of a RW slot
*
- * @param copy Copy index to get the flash offset of.
- * @return Flash offset of the slot storing <copy>
+ * @param slot Slot index to get the flash offset of.
+ * @return Flash offset of the slot specified by <slot>
*/
-uint32_t flash_get_rw_offset(enum system_image_copy_t copy);
+uint32_t flash_get_rw_offset(enum flash_rw_slot slot);
#endif /* __CROS_EC_SYSTEM_H */