common: Drop image.h from common header
[oweals/u-boot.git] / board / freescale / imx8qm_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 <image.h>
10 #include <spl.h>
11 #include <dm/uclass.h>
12 #include <dm/device.h>
13 #include <dm/uclass-internal.h>
14 #include <dm/device-internal.h>
15 #include <dm/lists.h>
16 #include <asm/arch/sys_proto.h>
17
18 DECLARE_GLOBAL_DATA_PTR;
19
20 void spl_board_init(void)
21 {
22         struct udevice *dev;
23
24         uclass_find_first_device(UCLASS_MISC, &dev);
25
26         for (; dev; uclass_find_next_device(&dev)) {
27                 if (device_probe(dev))
28                         continue;
29         }
30
31         arch_cpu_init();
32
33         board_early_init_f();
34
35         timer_init();
36
37         preloader_console_init();
38
39         puts("Normal Boot\n");
40 }
41
42 void spl_board_prepare_for_boot(void)
43 {
44         imx8_power_off_pd_devices(NULL, 0);
45 }
46
47 #ifdef CONFIG_SPL_LOAD_FIT
48 int board_fit_config_name_match(const char *name)
49 {
50         /* Just empty function now - can't decide what to choose */
51         debug("%s: %s\n", __func__, name);
52
53         return 0;
54 }
55 #endif
56
57 void board_init_f(ulong dummy)
58 {
59         /* Clear global data */
60         memset((void *)gd, 0, sizeof(gd_t));
61
62         /* Clear the BSS. */
63         memset(__bss_start, 0, __bss_end - __bss_start);
64
65         board_init_r(NULL, 0);
66 }