armv8: fsl-layerscape: spl: remove BSS clearing and board_init_r
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / spl.c
1 /*
2  * Copyright 2014-2015 Freescale Semiconductor, Inc.
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #include <common.h>
8 #include <spl.h>
9 #include <asm/io.h>
10 #include <fsl_ifc.h>
11 #include <i2c.h>
12
13 DECLARE_GLOBAL_DATA_PTR;
14
15 u32 spl_boot_device(void)
16 {
17 #ifdef CONFIG_SPL_MMC_SUPPORT
18         return BOOT_DEVICE_MMC1;
19 #endif
20 #ifdef CONFIG_SPL_NAND_SUPPORT
21         return BOOT_DEVICE_NAND;
22 #endif
23         return 0;
24 }
25
26 u32 spl_boot_mode(const u32 boot_device)
27 {
28         switch (spl_boot_device()) {
29         case BOOT_DEVICE_MMC1:
30 #ifdef CONFIG_SPL_FAT_SUPPORT
31                 return MMCSD_MODE_FS;
32 #else
33                 return MMCSD_MODE_RAW;
34 #endif
35         case BOOT_DEVICE_NAND:
36                 return 0;
37         default:
38                 puts("spl: error: unsupported device\n");
39                 hang();
40         }
41 }
42
43 #ifdef CONFIG_SPL_BUILD
44 void board_init_f(ulong dummy)
45 {
46         /* Clear global data */
47         memset((void *)gd, 0, sizeof(gd_t));
48 #ifdef CONFIG_LS2080A
49         arch_cpu_init();
50 #endif
51         board_early_init_f();
52         timer_init();
53 #ifdef CONFIG_LS2080A
54         env_init();
55 #endif
56         get_clocks();
57
58         preloader_console_init();
59
60 #ifdef CONFIG_SPL_I2C_SUPPORT
61         i2c_init_all();
62 #endif
63         dram_init();
64 }
65 #endif