Michal Simek | e60148d | 2014-01-14 14:21:52 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2014 Xilinx, Inc. Michal Simek |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | #include <common.h> |
| 7 | #include <spl.h> |
| 8 | |
| 9 | #include <asm/io.h> |
| 10 | #include <asm/arch/hardware.h> |
| 11 | #include <asm/arch/spl.h> |
| 12 | #include <asm/arch/sys_proto.h> |
| 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
| 16 | void board_init_f(ulong dummy) |
| 17 | { |
| 18 | ps7_init(); |
| 19 | |
| 20 | /* Clear the BSS. */ |
| 21 | memset(__bss_start, 0, __bss_end - __bss_start); |
| 22 | |
| 23 | /* Set global data pointer. */ |
| 24 | gd = &gdata; |
| 25 | |
| 26 | preloader_console_init(); |
| 27 | arch_cpu_init(); |
| 28 | board_init_r(NULL, 0); |
| 29 | } |
| 30 | |
Michal Simek | a831f1f | 2014-04-25 12:15:40 +0200 | [diff] [blame] | 31 | #ifdef CONFIG_SPL_BOARD_INIT |
| 32 | void spl_board_init(void) |
| 33 | { |
| 34 | board_init(); |
| 35 | } |
| 36 | #endif |
| 37 | |
Michal Simek | e60148d | 2014-01-14 14:21:52 +0100 | [diff] [blame] | 38 | u32 spl_boot_device(void) |
| 39 | { |
| 40 | u32 mode; |
| 41 | |
| 42 | switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) { |
| 43 | #ifdef CONFIG_SPL_SPI_SUPPORT |
| 44 | case ZYNQ_BM_QSPI: |
| 45 | puts("qspi boot\n"); |
| 46 | mode = BOOT_DEVICE_SPI; |
| 47 | break; |
| 48 | #endif |
| 49 | #ifdef CONFIG_SPL_MMC_SUPPORT |
| 50 | case ZYNQ_BM_SD: |
| 51 | puts("mmc boot\n"); |
| 52 | mode = BOOT_DEVICE_MMC1; |
| 53 | break; |
| 54 | #endif |
| 55 | default: |
| 56 | puts("Unsupported boot mode selected\n"); |
| 57 | hang(); |
| 58 | } |
| 59 | |
| 60 | return mode; |
| 61 | } |
| 62 | |
| 63 | #ifdef CONFIG_SPL_MMC_SUPPORT |
| 64 | u32 spl_boot_mode(void) |
| 65 | { |
| 66 | return MMCSD_MODE_FAT; |
| 67 | } |
| 68 | #endif |
| 69 | |
| 70 | #ifdef CONFIG_SPL_OS_BOOT |
| 71 | int spl_start_uboot(void) |
| 72 | { |
| 73 | /* boot linux */ |
| 74 | return 0; |
| 75 | } |
| 76 | #endif |
Masahiro Yamada | c2d1079 | 2014-05-12 12:18:30 +0900 | [diff] [blame^] | 77 | |
| 78 | __weak void ps7_init(void) |
| 79 | { |
| 80 | /* |
| 81 | * This function is overridden by the one in |
| 82 | * board/xilinx/zynq/ps7_init.c, if it exists. |
| 83 | */ |
| 84 | } |