spl.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause
  5. */
  6. #include <common.h>
  7. #include <dm.h>
  8. #include <spl.h>
  9. u32 spl_boot_device(void)
  10. {
  11. return BOOT_DEVICE_MMC1;
  12. }
  13. u32 spl_boot_mode(const u32 boot_device)
  14. {
  15. return MMCSD_MODE_RAW;
  16. }
  17. void board_init_f(ulong dummy)
  18. {
  19. struct udevice *dev;
  20. int ret;
  21. arch_cpu_init();
  22. ret = spl_early_init();
  23. if (ret) {
  24. debug("spl_early_init() failed: %d\n", ret);
  25. hang();
  26. }
  27. ret = uclass_get_device(UCLASS_CLK, 0, &dev);
  28. if (ret) {
  29. debug("Clock init failed: %d\n", ret);
  30. return;
  31. }
  32. ret = uclass_get_device(UCLASS_RESET, 0, &dev);
  33. if (ret) {
  34. debug("Reset init failed: %d\n", ret);
  35. return;
  36. }
  37. ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
  38. if (ret) {
  39. debug("%s: Cannot find pinctrl device\n", __func__);
  40. return;
  41. }
  42. /* enable console uart printing */
  43. preloader_console_init();
  44. ret = uclass_get_device(UCLASS_RAM, 0, &dev);
  45. if (ret) {
  46. debug("DRAM init failed: %d\n", ret);
  47. return;
  48. }
  49. }