bootretry.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * (C) Copyright 2000
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef __BOOTRETRY_H
  8. #define __BOOTRETRY_H
  9. #ifdef CONFIG_BOOT_RETRY_TIME
  10. /**
  11. * bootretry_tstc_timeout() - ensure we get a keypress before timeout
  12. *
  13. * Check for a keypress repeatedly, resetting the watchdog each time. If a
  14. * keypress is not received within the command timeout, return an error.
  15. *
  16. * @return 0 if a key is received in time, -ETIMEDOUT if not
  17. */
  18. int bootretry_tstc_timeout(void);
  19. /**
  20. * bootretry_init_cmd_timeout() - set up command timeout
  21. *
  22. * Get the required command timeout from the environment.
  23. */
  24. void bootretry_init_cmd_timeout(void);
  25. /**
  26. * bootretry_reset_cmd_timeout() - reset command timeout
  27. *
  28. * Reset the command timeout so that the user has a fresh start. This is
  29. * typically used when input is received from the user.
  30. */
  31. void bootretry_reset_cmd_timeout(void);
  32. /** bootretry_dont_retry() - Indicate that we should not retry the boot */
  33. void bootretry_dont_retry(void);
  34. #else
  35. static inline int bootretry_tstc_timeout(void)
  36. {
  37. return 0;
  38. }
  39. static inline void bootretry_init_cmd_timeout(void)
  40. {
  41. }
  42. static inline void bootretry_reset_cmd_timeout(void)
  43. {
  44. }
  45. static inline void bootretry_dont_retry(void)
  46. {
  47. }
  48. #endif
  49. #endif