From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 10/15] bootm: rename image_data::os/initrd with _uimage suffix
Date: Tue, 27 Jan 2026 09:39:20 +0100 [thread overview]
Message-ID: <20260127084546.3751357-11-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260127084546.3751357-1-a.fatoum@pengutronix.de>
We will use the generic unadorned for the incoming loadable support, so
add a _uimage suffix to the uimage-only members to make the association
clearer.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/powerpc/lib/ppclinux.c | 2 +-
common/bootm-uimage.c | 38 ++++++++++++++++++-------------------
common/bootm.c | 12 ++++++------
include/bootm.h | 4 ++--
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/arch/powerpc/lib/ppclinux.c b/arch/powerpc/lib/ppclinux.c
index eda2539e6125..4e9693cbad60 100644
--- a/arch/powerpc/lib/ppclinux.c
+++ b/arch/powerpc/lib/ppclinux.c
@@ -30,7 +30,7 @@ static struct fdt_header *bootm_relocate_fdt(struct image_data *data,
*/
if (os < (void *)fdt->totalsize) {
os = (void *)PAGE_ALIGN((phys_addr_t)os +
- data->os->header.ih_size);
+ data->os_uimage->header.ih_size);
os += fdt->totalsize;
if (os < LINUX_TLB1_MAX_ADDR)
os = LINUX_TLB1_MAX_ADDR;
diff --git a/common/bootm-uimage.c b/common/bootm-uimage.c
index 609b678e1d4a..b32ed5b0e95f 100644
--- a/common/bootm-uimage.c
+++ b/common/bootm-uimage.c
@@ -29,7 +29,7 @@ int bootm_load_uimage_os(struct image_data *data, unsigned long load_address)
num = uimage_part_num(data->os_part);
- data->os_res = uimage_load_to_sdram(data->os,
+ data->os_res = uimage_load_to_sdram(data->os_uimage,
num, load_address);
if (!data->os_res)
return -ENOMEM;
@@ -42,21 +42,21 @@ static int bootm_open_initrd_uimage(struct image_data *data)
int ret;
if (strcmp(data->os_file, data->initrd_file)) {
- data->initrd = uimage_open(data->initrd_file);
- if (!data->initrd)
+ data->initrd_uimage = uimage_open(data->initrd_file);
+ if (!data->initrd_uimage)
return -EINVAL;
if (bootm_get_verify_mode() > BOOTM_VERIFY_NONE) {
- ret = uimage_verify(data->initrd);
+ ret = uimage_verify(data->initrd_uimage);
if (ret) {
pr_err("Checking data crc failed with %pe\n",
ERR_PTR(ret));
return ret;
}
}
- uimage_print_contents(data->initrd);
+ uimage_print_contents(data->initrd_uimage);
} else {
- data->initrd = data->os;
+ data->initrd_uimage = data->os_uimage;
}
return 0;
@@ -90,7 +90,7 @@ bootm_load_uimage_initrd(struct image_data *data, unsigned long load_address)
num = uimage_part_num(data->initrd_part);
- res = uimage_load_to_sdram(data->initrd,
+ res = uimage_load_to_sdram(data->initrd_uimage,
num, load_address);
if (!res)
return ERR_PTR(-ENOMEM);
@@ -110,9 +110,9 @@ int bootm_open_oftree_uimage(struct image_data *data, size_t *size,
pr_info("Loading devicetree from '%s'@%d\n", oftree, num);
if (!strcmp(data->os_file, oftree)) {
- of_handle = data->os;
+ of_handle = data->os_uimage;
} else if (!strcmp(data->initrd_file, oftree)) {
- of_handle = data->initrd;
+ of_handle = data->initrd_uimage;
} else {
of_handle = uimage_open(oftree);
if (!of_handle)
@@ -141,12 +141,12 @@ int bootm_open_uimage(struct image_data *data)
{
int ret;
- data->os = uimage_open(data->os_file);
- if (!data->os)
+ data->os_uimage = uimage_open(data->os_file);
+ if (!data->os_uimage)
return -EINVAL;
if (bootm_get_verify_mode() > BOOTM_VERIFY_NONE) {
- ret = uimage_verify(data->os);
+ ret = uimage_verify(data->os_uimage);
if (ret) {
pr_err("Checking data crc failed with %pe\n",
ERR_PTR(ret));
@@ -154,23 +154,23 @@ int bootm_open_uimage(struct image_data *data)
}
}
- uimage_print_contents(data->os);
+ uimage_print_contents(data->os_uimage);
- if (IH_ARCH == IH_ARCH_INVALID || data->os->header.ih_arch != IH_ARCH) {
+ if (IH_ARCH == IH_ARCH_INVALID || data->os_uimage->header.ih_arch != IH_ARCH) {
pr_err("Unsupported Architecture 0x%x\n",
- data->os->header.ih_arch);
+ data->os_uimage->header.ih_arch);
return -EINVAL;
}
if (data->os_address == UIMAGE_SOME_ADDRESS)
- data->os_address = data->os->header.ih_load;
+ data->os_address = data->os_uimage->header.ih_load;
return 0;
}
void bootm_close_uimage(struct image_data *data)
{
- if (data->initrd && data->initrd != data->os)
- uimage_close(data->initrd);
- uimage_close(data->os);
+ if (data->initrd_uimage && data->initrd_uimage != data->os_uimage)
+ uimage_close(data->initrd_uimage);
+ uimage_close(data->os_uimage);
}
diff --git a/common/bootm.c b/common/bootm.c
index a2301ea72458..7fe0afe24ce8 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -33,7 +33,7 @@ static bool uimage_check(struct image_handler *handler,
enum filetype detected_filetype)
{
return detected_filetype == filetype_uimage &&
- handler->ih_os == data->os->header.ih_os;
+ handler->ih_os == data->os_uimage->header.ih_os;
}
static bool filetype_check(struct image_handler *handler,
@@ -208,7 +208,7 @@ static int uimage_part_num(const char *partname)
static inline bool image_is_uimage(struct image_data *data)
{
- return IS_ENABLED(CONFIG_BOOTM_UIMAGE) && data->os;
+ return IS_ENABLED(CONFIG_BOOTM_UIMAGE) && data->os_uimage;
}
static bool bootm_get_override(char **oldpath, const char *newpath)
@@ -322,7 +322,7 @@ bootm_load_initrd(struct image_data *data, ulong load_address, ulong end_address
if (type == filetype_uimage) {
res = bootm_load_uimage_initrd(data, load_address);
- if (data->initrd->header.ih_type == IH_TYPE_MULTI)
+ if (data->initrd_uimage->header.ih_type == IH_TYPE_MULTI)
initrd_part = data->initrd_part;
} else if (initrd) {
@@ -496,7 +496,7 @@ int bootm_get_os_size(struct image_data *data)
int ret;
if (image_is_uimage(data))
- return uimage_get_size(data->os, uimage_part_num(data->os_part));
+ return uimage_get_size(data->os_uimage, uimage_part_num(data->os_part));
if (data->os_fit)
return data->fit_kernel_size;
if (!data->os_file)
@@ -744,7 +744,7 @@ int bootm_boot(struct bootm_data *bootm_data)
pr_info("\nLoading %s '%s'", file_type_to_string(data->kernel_type), data->os_file);
if (data->kernel_type == filetype_uimage &&
- data->os->header.ih_type == IH_TYPE_MULTI)
+ data->os_uimage->header.ih_type == IH_TYPE_MULTI)
pr_info(", multifile image %d", uimage_part_num(data->os_part));
pr_info("\n");
@@ -758,7 +758,7 @@ int bootm_boot(struct bootm_data *bootm_data)
pr_err("no image handler found for image type %s\n",
file_type_to_string(data->kernel_type));
if (data->kernel_type == filetype_uimage)
- pr_err("and OS type: %d\n", data->os->header.ih_os);
+ pr_err("and OS type: %d\n", data->os_uimage->header.ih_os);
ret = -ENODEV;
goto err_out;
}
diff --git a/include/bootm.h b/include/bootm.h
index bdabba23f2b9..ef979807505d 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -59,7 +59,7 @@ struct image_data {
struct resource *os_res;
/* if os is an uImage this will be provided */
- struct uimage_handle *os;
+ struct uimage_handle *os_uimage;
/* if os is a FIT image this will be provided */
struct fit_handle *os_fit;
@@ -84,7 +84,7 @@ struct image_data {
struct resource *initrd_res;
/* if initrd is an uImage this will be provided */
- struct uimage_handle *initrd;
+ struct uimage_handle *initrd_uimage;
char *initrd_part;
/* otherwise only the filename will be provided */
--
2.47.3
next prev parent reply other threads:[~2026-01-27 9:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 8:39 [PATCH 00/15] bootm: prepare loadable abstraction rework Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 01/15] FIT: implement fit_count_images Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 02/15] FIT: add image index argument to fit_open_image Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 03/15] resource: implement gap-aware lookup_region Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 04/15] bootm: give bootm_load_ functions an end address Ahmad Fatoum
2026-01-27 15:31 ` Ahmad Fatoum
2026-01-30 13:35 ` Sascha Hauer
2026-01-27 8:39 ` [PATCH 05/15] bootm: store separate image_type and kernel_type Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 06/15] bootm: cache os_file for appendroot purposes Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 07/15] bootm: fit: move length calculation into fit_open Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 08/15] libfile: factor out zero-page resistant read_file as __read_full_anywhere Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 09/15] resource: implement resize_region Ahmad Fatoum
2026-01-30 12:38 ` Sascha Hauer
2026-01-27 8:39 ` Ahmad Fatoum [this message]
2026-01-27 8:39 ` [PATCH 11/15] uimage: record original file name in uimage_handle Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 12/15] bootm: factor out file detection into helper Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 13/15] efi: payload: bootm: add dry run support Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 14/15] efi: payload: bootm: fix memory corruption on initrd load error Ahmad Fatoum
2026-01-27 8:39 ` [PATCH 15/15] efi: initrd: make efi_initrd_register initrd pointer param const Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260127084546.3751357-11-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox