mdha.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Message Digest Hardware Accelerator Memory Map
  3. *
  4. * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __MDHA_H__
  26. #define __MDHA_H__
  27. /* Message Digest Hardware Accelerator */
  28. typedef struct mdha_ctrl {
  29. u32 mr; /* 0x00 MDHA Mode */
  30. u32 cr; /* 0x04 Control */
  31. u32 cmd; /* 0x08 Command */
  32. u32 sr; /* 0x0C Status */
  33. u32 isr; /* 0x10 Interrupt Status */
  34. u32 imr; /* 0x14 Interrupt Mask */
  35. u32 dsz; /* 0x1C Data Size */
  36. u32 inp; /* 0x20 Input FIFO */
  37. u32 res1[3]; /* 0x24 - 0x2F */
  38. u32 mda0; /* 0x30 Message Digest AO */
  39. u32 mdb0; /* 0x34 Message Digest BO */
  40. u32 mdc0; /* 0x38 Message Digest CO */
  41. u32 mdd0; /* 0x3C Message Digest DO */
  42. u32 mde0; /* 0x40 Message Digest EO */
  43. u32 mdsz; /* 0x44 Message Data Size */
  44. u32 res[10]; /* 0x48 - 0x6F */
  45. u32 mda1; /* 0x70 Message Digest A1 */
  46. u32 mdb1; /* 0x74 Message Digest B1 */
  47. u32 mdc1; /* 0x78 Message Digest C1 */
  48. u32 mdd1; /* 0x7C Message Digest D1 */
  49. u32 mde1; /* 0x80 Message Digest E1 */
  50. } mdha_t;
  51. #define MDHA_MR_SSL (0x00000400)
  52. #define MDHA_MR_MACFUL (0x00000200)
  53. #define MDHA_MR_SWAP (0x00000100)
  54. #define MDHA_MR_OPAD (0x00000080)
  55. #define MDHA_MR_IPAD (0x00000040)
  56. #define MDHA_MR_INIT (0x00000020)
  57. #define MDHA_MR_MAC(x) (((x) & 0x03) << 3)
  58. #define MDHA_MR_MAC_MASK (0xFFFFFFE7)
  59. #define MDHA_MR_MAC_EHMAC (0x00000010)
  60. #define MDHA_MR_MAC_HMAC (0x00000008)
  61. #define MDHA_MR_MAC_NONE (0x00000000)
  62. #define MDHA_MR_PDATA (0x00000004)
  63. #define MDHA_MR_ALG (0x00000001)
  64. #define MDHA_CR_DMAL(x) (((x) & 0x1F) << 16) /* 532x */
  65. #define MDHA_CR_DMAL_MASK (0xFFE0FFFF) /* 532x */
  66. #define MDHA_CR_END (0x00000004) /* 532x */
  67. #define MDHA_CR_DMA (0x00000002) /* 532x */
  68. #define MDHA_CR_IE (0x00000001)
  69. #define MDHA_CMD_GO (0x00000008)
  70. #define MDHA_CMD_CI (0x00000004)
  71. #define MDHA_CMD_RI (0x00000001)
  72. #define MDHA_CMD_SWR (0x00000001)
  73. #define MDHA_SR_IFL(x) (((x) & 0xFF) << 16)
  74. #define MDHA_SR_IFL_MASK (0xFF00FFFF)
  75. #define MDHA_SR_APD(x) (((x) & 0x7) << 13)
  76. #define MDHA_SR_APD_MASK (0xFFFF1FFF)
  77. #define MDHA_SR_FS(x) (((x) & 0x7) << 8)
  78. #define MDHA_SR_FS_MASK (0xFFFFF8FF)
  79. #define MDHA_SR_GNW (0x00000080)
  80. #define MDHA_SR_HSH (0x00000040)
  81. #define MDHA_SR_BUSY (0x00000010)
  82. #define MDHA_SR_RD (0x00000008)
  83. #define MDHA_SR_ERR (0x00000004)
  84. #define MDHA_SR_DONE (0x00000002)
  85. #define MDHA_SR_INT (0x00000001)
  86. #define MDHA_ISR_DRL (0x00000400) /* 532x */
  87. #define MDHA_ISR_GTDS (0x00000200)
  88. #define MDHA_ISR_ERE (0x00000100)
  89. #define MDHA_ISR_RMDP (0x00000080)
  90. #define MDHA_ISR_DSE (0x00000020)
  91. #define MDHA_ISR_IME (0x00000010)
  92. #define MDHA_ISR_NEIF (0x00000004)
  93. #define MDHA_ISR_IFO (0x00000001)
  94. #endif /* __MDHA_H__ */