spl.c 780 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 <dm/uclass.h>
  13. #include <dm/device.h>
  14. #include <dm/uclass-internal.h>
  15. #include <dm/device-internal.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. void spl_board_init(void)
  18. {
  19. struct udevice *dev;
  20. uclass_find_first_device(UCLASS_MISC, &dev);
  21. for (; dev; uclass_find_next_device(&dev)) {
  22. if (device_probe(dev))
  23. continue;
  24. }
  25. arch_cpu_init();
  26. board_early_init_f();
  27. timer_init();
  28. preloader_console_init();
  29. }
  30. void board_init_f(ulong dummy)
  31. {
  32. /* Clear global data */
  33. memset((void *)gd, 0, sizeof(gd_t));
  34. /* Clear the BSS. */
  35. memset(__bss_start, 0, __bss_end - __bss_start);
  36. board_init_r(NULL, 0);
  37. }