Commit f4d7d8596f3a4f5bce500c622b75d2e9c8d6f989

Authored by Simon Glass
Committed by Tom Rini
1 parent 710e9ca579

spl: Update spl_load_simple_fit() to take an spl_image param

Upda the SPL FIT code to use the spl_image parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

Showing 8 changed files with 14 additions and 11 deletions Side-by-side Diff

... ... @@ -204,7 +204,7 @@
204 204 debug("Found FIT\n");
205 205 load.bl_len = 1;
206 206 load.read = spl_ram_load_read;
207   - spl_load_simple_fit(&load, 0, header);
  207 + spl_load_simple_fit(spl_image, &load, 0, header);
208 208 } else {
209 209 debug("Legacy image\n");
210 210 /*
common/spl/spl_fat.c
... ... @@ -82,7 +82,7 @@
82 82 load.filename = (void *)filename;
83 83 load.priv = NULL;
84 84  
85   - return spl_load_simple_fit(&load, 0, header);
  85 + return spl_load_simple_fit(spl_image, &load, 0, header);
86 86 } else {
87 87 err = spl_parse_image_header(spl_image, header);
88 88 if (err)
common/spl/spl_fit.c
... ... @@ -123,7 +123,8 @@
123 123 return (data_size + info->bl_len - 1) / info->bl_len;
124 124 }
125 125  
126   -int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit)
  126 +int spl_load_simple_fit(struct spl_image_info *spl_image,
  127 + struct spl_load_info *info, ulong sector, void *fit)
127 128 {
128 129 int sectors;
129 130 ulong size, load;
... ... @@ -184,9 +185,9 @@
184 185 data_size = fdt_getprop_u32(fit, node, "data-size");
185 186 load = fdt_getprop_u32(fit, node, "load");
186 187 debug("data_offset=%x, data_size=%x\n", data_offset, data_size);
187   - spl_image.load_addr = load;
188   - spl_image.entry_point = load;
189   - spl_image.os = IH_OS_U_BOOT;
  188 + spl_image->load_addr = load;
  189 + spl_image->entry_point = load;
  190 + spl_image->os = IH_OS_U_BOOT;
190 191  
191 192 /*
192 193 * Work out where to place the image. We read it so that the first
common/spl/spl_mmc.c
... ... @@ -80,7 +80,7 @@
80 80 load.filename = NULL;
81 81 load.bl_len = mmc->read_bl_len;
82 82 load.read = h_spl_load_read;
83   - ret = spl_load_simple_fit(&load, sector, header);
  83 + ret = spl_load_simple_fit(spl_image, &load, sector, header);
84 84 } else {
85 85 ret = mmc_load_legacy(spl_image, mmc, sector, header);
86 86 }
common/spl/spl_nand.c
... ... @@ -59,7 +59,7 @@
59 59 load.filename = NULL;
60 60 load.bl_len = 1;
61 61 load.read = spl_nand_fit_read;
62   - return spl_load_simple_fit(&load, offset, header);
  62 + return spl_load_simple_fit(spl_image, &load, offset, header);
63 63 } else {
64 64 err = spl_parse_image_header(spl_image, header);
65 65 if (err)
common/spl/spl_spi.c
... ... @@ -108,7 +108,7 @@
108 108 load.filename = NULL;
109 109 load.bl_len = 1;
110 110 load.read = spl_spi_fit_read;
111   - err = spl_load_simple_fit(&load,
  111 + err = spl_load_simple_fit(spl_image, &load,
112 112 CONFIG_SYS_SPI_U_BOOT_OFFS,
113 113 header);
114 114 } else {
common/spl/spl_ymodem.c
... ... @@ -103,7 +103,7 @@
103 103 info.buf = buf;
104 104 info.image_read = BUF_SIZE;
105 105 load.read = ymodem_read_fit;
106   - ret = spl_load_simple_fit(&load, 0, (void *)buf);
  106 + ret = spl_load_simple_fit(spl_image, &load, 0, (void *)buf);
107 107 size = info.image_read;
108 108  
109 109 while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0)
... ... @@ -49,6 +49,7 @@
49 49  
50 50 /**
51 51 * spl_load_simple_fit() - Loads a fit image from a device.
  52 + * @spl_image: Image description to set up
52 53 * @info: Structure containing the information required to load data.
53 54 * @sector: Sector number where FIT image is located in the device
54 55 * @fdt: Pointer to the copied FIT header.
... ... @@ -57,7 +58,8 @@
57 58 * specified load address and copies the dtb to end of u-boot image.
58 59 * Returns 0 on success.
59 60 */
60   -int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fdt);
  61 +int spl_load_simple_fit(struct spl_image_info *spl_image,
  62 + struct spl_load_info *info, ulong sector, void *fdt);
61 63  
62 64 #define SPL_COPY_PAYLOAD_ONLY 1
63 65