arm-sip-service.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. Arm SiP Services
  2. ================
  3. This document enumerates and describes the Arm SiP (Silicon Provider) services.
  4. SiP services are non-standard, platform-specific services offered by the silicon
  5. implementer or platform provider. They are accessed via ``SMC`` ("SMC calls")
  6. instruction executed from Exception Levels below EL3. SMC calls for SiP
  7. services:
  8. - Follow `SMC Calling Convention`_;
  9. - Use SMC function IDs that fall in the SiP range, which are ``0xc2000000`` -
  10. ``0xc200ffff`` for 64-bit calls, and ``0x82000000`` - ``0x8200ffff`` for 32-bit
  11. calls.
  12. The Arm SiP implementation offers the following services:
  13. - Execution State Switching service
  14. Source definitions for Arm SiP service are located in the ``arm_sip_svc.h`` header
  15. file.
  16. +----------------------------+----------------------------+---------------------------------------+
  17. | ARM_SIP_SVC_VERSION_MAJOR | ARM_SIP_SVC_VERSION_MINOR | Changes |
  18. +============================+============================+=======================================+
  19. | 1 | 0 | Move DebugFS and PMF to the new vendor|
  20. | | | specific FID range. The old FID range |
  21. | | | for these services are deprecated |
  22. +----------------------------+----------------------------+---------------------------------------+
  23. *Table 1: Showing different versions of arm-sip-service and changes done with each version*
  24. Execution State Switching service
  25. ---------------------------------
  26. Execution State Switching service provides a mechanism for a non-secure lower
  27. Exception Level (either EL2, or NS EL1 if EL2 isn't implemented) to request to
  28. switch its execution state (a.k.a. Register Width), either from AArch64 to
  29. AArch32, or from AArch32 to AArch64, for the calling CPU. This service is only
  30. available when Trusted Firmware-A (TF-A) is built for AArch64 (i.e. when build
  31. option ``ARCH`` is set to ``aarch64``).
  32. ``ARM_SIP_SVC_EXE_STATE_SWITCH``
  33. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. ::
  35. Arguments:
  36. uint32_t Function ID
  37. uint32_t PC hi
  38. uint32_t PC lo
  39. uint32_t Cookie hi
  40. uint32_t Cookie lo
  41. Return:
  42. uint32_t
  43. The function ID parameter must be ``0x82000020``. It uniquely identifies the
  44. Execution State Switching service being requested.
  45. The parameters *PC hi* and *PC lo* defines upper and lower words, respectively,
  46. of the entry point (physical address) at which execution should start, after
  47. Execution State has been switched. When calling from AArch64, *PC hi* must be 0.
  48. When execution starts at the supplied entry point after Execution State has been
  49. switched, the parameters *Cookie hi* and *Cookie lo* are passed in CPU registers
  50. 0 and 1, respectively. When calling from AArch64, *Cookie hi* must be 0.
  51. This call can only be made on the primary CPU, before any secondaries were
  52. brought up with ``CPU_ON`` PSCI call. Otherwise, the call will always fail.
  53. The effect of switching execution state is as if the Exception Level were
  54. entered for the first time, following power on. This means CPU registers that
  55. have a defined reset value by the Architecture will assume that value. Other
  56. registers should not be expected to hold their values before the call was made.
  57. CPU endianness, however, is preserved from the previous execution state. Note
  58. that this switches the execution state of the calling CPU only. This is not a
  59. substitute for PSCI ``SYSTEM_RESET``.
  60. The service may return the following error codes:
  61. - ``STATE_SW_E_PARAM``: If any of the parameters were deemed invalid for
  62. a specific request.
  63. - ``STATE_SW_E_DENIED``: If the call is not successful, or when TF-A is
  64. built for AArch32.
  65. If the call is successful, the caller wouldn't observe the SMC returning.
  66. Instead, execution starts at the supplied entry point, with the CPU registers 0
  67. and 1 populated with the supplied *Cookie hi* and *Cookie lo* values,
  68. respectively.
  69. --------------
  70. *Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.*
  71. .. _SMC Calling Convention: https://developer.arm.com/docs/den0028/latest