From 9adce87efc8acc947b8b49d700c9773a7f071e02 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Wed, 1 Dec 2021 11:50:22 +0530 Subject: [PATCH] feat(fwu): add a function to pass metadata structure to platforms Add a helper function to pass the metadata structure to the platforms. Platforms can then read the metadata structure and pass the boot index value, i.e. the bank(partition) from which the firmware images were booted, to the Update Agent. Signed-off-by: Sughosh Ganu Change-Id: I571179b9baa0fbc4d0f08d7a6e3b50c0c7165c5c --- drivers/fwu/fwu.c | 7 +++++++ include/drivers/fwu/fwu.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/fwu/fwu.c b/drivers/fwu/fwu.c index 7cb4c2982..b8b13cdfa 100644 --- a/drivers/fwu/fwu.c +++ b/drivers/fwu/fwu.c @@ -157,6 +157,13 @@ bool fwu_is_trial_run_state(void) return trial_run; } +const struct fwu_metadata *fwu_get_metadata(void) +{ + assert(is_fwu_initialized); + + return &metadata; +} + /******************************************************************************* * Load verified copy of FWU metadata image kept in the platform NV storage * into local FWU metadata structure. diff --git a/include/drivers/fwu/fwu.h b/include/drivers/fwu/fwu.h index ae06da98f..9f18e221c 100644 --- a/include/drivers/fwu/fwu.h +++ b/include/drivers/fwu/fwu.h @@ -11,5 +11,6 @@ void fwu_init(void); bool fwu_is_trial_run_state(void); +const struct fwu_metadata *fwu_get_metadata(void); #endif /* FWU_H */