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();