51f323811a073d4a646e326a85750859e49eccf2
[oweals/u-boot.git] / board / freescale / imx8qxp_mek / spl.c
1 /*
2  * Copyright 2018 NXP
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #include <common.h>
8 #include <dm.h>
9 #include <spl.h>
10 #include <dm/uclass.h>
11 #include <dm/device.h>
12 #include <dm/uclass-internal.h>
13 #include <dm/device-internal.h>
14 #include <dm/lists.h>
15
16 DECLARE_GLOBAL_DATA_PTR;
17
18 void spl_board_init(void)
19 {
20         struct udevice *dev;
21         int offset;
22
23         uclass_find_first_device(UCLASS_MISC, &dev);
24
25         for (; dev; uclass_find_next_device(&dev)) {
26                 if (device_probe(dev))
27                         continue;
28         }
29
30         arch_cpu_init();
31
32         board_early_init_f();
33
34         timer_init();
35
36         preloader_console_init();
37
38         puts("Normal Boot\n");
39 }
40
41 #ifdef CONFIG_SPL_LOAD_FIT
42 int board_fit_config_name_match(const char *name)
43 {
44         /* Just empty function now - can't decide what to choose */
45         debug("%s: %s\n", __func__, name);
46
47         return 0;
48 }
49 #endif
50
51 void board_init_f(ulong dummy)
52 {
53         /* Clear global data */
54         memset((void *)gd, 0, sizeof(gd_t));
55
56         /* Clear the BSS. */
57         memset(__bss_start, 0, __bss_end - __bss_start);
58
59         board_init_r(NULL, 0);
60 }