Go to the documentation of this file.
11 #include <linux/bitops.h>
13 #define HASH_BLOCK_SIZE 64
14 #define HASH_DMA_ALIGN_SIZE 4
15 #define HASH_DMA_PERFORMANCE_MIN_SIZE 1024
16 #define HASH_BYTES_PER_WORD 4
19 #define HASH_HIGH_WORD_MAX_VAL 0xFFFFFFFFUL
22 #define HASH_RESET_CR_VALUE 0x0
23 #define HASH_RESET_STR_VALUE 0x0
26 #define HASH_CSR_COUNT 52
28 #define HASH_RESET_CSRX_REG_VALUE 0x0
29 #define HASH_RESET_CSFULL_REG_VALUE 0x0
30 #define HASH_RESET_CSDATAIN_REG_VALUE 0x0
32 #define HASH_RESET_INDEX_VAL 0x0
33 #define HASH_RESET_BIT_INDEX_VAL 0x0
34 #define HASH_RESET_BUFFER_VAL 0x0
35 #define HASH_RESET_LEN_HIGH_VAL 0x0
36 #define HASH_RESET_LEN_LOW_VAL 0x0
39 #define HASH_CR_RESUME_MASK 0x11FCF
41 #define HASH_CR_SWITCHON_POS 31
42 #define HASH_CR_SWITCHON_MASK BIT(31)
44 #define HASH_CR_EMPTYMSG_POS 20
45 #define HASH_CR_EMPTYMSG_MASK BIT(20)
47 #define HASH_CR_DINF_POS 12
48 #define HASH_CR_DINF_MASK BIT(12)
50 #define HASH_CR_NBW_POS 8
51 #define HASH_CR_NBW_MASK 0x00000F00UL
53 #define HASH_CR_LKEY_POS 16
54 #define HASH_CR_LKEY_MASK BIT(16)
56 #define HASH_CR_ALGO_POS 7
57 #define HASH_CR_ALGO_MASK BIT(7)
59 #define HASH_CR_MODE_POS 6
60 #define HASH_CR_MODE_MASK BIT(6)
62 #define HASH_CR_DATAFORM_POS 4
63 #define HASH_CR_DATAFORM_MASK (BIT(4) | BIT(5))
65 #define HASH_CR_DMAE_POS 3
66 #define HASH_CR_DMAE_MASK BIT(3)
68 #define HASH_CR_INIT_POS 2
69 #define HASH_CR_INIT_MASK BIT(2)
71 #define HASH_CR_PRIVN_POS 1
72 #define HASH_CR_PRIVN_MASK BIT(1)
74 #define HASH_CR_SECN_POS 0
75 #define HASH_CR_SECN_MASK BIT(0)
78 #define HASH_STR_DCAL_POS 8
79 #define HASH_STR_DCAL_MASK BIT(8)
80 #define HASH_STR_DEFAULT 0x0
82 #define HASH_STR_NBLW_POS 0
83 #define HASH_STR_NBLW_MASK 0x0000001FUL
85 #define HASH_NBLW_MAX_VAL 0x1F
88 #define HASH_P_ID0 0xE0
89 #define HASH_P_ID1 0x05
90 #define HASH_P_ID2 0x38
91 #define HASH_P_ID3 0x00
92 #define HASH_CELL_ID0 0x0D
93 #define HASH_CELL_ID1 0xF0
94 #define HASH_CELL_ID2 0x05
95 #define HASH_CELL_ID3 0xB1
97 #define HASH_SET_BITS(reg_name, mask) \
98 writel_relaxed((readl_relaxed(reg_name) | mask), reg_name)
100 #define HASH_CLEAR_BITS(reg_name, mask) \
101 writel_relaxed((readl_relaxed(reg_name) & ~mask), reg_name)
103 #define HASH_PUT_BITS(reg, val, shift, mask) \
104 writel_relaxed(((readl(reg) & ~(mask)) | \
105 (((u32)val << shift) & (mask))), reg)
107 #define HASH_SET_DIN(val, len) writesl(&device_data->base->din, (val), (len))
109 #define HASH_INITIALIZE \
111 &device_data->base->cr, \
112 0x01, HASH_CR_INIT_POS, \
115 #define HASH_SET_DATA_FORMAT(data_format) \
117 &device_data->base->cr, \
118 (u32) (data_format), HASH_CR_DATAFORM_POS, \
119 HASH_CR_DATAFORM_MASK)
120 #define HASH_SET_NBLW(val) \
122 &device_data->base->str, \
123 (u32) (val), HASH_STR_NBLW_POS, \
125 #define HASH_SET_DCAL \
127 &device_data->base->str, \
128 0x01, HASH_STR_DCAL_POS, \