stm32mp1_smc.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (c) 2016-2021, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP1_SMC_H
  7. #define STM32MP1_SMC_H
  8. /*
  9. * SMC function IDs for STM32 Service queries
  10. * STM32 SMC services use the space between 0x82000000 and 0x8200FFFF
  11. * like this is defined in SMC calling Convention by ARM
  12. * for SiP (silicon Partner)
  13. * https://developer.arm.com/docs/den0028/latest
  14. */
  15. /* Secure Service access from Non-secure */
  16. /*
  17. * STM32_SMC_BSEC call API
  18. *
  19. * Argument a0: (input) SMCC ID
  20. * (output) status return code
  21. * Argument a1: (input) Service ID (STM32_SMC_BSEC_xxx)
  22. * Argument a2: (input) OTP index
  23. * (output) OTP read value, if applicable
  24. * Argument a3: (input) OTP value if applicable
  25. */
  26. #define STM32_SMC_BSEC 0x82001003
  27. /*
  28. * STM32_SIP_SMC_SCMI_AGENT0
  29. * STM32_SIP_SMC_SCMI_AGENT1
  30. * Process SCMI message pending in SCMI shared memory buffer.
  31. *
  32. * Argument a0: (input) SMCC ID
  33. */
  34. #define STM32_SIP_SMC_SCMI_AGENT0 0x82002000
  35. #define STM32_SIP_SMC_SCMI_AGENT1 0x82002001
  36. /* SMC function IDs for SiP Service queries */
  37. #define STM32_SIP_SVC_CALL_COUNT 0x8200ff00
  38. #define STM32_SIP_SVC_UID 0x8200ff01
  39. /* 0x8200ff02 is reserved */
  40. #define STM32_SIP_SVC_VERSION 0x8200ff03
  41. /* STM32 SiP Service Calls version numbers */
  42. #define STM32_SIP_SVC_VERSION_MAJOR 0x0
  43. #define STM32_SIP_SVC_VERSION_MINOR 0x1
  44. /* Number of STM32 SiP Calls implemented */
  45. #define STM32_COMMON_SIP_NUM_CALLS 3
  46. /* Service for BSEC */
  47. #define STM32_SMC_READ_SHADOW 0x01
  48. #define STM32_SMC_PROG_OTP 0x02
  49. #define STM32_SMC_WRITE_SHADOW 0x03
  50. #define STM32_SMC_READ_OTP 0x04
  51. /* SMC error codes */
  52. #define STM32_SMC_OK 0x00000000U
  53. #define STM32_SMC_NOT_SUPPORTED 0xFFFFFFFFU
  54. #define STM32_SMC_FAILED 0xFFFFFFFEU
  55. #define STM32_SMC_INVALID_PARAMS 0xFFFFFFFDU
  56. #endif /* STM32MP1_SMC_H */