]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/at91-common/spl.c
Merge branch 'master' of git://git.denx.de/u-boot-usb
[karo-tx-uboot.git] / arch / arm / cpu / at91-common / spl.c
1 /*
2  * Copyright (C) 2013 Atmel Corporation
3  *                    Bo Shen <voice.shen@atmel.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <asm/io.h>
10 #include <asm/arch/at91_common.h>
11 #include <asm/arch/at91_wdt.h>
12 #include <asm/arch/clk.h>
13 #include <spl.h>
14
15 void at91_disable_wdt(void)
16 {
17         struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
18
19         writel(AT91_WDT_MR_WDDIS, &wdt->mr);
20 }
21
22 u32 spl_boot_device(void)
23 {
24 #ifdef CONFIG_SYS_USE_MMC
25         return BOOT_DEVICE_MMC1;
26 #elif CONFIG_SYS_USE_NANDFLASH
27         return BOOT_DEVICE_NAND;
28 #elif CONFIG_SYS_USE_SERIALFLASH
29         return BOOT_DEVICE_SPI;
30 #endif
31         return BOOT_DEVICE_NONE;
32 }
33
34 u32 spl_boot_mode(void)
35 {
36         switch (spl_boot_device()) {
37 #ifdef CONFIG_SYS_USE_MMC
38         case BOOT_DEVICE_MMC1:
39                 return MMCSD_MODE_FS;
40                 break;
41 #endif
42         case BOOT_DEVICE_NONE:
43         default:
44                 hang();
45         }
46 }