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