atmel-tdes-regs.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ATMEL_TDES_REGS_H__
  3. #define __ATMEL_TDES_REGS_H__
  4. #define TDES_CR 0x00
  5. #define TDES_CR_START (1 << 0)
  6. #define TDES_CR_SWRST (1 << 8)
  7. #define TDES_CR_LOADSEED (1 << 16)
  8. #define TDES_MR 0x04
  9. #define TDES_MR_CYPHER_DEC (0 << 0)
  10. #define TDES_MR_CYPHER_ENC (1 << 0)
  11. #define TDES_MR_TDESMOD_MASK (0x3 << 1)
  12. #define TDES_MR_TDESMOD_DES (0x0 << 1)
  13. #define TDES_MR_TDESMOD_TDES (0x1 << 1)
  14. #define TDES_MR_TDESMOD_XTEA (0x2 << 1)
  15. #define TDES_MR_KEYMOD_3KEY (0 << 4)
  16. #define TDES_MR_KEYMOD_2KEY (1 << 4)
  17. #define TDES_MR_SMOD_MASK (0x3 << 8)
  18. #define TDES_MR_SMOD_MANUAL (0x0 << 8)
  19. #define TDES_MR_SMOD_AUTO (0x1 << 8)
  20. #define TDES_MR_SMOD_PDC (0x2 << 8)
  21. #define TDES_MR_OPMOD_MASK (0x3 << 12)
  22. #define TDES_MR_OPMOD_ECB (0x0 << 12)
  23. #define TDES_MR_OPMOD_CBC (0x1 << 12)
  24. #define TDES_MR_OPMOD_OFB (0x2 << 12)
  25. #define TDES_MR_OPMOD_CFB (0x3 << 12)
  26. #define TDES_MR_LOD (0x1 << 15)
  27. #define TDES_MR_CFBS_MASK (0x3 << 16)
  28. #define TDES_MR_CFBS_64b (0x0 << 16)
  29. #define TDES_MR_CFBS_32b (0x1 << 16)
  30. #define TDES_MR_CFBS_16b (0x2 << 16)
  31. #define TDES_MR_CFBS_8b (0x3 << 16)
  32. #define TDES_MR_CKEY_MASK (0xF << 20)
  33. #define TDES_MR_CKEY_OFFSET 20
  34. #define TDES_MR_CTYPE_MASK (0x3F << 24)
  35. #define TDES_MR_CTYPE_OFFSET 24
  36. #define TDES_IER 0x10
  37. #define TDES_IDR 0x14
  38. #define TDES_IMR 0x18
  39. #define TDES_ISR 0x1C
  40. #define TDES_INT_DATARDY (1 << 0)
  41. #define TDES_INT_ENDRX (1 << 1)
  42. #define TDES_INT_ENDTX (1 << 2)
  43. #define TDES_INT_RXBUFF (1 << 3)
  44. #define TDES_INT_TXBUFE (1 << 4)
  45. #define TDES_INT_URAD (1 << 8)
  46. #define TDES_ISR_URAT_MASK (0x3 << 12)
  47. #define TDES_ISR_URAT_IDR (0x0 << 12)
  48. #define TDES_ISR_URAT_ODR (0x1 << 12)
  49. #define TDES_ISR_URAT_MR (0x2 << 12)
  50. #define TDES_ISR_URAT_WO (0x3 << 12)
  51. #define TDES_KEY1W1R 0x20
  52. #define TDES_KEY1W2R 0x24
  53. #define TDES_KEY2W1R 0x28
  54. #define TDES_KEY2W2R 0x2C
  55. #define TDES_KEY3W1R 0x30
  56. #define TDES_KEY3W2R 0x34
  57. #define TDES_IDATA1R 0x40
  58. #define TDES_IDATA2R 0x44
  59. #define TDES_ODATA1R 0x50
  60. #define TDES_ODATA2R 0x54
  61. #define TDES_IV1R 0x60
  62. #define TDES_IV2R 0x64
  63. #define TDES_XTEARNDR 0x70
  64. #define TDES_XTEARNDR_XTEA_RNDS_MASK (0x3F << 0)
  65. #define TDES_XTEARNDR_XTEA_RNDS_OFFSET 0
  66. #define TDES_HW_VERSION 0xFC
  67. #define TDES_RPR 0x100
  68. #define TDES_RCR 0x104
  69. #define TDES_TPR 0x108
  70. #define TDES_TCR 0x10C
  71. #define TDES_RNPR 0x118
  72. #define TDES_RNCR 0x11C
  73. #define TDES_TNPR 0x118
  74. #define TDES_TNCR 0x11C
  75. #define TDES_PTCR 0x120
  76. #define TDES_PTCR_RXTEN (1 << 0)
  77. #define TDES_PTCR_RXTDIS (1 << 1)
  78. #define TDES_PTCR_TXTEN (1 << 8)
  79. #define TDES_PTCR_TXTDIS (1 << 9)
  80. #define TDES_PTSR 0x124
  81. #define TDES_PTSR_RXTEN (1 << 0)
  82. #define TDES_PTSR_TXTEN (1 << 8)
  83. #endif /* __ATMEL_TDES_REGS_H__ */