Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2010 |
| 3 | * Texas Instruments, <www.ti.com> |
| 4 | * |
| 5 | * Aneesh V <aneesh@ti.com> |
| 6 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 8 | */ |
| 9 | #include <common.h> |
Simon Glass | f22851a | 2015-06-23 15:38:51 -0600 | [diff] [blame] | 10 | #include <dm.h> |
Tom Rini | 28591df | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 11 | #include <spl.h> |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 12 | #include <linux/compiler.h> |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 13 | #include <asm/u-boot.h> |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 14 | #include <mmc.h> |
Tom Rini | 1530e8a | 2013-06-28 14:43:01 -0400 | [diff] [blame] | 15 | #include <image.h> |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 16 | |
| 17 | DECLARE_GLOBAL_DATA_PTR; |
| 18 | |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 19 | static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector) |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 20 | { |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 21 | unsigned long count; |
Peter Korsgaard | f247129 | 2013-03-21 04:55:17 +0000 | [diff] [blame] | 22 | u32 image_size_sectors; |
| 23 | struct image_header *header; |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 24 | |
| 25 | header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 26 | sizeof(struct image_header)); |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 27 | |
| 28 | /* read image header to find the image size & load address */ |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 29 | count = mmc->block_dev.block_read(0, sector, 1, header); |
Simon Glass | 5614db8 | 2015-06-23 15:38:47 -0600 | [diff] [blame] | 30 | debug("read sector %lx, count=%lu\n", sector, count); |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 31 | if (count == 0) |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 32 | goto end; |
| 33 | |
Simon Glass | 5614db8 | 2015-06-23 15:38:47 -0600 | [diff] [blame] | 34 | if (image_get_magic(header) != IH_MAGIC) { |
| 35 | puts("bad magic\n"); |
Tom Rini | 1530e8a | 2013-06-28 14:43:01 -0400 | [diff] [blame] | 36 | return -1; |
Simon Glass | 5614db8 | 2015-06-23 15:38:47 -0600 | [diff] [blame] | 37 | } |
Tom Rini | 1530e8a | 2013-06-28 14:43:01 -0400 | [diff] [blame] | 38 | |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 39 | spl_parse_image_header(header); |
| 40 | |
| 41 | /* convert size to sectors - round up */ |
Tom Rini | a0b9fa5 | 2012-08-14 10:25:15 -0700 | [diff] [blame] | 42 | image_size_sectors = (spl_image.size + mmc->read_bl_len - 1) / |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 43 | mmc->read_bl_len; |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 44 | |
| 45 | /* Read the header too to avoid extra memcpy */ |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 46 | count = mmc->block_dev.block_read(0, sector, image_size_sectors, |
Gong Qianyu | 2ae4589 | 2015-07-30 14:07:12 +0800 | [diff] [blame] | 47 | (void *)(ulong)spl_image.load_addr); |
Simon Glass | 5614db8 | 2015-06-23 15:38:47 -0600 | [diff] [blame] | 48 | debug("read %x sectors to %x\n", image_size_sectors, |
| 49 | spl_image.load_addr); |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 50 | |
| 51 | end: |
Paul Kocialkowski | 01c723f | 2015-06-03 18:48:51 +0200 | [diff] [blame] | 52 | if (count == 0) { |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 53 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 01c723f | 2015-06-03 18:48:51 +0200 | [diff] [blame] | 54 | puts("spl: mmc block read error\n"); |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 55 | #endif |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 56 | return -1; |
Paul Kocialkowski | 01c723f | 2015-06-03 18:48:51 +0200 | [diff] [blame] | 57 | } |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 58 | |
| 59 | return 0; |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 60 | } |
| 61 | |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 62 | #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION |
| 63 | static int mmc_load_image_raw_partition(struct mmc *mmc, int partition) |
| 64 | { |
| 65 | disk_partition_t info; |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 66 | int err; |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 67 | |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 68 | err = get_partition_info(&mmc->block_dev, partition, &info); |
| 69 | if (err) { |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 70 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 01c723f | 2015-06-03 18:48:51 +0200 | [diff] [blame] | 71 | puts("spl: partition error\n"); |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 72 | #endif |
| 73 | return -1; |
| 74 | } |
| 75 | |
Stefan Roese | d0503cd | 2015-07-20 11:20:39 +0200 | [diff] [blame] | 76 | #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR |
| 77 | return mmc_load_image_raw_sector(mmc, info.start + |
| 78 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); |
| 79 | #else |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 80 | return mmc_load_image_raw_sector(mmc, info.start); |
Stefan Roese | d0503cd | 2015-07-20 11:20:39 +0200 | [diff] [blame] | 81 | #endif |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 82 | } |
| 83 | #endif |
| 84 | |
Peter Korsgaard | 01b542f | 2013-05-13 08:36:29 +0000 | [diff] [blame] | 85 | #ifdef CONFIG_SPL_OS_BOOT |
| 86 | static int mmc_load_image_raw_os(struct mmc *mmc) |
| 87 | { |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 88 | unsigned long count; |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 89 | |
Paul Kocialkowski | 2d69f25 | 2015-05-22 12:45:35 +0200 | [diff] [blame] | 90 | count = mmc->block_dev.block_read(0, |
| 91 | CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, |
| 92 | CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS, |
| 93 | (void *) CONFIG_SYS_SPL_ARGS_ADDR); |
| 94 | if (count == 0) { |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 95 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 01c723f | 2015-06-03 18:48:51 +0200 | [diff] [blame] | 96 | puts("spl: mmc block read error\n"); |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 97 | #endif |
Peter Korsgaard | 01b542f | 2013-05-13 08:36:29 +0000 | [diff] [blame] | 98 | return -1; |
| 99 | } |
| 100 | |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 101 | return mmc_load_image_raw_sector(mmc, |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 102 | CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR); |
Peter Korsgaard | 01b542f | 2013-05-13 08:36:29 +0000 | [diff] [blame] | 103 | } |
| 104 | #endif |
| 105 | |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 106 | void spl_mmc_load_image(void) |
| 107 | { |
| 108 | struct mmc *mmc; |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 109 | u32 boot_mode; |
Simon Glass | f22851a | 2015-06-23 15:38:51 -0600 | [diff] [blame] | 110 | int err = 0; |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 111 | __maybe_unused int part; |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 112 | |
Simon Glass | f22851a | 2015-06-23 15:38:51 -0600 | [diff] [blame] | 113 | #ifdef CONFIG_DM_MMC |
| 114 | struct udevice *dev; |
| 115 | |
| 116 | mmc_initialize(NULL); |
| 117 | err = uclass_get_device(UCLASS_MMC, 0, &dev); |
| 118 | mmc = NULL; |
| 119 | if (!err) |
| 120 | mmc = mmc_get_mmc_dev(dev); |
| 121 | #else |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 122 | mmc_initialize(gd->bd); |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 123 | |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 124 | /* We register only one device. So, the dev id is always 0 */ |
| 125 | mmc = find_mmc_device(0); |
| 126 | if (!mmc) { |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 127 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 128 | puts("spl: mmc device not found\n"); |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 129 | #endif |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 130 | hang(); |
| 131 | } |
Simon Glass | f22851a | 2015-06-23 15:38:51 -0600 | [diff] [blame] | 132 | #endif |
| 133 | |
| 134 | if (!err) |
| 135 | err = mmc_init(mmc); |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 136 | |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 137 | if (err) { |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 138 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 139 | printf("spl: mmc init failed with error: %d\n", err); |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 140 | #endif |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 141 | hang(); |
| 142 | } |
Peter Korsgaard | 5e5483d | 2013-05-13 08:36:25 +0000 | [diff] [blame] | 143 | |
Tom Rini | a76ff95 | 2012-08-14 09:19:44 -0700 | [diff] [blame] | 144 | boot_mode = spl_boot_mode(); |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 145 | switch (boot_mode) { |
| 146 | case MMCSD_MODE_RAW: |
| 147 | debug("spl: mmc boot mode: raw\n"); |
| 148 | |
Peter Korsgaard | 01b542f | 2013-05-13 08:36:29 +0000 | [diff] [blame] | 149 | #ifdef CONFIG_SPL_OS_BOOT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 150 | if (!spl_start_uboot()) { |
| 151 | err = mmc_load_image_raw_os(mmc); |
| 152 | if (!err) |
| 153 | return; |
| 154 | } |
Peter Korsgaard | 01b542f | 2013-05-13 08:36:29 +0000 | [diff] [blame] | 155 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 156 | #if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION) |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 157 | err = mmc_load_image_raw_partition(mmc, |
| 158 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION); |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 159 | if (!err) |
| 160 | return; |
| 161 | #elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 162 | err = mmc_load_image_raw_sector(mmc, |
Dan Murphy | b7b5b0c | 2014-01-16 11:23:29 -0600 | [diff] [blame] | 163 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 164 | if (!err) |
| 165 | return; |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 166 | #endif |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 167 | case MMCSD_MODE_FS: |
| 168 | debug("spl: mmc boot mode: fs\n"); |
| 169 | |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 170 | #ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION |
Guillaume GARDET | 1eb410c | 2014-10-15 17:53:12 +0200 | [diff] [blame] | 171 | #ifdef CONFIG_SPL_FAT_SUPPORT |
Peter Korsgaard | 465f1f8 | 2013-05-13 08:36:27 +0000 | [diff] [blame] | 172 | #ifdef CONFIG_SPL_OS_BOOT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 173 | if (!spl_start_uboot()) { |
| 174 | err = spl_load_image_fat_os(&mmc->block_dev, |
| 175 | CONFIG_SYS_MMCSD_FS_BOOT_PARTITION); |
| 176 | if (!err) |
| 177 | return; |
| 178 | } |
Peter Korsgaard | 465f1f8 | 2013-05-13 08:36:27 +0000 | [diff] [blame] | 179 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 180 | #ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME |
Dan Murphy | b7b5b0c | 2014-01-16 11:23:29 -0600 | [diff] [blame] | 181 | err = spl_load_image_fat(&mmc->block_dev, |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 182 | CONFIG_SYS_MMCSD_FS_BOOT_PARTITION, |
| 183 | CONFIG_SPL_FS_LOAD_PAYLOAD_NAME); |
| 184 | if (!err) |
| 185 | return; |
| 186 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 187 | #endif |
Guillaume GARDET | 1eb410c | 2014-10-15 17:53:12 +0200 | [diff] [blame] | 188 | #ifdef CONFIG_SPL_EXT_SUPPORT |
| 189 | #ifdef CONFIG_SPL_OS_BOOT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 190 | if (!spl_start_uboot()) { |
| 191 | err = spl_load_image_ext_os(&mmc->block_dev, |
| 192 | CONFIG_SYS_MMCSD_FS_BOOT_PARTITION); |
| 193 | if (!err) |
| 194 | return; |
| 195 | } |
Tom Rini | a0d8cca | 2012-08-10 09:27:14 -0700 | [diff] [blame] | 196 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 197 | #ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME |
Guillaume GARDET | 1eb410c | 2014-10-15 17:53:12 +0200 | [diff] [blame] | 198 | err = spl_load_image_ext(&mmc->block_dev, |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 199 | CONFIG_SYS_MMCSD_FS_BOOT_PARTITION, |
| 200 | CONFIG_SPL_FS_LOAD_PAYLOAD_NAME); |
| 201 | if (!err) |
| 202 | return; |
| 203 | #endif |
| 204 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 205 | #endif |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 206 | #ifdef CONFIG_SUPPORT_EMMC_BOOT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 207 | case MMCSD_MODE_EMMCBOOT: |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 208 | /* |
| 209 | * We need to check what the partition is configured to. |
| 210 | * 1 and 2 match up to boot0 / boot1 and 7 is user data |
| 211 | * which is the first physical partition (0). |
| 212 | */ |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 213 | part = (mmc->part_config >> 3) & PART_ACCESS_MASK; |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 214 | |
| 215 | if (part == 7) |
| 216 | part = 0; |
| 217 | |
| 218 | if (mmc_switch_part(0, part)) { |
| 219 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 220 | puts("spl: mmc partition switch failed\n"); |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 221 | #endif |
| 222 | hang(); |
| 223 | } |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 224 | |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 225 | #ifdef CONFIG_SPL_OS_BOOT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 226 | if (!spl_start_uboot()) { |
| 227 | err = mmc_load_image_raw_os(mmc); |
| 228 | if (!err) |
| 229 | return; |
| 230 | } |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 231 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 232 | #if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION) |
Paul Kocialkowski | 409d4f7 | 2015-04-27 10:20:23 +0200 | [diff] [blame] | 233 | err = mmc_load_image_raw_partition(mmc, |
| 234 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION); |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 235 | if (!err) |
| 236 | return; |
| 237 | #elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) |
Paul Kocialkowski | 17675c8 | 2014-11-08 23:14:56 +0100 | [diff] [blame] | 238 | err = mmc_load_image_raw_sector(mmc, |
Tom Rini | cc61269 | 2014-02-05 10:24:18 -0500 | [diff] [blame] | 239 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 240 | if (!err) |
| 241 | return; |
Guillaume GARDET | 1143b0a | 2014-12-16 12:00:44 +0100 | [diff] [blame] | 242 | #endif |
Paul Kocialkowski | 4bd66e7 | 2015-06-08 23:05:09 +0200 | [diff] [blame] | 243 | #endif |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 244 | case MMCSD_MODE_UNDEFINED: |
| 245 | default: |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 246 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 247 | if (err) |
| 248 | puts("spl: mmc: no boot mode left to try\n"); |
| 249 | else |
| 250 | puts("spl: mmc: wrong boot mode\n"); |
Paul Burton | a8015fd | 2013-09-04 16:12:24 +0100 | [diff] [blame] | 251 | #endif |
Peter Korsgaard | 5e5483d | 2013-05-13 08:36:25 +0000 | [diff] [blame] | 252 | hang(); |
Paul Kocialkowski | 0d13972 | 2015-04-27 10:20:22 +0200 | [diff] [blame] | 253 | } |
Simon Schwarz | e21d2d8 | 2011-09-14 15:33:34 -0400 | [diff] [blame] | 254 | } |