1 /******************************************************************************
3 ** FILE NAME : ifxmips_atm_ppe_common.h
5 ** MODULES : ATM (ADSL)
9 ** DESCRIPTION : ATM Driver (PPE Registers)
10 ** COPYRIGHT : Copyright (c) 2006
11 ** Infineon Technologies AG
12 ** Am Campeon 1-12, 85579 Neubiberg, Germany
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License as published by
16 ** the Free Software Foundation; either version 2 of the License, or
17 ** (at your option) any later version.
20 ** $Date $Author $Comment
21 ** 4 AUG 2005 Xu Liang Initiate Version
22 ** 23 OCT 2006 Xu Liang Add GPL header.
23 ** 9 JAN 2007 Xu Liang First version got from Anand (IC designer)
24 *******************************************************************************/
28 #ifndef IFXMIPS_ATM_PPE_COMMON_H
29 #define IFXMIPS_ATM_PPE_COMMON_H
30 #if defined(CONFIG_DANUBE)
31 #include "ifxmips_atm_ppe_danube.h"
32 #elif defined(CONFIG_AMAZON_SE)
33 #include "ifxmips_atm_ppe_amazon_se.h"
34 #elif defined(CONFIG_AR9)
35 #include "ifxmips_atm_ppe_ar9.h"
36 #elif defined(CONFIG_VR9)
37 #include "ifxmips_atm_ppe_vr9.h"
39 #error Platform is not specified!
45 * Code/Data Memory (CDM) Interface Configuration Register
47 #define CDM_CFG PPE_REG_ADDR(0x0100)
49 #define CDM_CFG_RAM1 GET_BITS(*CDM_CFG, 3, 2)
50 #define CDM_CFG_RAM0 (*CDM_CFG & (1 << 1))
52 #define CDM_CFG_RAM1_SET(value) SET_BITS(0, 3, 2, value)
53 #define CDM_CFG_RAM0_SET(value) ((value) ? (1 << 1) : 0)
56 * QSB Internal Cell Delay Variation Register
58 #define QSB_ICDV QSB_CONF_REG_ADDR(0x0007)
60 #define QSB_ICDV_TAU GET_BITS(*QSB_ICDV, 5, 0)
62 #define QSB_ICDV_TAU_SET(value) SET_BITS(0, 5, 0, value)
65 * QSB Scheduler Burst Limit Register
67 #define QSB_SBL QSB_CONF_REG_ADDR(0x0009)
69 #define QSB_SBL_SBL GET_BITS(*QSB_SBL, 3, 0)
71 #define QSB_SBL_SBL_SET(value) SET_BITS(0, 3, 0, value)
74 * QSB Configuration Register
76 #define QSB_CFG QSB_CONF_REG_ADDR(0x000A)
78 #define QSB_CFG_TSTEPC GET_BITS(*QSB_CFG, 1, 0)
80 #define QSB_CFG_TSTEPC_SET(value) SET_BITS(0, 1, 0, value)
83 * QSB RAM Transfer Table Register
85 #define QSB_RTM QSB_CONF_REG_ADDR(0x000B)
87 #define QSB_RTM_DM (*QSB_RTM)
89 #define QSB_RTM_DM_SET(value) ((value) & 0xFFFFFFFF)
92 * QSB RAM Transfer Data Register
94 #define QSB_RTD QSB_CONF_REG_ADDR(0x000C)
96 #define QSB_RTD_TTV (*QSB_RTD)
98 #define QSB_RTD_TTV_SET(value) ((value) & 0xFFFFFFFF)
101 * QSB RAM Access Register
103 #define QSB_RAMAC QSB_CONF_REG_ADDR(0x000D)
105 #define QSB_RAMAC_RW (*QSB_RAMAC & (1 << 31))
106 #define QSB_RAMAC_TSEL GET_BITS(*QSB_RAMAC, 27, 24)
107 #define QSB_RAMAC_LH (*QSB_RAMAC & (1 << 16))
108 #define QSB_RAMAC_TESEL GET_BITS(*QSB_RAMAC, 9, 0)
110 #define QSB_RAMAC_RW_SET(value) ((value) ? (1 << 31) : 0)
111 #define QSB_RAMAC_TSEL_SET(value) SET_BITS(0, 27, 24, value)
112 #define QSB_RAMAC_LH_SET(value) ((value) ? (1 << 16) : 0)
113 #define QSB_RAMAC_TESEL_SET(value) SET_BITS(0, 9, 0, value)
116 * QSB Queue Scheduling and Shaping Definitions
118 #define QSB_WFQ_NONUBR_MAX 0x3f00
119 #define QSB_WFQ_UBR_BYPASS 0x3fff
120 #define QSB_TP_TS_MAX 65472
121 #define QSB_TAUS_MAX 64512
122 #define QSB_GCR_MIN 18
127 #define QSB_RAMAC_RW_READ 0
128 #define QSB_RAMAC_RW_WRITE 1
130 #define QSB_RAMAC_TSEL_QPT 0x01
131 #define QSB_RAMAC_TSEL_SCT 0x02
132 #define QSB_RAMAC_TSEL_SPT 0x03
133 #define QSB_RAMAC_TSEL_VBR 0x08
135 #define QSB_RAMAC_LH_LOW 0
136 #define QSB_RAMAC_LH_HIGH 1
138 #define QSB_QPT_SET_MASK 0x0
139 #define QSB_QVPT_SET_MASK 0x0
140 #define QSB_SET_SCT_MASK 0x0
141 #define QSB_SET_SPT_MASK 0x0
142 #define QSB_SET_SPT_SBVALID_MASK 0x7FFFFFFF
144 #define QSB_SPT_SBV_VALID (1 << 31)
145 #define QSB_SPT_PN_SET(value) (((value) & 0x01) ? (1 << 16) : 0)
146 #define QSB_SPT_INTRATE_SET(value) SET_BITS(0, 13, 0, value)
149 * QSB Queue Parameter Table Entry and Queue VBR Parameter Table Entry
151 #if defined(__BIG_ENDIAN)
152 union qsb_queue_parameter_table
{
154 unsigned int res1
:1;
156 unsigned int wfqf
:14;
162 union qsb_queue_vbr_parameter_table
{
164 unsigned int taus
:16;
170 union qsb_queue_parameter_table
{
173 unsigned int wfqf
:14;
175 unsigned int res1
:1;
180 union qsb_queue_vbr_parameter_table
{
183 unsigned int taus
:16;
187 #endif // defined(__BIG_ENDIAN)
190 * Mailbox IGU0 Registers
192 #define MBOX_IGU0_ISRS PPE_REG_ADDR(0x0200)
193 #define MBOX_IGU0_ISRC PPE_REG_ADDR(0x0201)
194 #define MBOX_IGU0_ISR PPE_REG_ADDR(0x0202)
195 #define MBOX_IGU0_IER PPE_REG_ADDR(0x0203)
197 #define MBOX_IGU0_ISRS_SET(n) (1 << (n))
198 #define MBOX_IGU0_ISRC_CLEAR(n) (1 << (n))
199 #define MBOX_IGU0_ISR_ISR(n) (*MBOX_IGU0_ISR & (1 << (n)))
200 #define MBOX_IGU0_IER_EN(n) (*MBOX_IGU0_IER & (1 << (n)))
201 #define MBOX_IGU0_IER_EN_SET(n) (1 << (n))
204 * Mailbox IGU1 Registers
206 #define MBOX_IGU1_ISRS PPE_REG_ADDR(0x0204)
207 #define MBOX_IGU1_ISRC PPE_REG_ADDR(0x0205)
208 #define MBOX_IGU1_ISR PPE_REG_ADDR(0x0206)
209 #define MBOX_IGU1_IER PPE_REG_ADDR(0x0207)
211 #define MBOX_IGU1_ISRS_SET(n) (1 << (n))
212 #define MBOX_IGU1_ISRC_CLEAR(n) (1 << (n))
213 #define MBOX_IGU1_ISR_ISR(n) (*MBOX_IGU1_ISR & (1 << (n)))
214 #define MBOX_IGU1_IER_EN(n) (*MBOX_IGU1_IER & (1 << (n)))
215 #define MBOX_IGU1_IER_EN_SET(n) (1 << (n))
218 * Mailbox IGU3 Registers
220 #define MBOX_IGU3_ISRS PPE_REG_ADDR(0x0214)
221 #define MBOX_IGU3_ISRC PPE_REG_ADDR(0x0215)
222 #define MBOX_IGU3_ISR PPE_REG_ADDR(0x0216)
223 #define MBOX_IGU3_IER PPE_REG_ADDR(0x0217)
225 #define MBOX_IGU3_ISRS_SET(n) (1 << (n))
226 #define MBOX_IGU3_ISRC_CLEAR(n) (1 << (n))
227 #define MBOX_IGU3_ISR_ISR(n) (*MBOX_IGU3_ISR & (1 << (n)))
228 #define MBOX_IGU3_IER_EN(n) (*MBOX_IGU3_IER & (1 << (n)))
229 #define MBOX_IGU3_IER_EN_SET(n) (1 << (n))
232 * RTHA/TTHA Registers
234 #define RFBI_CFG PPE_REG_ADDR(0x0400)
235 #define RBA_CFG0 PPE_REG_ADDR(0x0404)
236 #define RBA_CFG1 PPE_REG_ADDR(0x0405)
237 #define RCA_CFG0 PPE_REG_ADDR(0x0408)
238 #define RCA_CFG1 PPE_REG_ADDR(0x0409)
239 #define RDES_CFG0 PPE_REG_ADDR(0x040C)
240 #define RDES_CFG1 PPE_REG_ADDR(0x040D)
241 #define SFSM_STATE0 PPE_REG_ADDR(0x0410)
242 #define SFSM_STATE1 PPE_REG_ADDR(0x0411)
243 #define SFSM_DBA0 PPE_REG_ADDR(0x0412)
244 #define SFSM_DBA1 PPE_REG_ADDR(0x0413)
245 #define SFSM_CBA0 PPE_REG_ADDR(0x0414)
246 #define SFSM_CBA1 PPE_REG_ADDR(0x0415)
247 #define SFSM_CFG0 PPE_REG_ADDR(0x0416)
248 #define SFSM_CFG1 PPE_REG_ADDR(0x0417)
249 #define SFSM_PGCNT0 PPE_REG_ADDR(0x041C)
250 #define SFSM_PGCNT1 PPE_REG_ADDR(0x041D)
251 #define FFSM_DBA0 PPE_REG_ADDR(0x0508)
252 #define FFSM_DBA1 PPE_REG_ADDR(0x0509)
253 #define FFSM_CFG0 PPE_REG_ADDR(0x050A)
254 #define FFSM_CFG1 PPE_REG_ADDR(0x050B)
255 #define FFSM_IDLE_HEAD_BC0 PPE_REG_ADDR(0x050E)
256 #define FFSM_IDLE_HEAD_BC1 PPE_REG_ADDR(0x050F)
257 #define FFSM_PGCNT0 PPE_REG_ADDR(0x0514)
258 #define FFSM_PGCNT1 PPE_REG_ADDR(0x0515)
261 * PPE TC Logic Registers (partial)
263 #define DREG_A_VERSION PPE_REG_ADDR(0x0D00)
264 #define DREG_A_CFG PPE_REG_ADDR(0x0D01)
265 #define DREG_AT_CTRL PPE_REG_ADDR(0x0D02)
266 #define DREG_AT_CB_CFG0 PPE_REG_ADDR(0x0D03)
267 #define DREG_AT_CB_CFG1 PPE_REG_ADDR(0x0D04)
268 #define DREG_AR_CTRL PPE_REG_ADDR(0x0D08)
269 #define DREG_AR_CB_CFG0 PPE_REG_ADDR(0x0D09)
270 #define DREG_AR_CB_CFG1 PPE_REG_ADDR(0x0D0A)
271 #define DREG_A_UTPCFG PPE_REG_ADDR(0x0D0E)
272 #define DREG_A_STATUS PPE_REG_ADDR(0x0D0F)
273 #define DREG_AT_CFG0 PPE_REG_ADDR(0x0D20)
274 #define DREG_AT_CFG1 PPE_REG_ADDR(0x0D21)
275 #define DREG_AT_FB_SIZE0 PPE_REG_ADDR(0x0D22)
276 #define DREG_AT_FB_SIZE1 PPE_REG_ADDR(0x0D23)
277 #define DREG_AT_CELL0 PPE_REG_ADDR(0x0D24)
278 #define DREG_AT_CELL1 PPE_REG_ADDR(0x0D25)
279 #define DREG_AT_IDLE_CNT0 PPE_REG_ADDR(0x0D26)
280 #define DREG_AT_IDLE_CNT1 PPE_REG_ADDR(0x0D27)
281 #define DREG_AT_IDLE0 PPE_REG_ADDR(0x0D28)
282 #define DREG_AT_IDLE1 PPE_REG_ADDR(0x0D29)
283 #define DREG_AR_CFG0 PPE_REG_ADDR(0x0D60)
284 #define DREG_AR_CFG1 PPE_REG_ADDR(0x0D61)
285 #define DREG_AR_CELL0 PPE_REG_ADDR(0x0D68)
286 #define DREG_AR_CELL1 PPE_REG_ADDR(0x0D69)
287 #define DREG_AR_IDLE_CNT0 PPE_REG_ADDR(0x0D6A)
288 #define DREG_AR_IDLE_CNT1 PPE_REG_ADDR(0x0D6B)
289 #define DREG_AR_AIIDLE_CNT0 PPE_REG_ADDR(0x0D6C)
290 #define DREG_AR_AIIDLE_CNT1 PPE_REG_ADDR(0x0D6D)
291 #define DREG_AR_BE_CNT0 PPE_REG_ADDR(0x0D6E)
292 #define DREG_AR_BE_CNT1 PPE_REG_ADDR(0x0D6F)
293 #define DREG_AR_HEC_CNT0 PPE_REG_ADDR(0x0D70)
294 #define DREG_AR_HEC_CNT1 PPE_REG_ADDR(0x0D71)
295 #define DREG_AR_IDLE0 PPE_REG_ADDR(0x0D74)
296 #define DREG_AR_IDLE1 PPE_REG_ADDR(0x0D75)
297 #define DREG_AR_CVN_CNT0 PPE_REG_ADDR(0x0DA4)
298 #define DREG_AR_CVN_CNT1 PPE_REG_ADDR(0x0DA5)
299 #define DREG_AR_CVNP_CNT0 PPE_REG_ADDR(0x0DA6)
300 #define DREG_AR_CVNP_CNT1 PPE_REG_ADDR(0x0DA7)
301 #define DREG_B0_LADR PPE_REG_ADDR(0x0DA8)
302 #define DREG_B1_LADR PPE_REG_ADDR(0x0DA9)
304 #define SFSM_DBA(i) ( (SFSM_dba * ) PPE_REG_ADDR(0x0412 + (i)))
305 #define SFSM_CBA(i) ( (SFSM_cba * ) PPE_REG_ADDR(0x0414 + (i)))
306 #define SFSM_CFG(i) ( (SFSM_cfg * ) PPE_REG_ADDR(0x0416 + (i)))
307 #define SFSM_PGCNT(i) ( (SFSM_pgcnt * ) PPE_REG_ADDR(0x041C + (i)))
309 #define FFSM_DBA(i) ( (FFSM_dba * ) PPE_REG_ADDR(0x0508 + (i)))
310 #define FFSM_CFG(i) ( (FFSM_cfg * ) PPE_REG_ADDR(0x050A + (i)))
311 #define FFSM_PGCNT(i) ( (FFSM_pgcnt * ) PPE_REG_ADDR(0x0514 + (i)))
314 unsigned int res
: 19;
315 unsigned int dbase
: 13;
319 unsigned int res
: 19;
320 unsigned int cbase
: 13;
324 unsigned int res
: 15;
325 unsigned int endian
: 1;
326 unsigned int idlekeep
: 1;
327 unsigned int sen
: 1;
328 unsigned int res1
: 8;
329 unsigned int pnum
: 6;
333 unsigned int res
: 17;
334 unsigned int pptr
: 6;
335 unsigned int dcmd
: 1;
336 unsigned int res1
: 2;
337 unsigned int upage
: 6;
341 unsigned int res
: 19;
342 unsigned int dbase
: 13;
346 unsigned int res
: 12;
347 unsigned int rstptr
: 1;
348 unsigned int clvpage
: 1;
349 unsigned int fidle
: 1;
350 unsigned int endian
: 1;
351 unsigned int res1
: 10;
352 unsigned int pnum
: 6;
356 unsigned int res
: 17;
357 unsigned int ival
: 6;
358 unsigned int icmd
: 1;
359 unsigned int res1
: 2;
360 unsigned int vpage
: 6;
365 #endif // IFXMIPS_ATM_PPE_COMMON_H