Re: [U-Boot] [PATCH 26/27] spl: Update spl_load_simple_fit() to take an spl_image param

2016-09-18 Thread Tom Rini
On Sun, Sep 18, 2016 at 01:45:15PM -0600, Simon Glass wrote:

> Upda the SPL FIT code to use the spl_image parameter.
> 
> Signed-off-by: Simon Glass 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 26/27] spl: Update spl_load_simple_fit() to take an spl_image param

2016-09-18 Thread Simon Glass
Upda the SPL FIT code to use the spl_image parameter.

Signed-off-by: Simon Glass 
---

 common/spl/spl.c| 2 +-
 common/spl/spl_fat.c| 2 +-
 common/spl/spl_fit.c| 9 +
 common/spl/spl_mmc.c| 2 +-
 common/spl/spl_nand.c   | 2 +-
 common/spl/spl_spi.c| 2 +-
 common/spl/spl_ymodem.c | 2 +-
 include/spl.h   | 4 +++-
 8 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index e295b2e..0a9c632 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -199,7 +199,7 @@ static int spl_ram_load_image(struct spl_image_info 
*spl_image,
debug("Found FIT\n");
load.bl_len = 1;
load.read = spl_ram_load_read;
-   spl_load_simple_fit(, 0, header);
+   spl_load_simple_fit(spl_image, , 0, header);
} else {
debug("Legacy image\n");
/*
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index e2bb000..a14acce 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -82,7 +82,7 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
load.filename = (void *)filename;
load.priv = NULL;
 
-   return spl_load_simple_fit(, 0, header);
+   return spl_load_simple_fit(spl_image, , 0, header);
} else {
err = spl_parse_image_header(spl_image, header);
if (err)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index be86072..aae556f 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -123,7 +123,8 @@ static int get_aligned_image_size(struct spl_load_info 
*info, int data_size,
return (data_size + info->bl_len - 1) / info->bl_len;
 }
 
-int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit)
+int spl_load_simple_fit(struct spl_image_info *spl_image,
+   struct spl_load_info *info, ulong sector, void *fit)
 {
int sectors;
ulong size, load;
@@ -184,9 +185,9 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong 
sector, void *fit)
data_size = fdt_getprop_u32(fit, node, "data-size");
load = fdt_getprop_u32(fit, node, "load");
debug("data_offset=%x, data_size=%x\n", data_offset, data_size);
-   spl_image.load_addr = load;
-   spl_image.entry_point = load;
-   spl_image.os = IH_OS_U_BOOT;
+   spl_image->load_addr = load;
+   spl_image->entry_point = load;
+   spl_image->os = IH_OS_U_BOOT;
 
/*
 * Work out where to place the image. We read it so that the first
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 16a6b49..c674e61 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -80,7 +80,7 @@ static int mmc_load_image_raw_sector(struct spl_image_info 
*spl_image,
load.filename = NULL;
load.bl_len = mmc->read_bl_len;
load.read = h_spl_load_read;
-   ret = spl_load_simple_fit(, sector, header);
+   ret = spl_load_simple_fit(spl_image, , sector, header);
} else {
ret = mmc_load_legacy(spl_image, mmc, sector, header);
}
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 5cf712e..d1abda6 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -59,7 +59,7 @@ static int spl_nand_load_element(struct spl_image_info 
*spl_image,
load.filename = NULL;
load.bl_len = 1;
load.read = spl_nand_fit_read;
-   return spl_load_simple_fit(, offset, header);
+   return spl_load_simple_fit(spl_image, , offset, header);
} else {
err = spl_parse_image_header(spl_image, header);
if (err)
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index 4bf3d65..a3caafb 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -108,7 +108,7 @@ static int spl_spi_load_image(struct spl_image_info 
*spl_image,
load.filename = NULL;
load.bl_len = 1;
load.read = spl_spi_fit_read;
-   err = spl_load_simple_fit(,
+   err = spl_load_simple_fit(spl_image, ,
  CONFIG_SYS_SPI_U_BOOT_OFFS,
  header);
} else {
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index 8fbf895..13e8e51 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -103,7 +103,7 @@ static int spl_ymodem_load_image(struct spl_image_info 
*spl_image,
info.buf = buf;
info.image_read = BUF_SIZE;
load.read = ymodem_read_fit;
-   ret =  spl_load_simple_fit(, 0, (void *)buf);
+   ret = spl_load_simple_fit(spl_image, , 0, (void *)buf);
size =