blob: ba99002cf29cfd608f0d1e865e960f6bf29c759c [file] [log] [blame]
Peng Fan0d331c02019-03-05 02:32:49 +00001/*
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>
Peng Fan231401d2020-05-05 20:28:40 +080015#include <asm/arch/sys_proto.h>
Peng Fan0d331c02019-03-05 02:32:49 +000016
17DECLARE_GLOBAL_DATA_PTR;
18
19void spl_board_init(void)
20{
21 struct udevice *dev;
Peng Fan0d331c02019-03-05 02:32:49 +000022
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
Peng Fan0d331c02019-03-05 02:32:49 +000030 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
Peng Fan231401d2020-05-05 20:28:40 +080041void spl_board_prepare_for_boot(void)
42{
43 imx8_power_off_pd_devices(NULL, 0);
44}
45
Peng Fan0d331c02019-03-05 02:32:49 +000046#ifdef CONFIG_SPL_LOAD_FIT
47int board_fit_config_name_match(const char *name)
48{
49 /* Just empty function now - can't decide what to choose */
50 debug("%s: %s\n", __func__, name);
51
52 return 0;
53}
54#endif
55
56void board_init_f(ulong dummy)
57{
58 /* Clear global data */
59 memset((void *)gd, 0, sizeof(gd_t));
60
61 /* Clear the BSS. */
62 memset(__bss_start, 0, __bss_end - __bss_start);
63
64 board_init_r(NULL, 0);
65}