1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * QUICC Engine (QE) Internal Memory Map. 3*4882a593Smuzhiyun * The Internal Memory Map for devices with QE on them. This 4*4882a593Smuzhiyun * is the superset of all QE devices (8360, etc.). 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * Copyright (c) 2006-2009, 2011 Freescale Semiconductor, Inc. 7*4882a593Smuzhiyun * Author: Shlomi Gridih <gridish@freescale.com> 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * SPDX-License-Identifier: GPL-2.0+ 10*4882a593Smuzhiyun */ 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun #ifndef __IMMAP_QE_H__ 13*4882a593Smuzhiyun #define __IMMAP_QE_H__ 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun #ifdef CONFIG_MPC83xx 16*4882a593Smuzhiyun #if defined(CONFIG_MPC8360) 17*4882a593Smuzhiyun #define QE_MURAM_SIZE 0xc000UL 18*4882a593Smuzhiyun #define MAX_QE_RISC 2 19*4882a593Smuzhiyun #define QE_NUM_OF_SNUM 28 20*4882a593Smuzhiyun #elif defined(CONFIG_MPC832x) || defined(CONFIG_MPC8309) 21*4882a593Smuzhiyun #define QE_MURAM_SIZE 0x4000UL 22*4882a593Smuzhiyun #define MAX_QE_RISC 1 23*4882a593Smuzhiyun #define QE_NUM_OF_SNUM 28 24*4882a593Smuzhiyun #endif 25*4882a593Smuzhiyun #endif 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun #ifdef CONFIG_ARCH_LS1021A 28*4882a593Smuzhiyun #define QE_MURAM_SIZE 0x6000UL 29*4882a593Smuzhiyun #define MAX_QE_RISC 1 30*4882a593Smuzhiyun #define QE_NUM_OF_SNUM 28 31*4882a593Smuzhiyun #endif 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun #ifdef CONFIG_PPC 34*4882a593Smuzhiyun #define QE_IMMR_OFFSET 0x00140000 35*4882a593Smuzhiyun #else 36*4882a593Smuzhiyun #define QE_IMMR_OFFSET 0x01400000 37*4882a593Smuzhiyun #endif 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun /* QE I-RAM */ 40*4882a593Smuzhiyun typedef struct qe_iram { 41*4882a593Smuzhiyun u32 iadd; /* I-RAM Address Register */ 42*4882a593Smuzhiyun u32 idata; /* I-RAM Data Register */ 43*4882a593Smuzhiyun u8 res0[0x4]; 44*4882a593Smuzhiyun u32 iready; 45*4882a593Smuzhiyun u8 res1[0x70]; 46*4882a593Smuzhiyun } __attribute__ ((packed)) qe_iram_t; 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun /* QE Interrupt Controller */ 49*4882a593Smuzhiyun typedef struct qe_ic { 50*4882a593Smuzhiyun u32 qicr; 51*4882a593Smuzhiyun u32 qivec; 52*4882a593Smuzhiyun u32 qripnr; 53*4882a593Smuzhiyun u32 qipnr; 54*4882a593Smuzhiyun u32 qipxcc; 55*4882a593Smuzhiyun u32 qipycc; 56*4882a593Smuzhiyun u32 qipwcc; 57*4882a593Smuzhiyun u32 qipzcc; 58*4882a593Smuzhiyun u32 qimr; 59*4882a593Smuzhiyun u32 qrimr; 60*4882a593Smuzhiyun u32 qicnr; 61*4882a593Smuzhiyun u8 res0[0x4]; 62*4882a593Smuzhiyun u32 qiprta; 63*4882a593Smuzhiyun u32 qiprtb; 64*4882a593Smuzhiyun u8 res1[0x4]; 65*4882a593Smuzhiyun u32 qricr; 66*4882a593Smuzhiyun u8 res2[0x20]; 67*4882a593Smuzhiyun u32 qhivec; 68*4882a593Smuzhiyun u8 res3[0x1C]; 69*4882a593Smuzhiyun } __attribute__ ((packed)) qe_ic_t; 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun /* Communications Processor */ 72*4882a593Smuzhiyun typedef struct cp_qe { 73*4882a593Smuzhiyun u32 cecr; /* QE command register */ 74*4882a593Smuzhiyun u32 ceccr; /* QE controller configuration register */ 75*4882a593Smuzhiyun u32 cecdr; /* QE command data register */ 76*4882a593Smuzhiyun u8 res0[0xA]; 77*4882a593Smuzhiyun u16 ceter; /* QE timer event register */ 78*4882a593Smuzhiyun u8 res1[0x2]; 79*4882a593Smuzhiyun u16 cetmr; /* QE timers mask register */ 80*4882a593Smuzhiyun u32 cetscr; /* QE time-stamp timer control register */ 81*4882a593Smuzhiyun u32 cetsr1; /* QE time-stamp register 1 */ 82*4882a593Smuzhiyun u32 cetsr2; /* QE time-stamp register 2 */ 83*4882a593Smuzhiyun u8 res2[0x8]; 84*4882a593Smuzhiyun u32 cevter; /* QE virtual tasks event register */ 85*4882a593Smuzhiyun u32 cevtmr; /* QE virtual tasks mask register */ 86*4882a593Smuzhiyun u16 cercr; /* QE RAM control register */ 87*4882a593Smuzhiyun u8 res3[0x2]; 88*4882a593Smuzhiyun u8 res4[0x24]; 89*4882a593Smuzhiyun u16 ceexe1; /* QE external request 1 event register */ 90*4882a593Smuzhiyun u8 res5[0x2]; 91*4882a593Smuzhiyun u16 ceexm1; /* QE external request 1 mask register */ 92*4882a593Smuzhiyun u8 res6[0x2]; 93*4882a593Smuzhiyun u16 ceexe2; /* QE external request 2 event register */ 94*4882a593Smuzhiyun u8 res7[0x2]; 95*4882a593Smuzhiyun u16 ceexm2; /* QE external request 2 mask register */ 96*4882a593Smuzhiyun u8 res8[0x2]; 97*4882a593Smuzhiyun u16 ceexe3; /* QE external request 3 event register */ 98*4882a593Smuzhiyun u8 res9[0x2]; 99*4882a593Smuzhiyun u16 ceexm3; /* QE external request 3 mask register */ 100*4882a593Smuzhiyun u8 res10[0x2]; 101*4882a593Smuzhiyun u16 ceexe4; /* QE external request 4 event register */ 102*4882a593Smuzhiyun u8 res11[0x2]; 103*4882a593Smuzhiyun u16 ceexm4; /* QE external request 4 mask register */ 104*4882a593Smuzhiyun u8 res12[0x2]; 105*4882a593Smuzhiyun u8 res13[0x280]; 106*4882a593Smuzhiyun } __attribute__ ((packed)) cp_qe_t; 107*4882a593Smuzhiyun 108*4882a593Smuzhiyun /* QE Multiplexer */ 109*4882a593Smuzhiyun typedef struct qe_mux { 110*4882a593Smuzhiyun u32 cmxgcr; /* CMX general clock route register */ 111*4882a593Smuzhiyun u32 cmxsi1cr_l; /* CMX SI1 clock route low register */ 112*4882a593Smuzhiyun u32 cmxsi1cr_h; /* CMX SI1 clock route high register */ 113*4882a593Smuzhiyun u32 cmxsi1syr; /* CMX SI1 SYNC route register */ 114*4882a593Smuzhiyun u32 cmxucr1; /* CMX UCC1, UCC3 clock route register */ 115*4882a593Smuzhiyun u32 cmxucr2; /* CMX UCC5, UCC7 clock route register */ 116*4882a593Smuzhiyun u32 cmxucr3; /* CMX UCC2, UCC4 clock route register */ 117*4882a593Smuzhiyun u32 cmxucr4; /* CMX UCC6, UCC8 clock route register */ 118*4882a593Smuzhiyun u32 cmxupcr; /* CMX UPC clock route register */ 119*4882a593Smuzhiyun u8 res0[0x1C]; 120*4882a593Smuzhiyun } __attribute__ ((packed)) qe_mux_t; 121*4882a593Smuzhiyun 122*4882a593Smuzhiyun /* QE Timers */ 123*4882a593Smuzhiyun typedef struct qe_timers { 124*4882a593Smuzhiyun u8 gtcfr1; /* Timer 1 2 global configuration register */ 125*4882a593Smuzhiyun u8 res0[0x3]; 126*4882a593Smuzhiyun u8 gtcfr2; /* Timer 3 4 global configuration register */ 127*4882a593Smuzhiyun u8 res1[0xB]; 128*4882a593Smuzhiyun u16 gtmdr1; /* Timer 1 mode register */ 129*4882a593Smuzhiyun u16 gtmdr2; /* Timer 2 mode register */ 130*4882a593Smuzhiyun u16 gtrfr1; /* Timer 1 reference register */ 131*4882a593Smuzhiyun u16 gtrfr2; /* Timer 2 reference register */ 132*4882a593Smuzhiyun u16 gtcpr1; /* Timer 1 capture register */ 133*4882a593Smuzhiyun u16 gtcpr2; /* Timer 2 capture register */ 134*4882a593Smuzhiyun u16 gtcnr1; /* Timer 1 counter */ 135*4882a593Smuzhiyun u16 gtcnr2; /* Timer 2 counter */ 136*4882a593Smuzhiyun u16 gtmdr3; /* Timer 3 mode register */ 137*4882a593Smuzhiyun u16 gtmdr4; /* Timer 4 mode register */ 138*4882a593Smuzhiyun u16 gtrfr3; /* Timer 3 reference register */ 139*4882a593Smuzhiyun u16 gtrfr4; /* Timer 4 reference register */ 140*4882a593Smuzhiyun u16 gtcpr3; /* Timer 3 capture register */ 141*4882a593Smuzhiyun u16 gtcpr4; /* Timer 4 capture register */ 142*4882a593Smuzhiyun u16 gtcnr3; /* Timer 3 counter */ 143*4882a593Smuzhiyun u16 gtcnr4; /* Timer 4 counter */ 144*4882a593Smuzhiyun u16 gtevr1; /* Timer 1 event register */ 145*4882a593Smuzhiyun u16 gtevr2; /* Timer 2 event register */ 146*4882a593Smuzhiyun u16 gtevr3; /* Timer 3 event register */ 147*4882a593Smuzhiyun u16 gtevr4; /* Timer 4 event register */ 148*4882a593Smuzhiyun u16 gtps; /* Timer 1 prescale register */ 149*4882a593Smuzhiyun u8 res2[0x46]; 150*4882a593Smuzhiyun } __attribute__ ((packed)) qe_timers_t; 151*4882a593Smuzhiyun 152*4882a593Smuzhiyun /* BRG */ 153*4882a593Smuzhiyun typedef struct qe_brg { 154*4882a593Smuzhiyun u32 brgc1; /* BRG1 configuration register */ 155*4882a593Smuzhiyun u32 brgc2; /* BRG2 configuration register */ 156*4882a593Smuzhiyun u32 brgc3; /* BRG3 configuration register */ 157*4882a593Smuzhiyun u32 brgc4; /* BRG4 configuration register */ 158*4882a593Smuzhiyun u32 brgc5; /* BRG5 configuration register */ 159*4882a593Smuzhiyun u32 brgc6; /* BRG6 configuration register */ 160*4882a593Smuzhiyun u32 brgc7; /* BRG7 configuration register */ 161*4882a593Smuzhiyun u32 brgc8; /* BRG8 configuration register */ 162*4882a593Smuzhiyun u32 brgc9; /* BRG9 configuration register */ 163*4882a593Smuzhiyun u32 brgc10; /* BRG10 configuration register */ 164*4882a593Smuzhiyun u32 brgc11; /* BRG11 configuration register */ 165*4882a593Smuzhiyun u32 brgc12; /* BRG12 configuration register */ 166*4882a593Smuzhiyun u32 brgc13; /* BRG13 configuration register */ 167*4882a593Smuzhiyun u32 brgc14; /* BRG14 configuration register */ 168*4882a593Smuzhiyun u32 brgc15; /* BRG15 configuration register */ 169*4882a593Smuzhiyun u32 brgc16; /* BRG16 configuration register */ 170*4882a593Smuzhiyun u8 res0[0x40]; 171*4882a593Smuzhiyun } __attribute__ ((packed)) qe_brg_t; 172*4882a593Smuzhiyun 173*4882a593Smuzhiyun /* SPI */ 174*4882a593Smuzhiyun typedef struct spi { 175*4882a593Smuzhiyun u8 res0[0x20]; 176*4882a593Smuzhiyun u32 spmode; /* SPI mode register */ 177*4882a593Smuzhiyun u8 res1[0x2]; 178*4882a593Smuzhiyun u8 spie; /* SPI event register */ 179*4882a593Smuzhiyun u8 res2[0x1]; 180*4882a593Smuzhiyun u8 res3[0x2]; 181*4882a593Smuzhiyun u8 spim; /* SPI mask register */ 182*4882a593Smuzhiyun u8 res4[0x1]; 183*4882a593Smuzhiyun u8 res5[0x1]; 184*4882a593Smuzhiyun u8 spcom; /* SPI command register */ 185*4882a593Smuzhiyun u8 res6[0x2]; 186*4882a593Smuzhiyun u32 spitd; /* SPI transmit data register (cpu mode) */ 187*4882a593Smuzhiyun u32 spird; /* SPI receive data register (cpu mode) */ 188*4882a593Smuzhiyun u8 res7[0x8]; 189*4882a593Smuzhiyun } __attribute__ ((packed)) spi_t; 190*4882a593Smuzhiyun 191*4882a593Smuzhiyun /* SI */ 192*4882a593Smuzhiyun typedef struct si1 { 193*4882a593Smuzhiyun u16 siamr1; /* SI1 TDMA mode register */ 194*4882a593Smuzhiyun u16 sibmr1; /* SI1 TDMB mode register */ 195*4882a593Smuzhiyun u16 sicmr1; /* SI1 TDMC mode register */ 196*4882a593Smuzhiyun u16 sidmr1; /* SI1 TDMD mode register */ 197*4882a593Smuzhiyun u8 siglmr1_h; /* SI1 global mode register high */ 198*4882a593Smuzhiyun u8 res0[0x1]; 199*4882a593Smuzhiyun u8 sicmdr1_h; /* SI1 command register high */ 200*4882a593Smuzhiyun u8 res2[0x1]; 201*4882a593Smuzhiyun u8 sistr1_h; /* SI1 status register high */ 202*4882a593Smuzhiyun u8 res3[0x1]; 203*4882a593Smuzhiyun u16 sirsr1_h; /* SI1 RAM shadow address register high */ 204*4882a593Smuzhiyun u8 sitarc1; /* SI1 RAM counter Tx TDMA */ 205*4882a593Smuzhiyun u8 sitbrc1; /* SI1 RAM counter Tx TDMB */ 206*4882a593Smuzhiyun u8 sitcrc1; /* SI1 RAM counter Tx TDMC */ 207*4882a593Smuzhiyun u8 sitdrc1; /* SI1 RAM counter Tx TDMD */ 208*4882a593Smuzhiyun u8 sirarc1; /* SI1 RAM counter Rx TDMA */ 209*4882a593Smuzhiyun u8 sirbrc1; /* SI1 RAM counter Rx TDMB */ 210*4882a593Smuzhiyun u8 sircrc1; /* SI1 RAM counter Rx TDMC */ 211*4882a593Smuzhiyun u8 sirdrc1; /* SI1 RAM counter Rx TDMD */ 212*4882a593Smuzhiyun u8 res4[0x8]; 213*4882a593Smuzhiyun u16 siemr1; /* SI1 TDME mode register 16 bits */ 214*4882a593Smuzhiyun u16 sifmr1; /* SI1 TDMF mode register 16 bits */ 215*4882a593Smuzhiyun u16 sigmr1; /* SI1 TDMG mode register 16 bits */ 216*4882a593Smuzhiyun u16 sihmr1; /* SI1 TDMH mode register 16 bits */ 217*4882a593Smuzhiyun u8 siglmg1_l; /* SI1 global mode register low 8 bits */ 218*4882a593Smuzhiyun u8 res5[0x1]; 219*4882a593Smuzhiyun u8 sicmdr1_l; /* SI1 command register low 8 bits */ 220*4882a593Smuzhiyun u8 res6[0x1]; 221*4882a593Smuzhiyun u8 sistr1_l; /* SI1 status register low 8 bits */ 222*4882a593Smuzhiyun u8 res7[0x1]; 223*4882a593Smuzhiyun u16 sirsr1_l; /* SI1 RAM shadow address register low 16 bits */ 224*4882a593Smuzhiyun u8 siterc1; /* SI1 RAM counter Tx TDME 8 bits */ 225*4882a593Smuzhiyun u8 sitfrc1; /* SI1 RAM counter Tx TDMF 8 bits */ 226*4882a593Smuzhiyun u8 sitgrc1; /* SI1 RAM counter Tx TDMG 8 bits */ 227*4882a593Smuzhiyun u8 sithrc1; /* SI1 RAM counter Tx TDMH 8 bits */ 228*4882a593Smuzhiyun u8 sirerc1; /* SI1 RAM counter Rx TDME 8 bits */ 229*4882a593Smuzhiyun u8 sirfrc1; /* SI1 RAM counter Rx TDMF 8 bits */ 230*4882a593Smuzhiyun u8 sirgrc1; /* SI1 RAM counter Rx TDMG 8 bits */ 231*4882a593Smuzhiyun u8 sirhrc1; /* SI1 RAM counter Rx TDMH 8 bits */ 232*4882a593Smuzhiyun u8 res8[0x8]; 233*4882a593Smuzhiyun u32 siml1; /* SI1 multiframe limit register */ 234*4882a593Smuzhiyun u8 siedm1; /* SI1 extended diagnostic mode register */ 235*4882a593Smuzhiyun u8 res9[0xBB]; 236*4882a593Smuzhiyun } __attribute__ ((packed)) si1_t; 237*4882a593Smuzhiyun 238*4882a593Smuzhiyun /* SI Routing Tables */ 239*4882a593Smuzhiyun typedef struct sir { 240*4882a593Smuzhiyun u8 tx[0x400]; 241*4882a593Smuzhiyun u8 rx[0x400]; 242*4882a593Smuzhiyun u8 res0[0x800]; 243*4882a593Smuzhiyun } __attribute__ ((packed)) sir_t; 244*4882a593Smuzhiyun 245*4882a593Smuzhiyun /* USB Controller. */ 246*4882a593Smuzhiyun typedef struct usb_ctlr { 247*4882a593Smuzhiyun u8 usb_usmod; 248*4882a593Smuzhiyun u8 usb_usadr; 249*4882a593Smuzhiyun u8 usb_uscom; 250*4882a593Smuzhiyun u8 res1[1]; 251*4882a593Smuzhiyun u16 usb_usep1; 252*4882a593Smuzhiyun u16 usb_usep2; 253*4882a593Smuzhiyun u16 usb_usep3; 254*4882a593Smuzhiyun u16 usb_usep4; 255*4882a593Smuzhiyun u8 res2[4]; 256*4882a593Smuzhiyun u16 usb_usber; 257*4882a593Smuzhiyun u8 res3[2]; 258*4882a593Smuzhiyun u16 usb_usbmr; 259*4882a593Smuzhiyun u8 res4[1]; 260*4882a593Smuzhiyun u8 usb_usbs; 261*4882a593Smuzhiyun u16 usb_ussft; 262*4882a593Smuzhiyun u8 res5[2]; 263*4882a593Smuzhiyun u16 usb_usfrn; 264*4882a593Smuzhiyun u8 res6[0x22]; 265*4882a593Smuzhiyun } __attribute__ ((packed)) usb_t; 266*4882a593Smuzhiyun 267*4882a593Smuzhiyun /* MCC */ 268*4882a593Smuzhiyun typedef struct mcc { 269*4882a593Smuzhiyun u32 mcce; /* MCC event register */ 270*4882a593Smuzhiyun u32 mccm; /* MCC mask register */ 271*4882a593Smuzhiyun u32 mccf; /* MCC configuration register */ 272*4882a593Smuzhiyun u32 merl; /* MCC emergency request level register */ 273*4882a593Smuzhiyun u8 res0[0xF0]; 274*4882a593Smuzhiyun } __attribute__ ((packed)) mcc_t; 275*4882a593Smuzhiyun 276*4882a593Smuzhiyun /* QE UCC Slow */ 277*4882a593Smuzhiyun typedef struct ucc_slow { 278*4882a593Smuzhiyun u32 gumr_l; /* UCCx general mode register (low) */ 279*4882a593Smuzhiyun u32 gumr_h; /* UCCx general mode register (high) */ 280*4882a593Smuzhiyun u16 upsmr; /* UCCx protocol-specific mode register */ 281*4882a593Smuzhiyun u8 res0[0x2]; 282*4882a593Smuzhiyun u16 utodr; /* UCCx transmit on demand register */ 283*4882a593Smuzhiyun u16 udsr; /* UCCx data synchronization register */ 284*4882a593Smuzhiyun u16 ucce; /* UCCx event register */ 285*4882a593Smuzhiyun u8 res1[0x2]; 286*4882a593Smuzhiyun u16 uccm; /* UCCx mask register */ 287*4882a593Smuzhiyun u8 res2[0x1]; 288*4882a593Smuzhiyun u8 uccs; /* UCCx status register */ 289*4882a593Smuzhiyun u8 res3[0x24]; 290*4882a593Smuzhiyun u16 utpt; 291*4882a593Smuzhiyun u8 guemr; /* UCC general extended mode register */ 292*4882a593Smuzhiyun u8 res4[0x200 - 0x091]; 293*4882a593Smuzhiyun } __attribute__ ((packed)) ucc_slow_t; 294*4882a593Smuzhiyun 295*4882a593Smuzhiyun typedef struct ucc_mii_mng { 296*4882a593Smuzhiyun u32 miimcfg; /* MII management configuration reg */ 297*4882a593Smuzhiyun u32 miimcom; /* MII management command reg */ 298*4882a593Smuzhiyun u32 miimadd; /* MII management address reg */ 299*4882a593Smuzhiyun u32 miimcon; /* MII management control reg */ 300*4882a593Smuzhiyun u32 miimstat; /* MII management status reg */ 301*4882a593Smuzhiyun u32 miimind; /* MII management indication reg */ 302*4882a593Smuzhiyun u32 ifctl; /* interface control reg */ 303*4882a593Smuzhiyun u32 ifstat; /* interface statux reg */ 304*4882a593Smuzhiyun } __attribute__ ((packed))uec_mii_t; 305*4882a593Smuzhiyun 306*4882a593Smuzhiyun typedef struct ucc_ethernet { 307*4882a593Smuzhiyun u32 maccfg1; /* mac configuration reg. 1 */ 308*4882a593Smuzhiyun u32 maccfg2; /* mac configuration reg. 2 */ 309*4882a593Smuzhiyun u32 ipgifg; /* interframe gap reg. */ 310*4882a593Smuzhiyun u32 hafdup; /* half-duplex reg. */ 311*4882a593Smuzhiyun u8 res1[0x10]; 312*4882a593Smuzhiyun u32 miimcfg; /* MII management configuration reg */ 313*4882a593Smuzhiyun u32 miimcom; /* MII management command reg */ 314*4882a593Smuzhiyun u32 miimadd; /* MII management address reg */ 315*4882a593Smuzhiyun u32 miimcon; /* MII management control reg */ 316*4882a593Smuzhiyun u32 miimstat; /* MII management status reg */ 317*4882a593Smuzhiyun u32 miimind; /* MII management indication reg */ 318*4882a593Smuzhiyun u32 ifctl; /* interface control reg */ 319*4882a593Smuzhiyun u32 ifstat; /* interface statux reg */ 320*4882a593Smuzhiyun u32 macstnaddr1; /* mac station address part 1 reg */ 321*4882a593Smuzhiyun u32 macstnaddr2; /* mac station address part 2 reg */ 322*4882a593Smuzhiyun u8 res2[0x8]; 323*4882a593Smuzhiyun u32 uempr; /* UCC Ethernet Mac parameter reg */ 324*4882a593Smuzhiyun u32 utbipar; /* UCC tbi address reg */ 325*4882a593Smuzhiyun u16 uescr; /* UCC Ethernet statistics control reg */ 326*4882a593Smuzhiyun u8 res3[0x180 - 0x15A]; 327*4882a593Smuzhiyun u32 tx64; /* Total number of frames (including bad 328*4882a593Smuzhiyun * frames) transmitted that were exactly 329*4882a593Smuzhiyun * of the minimal length (64 for un tagged, 330*4882a593Smuzhiyun * 68 for tagged, or with length exactly 331*4882a593Smuzhiyun * equal to the parameter MINLength */ 332*4882a593Smuzhiyun u32 tx127; /* Total number of frames (including bad 333*4882a593Smuzhiyun * frames) transmitted that were between 334*4882a593Smuzhiyun * MINLength (Including FCS length==4) 335*4882a593Smuzhiyun * and 127 octets */ 336*4882a593Smuzhiyun u32 tx255; /* Total number of frames (including bad 337*4882a593Smuzhiyun * frames) transmitted that were between 338*4882a593Smuzhiyun * 128 (Including FCS length==4) and 255 339*4882a593Smuzhiyun * octets */ 340*4882a593Smuzhiyun u32 rx64; /* Total number of frames received including 341*4882a593Smuzhiyun * bad frames that were exactly of the 342*4882a593Smuzhiyun * mninimal length (64 bytes) */ 343*4882a593Smuzhiyun u32 rx127; /* Total number of frames (including bad 344*4882a593Smuzhiyun * frames) received that were between 345*4882a593Smuzhiyun * MINLength (Including FCS length==4) 346*4882a593Smuzhiyun * and 127 octets */ 347*4882a593Smuzhiyun u32 rx255; /* Total number of frames (including 348*4882a593Smuzhiyun * bad frames) received that were between 349*4882a593Smuzhiyun * 128 (Including FCS length==4) and 255 350*4882a593Smuzhiyun * octets */ 351*4882a593Smuzhiyun u32 txok; /* Total number of octets residing in frames 352*4882a593Smuzhiyun * that where involved in succesfull 353*4882a593Smuzhiyun * transmission */ 354*4882a593Smuzhiyun u16 txcf; /* Total number of PAUSE control frames 355*4882a593Smuzhiyun * transmitted by this MAC */ 356*4882a593Smuzhiyun u8 res4[0x2]; 357*4882a593Smuzhiyun u32 tmca; /* Total number of frames that were transmitted 358*4882a593Smuzhiyun * succesfully with the group address bit set 359*4882a593Smuzhiyun * that are not broadcast frames */ 360*4882a593Smuzhiyun u32 tbca; /* Total number of frames transmitted 361*4882a593Smuzhiyun * succesfully that had destination address 362*4882a593Smuzhiyun * field equal to the broadcast address */ 363*4882a593Smuzhiyun u32 rxfok; /* Total number of frames received OK */ 364*4882a593Smuzhiyun u32 rxbok; /* Total number of octets received OK */ 365*4882a593Smuzhiyun u32 rbyt; /* Total number of octets received including 366*4882a593Smuzhiyun * octets in bad frames. Must be implemented 367*4882a593Smuzhiyun * in HW because it includes octets in frames 368*4882a593Smuzhiyun * that never even reach the UCC */ 369*4882a593Smuzhiyun u32 rmca; /* Total number of frames that were received 370*4882a593Smuzhiyun * succesfully with the group address bit set 371*4882a593Smuzhiyun * that are not broadcast frames */ 372*4882a593Smuzhiyun u32 rbca; /* Total number of frames received succesfully 373*4882a593Smuzhiyun * that had destination address equal to the 374*4882a593Smuzhiyun * broadcast address */ 375*4882a593Smuzhiyun u32 scar; /* Statistics carry register */ 376*4882a593Smuzhiyun u32 scam; /* Statistics caryy mask register */ 377*4882a593Smuzhiyun u8 res5[0x200 - 0x1c4]; 378*4882a593Smuzhiyun } __attribute__ ((packed)) uec_t; 379*4882a593Smuzhiyun 380*4882a593Smuzhiyun /* QE UCC Fast */ 381*4882a593Smuzhiyun typedef struct ucc_fast { 382*4882a593Smuzhiyun u32 gumr; /* UCCx general mode register */ 383*4882a593Smuzhiyun u32 upsmr; /* UCCx protocol-specific mode register */ 384*4882a593Smuzhiyun u16 utodr; /* UCCx transmit on demand register */ 385*4882a593Smuzhiyun u8 res0[0x2]; 386*4882a593Smuzhiyun u16 udsr; /* UCCx data synchronization register */ 387*4882a593Smuzhiyun u8 res1[0x2]; 388*4882a593Smuzhiyun u32 ucce; /* UCCx event register */ 389*4882a593Smuzhiyun u32 uccm; /* UCCx mask register. */ 390*4882a593Smuzhiyun u8 uccs; /* UCCx status register */ 391*4882a593Smuzhiyun u8 res2[0x7]; 392*4882a593Smuzhiyun u32 urfb; /* UCC receive FIFO base */ 393*4882a593Smuzhiyun u16 urfs; /* UCC receive FIFO size */ 394*4882a593Smuzhiyun u8 res3[0x2]; 395*4882a593Smuzhiyun u16 urfet; /* UCC receive FIFO emergency threshold */ 396*4882a593Smuzhiyun u16 urfset; /* UCC receive FIFO special emergency 397*4882a593Smuzhiyun * threshold */ 398*4882a593Smuzhiyun u32 utfb; /* UCC transmit FIFO base */ 399*4882a593Smuzhiyun u16 utfs; /* UCC transmit FIFO size */ 400*4882a593Smuzhiyun u8 res4[0x2]; 401*4882a593Smuzhiyun u16 utfet; /* UCC transmit FIFO emergency threshold */ 402*4882a593Smuzhiyun u8 res5[0x2]; 403*4882a593Smuzhiyun u16 utftt; /* UCC transmit FIFO transmit threshold */ 404*4882a593Smuzhiyun u8 res6[0x2]; 405*4882a593Smuzhiyun u16 utpt; /* UCC transmit polling timer */ 406*4882a593Smuzhiyun u8 res7[0x2]; 407*4882a593Smuzhiyun u32 urtry; /* UCC retry counter register */ 408*4882a593Smuzhiyun u8 res8[0x4C]; 409*4882a593Smuzhiyun u8 guemr; /* UCC general extended mode register */ 410*4882a593Smuzhiyun u8 res9[0x100 - 0x091]; 411*4882a593Smuzhiyun uec_t ucc_eth; 412*4882a593Smuzhiyun } __attribute__ ((packed)) ucc_fast_t; 413*4882a593Smuzhiyun 414*4882a593Smuzhiyun /* QE UCC */ 415*4882a593Smuzhiyun typedef struct ucc_common { 416*4882a593Smuzhiyun u8 res1[0x90]; 417*4882a593Smuzhiyun u8 guemr; 418*4882a593Smuzhiyun u8 res2[0x200 - 0x091]; 419*4882a593Smuzhiyun } __attribute__ ((packed)) ucc_common_t; 420*4882a593Smuzhiyun 421*4882a593Smuzhiyun typedef struct ucc { 422*4882a593Smuzhiyun union { 423*4882a593Smuzhiyun ucc_slow_t slow; 424*4882a593Smuzhiyun ucc_fast_t fast; 425*4882a593Smuzhiyun ucc_common_t common; 426*4882a593Smuzhiyun }; 427*4882a593Smuzhiyun } __attribute__ ((packed)) ucc_t; 428*4882a593Smuzhiyun 429*4882a593Smuzhiyun /* MultiPHY UTOPIA POS Controllers (UPC) */ 430*4882a593Smuzhiyun typedef struct upc { 431*4882a593Smuzhiyun u32 upgcr; /* UTOPIA/POS general configuration register */ 432*4882a593Smuzhiyun u32 uplpa; /* UTOPIA/POS last PHY address */ 433*4882a593Smuzhiyun u32 uphec; /* ATM HEC register */ 434*4882a593Smuzhiyun u32 upuc; /* UTOPIA/POS UCC configuration */ 435*4882a593Smuzhiyun u32 updc1; /* UTOPIA/POS device 1 configuration */ 436*4882a593Smuzhiyun u32 updc2; /* UTOPIA/POS device 2 configuration */ 437*4882a593Smuzhiyun u32 updc3; /* UTOPIA/POS device 3 configuration */ 438*4882a593Smuzhiyun u32 updc4; /* UTOPIA/POS device 4 configuration */ 439*4882a593Smuzhiyun u32 upstpa; /* UTOPIA/POS STPA threshold */ 440*4882a593Smuzhiyun u8 res0[0xC]; 441*4882a593Smuzhiyun u32 updrs1_h; /* UTOPIA/POS device 1 rate select */ 442*4882a593Smuzhiyun u32 updrs1_l; /* UTOPIA/POS device 1 rate select */ 443*4882a593Smuzhiyun u32 updrs2_h; /* UTOPIA/POS device 2 rate select */ 444*4882a593Smuzhiyun u32 updrs2_l; /* UTOPIA/POS device 2 rate select */ 445*4882a593Smuzhiyun u32 updrs3_h; /* UTOPIA/POS device 3 rate select */ 446*4882a593Smuzhiyun u32 updrs3_l; /* UTOPIA/POS device 3 rate select */ 447*4882a593Smuzhiyun u32 updrs4_h; /* UTOPIA/POS device 4 rate select */ 448*4882a593Smuzhiyun u32 updrs4_l; /* UTOPIA/POS device 4 rate select */ 449*4882a593Smuzhiyun u32 updrp1; /* UTOPIA/POS device 1 receive priority low */ 450*4882a593Smuzhiyun u32 updrp2; /* UTOPIA/POS device 2 receive priority low */ 451*4882a593Smuzhiyun u32 updrp3; /* UTOPIA/POS device 3 receive priority low */ 452*4882a593Smuzhiyun u32 updrp4; /* UTOPIA/POS device 4 receive priority low */ 453*4882a593Smuzhiyun u32 upde1; /* UTOPIA/POS device 1 event */ 454*4882a593Smuzhiyun u32 upde2; /* UTOPIA/POS device 2 event */ 455*4882a593Smuzhiyun u32 upde3; /* UTOPIA/POS device 3 event */ 456*4882a593Smuzhiyun u32 upde4; /* UTOPIA/POS device 4 event */ 457*4882a593Smuzhiyun u16 uprp1; 458*4882a593Smuzhiyun u16 uprp2; 459*4882a593Smuzhiyun u16 uprp3; 460*4882a593Smuzhiyun u16 uprp4; 461*4882a593Smuzhiyun u8 res1[0x8]; 462*4882a593Smuzhiyun u16 uptirr1_0; /* Device 1 transmit internal rate 0 */ 463*4882a593Smuzhiyun u16 uptirr1_1; /* Device 1 transmit internal rate 1 */ 464*4882a593Smuzhiyun u16 uptirr1_2; /* Device 1 transmit internal rate 2 */ 465*4882a593Smuzhiyun u16 uptirr1_3; /* Device 1 transmit internal rate 3 */ 466*4882a593Smuzhiyun u16 uptirr2_0; /* Device 2 transmit internal rate 0 */ 467*4882a593Smuzhiyun u16 uptirr2_1; /* Device 2 transmit internal rate 1 */ 468*4882a593Smuzhiyun u16 uptirr2_2; /* Device 2 transmit internal rate 2 */ 469*4882a593Smuzhiyun u16 uptirr2_3; /* Device 2 transmit internal rate 3 */ 470*4882a593Smuzhiyun u16 uptirr3_0; /* Device 3 transmit internal rate 0 */ 471*4882a593Smuzhiyun u16 uptirr3_1; /* Device 3 transmit internal rate 1 */ 472*4882a593Smuzhiyun u16 uptirr3_2; /* Device 3 transmit internal rate 2 */ 473*4882a593Smuzhiyun u16 uptirr3_3; /* Device 3 transmit internal rate 3 */ 474*4882a593Smuzhiyun u16 uptirr4_0; /* Device 4 transmit internal rate 0 */ 475*4882a593Smuzhiyun u16 uptirr4_1; /* Device 4 transmit internal rate 1 */ 476*4882a593Smuzhiyun u16 uptirr4_2; /* Device 4 transmit internal rate 2 */ 477*4882a593Smuzhiyun u16 uptirr4_3; /* Device 4 transmit internal rate 3 */ 478*4882a593Smuzhiyun u32 uper1; /* Device 1 port enable register */ 479*4882a593Smuzhiyun u32 uper2; /* Device 2 port enable register */ 480*4882a593Smuzhiyun u32 uper3; /* Device 3 port enable register */ 481*4882a593Smuzhiyun u32 uper4; /* Device 4 port enable register */ 482*4882a593Smuzhiyun u8 res2[0x150]; 483*4882a593Smuzhiyun } __attribute__ ((packed)) upc_t; 484*4882a593Smuzhiyun 485*4882a593Smuzhiyun /* SDMA */ 486*4882a593Smuzhiyun typedef struct sdma { 487*4882a593Smuzhiyun u32 sdsr; /* Serial DMA status register */ 488*4882a593Smuzhiyun u32 sdmr; /* Serial DMA mode register */ 489*4882a593Smuzhiyun u32 sdtr1; /* SDMA system bus threshold register */ 490*4882a593Smuzhiyun u32 sdtr2; /* SDMA secondary bus threshold register */ 491*4882a593Smuzhiyun u32 sdhy1; /* SDMA system bus hysteresis register */ 492*4882a593Smuzhiyun u32 sdhy2; /* SDMA secondary bus hysteresis register */ 493*4882a593Smuzhiyun u32 sdta1; /* SDMA system bus address register */ 494*4882a593Smuzhiyun u32 sdta2; /* SDMA secondary bus address register */ 495*4882a593Smuzhiyun u32 sdtm1; /* SDMA system bus MSNUM register */ 496*4882a593Smuzhiyun u32 sdtm2; /* SDMA secondary bus MSNUM register */ 497*4882a593Smuzhiyun u8 res0[0x10]; 498*4882a593Smuzhiyun u32 sdaqr; /* SDMA address bus qualify register */ 499*4882a593Smuzhiyun u32 sdaqmr; /* SDMA address bus qualify mask register */ 500*4882a593Smuzhiyun u8 res1[0x4]; 501*4882a593Smuzhiyun u32 sdwbcr; /* SDMA CAM entries base register */ 502*4882a593Smuzhiyun u8 res2[0x38]; 503*4882a593Smuzhiyun } __attribute__ ((packed)) sdma_t; 504*4882a593Smuzhiyun 505*4882a593Smuzhiyun /* Debug Space */ 506*4882a593Smuzhiyun typedef struct dbg { 507*4882a593Smuzhiyun u32 bpdcr; /* Breakpoint debug command register */ 508*4882a593Smuzhiyun u32 bpdsr; /* Breakpoint debug status register */ 509*4882a593Smuzhiyun u32 bpdmr; /* Breakpoint debug mask register */ 510*4882a593Smuzhiyun u32 bprmrr0; /* Breakpoint request mode risc register 0 */ 511*4882a593Smuzhiyun u32 bprmrr1; /* Breakpoint request mode risc register 1 */ 512*4882a593Smuzhiyun u8 res0[0x8]; 513*4882a593Smuzhiyun u32 bprmtr0; /* Breakpoint request mode trb register 0 */ 514*4882a593Smuzhiyun u32 bprmtr1; /* Breakpoint request mode trb register 1 */ 515*4882a593Smuzhiyun u8 res1[0x8]; 516*4882a593Smuzhiyun u32 bprmir; /* Breakpoint request mode immediate register */ 517*4882a593Smuzhiyun u32 bprmsr; /* Breakpoint request mode serial register */ 518*4882a593Smuzhiyun u32 bpemr; /* Breakpoint exit mode register */ 519*4882a593Smuzhiyun u8 res2[0x48]; 520*4882a593Smuzhiyun } __attribute__ ((packed)) dbg_t; 521*4882a593Smuzhiyun 522*4882a593Smuzhiyun /* 523*4882a593Smuzhiyun * RISC Special Registers (Trap and Breakpoint). These are described in 524*4882a593Smuzhiyun * the QE Developer's Handbook. 525*4882a593Smuzhiyun */ 526*4882a593Smuzhiyun typedef struct rsp { 527*4882a593Smuzhiyun u32 tibcr[16]; /* Trap/instruction breakpoint control regs */ 528*4882a593Smuzhiyun u8 res0[64]; 529*4882a593Smuzhiyun u32 ibcr0; 530*4882a593Smuzhiyun u32 ibs0; 531*4882a593Smuzhiyun u32 ibcnr0; 532*4882a593Smuzhiyun u8 res1[4]; 533*4882a593Smuzhiyun u32 ibcr1; 534*4882a593Smuzhiyun u32 ibs1; 535*4882a593Smuzhiyun u32 ibcnr1; 536*4882a593Smuzhiyun u32 npcr; 537*4882a593Smuzhiyun u32 dbcr; 538*4882a593Smuzhiyun u32 dbar; 539*4882a593Smuzhiyun u32 dbamr; 540*4882a593Smuzhiyun u32 dbsr; 541*4882a593Smuzhiyun u32 dbcnr; 542*4882a593Smuzhiyun u8 res2[12]; 543*4882a593Smuzhiyun u32 dbdr_h; 544*4882a593Smuzhiyun u32 dbdr_l; 545*4882a593Smuzhiyun u32 dbdmr_h; 546*4882a593Smuzhiyun u32 dbdmr_l; 547*4882a593Smuzhiyun u32 bsr; 548*4882a593Smuzhiyun u32 bor; 549*4882a593Smuzhiyun u32 bior; 550*4882a593Smuzhiyun u8 res3[4]; 551*4882a593Smuzhiyun u32 iatr[4]; 552*4882a593Smuzhiyun u32 eccr; /* Exception control configuration register */ 553*4882a593Smuzhiyun u32 eicr; 554*4882a593Smuzhiyun u8 res4[0x100-0xf8]; 555*4882a593Smuzhiyun } __attribute__ ((packed)) rsp_t; 556*4882a593Smuzhiyun 557*4882a593Smuzhiyun typedef struct qe_immap { 558*4882a593Smuzhiyun qe_iram_t iram; /* I-RAM */ 559*4882a593Smuzhiyun qe_ic_t ic; /* Interrupt Controller */ 560*4882a593Smuzhiyun cp_qe_t cp; /* Communications Processor */ 561*4882a593Smuzhiyun qe_mux_t qmx; /* QE Multiplexer */ 562*4882a593Smuzhiyun qe_timers_t qet; /* QE Timers */ 563*4882a593Smuzhiyun spi_t spi[0x2]; /* spi */ 564*4882a593Smuzhiyun mcc_t mcc; /* mcc */ 565*4882a593Smuzhiyun qe_brg_t brg; /* brg */ 566*4882a593Smuzhiyun usb_t usb; /* USB */ 567*4882a593Smuzhiyun si1_t si1; /* SI */ 568*4882a593Smuzhiyun u8 res11[0x800]; 569*4882a593Smuzhiyun sir_t sir; /* SI Routing Tables */ 570*4882a593Smuzhiyun ucc_t ucc1; /* ucc1 */ 571*4882a593Smuzhiyun ucc_t ucc3; /* ucc3 */ 572*4882a593Smuzhiyun ucc_t ucc5; /* ucc5 */ 573*4882a593Smuzhiyun ucc_t ucc7; /* ucc7 */ 574*4882a593Smuzhiyun u8 res12[0x600]; 575*4882a593Smuzhiyun upc_t upc1; /* MultiPHY UTOPIA POS Controller 1 */ 576*4882a593Smuzhiyun ucc_t ucc2; /* ucc2 */ 577*4882a593Smuzhiyun ucc_t ucc4; /* ucc4 */ 578*4882a593Smuzhiyun ucc_t ucc6; /* ucc6 */ 579*4882a593Smuzhiyun ucc_t ucc8; /* ucc8 */ 580*4882a593Smuzhiyun u8 res13[0x600]; 581*4882a593Smuzhiyun upc_t upc2; /* MultiPHY UTOPIA POS Controller 2 */ 582*4882a593Smuzhiyun sdma_t sdma; /* SDMA */ 583*4882a593Smuzhiyun dbg_t dbg; /* Debug Space */ 584*4882a593Smuzhiyun rsp_t rsp[0x2]; /* RISC Special Registers 585*4882a593Smuzhiyun * (Trap and Breakpoint) */ 586*4882a593Smuzhiyun u8 res14[0x300]; 587*4882a593Smuzhiyun u8 res15[0x3A00]; 588*4882a593Smuzhiyun u8 res16[0x8000]; /* 0x108000 - 0x110000 */ 589*4882a593Smuzhiyun u8 muram[QE_MURAM_SIZE]; 590*4882a593Smuzhiyun } __attribute__ ((packed)) qe_map_t; 591*4882a593Smuzhiyun 592*4882a593Smuzhiyun extern qe_map_t *qe_immr; 593*4882a593Smuzhiyun 594*4882a593Smuzhiyun #endif /* __IMMAP_QE_H__ */ 595