diff options
author | Simon Glass <sjg@chromium.org> | 2022-10-20 18:23:03 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-10-31 11:02:44 -0400 |
commit | 44ad35a0f699b0b49ef6efaa1405b6f99c703ea8 (patch) | |
tree | 5e747333f41e62e7641ed2d968c14890820359e3 /boot | |
parent | b2d93c6aaa99f3f90470c0df3e49bd5ed265d350 (diff) | |
download | u-boot-44ad35a0f699b0b49ef6efaa1405b6f99c703ea8.zip u-boot-44ad35a0f699b0b49ef6efaa1405b6f99c703ea8.tar.gz u-boot-44ad35a0f699b0b49ef6efaa1405b6f99c703ea8.tar.bz2 |
image: Add the concept of a phase to FIT
We want to be able to mark an image as related to a phase, so we can
easily load all the images for SPL or for U-Boot proper.
Add this to the FIT specification, along with some access functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/image.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/boot/image.c b/boot/image.c index 9f95b32..b33d1df 100644 --- a/boot/image.c +++ b/boot/image.c @@ -194,6 +194,13 @@ static const table_entry_t uimage_comp[] = { { -1, "", "", }, }; +static const table_entry_t uimage_phase[] = { + { IH_PHASE_NONE, "none", "any", }, + { IH_PHASE_U_BOOT, "u-boot", "U-Boot phase", }, + { IH_PHASE_SPL, "spl", "SPL Phase", }, + { -1, "", "", }, +}; + struct table_info { const char *desc; int count; @@ -215,6 +222,7 @@ static const struct table_info table_info[IH_COUNT] = { { "compression", IH_COMP_COUNT, uimage_comp }, { "operating system", IH_OS_COUNT, uimage_os }, { "image type", IH_TYPE_COUNT, uimage_type }, + { "phase", IH_PHASE_COUNT, uimage_phase }, }; /*****************************************************************************/ @@ -656,6 +664,11 @@ const char *genimg_get_comp_name(uint8_t comp) comp)); } +const char *genimg_get_phase_name(enum image_phase_t phase) +{ + return get_table_entry_name(uimage_phase, "Unknown Phase", phase); +} + static const char *genimg_get_short_name(const table_entry_t *table, int val) { table = get_table_entry(table, val); @@ -731,3 +744,8 @@ int genimg_get_comp_id(const char *name) { return (get_table_entry_id(uimage_comp, "Compression", name)); } + +int genimg_get_phase_id(const char *name) +{ + return get_table_entry_id(uimage_phase, "Phase", name); +} |