blob: e160c611a962142d0c624feea70fd60bb4fc6203 [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>
Simon Glass97589732020-05-10 11:40:02 -06009#include <init.h>
Anatolij Gustschin49234a32020-01-07 16:37:42 +010010#include <spl.h>
11#include <dm.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060012#include <asm/global_data.h>
Shiji Yangbb112342023-08-03 09:47:16 +080013#include <asm/sections.h>
Anatolij Gustschin49234a32020-01-07 16:37:42 +010014#include <dm/uclass.h>
15#include <dm/device.h>
16#include <dm/uclass-internal.h>
17#include <dm/device-internal.h>
18
19DECLARE_GLOBAL_DATA_PTR;
20
21void spl_board_init(void)
22{
23 struct udevice *dev;
24
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
32 arch_cpu_init();
33
34 board_early_init_f();
35
36 timer_init();
37
38 preloader_console_init();
39}
40
41void board_init_f(ulong dummy)
42{
43 /* Clear global data */
44 memset((void *)gd, 0, sizeof(gd_t));
45
46 /* Clear the BSS. */
47 memset(__bss_start, 0, __bss_end - __bss_start);
48
49 board_init_r(NULL, 0);
50}