1 // 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 <init.h> 10 #include <spl.h> 11 #include <dm.h> 12 #include <asm/global_data.h> 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 spl_board_init(void)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 board_init_f(ulong dummy)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 } 50