tegra-aes.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (c) 2010, NVIDIA Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. */
  18. #ifndef __CRYPTODEV_TEGRA_AES_H
  19. #define __CRYPTODEV_TEGRA_AES_H
  20. #define TEGRA_AES_ICMDQUE_WR 0x1000
  21. #define TEGRA_AES_CMDQUE_CONTROL 0x1008
  22. #define TEGRA_AES_INTR_STATUS 0x1018
  23. #define TEGRA_AES_INT_ENB 0x1040
  24. #define TEGRA_AES_CONFIG 0x1044
  25. #define TEGRA_AES_IRAM_ACCESS_CFG 0x10A0
  26. #define TEGRA_AES_SECURE_DEST_ADDR 0x1100
  27. #define TEGRA_AES_SECURE_INPUT_SELECT 0x1104
  28. #define TEGRA_AES_SECURE_CONFIG 0x1108
  29. #define TEGRA_AES_SECURE_CONFIG_EXT 0x110C
  30. #define TEGRA_AES_SECURE_SECURITY 0x1110
  31. #define TEGRA_AES_SECURE_HASH_RESULT0 0x1120
  32. #define TEGRA_AES_SECURE_HASH_RESULT1 0x1124
  33. #define TEGRA_AES_SECURE_HASH_RESULT2 0x1128
  34. #define TEGRA_AES_SECURE_HASH_RESULT3 0x112C
  35. #define TEGRA_AES_SECURE_SEC_SEL0 0x1140
  36. #define TEGRA_AES_SECURE_SEC_SEL1 0x1144
  37. #define TEGRA_AES_SECURE_SEC_SEL2 0x1148
  38. #define TEGRA_AES_SECURE_SEC_SEL3 0x114C
  39. #define TEGRA_AES_SECURE_SEC_SEL4 0x1150
  40. #define TEGRA_AES_SECURE_SEC_SEL5 0x1154
  41. #define TEGRA_AES_SECURE_SEC_SEL6 0x1158
  42. #define TEGRA_AES_SECURE_SEC_SEL7 0x115C
  43. /* interrupt status reg masks and shifts */
  44. #define TEGRA_AES_ENGINE_BUSY_FIELD BIT(0)
  45. #define TEGRA_AES_ICQ_EMPTY_FIELD BIT(3)
  46. #define TEGRA_AES_DMA_BUSY_FIELD BIT(23)
  47. /* secure select reg masks and shifts */
  48. #define TEGRA_AES_SECURE_SEL0_KEYREAD_ENB0_FIELD BIT(0)
  49. /* secure config ext masks and shifts */
  50. #define TEGRA_AES_SECURE_KEY_SCH_DIS_FIELD BIT(15)
  51. /* secure config masks and shifts */
  52. #define TEGRA_AES_SECURE_KEY_INDEX_SHIFT 20
  53. #define TEGRA_AES_SECURE_KEY_INDEX_FIELD (0x1F << TEGRA_AES_SECURE_KEY_INDEX_SHIFT)
  54. #define TEGRA_AES_SECURE_BLOCK_CNT_SHIFT 0
  55. #define TEGRA_AES_SECURE_BLOCK_CNT_FIELD (0xFFFFF << TEGRA_AES_SECURE_BLOCK_CNT_SHIFT)
  56. /* stream interface select masks and shifts */
  57. #define TEGRA_AES_CMDQ_CTRL_UCMDQEN_FIELD BIT(0)
  58. #define TEGRA_AES_CMDQ_CTRL_ICMDQEN_FIELD BIT(1)
  59. #define TEGRA_AES_CMDQ_CTRL_SRC_STM_SEL_FIELD BIT(4)
  60. #define TEGRA_AES_CMDQ_CTRL_DST_STM_SEL_FIELD BIT(5)
  61. /* config register masks and shifts */
  62. #define TEGRA_AES_CONFIG_ENDIAN_ENB_FIELD BIT(10)
  63. #define TEGRA_AES_CONFIG_MODE_SEL_SHIFT 0
  64. #define TEGRA_AES_CONFIG_MODE_SEL_FIELD (0x1F << TEGRA_AES_CONFIG_MODE_SEL_SHIFT)
  65. /* extended config */
  66. #define TEGRA_AES_SECURE_OFFSET_CNT_SHIFT 24
  67. #define TEGRA_AES_SECURE_OFFSET_CNT_FIELD (0xFF << TEGRA_AES_SECURE_OFFSET_CNT_SHIFT)
  68. #define TEGRA_AES_SECURE_KEYSCHED_GEN_FIELD BIT(15)
  69. /* init vector select */
  70. #define TEGRA_AES_SECURE_IV_SELECT_SHIFT 10
  71. #define TEGRA_AES_SECURE_IV_SELECT_FIELD BIT(10)
  72. /* secure engine input */
  73. #define TEGRA_AES_SECURE_INPUT_ALG_SEL_SHIFT 28
  74. #define TEGRA_AES_SECURE_INPUT_ALG_SEL_FIELD (0xF << TEGRA_AES_SECURE_INPUT_ALG_SEL_SHIFT)
  75. #define TEGRA_AES_SECURE_INPUT_KEY_LEN_SHIFT 16
  76. #define TEGRA_AES_SECURE_INPUT_KEY_LEN_FIELD (0xFFF << TEGRA_AES_SECURE_INPUT_KEY_LEN_SHIFT)
  77. #define TEGRA_AES_SECURE_RNG_ENB_FIELD BIT(11)
  78. #define TEGRA_AES_SECURE_CORE_SEL_SHIFT 9
  79. #define TEGRA_AES_SECURE_CORE_SEL_FIELD BIT(9)
  80. #define TEGRA_AES_SECURE_VCTRAM_SEL_SHIFT 7
  81. #define TEGRA_AES_SECURE_VCTRAM_SEL_FIELD (0x3 << TEGRA_AES_SECURE_VCTRAM_SEL_SHIFT)
  82. #define TEGRA_AES_SECURE_INPUT_SEL_SHIFT 5
  83. #define TEGRA_AES_SECURE_INPUT_SEL_FIELD (0x3 << TEGRA_AES_SECURE_INPUT_SEL_SHIFT)
  84. #define TEGRA_AES_SECURE_XOR_POS_SHIFT 3
  85. #define TEGRA_AES_SECURE_XOR_POS_FIELD (0x3 << TEGRA_AES_SECURE_XOR_POS_SHIFT)
  86. #define TEGRA_AES_SECURE_HASH_ENB_FIELD BIT(2)
  87. #define TEGRA_AES_SECURE_ON_THE_FLY_FIELD BIT(0)
  88. /* interrupt error mask */
  89. #define TEGRA_AES_INT_ERROR_MASK 0xFFF000
  90. #endif