blob: 696b5ebd340b94fc18250a08ddb5b843850accfc [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 */
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Anatolij Gustschin49234a32020-01-07 16:37:42 +01009#include <spl.h>
10#include <dm.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060011#include <asm/global_data.h>
Shiji Yangbb112342023-08-03 09:47:16 +080012#include <asm/sections.h>
Anatolij Gustschin49234a32020-01-07 16:37:42 +010013#include <dm/uclass.h>
14#include <dm/device.h>
15#include <dm/uclass-internal.h>
16#include <dm/device-internal.h>
17
18DECLARE_GLOBAL_DATA_PTR;
19
20void 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
40void board_init_f(ulong dummy)
41{
42 /* Clear global data */
43 memset((void *)gd, 0, sizeof(gd_t));
44
45 /* Clear the BSS. */
46 memset(__bss_start, 0, __bss_end - __bss_start);
47
48 board_init_r(NULL, 0);
49}