atmel-aes-regs.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef __ATMEL_AES_REGS_H__
  2. #define __ATMEL_AES_REGS_H__
  3. #define AES_CR 0x00
  4. #define AES_CR_START (1 << 0)
  5. #define AES_CR_SWRST (1 << 8)
  6. #define AES_CR_LOADSEED (1 << 16)
  7. #define AES_MR 0x04
  8. #define AES_MR_CYPHER_DEC (0 << 0)
  9. #define AES_MR_CYPHER_ENC (1 << 0)
  10. #define AES_MR_DUALBUFF (1 << 3)
  11. #define AES_MR_PROCDLY_MASK (0xF << 4)
  12. #define AES_MR_PROCDLY_OFFSET 4
  13. #define AES_MR_SMOD_MASK (0x3 << 8)
  14. #define AES_MR_SMOD_MANUAL (0x0 << 8)
  15. #define AES_MR_SMOD_AUTO (0x1 << 8)
  16. #define AES_MR_SMOD_IDATAR0 (0x2 << 8)
  17. #define AES_MR_KEYSIZE_MASK (0x3 << 10)
  18. #define AES_MR_KEYSIZE_128 (0x0 << 10)
  19. #define AES_MR_KEYSIZE_192 (0x1 << 10)
  20. #define AES_MR_KEYSIZE_256 (0x2 << 10)
  21. #define AES_MR_OPMOD_MASK (0x7 << 12)
  22. #define AES_MR_OPMOD_ECB (0x0 << 12)
  23. #define AES_MR_OPMOD_CBC (0x1 << 12)
  24. #define AES_MR_OPMOD_OFB (0x2 << 12)
  25. #define AES_MR_OPMOD_CFB (0x3 << 12)
  26. #define AES_MR_OPMOD_CTR (0x4 << 12)
  27. #define AES_MR_LOD (0x1 << 15)
  28. #define AES_MR_CFBS_MASK (0x7 << 16)
  29. #define AES_MR_CFBS_128b (0x0 << 16)
  30. #define AES_MR_CFBS_64b (0x1 << 16)
  31. #define AES_MR_CFBS_32b (0x2 << 16)
  32. #define AES_MR_CFBS_16b (0x3 << 16)
  33. #define AES_MR_CFBS_8b (0x4 << 16)
  34. #define AES_MR_CKEY_MASK (0xF << 20)
  35. #define AES_MR_CKEY_OFFSET 20
  36. #define AES_MR_CMTYP_MASK (0x1F << 24)
  37. #define AES_MR_CMTYP_OFFSET 24
  38. #define AES_IER 0x10
  39. #define AES_IDR 0x14
  40. #define AES_IMR 0x18
  41. #define AES_ISR 0x1C
  42. #define AES_INT_DATARDY (1 << 0)
  43. #define AES_INT_URAD (1 << 8)
  44. #define AES_ISR_URAT_MASK (0xF << 12)
  45. #define AES_ISR_URAT_IDR_WR_PROC (0x0 << 12)
  46. #define AES_ISR_URAT_ODR_RD_PROC (0x1 << 12)
  47. #define AES_ISR_URAT_MR_WR_PROC (0x2 << 12)
  48. #define AES_ISR_URAT_ODR_RD_SUBK (0x3 << 12)
  49. #define AES_ISR_URAT_MR_WR_SUBK (0x4 << 12)
  50. #define AES_ISR_URAT_WOR_RD (0x5 << 12)
  51. #define AES_KEYWR(x) (0x20 + ((x) * 0x04))
  52. #define AES_IDATAR(x) (0x40 + ((x) * 0x04))
  53. #define AES_ODATAR(x) (0x50 + ((x) * 0x04))
  54. #define AES_IVR(x) (0x60 + ((x) * 0x04))
  55. #define AES_HW_VERSION 0xFC
  56. #endif /* __ATMEL_AES_REGS_H__ */