spl.c 976 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2018 NXP
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <dm.h>
  8. #include <spl.h>
  9. #include <dm/uclass.h>
  10. #include <dm/device.h>
  11. #include <dm/uclass-internal.h>
  12. #include <dm/device-internal.h>
  13. #include <dm/lists.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. void spl_board_init(void)
  16. {
  17. struct udevice *dev;
  18. uclass_find_first_device(UCLASS_MISC, &dev);
  19. for (; dev; uclass_find_next_device(&dev)) {
  20. if (device_probe(dev))
  21. continue;
  22. }
  23. arch_cpu_init();
  24. board_early_init_f();
  25. timer_init();
  26. preloader_console_init();
  27. puts("Normal Boot\n");
  28. }
  29. #ifdef CONFIG_SPL_LOAD_FIT
  30. int board_fit_config_name_match(const char *name)
  31. {
  32. /* Just empty function now - can't decide what to choose */
  33. debug("%s: %s\n", __func__, name);
  34. return 0;
  35. }
  36. #endif
  37. void board_init_f(ulong dummy)
  38. {
  39. /* Clear global data */
  40. memset((void *)gd, 0, sizeof(gd_t));
  41. /* Clear the BSS. */
  42. memset(__bss_start, 0, __bss_end - __bss_start);
  43. board_init_r(NULL, 0);
  44. }