blob: c674e61cbdebf4fb8fd98a078efce7617cb157d1 [file] [log] [blame]
Simon Schwarze21d2d82011-09-14 15:33:34 -04001/*
2 * (C) Copyright 2010
3 * Texas Instruments, <www.ti.com>
4 *
5 * Aneesh V <aneesh@ti.com>
6 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Simon Schwarze21d2d82011-09-14 15:33:34 -04008 */
9#include <common.h>
Simon Glassf22851a2015-06-23 15:38:51 -060010#include <dm.h>
Tom Rini28591df2012-08-13 12:03:19 -070011#include <spl.h>
Paul Kocialkowski0d139722015-04-27 10:20:22 +020012#include <linux/compiler.h>
Nikita Kiryanov33eefe42015-11-08 17:11:49 +020013#include <errno.h>
Simon Schwarze21d2d82011-09-14 15:33:34 -040014#include <asm/u-boot.h>
Nikita Kiryanov022ddb82015-11-08 17:11:44 +020015#include <errno.h>
Simon Schwarze21d2d82011-09-14 15:33:34 -040016#include <mmc.h>
Tom Rini1530e8a2013-06-28 14:43:01 -040017#include <image.h>
Simon Schwarze21d2d82011-09-14 15:33:34 -040018
19DECLARE_GLOBAL_DATA_PTR;
20
Simon Glassee306792016-09-24 18:20:13 -060021static int mmc_load_legacy(struct spl_image_info *spl_image, struct mmc *mmc,
22 ulong sector, struct image_header *header)
Simon Glassb52c7fc2016-02-22 22:55:58 -070023{
24 u32 image_size_sectors;
25 unsigned long count;
Marek Vasut02266e22016-04-29 00:44:54 +020026 int ret;
27
Simon Glassee306792016-09-24 18:20:13 -060028 ret = spl_parse_image_header(spl_image, header);
Marek Vasut02266e22016-04-29 00:44:54 +020029 if (ret)
30 return ret;
Simon Glassb52c7fc2016-02-22 22:55:58 -070031
Simon Glassb52c7fc2016-02-22 22:55:58 -070032 /* convert size to sectors - round up */
Simon Glassee306792016-09-24 18:20:13 -060033 image_size_sectors = (spl_image->size + mmc->read_bl_len - 1) /
Simon Glassb52c7fc2016-02-22 22:55:58 -070034 mmc->read_bl_len;
35
36 /* Read the header too to avoid extra memcpy */
Simon Glass670d3042016-05-14 14:03:06 -060037 count = blk_dread(mmc_get_blk_desc(mmc), sector, image_size_sectors,
Simon Glassee306792016-09-24 18:20:13 -060038 (void *)(ulong)spl_image->load_addr);
Simon Glassb52c7fc2016-02-22 22:55:58 -070039 debug("read %x sectors to %x\n", image_size_sectors,
Simon Glassee306792016-09-24 18:20:13 -060040 spl_image->load_addr);
Simon Glassb52c7fc2016-02-22 22:55:58 -070041 if (count != image_size_sectors)
42 return -EIO;
43
44 return 0;
45}
46
Simon Glassb52c7fc2016-02-22 22:55:58 -070047static ulong h_spl_load_read(struct spl_load_info *load, ulong sector,
48 ulong count, void *buf)
49{
50 struct mmc *mmc = load->dev;
51
Simon Glass670d3042016-05-14 14:03:06 -060052 return blk_dread(mmc_get_blk_desc(mmc), sector, count, buf);
Simon Glassb52c7fc2016-02-22 22:55:58 -070053}
Simon Glassb52c7fc2016-02-22 22:55:58 -070054
Simon Glassee306792016-09-24 18:20:13 -060055static int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
56 struct mmc *mmc, unsigned long sector)
Simon Schwarze21d2d82011-09-14 15:33:34 -040057{
Paul Kocialkowski2d69f252015-05-22 12:45:35 +020058 unsigned long count;
Peter Korsgaardf2471292013-03-21 04:55:17 +000059 struct image_header *header;
Simon Glassb52c7fc2016-02-22 22:55:58 -070060 int ret = 0;
Simon Schwarze21d2d82011-09-14 15:33:34 -040061
62 header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
Paul Kocialkowski0d139722015-04-27 10:20:22 +020063 sizeof(struct image_header));
Simon Schwarze21d2d82011-09-14 15:33:34 -040064
65 /* read image header to find the image size & load address */
Simon Glass670d3042016-05-14 14:03:06 -060066 count = blk_dread(mmc_get_blk_desc(mmc), sector, 1, header);
Simon Glassb52c7fc2016-02-22 22:55:58 -070067 debug("hdr read sector %lx, count=%lu\n", sector, count);
68 if (count == 0) {
69 ret = -EIO;
Simon Schwarze21d2d82011-09-14 15:33:34 -040070 goto end;
Simon Glassb52c7fc2016-02-22 22:55:58 -070071 }
Simon Schwarze21d2d82011-09-14 15:33:34 -040072
Masahiro Yamada802f1c32016-03-16 12:10:00 +090073 if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
74 image_get_magic(header) == FDT_MAGIC) {
Simon Glassb52c7fc2016-02-22 22:55:58 -070075 struct spl_load_info load;
76
77 debug("Found FIT\n");
78 load.dev = mmc;
79 load.priv = NULL;
Lokesh Vutlaf62cef12016-05-24 10:34:38 +053080 load.filename = NULL;
Simon Glassb52c7fc2016-02-22 22:55:58 -070081 load.bl_len = mmc->read_bl_len;
82 load.read = h_spl_load_read;
Simon Glass43a734f2016-09-24 18:20:16 -060083 ret = spl_load_simple_fit(spl_image, &load, sector, header);
Masahiro Yamada802f1c32016-03-16 12:10:00 +090084 } else {
Simon Glassee306792016-09-24 18:20:13 -060085 ret = mmc_load_legacy(spl_image, mmc, sector, header);
Simon Glass5614db82015-06-23 15:38:47 -060086 }
Tom Rini1530e8a2013-06-28 14:43:01 -040087
Simon Schwarze21d2d82011-09-14 15:33:34 -040088end:
Simon Glassb52c7fc2016-02-22 22:55:58 -070089 if (ret) {
Paul Burtona8015fd2013-09-04 16:12:24 +010090#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
Fabio Estevam37342ab2016-04-20 23:12:04 -030091 puts("mmc_load_image_raw_sector: mmc block read error\n");
Paul Burtona8015fd2013-09-04 16:12:24 +010092#endif
Paul Kocialkowski2d69f252015-05-22 12:45:35 +020093 return -1;
Paul Kocialkowski01c723f2015-06-03 18:48:51 +020094 }
Paul Kocialkowski2d69f252015-05-22 12:45:35 +020095
96 return 0;
Simon Schwarze21d2d82011-09-14 15:33:34 -040097}
98
Nikita Kiryanove63b2dd2015-11-08 17:11:54 +020099int spl_mmc_get_device_index(u32 boot_device)
100{
101 switch (boot_device) {
102 case BOOT_DEVICE_MMC1:
103 return 0;
104 case BOOT_DEVICE_MMC2:
105 case BOOT_DEVICE_MMC2_2:
106 return 1;
107 }
108
109#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
110 printf("spl: unsupported mmc boot device.\n");
111#endif
112
113 return -ENODEV;
114}
115
Simon Glass4faf63b2015-12-02 10:59:12 -0700116static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200117{
Simon Glass51ace322015-12-02 10:59:13 -0700118#ifdef CONFIG_DM_MMC
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200119 struct udevice *dev;
Simon Glass51ace322015-12-02 10:59:13 -0700120#endif
Nikita Kiryanove63b2dd2015-11-08 17:11:54 +0200121 int err, mmc_dev;
122
123 mmc_dev = spl_mmc_get_device_index(boot_device);
124 if (mmc_dev < 0)
125 return mmc_dev;
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200126
127 err = mmc_initialize(NULL);
128 if (err) {
129#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
130 printf("spl: could not initialize mmc. error: %d\n", err);
131#endif
132 return err;
133 }
134
Simon Glass51ace322015-12-02 10:59:13 -0700135#ifdef CONFIG_DM_MMC
Nikita Kiryanove63b2dd2015-11-08 17:11:54 +0200136 err = uclass_get_device(UCLASS_MMC, mmc_dev, &dev);
Simon Glass51ace322015-12-02 10:59:13 -0700137 if (!err)
138 *mmcp = mmc_get_mmc_dev(dev);
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200139#else
Simon Glass51ace322015-12-02 10:59:13 -0700140 *mmcp = find_mmc_device(mmc_dev);
141 err = *mmcp ? 0 : -ENODEV;
142#endif
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200143 if (err) {
144#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
Simon Glass51ace322015-12-02 10:59:13 -0700145 printf("spl: could not find mmc device. error: %d\n", err);
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200146#endif
147 return err;
148 }
149
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200150 return 0;
151}
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200152
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100153#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
Simon Glassee306792016-09-24 18:20:13 -0600154static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
155 struct mmc *mmc, int partition)
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100156{
157 disk_partition_t info;
Paul Kocialkowski2d69f252015-05-22 12:45:35 +0200158 int err;
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100159
Simon Glass55877f92016-07-05 17:10:18 -0600160 err = part_get_info(mmc_get_blk_desc(mmc), partition, &info);
Paul Kocialkowski2d69f252015-05-22 12:45:35 +0200161 if (err) {
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100162#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
Paul Kocialkowski01c723f2015-06-03 18:48:51 +0200163 puts("spl: partition error\n");
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100164#endif
165 return -1;
166 }
167
Stefan Roesed0503cd2015-07-20 11:20:39 +0200168#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
Simon Glassee306792016-09-24 18:20:13 -0600169 return mmc_load_image_raw_sector(spl_image, mmc,
170 info.start + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
Stefan Roesed0503cd2015-07-20 11:20:39 +0200171#else
Simon Glassee306792016-09-24 18:20:13 -0600172 return mmc_load_image_raw_sector(spl_image, mmc, info.start);
Stefan Roesed0503cd2015-07-20 11:20:39 +0200173#endif
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100174}
Nikita Kiryanov011cd8f2015-11-08 17:11:46 +0200175#else
176#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION -1
Simon Glassee306792016-09-24 18:20:13 -0600177static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
178 struct mmc *mmc, int partition)
Nikita Kiryanov011cd8f2015-11-08 17:11:46 +0200179{
180 return -ENOSYS;
181}
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100182#endif
183
Peter Korsgaard01b542f2013-05-13 08:36:29 +0000184#ifdef CONFIG_SPL_OS_BOOT
Simon Glassee306792016-09-24 18:20:13 -0600185static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
186 struct mmc *mmc)
Peter Korsgaard01b542f2013-05-13 08:36:29 +0000187{
Paul Kocialkowski2d69f252015-05-22 12:45:35 +0200188 unsigned long count;
Lokesh Vutla9dee77f2016-04-11 15:24:50 +0530189 int ret;
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200190
Simon Glass70061ba2016-06-12 23:30:32 -0600191 count = blk_dread(mmc_get_blk_desc(mmc),
Paul Kocialkowski2d69f252015-05-22 12:45:35 +0200192 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
193 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
194 (void *) CONFIG_SYS_SPL_ARGS_ADDR);
195 if (count == 0) {
Paul Burtona8015fd2013-09-04 16:12:24 +0100196#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
Fabio Estevam37342ab2016-04-20 23:12:04 -0300197 puts("mmc_load_image_raw_os: mmc block read error\n");
Paul Burtona8015fd2013-09-04 16:12:24 +0100198#endif
Peter Korsgaard01b542f2013-05-13 08:36:29 +0000199 return -1;
200 }
201
Simon Glassee306792016-09-24 18:20:13 -0600202 ret = mmc_load_image_raw_sector(spl_image, mmc,
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200203 CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR);
Lokesh Vutla9dee77f2016-04-11 15:24:50 +0530204 if (ret)
205 return ret;
206
Simon Glassee306792016-09-24 18:20:13 -0600207 if (spl_image->os != IH_OS_LINUX) {
Lokesh Vutla9dee77f2016-04-11 15:24:50 +0530208 puts("Expected Linux image is not found. Trying to start U-boot\n");
209 return -ENOENT;
210 }
211
212 return 0;
Peter Korsgaard01b542f2013-05-13 08:36:29 +0000213}
Nikita Kiryanovcc49f552015-11-08 17:11:45 +0200214#else
215int spl_start_uboot(void)
216{
217 return 1;
218}
Simon Glassee306792016-09-24 18:20:13 -0600219static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
220 struct mmc *mmc)
Nikita Kiryanovcc49f552015-11-08 17:11:45 +0200221{
222 return -ENOSYS;
223}
Peter Korsgaard01b542f2013-05-13 08:36:29 +0000224#endif
225
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200226#ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION
Simon Glassee306792016-09-24 18:20:13 -0600227static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, struct mmc *mmc)
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200228{
229 int err = -ENOSYS;
230
231#ifdef CONFIG_SPL_FAT_SUPPORT
232 if (!spl_start_uboot()) {
Simon Glass3eb382a2016-09-24 18:20:15 -0600233 err = spl_load_image_fat_os(spl_image, mmc_get_blk_desc(mmc),
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200234 CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
235 if (!err)
236 return err;
237 }
238#ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
Simon Glass3eb382a2016-09-24 18:20:15 -0600239 err = spl_load_image_fat(spl_image, mmc_get_blk_desc(mmc),
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200240 CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
241 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
242 if (!err)
243 return err;
244#endif
245#endif
246#ifdef CONFIG_SPL_EXT_SUPPORT
247 if (!spl_start_uboot()) {
Simon Glass0649e912016-09-24 18:20:14 -0600248 err = spl_load_image_ext_os(spl_image, &mmc->block_dev,
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200249 CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
250 if (!err)
251 return err;
252 }
253#ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
Simon Glass0649e912016-09-24 18:20:14 -0600254 err = spl_load_image_ext(spl_image, &mmc->block_dev,
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200255 CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
256 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
257 if (!err)
258 return err;
259#endif
260#endif
261
262#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
263 err = -ENOENT;
264#endif
265
266 return err;
267}
268#else
Simon Glassee306792016-09-24 18:20:13 -0600269static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, struct mmc *mmc)
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200270{
271 return -ENOSYS;
272}
273#endif
274
Simon Glassee306792016-09-24 18:20:13 -0600275static int spl_mmc_load_image(struct spl_image_info *spl_image,
276 struct spl_boot_device *bootdev)
Simon Schwarze21d2d82011-09-14 15:33:34 -0400277{
Simon Glassa2b771c2015-12-02 10:59:11 -0700278 struct mmc *mmc = NULL;
Simon Schwarze21d2d82011-09-14 15:33:34 -0400279 u32 boot_mode;
Simon Glassf22851a2015-06-23 15:38:51 -0600280 int err = 0;
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200281 __maybe_unused int part;
Simon Schwarze21d2d82011-09-14 15:33:34 -0400282
Simon Glassc0b6c9b2016-09-24 18:19:57 -0600283 err = spl_mmc_find_device(&mmc, bootdev->boot_device);
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200284 if (err)
285 return err;
Simon Schwarze21d2d82011-09-14 15:33:34 -0400286
Nikita Kiryanov022ddb82015-11-08 17:11:44 +0200287 err = mmc_init(mmc);
Simon Schwarze21d2d82011-09-14 15:33:34 -0400288 if (err) {
Paul Burtona8015fd2013-09-04 16:12:24 +0100289#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200290 printf("spl: mmc init failed with error: %d\n", err);
Paul Burtona8015fd2013-09-04 16:12:24 +0100291#endif
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200292 return err;
Simon Schwarze21d2d82011-09-14 15:33:34 -0400293 }
Peter Korsgaard5e5483d2013-05-13 08:36:25 +0000294
Simon Glassc0b6c9b2016-09-24 18:19:57 -0600295 boot_mode = spl_boot_mode(bootdev->boot_device);
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200296 err = -EINVAL;
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200297 switch (boot_mode) {
Nikita Kiryanov2b3ae5f2015-11-08 17:11:48 +0200298 case MMCSD_MODE_EMMCBOOT:
299 /*
300 * We need to check what the partition is configured to.
301 * 1 and 2 match up to boot0 / boot1 and 7 is user data
302 * which is the first physical partition (0).
303 */
304 part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
305
306 if (part == 7)
307 part = 0;
308
Simon Glass11f2bb62016-05-01 13:52:29 -0600309 err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200310 if (err) {
Nikita Kiryanov2b3ae5f2015-11-08 17:11:48 +0200311#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
312 puts("spl: mmc partition switch failed\n");
313#endif
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200314 return err;
Nikita Kiryanov2b3ae5f2015-11-08 17:11:48 +0200315 }
316 /* Fall through */
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200317 case MMCSD_MODE_RAW:
318 debug("spl: mmc boot mode: raw\n");
319
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200320 if (!spl_start_uboot()) {
Simon Glassee306792016-09-24 18:20:13 -0600321 err = mmc_load_image_raw_os(spl_image, mmc);
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200322 if (!err)
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200323 return err;
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200324 }
Nikita Kiryanov011cd8f2015-11-08 17:11:46 +0200325
Simon Glassee306792016-09-24 18:20:13 -0600326 err = mmc_load_image_raw_partition(spl_image, mmc,
Paul Kocialkowski17675c82014-11-08 23:14:56 +0100327 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
Paul Kocialkowski4bd66e72015-06-08 23:05:09 +0200328 if (!err)
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200329 return err;
Nikita Kiryanov011cd8f2015-11-08 17:11:46 +0200330#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
Simon Glassee306792016-09-24 18:20:13 -0600331 err = mmc_load_image_raw_sector(spl_image, mmc,
Dan Murphyb7b5b0c2014-01-16 11:23:29 -0600332 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200333 if (!err)
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200334 return err;
Paul Kocialkowski4bd66e72015-06-08 23:05:09 +0200335#endif
Guillaume GARDET834dd882016-02-18 18:17:36 +0100336 /* If RAW mode fails, try FS mode. */
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200337 case MMCSD_MODE_FS:
338 debug("spl: mmc boot mode: fs\n");
339
Simon Glassee306792016-09-24 18:20:13 -0600340 err = spl_mmc_do_fs_boot(spl_image, mmc);
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200341 if (!err)
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200342 return err;
Nikita Kiryanov642648c2015-11-08 17:11:47 +0200343
Nikita Kiryanoved52f4d2015-11-08 17:11:43 +0200344 break;
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200345 case MMCSD_MODE_UNDEFINED:
Paul Burtona8015fd2013-09-04 16:12:24 +0100346#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
Nikita Kiryanoved52f4d2015-11-08 17:11:43 +0200347 default:
348 puts("spl: mmc: wrong boot mode\n");
Paul Burtona8015fd2013-09-04 16:12:24 +0100349#endif
Paul Kocialkowski0d139722015-04-27 10:20:22 +0200350 }
Nikita Kiryanoved52f4d2015-11-08 17:11:43 +0200351
Nikita Kiryanov33eefe42015-11-08 17:11:49 +0200352 return err;
Simon Schwarze21d2d82011-09-14 15:33:34 -0400353}
Simon Glassd449cb82016-09-24 18:20:00 -0600354
355SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_MMC1, spl_mmc_load_image);
356SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_MMC2, spl_mmc_load_image);
357SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_MMC2_2, spl_mmc_load_image);