xref: /openbmc/u-boot/arch/arm/cpu/armv7/ls102xa/spl.c (revision 00caae6d)
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(const u32 boot_device)
19 {
20 	switch (spl_boot_device()) {
21 	case BOOT_DEVICE_MMC1:
22 #ifdef CONFIG_SPL_FAT_SUPPORT
23 		return MMCSD_MODE_FS;
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 }
34