treewide: Drop image_header_t typedef
This is not needed and we should avoid typedefs. Use the struct instead
and rename it to indicate that it really is a legacy struct.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/arm/mach-aspeed/ast2600/spl.c b/arch/arm/mach-aspeed/ast2600/spl.c
index 53c8a15..0952e73 100644
--- a/arch/arm/mach-aspeed/ast2600/spl.c
+++ b/arch/arm/mach-aspeed/ast2600/spl.c
@@ -56,9 +56,9 @@
return BOOT_DEVICE_RAM;
}
-struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
+struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
{
- return (struct image_header *)(CONFIG_SYS_LOAD_ADDR);
+ return (struct legacy_img_hdr *)(CONFIG_SYS_LOAD_ADDR);
}
#ifdef CONFIG_SPL_OS_BOOT
diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 0d1a776..c6747b2 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -589,7 +589,7 @@
switch (genimg_get_format(buf)) {
#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
- return (image_get_image_size((image_header_t *)img_addr)
+ return (image_get_image_size((struct legacy_img_hdr *)img_addr)
+ 0x1000 - 1) & ~(0x1000 - 1);
#endif
#if CONFIG_IS_ENABLED(FIT)
diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c
index 07bf07b..aa5d23a 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -72,7 +72,7 @@
int ret;
u32 offset;
u32 pagesize, size;
- struct image_header *header;
+ struct legacy_img_hdr *header;
u32 image_offset;
ret = rom_api_query_boot_infor(QUERY_IVT_OFF, &offset);
@@ -84,14 +84,14 @@
return -1;
}
- header = (struct image_header *)(CONFIG_SPL_IMX_ROMAPI_LOADADDR);
+ header = (struct legacy_img_hdr *)(CONFIG_SPL_IMX_ROMAPI_LOADADDR);
printf("image offset 0x%x, pagesize 0x%x, ivt offset 0x%x\n",
image_offset, pagesize, offset);
offset = spl_romapi_get_uboot_base(image_offset, rom_bt_dev);
- size = ALIGN(sizeof(struct image_header), pagesize);
+ size = ALIGN(sizeof(struct legacy_img_hdr), pagesize);
ret = rom_api_download_image((u8 *)header, offset, size);
if (ret != ROM_API_OKAY) {
diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c
index b3beeca..aea640b 100644
--- a/arch/arm/mach-k3/sysfw-loader.c
+++ b/arch/arm/mach-k3/sysfw-loader.c
@@ -88,10 +88,10 @@
* Populate SPL hook to override the default load address used by the SPL
* loader function with a custom address for SYSFW loading.
*/
-struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
+struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
{
if (sysfw_loaded)
- return (struct image_header *)(CONFIG_SYS_TEXT_BASE + offset);
+ return (struct legacy_img_hdr *)(CONFIG_SYS_TEXT_BASE + offset);
else if (sysfw_load_address)
return sysfw_load_address;
else
@@ -490,7 +490,7 @@
sysfw_loaded = true;
/* Ensure the SYSFW image is in FIT format */
- if (image_get_magic((const image_header_t *)sysfw_load_address) !=
+ if (image_get_magic((const struct legacy_img_hdr *)sysfw_load_address) !=
FDT_MAGIC)
panic("SYSFW image not in FIT format!\n");
diff --git a/arch/arm/mach-keystone/cmd_mon.c b/arch/arm/mach-keystone/cmd_mon.c
index e26296b..4734e4c 100644
--- a/arch/arm/mach-keystone/cmd_mon.c
+++ b/arch/arm/mach-keystone/cmd_mon.c
@@ -17,7 +17,7 @@
{
u32 addr, dpsc_base = 0x1E80000, freq, load_addr, size;
int rcode = 0;
- struct image_header *header;
+ struct legacy_img_hdr *header;
u32 ecrypt_bm_addr = 0;
if (argc < 2)
@@ -27,7 +27,7 @@
addr = hextoul(argv[1], NULL);
- header = (struct image_header *)addr;
+ header = (struct legacy_img_hdr *)addr;
if (image_get_magic(header) != IH_MAGIC) {
printf("## Please update monitor image\n");
@@ -36,7 +36,7 @@
load_addr = image_get_load(header);
size = image_get_data_size(header);
- memcpy((void *)load_addr, (void *)(addr + sizeof(struct image_header)),
+ memcpy((void *)load_addr, (void *)(addr + sizeof(struct legacy_img_hdr)),
size);
if (argc >= 3)
diff --git a/arch/arm/mach-sunxi/spl_spi_sunxi.c b/arch/arm/mach-sunxi/spl_spi_sunxi.c
index de9aa68..925bf85 100644
--- a/arch/arm/mach-sunxi/spl_spi_sunxi.c
+++ b/arch/arm/mach-sunxi/spl_spi_sunxi.c
@@ -335,10 +335,10 @@
struct spl_boot_device *bootdev)
{
int ret = 0;
- struct image_header *header;
- header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+ struct legacy_img_hdr *header;
uint32_t load_offset = sunxi_get_spl_size();
+ header = (struct legacy_img_hdr *)CONFIG_SYS_TEXT_BASE;
load_offset = max_t(uint32_t, load_offset, CONFIG_SYS_SPI_U_BOOT_OFFS);
spi0_init();
diff --git a/arch/mips/mach-jz47xx/jz4780/jz4780.c b/arch/mips/mach-jz47xx/jz4780/jz4780.c
index a57ec78..4c40bd8 100644
--- a/arch/mips/mach-jz47xx/jz4780/jz4780.c
+++ b/arch/mips/mach-jz47xx/jz4780/jz4780.c
@@ -30,7 +30,7 @@
typedef void __noreturn (*image_entry_noargs_t)(void);
struct mmc *mmc;
unsigned long count;
- struct image_header *header;
+ struct legacy_img_hdr *header;
int ret;
/* Set global data pointer */
@@ -58,8 +58,8 @@
if (ret)
hang();
- header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
- sizeof(struct image_header));
+ header = (struct legacy_img_hdr *)(CONFIG_SYS_TEXT_BASE -
+ sizeof(struct legacy_img_hdr));
count = blk_dread(mmc_get_blk_desc(mmc),
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
diff --git a/arch/mips/mach-mtmips/mt7621/spl/spl.c b/arch/mips/mach-mtmips/mt7621/spl/spl.c
index 91eebc6..aa5b267 100644
--- a/arch/mips/mach-mtmips/mt7621/spl/spl.c
+++ b/arch/mips/mach-mtmips/mt7621/spl/spl.c
@@ -64,7 +64,7 @@
unsigned long spl_nor_get_uboot_base(void)
{
const struct tpl_info *tpli;
- const image_header_t *hdr;
+ const struct legacy_img_hdr *hdr;
u32 addr;
addr = FLASH_MMAP_BASE + TPL_INFO_OFFSET;
@@ -72,7 +72,7 @@
if (tpli->magic == TPL_INFO_MAGIC) {
addr = FLASH_MMAP_BASE + tpli->size;
- hdr = (const image_header_t *)KSEG1ADDR(addr);
+ hdr = (const struct legacy_img_hdr *)KSEG1ADDR(addr);
if (image_get_magic(hdr) == IH_MAGIC) {
addr += sizeof(*hdr) + image_get_size(hdr);
diff --git a/arch/mips/mach-mtmips/mt7621/tpl/tpl.c b/arch/mips/mach-mtmips/mt7621/tpl/tpl.c
index 2a82890..d77592d 100644
--- a/arch/mips/mach-mtmips/mt7621/tpl/tpl.c
+++ b/arch/mips/mach-mtmips/mt7621/tpl/tpl.c
@@ -116,7 +116,7 @@
void __noreturn tpl_main(void)
{
- const image_header_t *hdr = (const image_header_t *)__image_copy_end;
+ const struct legacy_img_hdr *hdr = (const struct legacy_img_hdr *)__image_copy_end;
image_entry_noargs_t image_entry;
u32 loadaddr, size;
uintptr_t data;
@@ -132,7 +132,7 @@
image_entry = (image_entry_noargs_t)image_get_ep(hdr);
/* Load TPL image to L2 cache */
- data = (uintptr_t)__image_copy_end + sizeof(struct image_header);
+ data = (uintptr_t)__image_copy_end + sizeof(struct legacy_img_hdr);
fill_lock_l2cache(data, loadaddr, size);
/* Jump to SPL */
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 4fdf1b2..eafcddf 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -72,7 +72,7 @@
static int boot_prep_linux(struct bootm_headers *images)
{
char *cmd_line_dest = NULL;
- image_header_t *hdr;
+ struct legacy_img_hdr *hdr;
int is_zimage = 0;
void *data = NULL;
size_t len;