Alison Wang | 9da5178 | 2014-12-03 15:00:47 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <spl.h> |
| 9 | |
| 10 | u32 spl_boot_device(void) |
| 11 | { |
| 12 | #ifdef CONFIG_SPL_MMC_SUPPORT |
| 13 | return BOOT_DEVICE_MMC1; |
| 14 | #endif |
| 15 | return BOOT_DEVICE_NAND; |
| 16 | } |
| 17 | |
Marek Vasut | 64d64bb | 2016-05-14 23:42:07 +0200 | [diff] [blame] | 18 | u32 spl_boot_mode(const u32 boot_device) |
Alison Wang | 9da5178 | 2014-12-03 15:00:47 +0800 | [diff] [blame] | 19 | { |
| 20 | switch (spl_boot_device()) { |
| 21 | case BOOT_DEVICE_MMC1: |
| 22 | #ifdef CONFIG_SPL_FAT_SUPPORT |
Qianyu Gong | 1e98bab | 2016-04-27 09:44:51 +0800 | [diff] [blame] | 23 | return MMCSD_MODE_FS; |
Alison Wang | 9da5178 | 2014-12-03 15:00:47 +0800 | [diff] [blame] | 24 | #else |
| 25 | return MMCSD_MODE_RAW; |
| 26 | #endif |
| 27 | case BOOT_DEVICE_NAND: |
| 28 | return 0; |
| 29 | default: |
| 30 | puts("spl: error: unsupported device\n"); |
| 31 | hang(); |
| 32 | } |
| 33 | } |