mlxbf-bootctl.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. /*
  68. * Initiate Firmware Reset via TYU. This might be invoked during the reset
  69. * flow in isolation mode.
  70. */
  71. #define MLXBF_BOOTCTL_FW_RESET 0x8200000D
  72. /*
  73. * SMC function IDs to set, get and lock the manufacturing information
  74. * stored within the eeprom.
  75. */
  76. #define MLXBF_BOOTCTL_SET_MFG_INFO 0x8200000E
  77. #define MLXBF_BOOTCTL_GET_MFG_INFO 0x8200000F
  78. #define MLXBF_BOOTCTL_LOCK_MFG_INFO 0x82000011
  79. /*
  80. * SMC function IDs to set and get the large ICM carveout size
  81. * stored in the eeprom.
  82. */
  83. #define MLNX_HANDLE_SET_ICM_INFO 0x82000012
  84. #define MLNX_HANDLE_GET_ICM_INFO 0x82000013
  85. #define MAX_ICM_BUFFER_SIZE 10
  86. /*
  87. * SMC function ID to set the ARM boot state to up
  88. */
  89. #define MLNX_HANDLE_OS_UP 0x82000014
  90. /* SMC function IDs for SiP Service queries */
  91. #define MLXBF_BOOTCTL_SIP_SVC_CALL_COUNT 0x8200ff00
  92. #define MLXBF_BOOTCTL_SIP_SVC_UID 0x8200ff01
  93. #define MLXBF_BOOTCTL_SIP_SVC_VERSION 0x8200ff03
  94. /* ARM Standard Service Calls version numbers */
  95. #define MLXBF_BOOTCTL_SVC_VERSION_MAJOR 0x0
  96. #define MLXBF_BOOTCTL_SVC_VERSION_MINOR 0x2
  97. /* Number of svc calls defined. */
  98. #define MLXBF_BOOTCTL_NUM_SVC_CALLS 12
  99. /* Valid reset actions for MLXBF_BOOTCTL_SET_RESET_ACTION. */
  100. #define MLXBF_BOOTCTL_EXTERNAL 0 /* Not boot from eMMC */
  101. #define MLXBF_BOOTCTL_EMMC 1 /* From primary eMMC boot partition */
  102. #define MLNX_BOOTCTL_SWAP_EMMC 2 /* Swap eMMC boot partitions and reboot */
  103. #define MLXBF_BOOTCTL_EMMC_LEGACY 3 /* From primary eMMC in legacy mode */
  104. /* Valid arguments for requesting the fuse status. */
  105. #define MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE 0 /* Return lifecycle status. */
  106. #define MLXBF_BOOTCTL_FUSE_STATUS_KEYS 1 /* Return secure boot key status */
  107. /* Additional value to disable the MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION. */
  108. #define MLXBF_BOOTCTL_NONE 0x7fffffff /* Don't change next boot action */
  109. #define MLXBF_LARGE_ICMC_MAX_STRING_SIZE 16
  110. #define MLXBF_LARGE_ICMC_SIZE_MIN 0x80
  111. #define MLXBF_LARGE_ICMC_SIZE_MAX 0x100000
  112. #define MLXBF_LARGE_ICMC_GRANULARITY MLXBF_LARGE_ICMC_SIZE_MIN
  113. #endif /* __MLXBF_BOOTCTL_H__ */