aboutsummaryrefslogtreecommitdiff
path: root/include/fwu.h
diff options
context:
space:
mode:
authorSughosh Ganu2022-10-21 18:16:02 +0530
committerTom Rini2022-10-31 14:47:32 -0400
commit7e9814cc6c1dcda8cb8028e1d34483387889e149 (patch)
tree1c4130356d450deba6b9fc3a40dce1e4c7763183 /include/fwu.h
parent467bad5e368abfb8bca218b988567799e53f9e03 (diff)
FWU: Add boot time checks as highlighted by the FWU specification
The FWU Multi Bank Update specification requires the Update Agent to carry out certain checks at the time of platform boot. The Update Agent is the component which is responsible for updating the firmware components and maintaining and keeping the metadata in sync. The spec requires that the Update Agent perform the following checks at the time of boot * Sanity check of both the metadata copies maintained by the platform. * Get the boot index passed to U-Boot by the prior stage bootloader and use this value for metadata bookkeeping. * Check if the system is booting in Trial State. If the system boots in the Trial State for more than a specified number of boot counts, change the Active Bank to be booting the platform from. Call these checks through the main loop event at the time of platform boot. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/fwu.h')
-rw-r--r--include/fwu.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/fwu.h b/include/fwu.h
index 73628c59f44..a8ed67b0e0e 100644
--- a/include/fwu.h
+++ b/include/fwu.h
@@ -353,4 +353,30 @@ int fwu_plat_get_update_index(uint *update_idx);
*
*/
void fwu_plat_get_bootidx(uint *boot_idx);
+
+/**
+ * fwu_update_checks_pass() - Check if FWU update can be done
+ *
+ * Check if the FWU update can be executed. The updates are
+ * allowed only when the platform is not in Trial State and
+ * the boot time checks have passed
+ *
+ * Return: 1 if OK, 0 if checks do not pass
+ *
+ */
+u8 fwu_update_checks_pass(void);
+
+/**
+ * fwu_empty_capsule_checks_pass() - Check if empty capsule can be processed
+ *
+ * Check if the empty capsule can be processed to either accept or revert
+ * an earlier executed update. The empty capsules need to be processed
+ * only when the platform is in Trial State and the boot time checks have
+ * passed
+ *
+ * Return: 1 if OK, 0 if not to be allowed
+ *
+ */
+u8 fwu_empty_capsule_checks_pass(void);
+
#endif /* _FWU_H_ */