summaryrefslogtreecommitdiff
path: root/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_regs_adsl.h
blob: d6bdfd9ef72187a601cbea73130e002b64595976 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/******************************************************************************
**
** FILE NAME    : ifxmips_ptm_fw_regs_adsl.h
** PROJECT      : UEIP
** MODULES      : PTM
**
** DATE         : 7 Jul 2009
** AUTHOR       : Xu Liang
** DESCRIPTION  : PTM driver header file (firmware register for ADSL)
** COPYRIGHT    :       Copyright (c) 2006
**                      Infineon Technologies AG
**                      Am Campeon 1-12, 85579 Neubiberg, Germany
**
**    This program is free software; you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation; either version 2 of the License, or
**    (at your option) any later version.
**
** HISTORY
** $Date        $Author         $Comment
** 07 JUL 2009  Xu Liang        Init Version
*******************************************************************************/



#ifndef IFXMIPS_PTM_FW_REGS_ADSL_H
#define IFXMIPS_PTM_FW_REGS_ADSL_H



#if defined(CONFIG_DANUBE)
  #include "ifxmips_ptm_fw_regs_danube.h"
#elif defined(CONFIG_AMAZON_SE)
  #include "ifxmips_ptm_fw_regs_amazon_se.h"
#elif defined(CONFIG_AR9)
  #include "ifxmips_ptm_fw_regs_ar9.h"
#elif defined(CONFIG_VR9)
  #error VR9 is not ADSL PTM mode!
#else
  #error Platform is not specified!
#endif



/*
 *  MIB Table Maintained by Firmware
 */

struct wan_mib_table {
    unsigned int            wrx_correct_pdu;            /* 0 */
    unsigned int            wrx_correct_pdu_bytes;      /* 1 */
    unsigned int            wrx_tccrc_err_pdu;          /* 2 */
    unsigned int            wrx_tccrc_err_pdu_bytes;    /* 3 */
    unsigned int            wrx_ethcrc_err_pdu;         /* 4 */
    unsigned int            wrx_ethcrc_err_pdu_bytes;   /* 5 */
    unsigned int            wrx_nodesc_drop_pdu;        /* 6 */
    unsigned int            wrx_len_violation_drop_pdu; /* 7 */
    unsigned int            wrx_idle_bytes;             /* 8 */
    unsigned int            wrx_nonidle_cw;             /* 9 */
    unsigned int            wrx_idle_cw;                /* A */
    unsigned int            wrx_err_cw;                 /* B */
    unsigned int            wtx_total_pdu;              /* C */
    unsigned int            wtx_total_bytes;            /* D */
    unsigned int            res0;                       /* E */
    unsigned int            res1;                       /* F */
};


/*
 *  Host-PPE Communication Data Structure
 */

#if defined(__BIG_ENDIAN)

  struct fw_ver_id {
    unsigned int family         :4;
    unsigned int fwtype         :4;
    unsigned int interface      :4;
    unsigned int fwmode         :4;
    unsigned int major          :8;
    unsigned int minor          :8;
  };

  struct wrx_port_cfg_status {
    /* 0h */
    unsigned int mfs            :16;
    unsigned int res0           :12;
    unsigned int dmach          :3;
    unsigned int res1           :1;

    /* 1h */
    unsigned int res2           :14;
    unsigned int local_state    :2;     //  init with 0, written by firmware only
    unsigned int res3           :15;
    unsigned int partner_state  :1;     //  init with 0, written by firmware only

  };

  struct wrx_dma_channel_config {
    /*  0h  */
    unsigned int res3           :1;
    unsigned int res4           :2;
    unsigned int res5           :1;
    unsigned int desba          :28;
    /*  1h  */
    unsigned int res1           :16;
    unsigned int res2           :16;
    /*  2h  */
    unsigned int deslen         :16;
    unsigned int vlddes         :16;
  };

  struct wtx_port_cfg {
    /* 0h */
    unsigned int tx_cwth2       :8;
    unsigned int tx_cwth1       :8;
    unsigned int res0           :16;
  };

  struct wtx_dma_channel_config {
    /*  0h  */
    unsigned int res3           :1;
    unsigned int res4           :2;
    unsigned int res5           :1;
    unsigned int desba          :28;

    /*  1h  */
    unsigned int res1           :16;
    unsigned int res2           :16;

    /*  2h  */
    unsigned int deslen         :16;
    unsigned int vlddes         :16;
  };

  struct eth_efmtc_crc_cfg {
    /*  0h  */
    unsigned int res0               :6;
    unsigned int tx_eth_crc_gen     :1;
    unsigned int tx_tc_crc_gen      :1;
    unsigned int tx_tc_crc_len      :8;
    unsigned int res1               :5;
    unsigned int rx_eth_crc_present :1;
    unsigned int rx_eth_crc_check   :1;
    unsigned int rx_tc_crc_check    :1;
    unsigned int rx_tc_crc_len      :8;
  };

  /* DMA descriptor */
  struct rx_descriptor {
    /*  0 - 3h  */
    unsigned int own            :1;
    unsigned int c              :1;
    unsigned int sop            :1;
    unsigned int eop            :1;
    unsigned int res1           :3;
    unsigned int byteoff        :2;
    unsigned int res2           :2;
    unsigned int id             :4;
    unsigned int err            :1;
    unsigned int datalen        :16;
    /*  4 - 7h  */
    unsigned int res3           :4;
    unsigned int dataptr        :28;
  };

  struct tx_descriptor {
    /*  0 - 3h  */
    unsigned int own            :1;
    unsigned int c              :1;
    unsigned int sop            :1;
    unsigned int eop            :1;
    unsigned int byteoff        :5;
    unsigned int res1           :5;
    unsigned int iscell         :1;
    unsigned int clp            :1;
    unsigned int datalen        :16;
    /*  4 - 7h  */
    unsigned int res2           :4;
    unsigned int dataptr        :28;
  };

#else /* defined(__BIG_ENDIAN) */

  struct wrx_port_cfg_status {
    /* 0h */
    unsigned int res1           :1;
    unsigned int dmach          :3;
    unsigned int res0           :12;
    unsigned int mfs            :16;

    /* 1h */
    unsigned int partner_state  :1;
    unsigned int res3           :15;
    unsigned int local_state    :2;
    unsigned int res2           :14;
  };

  struct wrx_dma_channel_config {
    /*  0h  */
    unsigned int desba          :28;
    unsigned int res5           :1;
    unsigned int res4           :2;
    unsigned int res3           :1;
    /*  1h  */
    unsigned int res2           :16;
    unsigned int res1           :16;
    /*  2h  */
    unsigned int vlddes         :16;
    unsigned int deslen         :16;
  };

  struct wtx_port_cfg {
    /* 0h */
    unsigned int res0           :16;
    unsigned int tx_cwth1       :8;
    unsigned int tx_cwth2       :8;
  };

  struct wtx_dma_channel_config {
    /*  0h  */
    unsigned int desba          :28;
    unsigned int res5           :1;
    unsigned int res4           :2;
    unsigned int res3           :1;
    /*  1h  */
    unsigned int res2           :16;
    unsigned int res1           :16;
    /*  2h  */
    unsigned int vlddes         :16;
    unsigned int deslen         :16;
  };

  struct eth_efmtc_crc_cfg {
    /*  0h  */
    unsigned int rx_tc_crc_len      :8;
    unsigned int rx_tc_crc_check    :1;
    unsigned int rx_eth_crc_check   :1;
    unsigned int rx_eth_crc_present :1;
    unsigned int res1               :5;
    unsigned int tx_tc_crc_len      :8;
    unsigned int tx_tc_crc_gen      :1;
    unsigned int tx_eth_crc_gen     :1;
    unsigned int res0               :6;
  };

  /* DMA descriptor */
  struct rx_descriptor {
    /*  4 - 7h  */
    unsigned int dataptr        :28;
    unsigned int res3           :4;
    /*  0 - 3h  */
    unsigned int datalen        :16;
    unsigned int err            :1;
    unsigned int id             :4;
    unsigned int res2           :2;
    unsigned int byteoff        :2;
    unsigned int res1           :3;
    unsigned int eop            :1;
    unsigned int sop            :1;
    unsigned int c              :1;
    unsigned int own            :1;
  };

  struct tx_descriptor {
    /*  4 - 7h  */
    unsigned int dataptr        :28;
    unsigned int res2           :4;
    /*  0 - 3h  */
    unsigned int datalen        :16;
    unsigned int clp            :1;
    unsigned int iscell         :1;
    unsigned int res1           :5;
    unsigned int byteoff        :5;
    unsigned int eop            :1;
    unsigned int sop            :1;
    unsigned int c              :1;
    unsigned int own            :1;
  };
#endif  /* defined(__BIG_ENDIAN) */



#endif  //  IFXMIPS_PTM_FW_REGS_ADSL_H