mlxbf-bootctl.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2019, Mellanox Technologies. All rights reserved.
  4. */
  5. #ifndef __MLXBF_BOOTCTL_H__
  6. #define __MLXBF_BOOTCTL_H__
  7. /*
  8. * Request that the on-chip watchdog be enabled, or disabled, after
  9. * the next chip soft reset. This call does not affect the current
  10. * status of the on-chip watchdog. If non-zero, the argument
  11. * specifies the watchdog interval in seconds. If zero, the watchdog
  12. * will not be enabled after the next soft reset. Non-zero errors are
  13. * returned as documented below.
  14. */
  15. #define MLXBF_BOOTCTL_SET_POST_RESET_WDOG 0x82000000
  16. /*
  17. * Query the status which has been requested for the on-chip watchdog
  18. * after the next chip soft reset. Returns the interval as set by
  19. * MLXBF_BOOTCTL_SET_POST_RESET_WDOG.
  20. */
  21. #define MLXBF_BOOTCTL_GET_POST_RESET_WDOG 0x82000001
  22. /*
  23. * Request that a specific boot action be taken at the next soft
  24. * reset. By default, the boot action is set by external chip pins,
  25. * which are sampled on hard reset. Note that the boot action
  26. * requested by this call will persist on subsequent resets unless
  27. * this service, or the MLNX_SET_SECOND_RESET_ACTION service, is
  28. * invoked. See below for the available MLNX_BOOT_xxx parameter
  29. * values. Non-zero errors are returned as documented below.
  30. */
  31. #define MLXBF_BOOTCTL_SET_RESET_ACTION 0x82000002
  32. /*
  33. * Return the specific boot action which will be taken at the next
  34. * soft reset. Returns the reset action (see below for the parameter
  35. * values for MLXBF_BOOTCTL_SET_RESET_ACTION).
  36. */
  37. #define MLXBF_BOOTCTL_GET_RESET_ACTION 0x82000003
  38. /*
  39. * Request that a specific boot action be taken at the soft reset
  40. * after the next soft reset. For a specified valid boot mode, the
  41. * effect of this call is identical to that of invoking
  42. * MLXBF_BOOTCTL_SET_RESET_ACTION after the next chip soft reset; in
  43. * particular, after that reset, the action for the now next reset can
  44. * be queried with MLXBF_BOOTCTL_GET_RESET_ACTION and modified with
  45. * MLXBF_BOOTCTL_SET_RESET_ACTION. You may also specify the parameter as
  46. * MLNX_BOOT_NONE, which is equivalent to specifying that no call to
  47. * MLXBF_BOOTCTL_SET_RESET_ACTION be taken after the next chip soft reset.
  48. * This call does not affect the action to be taken at the next soft
  49. * reset. Non-zero errors are returned as documented below.
  50. */
  51. #define MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION 0x82000004
  52. /*
  53. * Return the specific boot action which will be taken at the soft
  54. * reset after the next soft reset; this will be one of the valid
  55. * actions for MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION.
  56. */
  57. #define MLXBF_BOOTCTL_GET_SECOND_RESET_ACTION 0x82000005
  58. /*
  59. * Return the fuse status of the current chip. The caller should specify
  60. * with the second argument if the state of the lifecycle fuses or the
  61. * version of secure boot fuse keys left should be returned.
  62. */
  63. #define MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS 0x82000006
  64. /* Reset eMMC by programming the RST_N register. */
  65. #define MLXBF_BOOTCTL_SET_EMMC_RST_N 0x82000007
  66. #define MLXBF_BOOTCTL_GET_DIMM_INFO 0x82000008
  67. /* SMC function IDs for SiP Service queries */
  68. #define MLXBF_BOOTCTL_SIP_SVC_CALL_COUNT 0x8200ff00
  69. #define MLXBF_BOOTCTL_SIP_SVC_UID 0x8200ff01
  70. #define MLXBF_BOOTCTL_SIP_SVC_VERSION 0x8200ff03
  71. /* ARM Standard Service Calls version numbers */
  72. #define MLXBF_BOOTCTL_SVC_VERSION_MAJOR 0x0
  73. #define MLXBF_BOOTCTL_SVC_VERSION_MINOR 0x2
  74. /* Number of svc calls defined. */
  75. #define MLXBF_BOOTCTL_NUM_SVC_CALLS 12
  76. /* Valid reset actions for MLXBF_BOOTCTL_SET_RESET_ACTION. */
  77. #define MLXBF_BOOTCTL_EXTERNAL 0 /* Not boot from eMMC */
  78. #define MLXBF_BOOTCTL_EMMC 1 /* From primary eMMC boot partition */
  79. #define MLNX_BOOTCTL_SWAP_EMMC 2 /* Swap eMMC boot partitions and reboot */
  80. #define MLXBF_BOOTCTL_EMMC_LEGACY 3 /* From primary eMMC in legacy mode */
  81. /* Valid arguments for requesting the fuse status. */
  82. #define MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE 0 /* Return lifecycle status. */
  83. #define MLXBF_BOOTCTL_FUSE_STATUS_KEYS 1 /* Return secure boot key status */
  84. /* Additional value to disable the MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION. */
  85. #define MLXBF_BOOTCTL_NONE 0x7fffffff /* Don't change next boot action */
  86. #endif /* __MLXBF_BOOTCTL_H__ */