board.c 763 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2006-2024 RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-3-08 GuEe-GUI the first version
  9. */
  10. #include <setup.h>
  11. #include <board.h>
  12. #include <psci.h>
  13. void rt_hw_board_init(void)
  14. {
  15. #if RT_VER_NUM < 0x50200
  16. rt_fdt_commit_memregion_early(&(rt_region_t)
  17. {
  18. .name = "memheap",
  19. .start = (rt_size_t)rt_kmem_v2p(HEAP_BEGIN),
  20. .end = (rt_size_t)rt_kmem_v2p(HEAP_END),
  21. }, RT_TRUE);
  22. #endif
  23. rt_hw_common_setup();
  24. }
  25. void reboot(void)
  26. {
  27. psci_system_reboot();
  28. }
  29. MSH_CMD_EXPORT(reboot, reboot...);
  30. void rt_hw_cpu_shutdown(void)
  31. {
  32. psci_system_off();
  33. }
  34. MSH_CMD_EXPORT_ALIAS(rt_hw_cpu_shutdown, shutdown, shutdown...);