blob: a16f88a6c453c299d7465dd7ba1f997960e5c8d1 [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>
Simon Glass4d72caa2020-05-10 11:40:01 -06009#include <image.h>
Simon Glass691d7192020-05-10 11:40:02 -060010#include <init.h>
Peng Fan0d331c02019-03-05 02:32:49 +000011#include <spl.h>
12#include <dm/uclass.h>
13#include <dm/device.h>
14#include <dm/uclass-internal.h>
15#include <dm/device-internal.h>
16#include <dm/lists.h>
Peng Fan231401d2020-05-05 20:28:40 +080017#include <asm/arch/sys_proto.h>
Peng Fan0d331c02019-03-05 02:32:49 +000018
19DECLARE_GLOBAL_DATA_PTR;
20
21void spl_board_init(void)
22{
23 struct udevice *dev;
Peng Fan0d331c02019-03-05 02:32:49 +000024
25 uclass_find_first_device(UCLASS_MISC, &dev);
26
27 for (; dev; uclass_find_next_device(&dev)) {
28 if (device_probe(dev))
29 continue;
30 }
31
Peng Fan0d331c02019-03-05 02:32:49 +000032 arch_cpu_init();
33
34 board_early_init_f();
35
36 timer_init();
37
38 preloader_console_init();
39
40 puts("Normal Boot\n");
41}
42
Peng Fan231401d2020-05-05 20:28:40 +080043void spl_board_prepare_for_boot(void)
44{
45 imx8_power_off_pd_devices(NULL, 0);
46}
47
Peng Fan0d331c02019-03-05 02:32:49 +000048#ifdef CONFIG_SPL_LOAD_FIT
49int board_fit_config_name_match(const char *name)
50{
51 /* Just empty function now - can't decide what to choose */
52 debug("%s: %s\n", __func__, name);
53
54 return 0;
55}
56#endif
57
58void board_init_f(ulong dummy)
59{
60 /* Clear global data */
61 memset((void *)gd, 0, sizeof(gd_t));
62
63 /* Clear the BSS. */
64 memset(__bss_start, 0, __bss_end - __bss_start);
65
66 board_init_r(NULL, 0);
67}