Bo Shen | f92b298 | 2013-11-15 11:12:38 +0800 | [diff] [blame] | 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> |
Bo Shen | f92b298 | 2013-11-15 11:12:38 +0800 | [diff] [blame] | 11 | #include <asm/arch/at91_wdt.h> |
| 12 | #include <asm/arch/clk.h> |
| 13 | #include <spl.h> |
| 14 | |
Heiko Schocher | f1e3a8c | 2014-10-31 08:31:04 +0100 | [diff] [blame] | 15 | void at91_disable_wdt(void) |
Bo Shen | f92b298 | 2013-11-15 11:12:38 +0800 | [diff] [blame] | 16 | { |
| 17 | struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT; |
| 18 | |
| 19 | writel(AT91_WDT_MR_WDDIS, &wdt->mr); |
| 20 | } |
| 21 | |
Bo Shen | f92b298 | 2013-11-15 11:12:38 +0800 | [diff] [blame] | 22 | u32 spl_boot_device(void) |
| 23 | { |
| 24 | #ifdef CONFIG_SYS_USE_MMC |
| 25 | return BOOT_DEVICE_MMC1; |
Bo Shen | 540c031 | 2014-03-03 14:47:17 +0800 | [diff] [blame] | 26 | #elif CONFIG_SYS_USE_NANDFLASH |
| 27 | return BOOT_DEVICE_NAND; |
Bo Shen | 37a36b3 | 2014-03-03 14:47:15 +0800 | [diff] [blame] | 28 | #elif CONFIG_SYS_USE_SERIALFLASH |
| 29 | return BOOT_DEVICE_SPI; |
Bo Shen | f92b298 | 2013-11-15 11:12:38 +0800 | [diff] [blame] | 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: |
Guillaume GARDET | 602a16c | 2014-10-15 17:53:11 +0200 | [diff] [blame] | 39 | return MMCSD_MODE_FS; |
Bo Shen | f92b298 | 2013-11-15 11:12:38 +0800 | [diff] [blame] | 40 | break; |
| 41 | #endif |
| 42 | case BOOT_DEVICE_NONE: |
| 43 | default: |
| 44 | hang(); |
| 45 | } |
| 46 | } |