Peng Fan | 0d331c0 | 2019-03-05 02:32:49 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 NXP |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <dm.h> |
Simon Glass | 4d72caa | 2020-05-10 11:40:01 -0600 | [diff] [blame^] | 9 | #include <image.h> |
Peng Fan | 0d331c0 | 2019-03-05 02:32:49 +0000 | [diff] [blame] | 10 | #include <spl.h> |
| 11 | #include <dm/uclass.h> |
| 12 | #include <dm/device.h> |
| 13 | #include <dm/uclass-internal.h> |
| 14 | #include <dm/device-internal.h> |
| 15 | #include <dm/lists.h> |
Peng Fan | 231401d | 2020-05-05 20:28:40 +0800 | [diff] [blame] | 16 | #include <asm/arch/sys_proto.h> |
Peng Fan | 0d331c0 | 2019-03-05 02:32:49 +0000 | [diff] [blame] | 17 | |
| 18 | DECLARE_GLOBAL_DATA_PTR; |
| 19 | |
| 20 | void spl_board_init(void) |
| 21 | { |
| 22 | struct udevice *dev; |
Peng Fan | 0d331c0 | 2019-03-05 02:32:49 +0000 | [diff] [blame] | 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 | |
Peng Fan | 0d331c0 | 2019-03-05 02:32:49 +0000 | [diff] [blame] | 31 | arch_cpu_init(); |
| 32 | |
| 33 | board_early_init_f(); |
| 34 | |
| 35 | timer_init(); |
| 36 | |
| 37 | preloader_console_init(); |
| 38 | |
| 39 | puts("Normal Boot\n"); |
| 40 | } |
| 41 | |
Peng Fan | 231401d | 2020-05-05 20:28:40 +0800 | [diff] [blame] | 42 | void spl_board_prepare_for_boot(void) |
| 43 | { |
| 44 | imx8_power_off_pd_devices(NULL, 0); |
| 45 | } |
| 46 | |
Peng Fan | 0d331c0 | 2019-03-05 02:32:49 +0000 | [diff] [blame] | 47 | #ifdef CONFIG_SPL_LOAD_FIT |
| 48 | int board_fit_config_name_match(const char *name) |
| 49 | { |
| 50 | /* Just empty function now - can't decide what to choose */ |
| 51 | debug("%s: %s\n", __func__, name); |
| 52 | |
| 53 | return 0; |
| 54 | } |
| 55 | #endif |
| 56 | |
| 57 | void board_init_f(ulong dummy) |
| 58 | { |
| 59 | /* Clear global data */ |
| 60 | memset((void *)gd, 0, sizeof(gd_t)); |
| 61 | |
| 62 | /* Clear the BSS. */ |
| 63 | memset(__bss_start, 0, __bss_end - __bss_start); |
| 64 | |
| 65 | board_init_r(NULL, 0); |
| 66 | } |