blob: 47fe86ccc0330e4d420780c50f1674ddcdd9cdfc [file] [log] [blame]
Anatolij Gustschin49234a32020-01-07 16:37:42 +01001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2018 NXP
4 *
5 * Copyright 2019 Siemens AG
6 *
7 */
8#include <common.h>
9#include <spl.h>
10#include <dm.h>
11#include <dm/uclass.h>
12#include <dm/device.h>
13#include <dm/uclass-internal.h>
14#include <dm/device-internal.h>
15
16DECLARE_GLOBAL_DATA_PTR;
17
18void spl_board_init(void)
19{
20 struct udevice *dev;
21
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
29 arch_cpu_init();
30
31 board_early_init_f();
32
33 timer_init();
34
35 preloader_console_init();
36}
37
38void board_init_f(ulong dummy)
39{
40 /* Clear global data */
41 memset((void *)gd, 0, sizeof(gd_t));
42
43 /* Clear the BSS. */
44 memset(__bss_start, 0, __bss_end - __bss_start);
45
46 board_init_r(NULL, 0);
47}