rng_plat.h 934 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2024, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef RNG_PLAT_H
  7. #define RNG_PLAT_H
  8. #define TRNG_TIME_OUT 1000
  9. #define MTK_TRNG_MAX_ROUND 4
  10. /*******************************************************************************
  11. * TRNG related constants
  12. ******************************************************************************/
  13. #define TRNG_BASE_SIZE 0x1000
  14. #define TRNG_CTRL (TRNG_BASE + 0x0000)
  15. #define TRNG_TIME (TRNG_BASE + 0x0004)
  16. #define TRNG_DATA (TRNG_BASE + 0x0008)
  17. #define TRNG_CONF (TRNG_BASE + 0x000C)
  18. #define TRNG_CTRL_RDY 0x80000000
  19. #define TRNG_CTRL_START 0x00000001
  20. #define TRNG_CONF_VON_EN 0x00000020
  21. #define TRNG_PDN_BASE_SIZE 0x1000
  22. #define TRNG_PDN_SET (INFRACFG_AO_BASE + 0x0088)
  23. #define TRNG_PDN_CLR (INFRACFG_AO_BASE + 0x008C)
  24. #define TRNG_PDN_STATUS (INFRACFG_AO_BASE + 0x0094)
  25. #define TRNG_PDN_VALUE 0x200
  26. #endif /* RNG_PLAT_H */