Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2018 NXP |
| 4 | * |
| 5 | * Copyright 2019 Siemens AG |
| 6 | * |
| 7 | */ |
| 8 | #include <common.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 10 | #include <spl.h> |
| 11 | #include <dm.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 12 | #include <asm/global_data.h> |
Shiji Yang | bb11234 | 2023-08-03 09:47:16 +0800 | [diff] [blame] | 13 | #include <asm/sections.h> |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 14 | #include <dm/uclass.h> |
| 15 | #include <dm/device.h> |
| 16 | #include <dm/uclass-internal.h> |
| 17 | #include <dm/device-internal.h> |
| 18 | |
| 19 | DECLARE_GLOBAL_DATA_PTR; |
| 20 | |
| 21 | void 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 | |
| 41 | void 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 | } |