summaryrefslogtreecommitdiff
path: root/drivers/crypto/ux500/cryp/cryp_irqp.h
blob: 879ed68a12d7d52142bfb8631926b9c6d3057596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* SPDX-License-Identifier: GPL-2.0-only */
/**
 * Copyright (C) ST-Ericsson SA 2010
 * Author: Shujuan Chen <shujuan.chen@stericsson.com> for ST-Ericsson.
 * Author: Jonas Linde <jonas.linde@stericsson.com> for ST-Ericsson.
 * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson.
 * Author: Berne Hebark <berne.herbark@stericsson.com> for ST-Ericsson.
 * Author: Niklas Hernaeus <niklas.hernaeus@stericsson.com> for ST-Ericsson.
 */

#ifndef __CRYP_IRQP_H_
#define __CRYP_IRQP_H_

#include "cryp_irq.h"

/**
 *
 * CRYP Registers - Offset mapping
 *     +-----------------+
 * 00h | CRYP_CR         |  Configuration register
 *     +-----------------+
 * 04h | CRYP_SR         |  Status register
 *     +-----------------+
 * 08h | CRYP_DIN        |  Data In register
 *     +-----------------+
 * 0ch | CRYP_DOUT       |  Data out register
 *     +-----------------+
 * 10h | CRYP_DMACR      |  DMA control register
 *     +-----------------+
 * 14h | CRYP_IMSC       |  IMSC
 *     +-----------------+
 * 18h | CRYP_RIS        |  Raw interrupt status
 *     +-----------------+
 * 1ch | CRYP_MIS        |  Masked interrupt status.
 *     +-----------------+
 *       Key registers
 *       IVR registers
 *       Peripheral
 *       Cell IDs
 *
 *       Refer data structure for other register map
 */

/**
 * struct cryp_register
 * @cr			- Configuration register
 * @status		- Status register
 * @din			- Data input register
 * @din_size		- Data input size register
 * @dout		- Data output register
 * @dout_size		- Data output size register
 * @dmacr		- Dma control register
 * @imsc		- Interrupt mask set/clear register
 * @ris			- Raw interrupt status
 * @mis			- Masked interrupt statu register
 * @key_1_l		- Key register 1 L
 * @key_1_r		- Key register 1 R
 * @key_2_l		- Key register 2 L
 * @key_2_r		- Key register 2 R
 * @key_3_l		- Key register 3 L
 * @key_3_r		- Key register 3 R
 * @key_4_l		- Key register 4 L
 * @key_4_r		- Key register 4 R
 * @init_vect_0_l	- init vector 0 L
 * @init_vect_0_r	- init vector 0 R
 * @init_vect_1_l	- init vector 1 L
 * @init_vect_1_r	- init vector 1 R
 * @cryp_unused1	- unused registers
 * @itcr		- Integration test control register
 * @itip		- Integration test input register
 * @itop		- Integration test output register
 * @cryp_unused2	- unused registers
 * @periphId0		- FE0 CRYP Peripheral Identication Register
 * @periphId1		- FE4
 * @periphId2		- FE8
 * @periphId3		- FEC
 * @pcellId0		- FF0  CRYP PCell Identication Register
 * @pcellId1		- FF4
 * @pcellId2		- FF8
 * @pcellId3		- FFC
 */
struct cryp_register {
	u32 cr;			/* Configuration register   */
	u32 sr;			/* Status register          */
	u32 din;		/* Data input register      */
	u32 din_size;		/* Data input size register */
	u32 dout;		/* Data output register     */
	u32 dout_size;		/* Data output size register */
	u32 dmacr;		/* Dma control register     */
	u32 imsc;		/* Interrupt mask set/clear register */
	u32 ris;		/* Raw interrupt status             */
	u32 mis;		/* Masked interrupt statu register  */

	u32 key_1_l;		/*Key register 1 L */
	u32 key_1_r;		/*Key register 1 R */
	u32 key_2_l;		/*Key register 2 L */
	u32 key_2_r;		/*Key register 2 R */
	u32 key_3_l;		/*Key register 3 L */
	u32 key_3_r;		/*Key register 3 R */
	u32 key_4_l;		/*Key register 4 L */
	u32 key_4_r;		/*Key register 4 R */

	u32 init_vect_0_l;	/*init vector 0 L */
	u32 init_vect_0_r;	/*init vector 0 R */
	u32 init_vect_1_l;	/*init vector 1 L */
	u32 init_vect_1_r;	/*init vector 1 R */

	u32 cryp_unused1[(0x80 - 0x58) / sizeof(u32)];	/* unused registers */
	u32 itcr;		/*Integration test control register */
	u32 itip;		/*Integration test input register */
	u32 itop;		/*Integration test output register */
	u32 cryp_unused2[(0xFE0 - 0x8C) / sizeof(u32)];	/* unused registers */

	u32 periphId0;		/* FE0  CRYP Peripheral Identication Register */
	u32 periphId1;		/* FE4 */
	u32 periphId2;		/* FE8 */
	u32 periphId3;		/* FEC */

	u32 pcellId0;		/* FF0  CRYP PCell Identication Register */
	u32 pcellId1;		/* FF4 */
	u32 pcellId2;		/* FF8 */
	u32 pcellId3;		/* FFC */
};

#endif