sbi_system.h 890 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Anup Patel <anup.patel@wdc.com>
  8. */
  9. #ifndef __SBI_SYSTEM_H__
  10. #define __SBI_SYSTEM_H__
  11. #include <sbi/sbi_types.h>
  12. /** System reset hardware device */
  13. struct sbi_system_reset_device {
  14. /** Name of the system reset device */
  15. char name[32];
  16. /* Check whether reset type and reason supported by the device */
  17. int (*system_reset_check)(u32 reset_type, u32 reset_reason);
  18. /** Reset the system */
  19. void (*system_reset)(u32 reset_type, u32 reset_reason);
  20. };
  21. const struct sbi_system_reset_device *sbi_system_reset_get_device(void);
  22. void sbi_system_reset_set_device(const struct sbi_system_reset_device *dev);
  23. bool sbi_system_reset_supported(u32 reset_type, u32 reset_reason);
  24. void __noreturn sbi_system_reset(u32 reset_type, u32 reset_reason);
  25. #endif