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 | |
| 18 | u32 spl_boot_mode(void) |
| 19 | { |
| 20 | switch (spl_boot_device()) { |
| 21 | case BOOT_DEVICE_MMC1: |
| 22 | #ifdef CONFIG_SPL_FAT_SUPPORT |
| 23 | return MMCSD_MODE_FAT; |
| 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 | } |