spl.c 1.1 KB

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