summaryrefslogtreecommitdiff
path: root/boot/image.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-21 03:23:03 +0300
committerTom Rini <trini@konsulko.com>2022-10-31 18:02:44 +0300
commit44ad35a0f699b0b49ef6efaa1405b6f99c703ea8 (patch)
tree5e747333f41e62e7641ed2d968c14890820359e3 /boot/image.c
parentb2d93c6aaa99f3f90470c0df3e49bd5ed265d350 (diff)
downloadu-boot-44ad35a0f699b0b49ef6efaa1405b6f99c703ea8.tar.xz
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/image.c')
-rw-r--r--boot/image.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/boot/image.c b/boot/image.c
index 9f95b3260a..b33d1dfc6b 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);
+}