fsl_iee_apc.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright 2020-2021, NXP
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #ifndef _FSL_IEE_APC_H_
  8. #define _FSL_IEE_APC_H_
  9. #include "fsl_common.h"
  10. /*!
  11. * @addtogroup ieer
  12. * @{
  13. */
  14. /*******************************************************************************
  15. * Definitions
  16. ******************************************************************************/
  17. /*! @name Driver version */
  18. /*@{*/
  19. /*! @brief IEE_APC driver version. Version 2.0.1.
  20. *
  21. * Current version: 2.0.1
  22. *
  23. * Change log:
  24. * - Version 2.0.0
  25. * - Initial version
  26. * - Version 2.0.1
  27. * - Fixed MISRA issues.
  28. */
  29. #define FSL_IEE_APC_DRIVER_VERSION (MAKE_VERSION(2, 0, 1))
  30. /*@}*/
  31. /*! @brief APC IEE regions. */
  32. typedef enum _iee_apc_region
  33. {
  34. kIEE_APC_Region0 = 0U, /*!< APC IEE region 0 */
  35. kIEE_APC_Region1 = 1U, /*!< APC IEE region 1 */
  36. kIEE_APC_Region2 = 2U, /*!< APC IEE region 2 */
  37. kIEE_APC_Region3 = 3U, /*!< APC IEE region 3 */
  38. kIEE_APC_Region4 = 4U, /*!< APC IEE region 4 */
  39. kIEE_APC_Region5 = 5U, /*!< APC IEE region 5 */
  40. kIEE_APC_Region6 = 6U, /*!< APC IEE region 6 */
  41. kIEE_APC_Region7 = 7U /*!< APC IEE region 7 */
  42. } iee_apc_region_t;
  43. /*! @brief APC IEE domains. */
  44. typedef enum _apc_iee_domain
  45. {
  46. kIEE_APC_Domain0 = 0U, /*!< APC IEE region 0 */
  47. kIEE_APC_Domain1 = 1U /*!< APC IEE region 1 */
  48. } iee_apc_domain_t;
  49. /*******************************************************************************
  50. * API
  51. ******************************************************************************/
  52. #if defined(__cplusplus)
  53. extern "C" {
  54. #endif
  55. /*!
  56. * @brief Enable the APC IEE Region setting.
  57. *
  58. * This function enables IOMUXC LPSR GPR and APC IEE for setting the region.
  59. *
  60. * @param base APC IEE peripheral address.
  61. */
  62. void IEE_APC_GlobalEnable(IEE_APC_Type *base);
  63. /*!
  64. * @brief Disables the APC IEE Region setting.
  65. *
  66. * This function disables IOMUXC LPSR GPR and APC IEE for setting the region.
  67. *
  68. * @param base APC IEE peripheral address.
  69. */
  70. void IEE_APC_GlobalDisable(IEE_APC_Type *base);
  71. /*!
  72. * @brief Sets the APC IEE Memory Region Descriptors.
  73. *
  74. * This function configures APC IEE Memory Region Descriptor according to region configuration structure.
  75. *
  76. * @param base APC IEE peripheral address.
  77. * @param region Selection of the APC IEE region to be configured.
  78. * @param startAddr Start encryption adress for the selected APC IEE region.
  79. * @param endAddr End encryption adress for the selected APC IEE region.
  80. */
  81. status_t IEE_APC_SetRegionConfig(IEE_APC_Type *base, iee_apc_region_t region, uint32_t startAddr, uint32_t endAddr);
  82. /*!
  83. * @brief Lock the LPSR GPR and APC IEE configuration.
  84. *
  85. * This function locks writting to IOMUXC LPSR GPR and APC IEE encryption region setting registers.
  86. * Only system reset can clear the LPSR GPR and APC IEE-RDC_D0/1 Lock bit
  87. *
  88. * @param base APC IEE peripheral address.
  89. * @param region Selection of the APC IEE region to be locked.
  90. * @param domain
  91. */
  92. status_t IEE_APC_LockRegionConfig(IEE_APC_Type *base, iee_apc_region_t region, iee_apc_domain_t domain);
  93. /*!
  94. * @brief Enable the IEE encryption/decryption and can lock this setting.
  95. *
  96. * This function enables encryption/decryption by writting to IOMUXC LPSR GPR.
  97. *
  98. * @param base APC IEE peripheral address.
  99. * @param region Selection of the APC IEE region to be enabled.
  100. */
  101. void IEE_APC_RegionEnable(IEE_APC_Type *base, iee_apc_region_t region);
  102. #if defined(__cplusplus)
  103. }
  104. #endif
  105. /*!
  106. *@}
  107. */
  108. #endif /* _FSL_IEE_APC_H_ */