1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef __FTSDMC021_H
15#define __FTSDMC021_H
16
17#ifndef __ASSEMBLY__
18struct ftsdmc021 {
19 unsigned int tp1;
20 unsigned int tp2;
21 unsigned int cr1;
22 unsigned int cr2;
23 unsigned int bank0_bsr;
24 unsigned int bank1_bsr;
25 unsigned int bank2_bsr;
26 unsigned int bank3_bsr;
27 unsigned int bank4_bsr;
28 unsigned int bank5_bsr;
29 unsigned int bank6_bsr;
30 unsigned int bank7_bsr;
31 unsigned int ragr;
32 unsigned int frr;
33 unsigned int ebisr;
34 unsigned int rsved[25];
35 unsigned int crr;
36 unsigned int cfr;
37};
38#endif
39
40
41
42
43#define FTSDMC021_TP1_TCL(x) ((x) & 0x3)
44#define FTSDMC021_TP1_TWR(x) (((x) & 0x3) << 4)
45#define FTSDMC021_TP1_TRF(x) (((x) & 0xf) << 8)
46#define FTSDMC021_TP1_TRCD(x) (((x) & 0x7) << 12)
47#define FTSDMC021_TP1_TRP(x) (((x) & 0xf) << 16)
48#define FTSDMC021_TP1_TRAS(x) (((x) & 0xf) << 20)
49
50
51
52
53#define FTSDMC021_TP2_REF_INTV(x) ((x) & 0xffff)
54
55#define FTSDMC021_TP2_INI_REFT(x) (((x) & 0xf) << 16)
56
57#define FTSDMC021_TP2_INI_PREC(x) (((x) & 0xf) << 20)
58
59
60
61
62#define FTSDMC021_CR1_BNKSIZE(x) ((x) & 0xf)
63#define FTSDMC021_CR1_MBW(x) (((x) & 0x3) << 4)
64#define FTSDMC021_CR1_DSZ(x) (((x) & 0x7) << 8)
65#define FTSDMC021_CR1_DDW(x) (((x) & 0x3) << 12)
66
67#define FTSDMC021_CR1_MA2T(x) (1 << 16)
68
69#define FTSDMC021_BANK_SIZE(x) (ffs(x) - 1)
70
71
72
73
74#define FTSDMC021_CR2_SREF (1 << 0)
75#define FTSDMC021_CR2_PWDN (1 << 1)
76#define FTSDMC021_CR2_ISMR (1 << 2)
77#define FTSDMC021_CR2_IREF (1 << 3)
78#define FTSDMC021_CR2_IPREC (1 << 4)
79#define FTSDMC021_CR2_REFTYPE (1 << 5)
80
81
82
83
84#define FTSDMC021_BANK_ENABLE (1 << 12)
85
86
87
88
89#define FTSDMC021_BANK_BASE(x) ((x) & 0xfff)
90
91
92
93
94#define FTSDMC021_RAGR_CH1GW(x) (((x) & 0xff) << 0)
95#define FTSDMC021_RAGR_CH2GW(x) (((x) & 0xff) << 4)
96#define FTSDMC021_RAGR_CH3GW(x) (((x) & 0xff) << 8)
97#define FTSDMC021_RAGR_CH4GW(x) (((x) & 0xff) << 12)
98#define FTSDMC021_RAGR_CH5GW(x) (((x) & 0xff) << 16)
99#define FTSDMC021_RAGR_CH6GW(x) (((x) & 0xff) << 20)
100#define FTSDMC021_RAGR_CH7GW(x) (((x) & 0xff) << 24)
101#define FTSDMC021_RAGR_CH8GW(x) (((x) & 0xff) << 28)
102
103
104
105
106#define FTSDMC021_FRR_FLUSHCHN(x) (((x) & 0x7) << 0)
107#define FTSDMC021_FRR_FLUSHCMPLT (1 << 3)
108
109
110
111
112#define FTSDMC021_EBISR_MR(x) ((x) & 0xfff)
113#define FTSDMC021_EBISR_PRSMR (1 << 12)
114#define FTSDMC021_EBISR_POPREC (1 << 13)
115#define FTSDMC021_EBISR_POSMR (1 << 14)
116
117
118
119
120#define FTSDMC021_CRR_REV_VER (((x) >> 0) & 0xff)
121#define FTSDMC021_CRR_MINOR_VER (((x) >> 8) & 0xff)
122#define FTSDMC021_CRR_MAJOR_VER (((x) >> 16) & 0xff)
123
124
125
126
127#define FTSDMC021_CFR_EBNK (((x) >> 0) & 0xf)
128#define FTSDMC021_CFR_CHN (((x) >> 8) & 0xf)
129#define FTSDMC021_CFR_EBI (((x) >> 16) & 0x1)
130#define FTSDMC021_CFR_CH1_FDEPTH (((x) >> 24) & 0x1)
131#define FTSDMC021_CFR_CH2_FDEPTH (((x) >> 25) & 0x1)
132#define FTSDMC021_CFR_CH3_FDEPTH (((x) >> 26) & 0x1)
133#define FTSDMC021_CFR_CH4_FDEPTH (((x) >> 27) & 0x1)
134#define FTSDMC021_CFR_CH5_FDEPTH (((x) >> 28) & 0x1)
135#define FTSDMC021_CFR_CH6_FDEPTH (((x) >> 29) & 0x1)
136#define FTSDMC021_CFR_CH7_FDEPTH (((x) >> 30) & 0x1)
137#define FTSDMC021_CFR_CH8_FDEPTH (((x) >> 31) & 0x1)
138
139#endif
140