blob: cb4006eb2a40dc3cef6fdfd4130f2c8477a5d120 [file] [log] [blame]
Peng Fan203a2272019-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>
15
16DECLARE_GLOBAL_DATA_PTR;
17
18void spl_board_init(void)
19{
20 struct udevice *dev;
Peng Fan203a2272019-03-05 02:32:49 +000021
22 uclass_find_first_device(UCLASS_MISC, &dev);
23
24 for (; dev; uclass_find_next_device(&dev)) {
25 if (device_probe(dev))
26 continue;
27 }
28
Peng Fan203a2272019-03-05 02:32:49 +000029 arch_cpu_init();
30
31 board_early_init_f();
32
33 timer_init();
34
35 preloader_console_init();
36
37 puts("Normal Boot\n");
38}
39
40#ifdef CONFIG_SPL_LOAD_FIT
41int board_fit_config_name_match(const char *name)
42{
43 /* Just empty function now - can't decide what to choose */
44 debug("%s: %s\n", __func__, name);
45
46 return 0;
47}
48#endif
49
50void board_init_f(ulong dummy)
51{
52 /* Clear global data */
53 memset((void *)gd, 0, sizeof(gd_t));
54
55 /* Clear the BSS. */
56 memset(__bss_start, 0, __bss_end - __bss_start);
57
58 board_init_r(NULL, 0);
59}