spl.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (C) 2012 Altera Corporation <www.altera.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <asm/io.h>
  8. #include <asm/u-boot.h>
  9. #include <asm/utils.h>
  10. #include <version.h>
  11. #include <image.h>
  12. #include <asm/arch/reset_manager.h>
  13. #include <spl.h>
  14. #include <asm/arch/system_manager.h>
  15. #include <asm/arch/freeze_controller.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. u32 spl_boot_device(void)
  18. {
  19. return BOOT_DEVICE_RAM;
  20. }
  21. /*
  22. * Board initialization after bss clearance
  23. */
  24. void spl_board_init(void)
  25. {
  26. #ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET
  27. debug("Freezing all I/O banks\n");
  28. /* freeze all IO banks */
  29. sys_mgr_frzctrl_freeze_req();
  30. /* configure the pin muxing through system manager */
  31. sysmgr_pinmux_init();
  32. #endif /* CONFIG_SOCFPGA_VIRTUAL_TARGET */
  33. /* de-assert reset for peripherals and bridges based on handoff */
  34. reset_deassert_peripherals_handoff();
  35. debug("Unfreezing/Thaw all I/O banks\n");
  36. /* unfreeze / thaw all IO banks */
  37. sys_mgr_frzctrl_thaw_req();
  38. /* enable console uart printing */
  39. preloader_console_init();
  40. }