Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:50

0001 /**
0002  *  @file
0003  *  
0004  *  AMD AU1X00 specific information
0005  */
0006 
0007 /*
0008  *  Copyright (c) 2005 by Cogent Computer Systems
0009  *  Written by Jay Monkman <jtm@lopingdog.com>
0010  *
0011  *  The license and distribution terms for this file may be
0012  *  found in the file LICENSE in this distribution or at
0013  *  http://www.rtems.org/license/LICENSE.
0014  */
0015 
0016 #ifndef __AU1X00_H__
0017 #define __AU1X00_H__
0018 
0019 #define bit(x)         (1 << (x))
0020 
0021 /* Au1x00 CP0 registers
0022  */
0023 #define CP0_Index       $0
0024 #define CP0_Random      $1
0025 #define CP0_EntryLo0    $2
0026 #define CP0_EntryLo1    $3
0027 #define CP0_Context     $4
0028 #define CP0_PageMask    $5
0029 #define CP0_Wired       $6
0030 #define CP0_BadVAddr    $8
0031 #define CP0_Count       $9
0032 #define CP0_EntryHi     $10
0033 #define CP0_Compare     $11
0034 #define CP0_Status      $12
0035 #define CP0_Cause       $13
0036 #define CP0_EPC         $14
0037 #define CP0_PRId        $15
0038 #define CP0_Config      $16
0039 #define CP0_Config0     $16
0040 #define CP0_Config1     $16,1
0041 #define CP0_LLAddr      $17
0042 #define CP0_WatchLo     $18
0043 #define CP0_IWatchLo    $18,1
0044 #define CP0_WatchHi     $19
0045 #define CP0_IWatchHi    $19,1
0046 #define CP0_Scratch     $22
0047 #define CP0_Debug       $23
0048 #define CP0_DEPC        $24
0049 #define CP0_PerfCnt     $25
0050 #define CP0_PerfCtrl    $25,1
0051 #define CP0_DTag        $28
0052 #define CP0_DData       $28,1
0053 #define CP0_ITag        $29
0054 #define CP0_IData       $29,1
0055 #define CP0_ErrorEPC    $30
0056 #define CP0_DESave      $31
0057 
0058 /* Addresses common to all AU1x00 CPUs */
0059 #define AU1X00_MEM_ADDR     0xB4000000
0060 #define AU1X00_AC97_ADDR    0xB0000000
0061 #define AU1X00_USBH_ADDR    0xB0100000
0062 #define AU1X00_USBD_ADDR    0xB0200000
0063 #define AU1X00_MACDMA0_ADDR 0xB4004000
0064 #define AU1X00_MACDMA1_ADDR 0xB4004200
0065 #define AU1X00_UART0_ADDR   0xB1100000
0066 #define AU1X00_UART3_ADDR   0xB1400000
0067 #define AU1X00_SYS_ADDR         0xB1900000
0068 #define AU1X00_GPIO2_ADDR   0xB1700000
0069 #define AU1X00_IC0_ADDR         0xB0400000
0070 #define AU1X00_IC1_ADDR         0xB1800000
0071 
0072 /* Au1100 base addresses (in KSEG1 region) */
0073 #define AU1100_MAC0_ADDR    0xB0500000
0074 #define AU1100_MACEN_ADDR   0xB0520000
0075 
0076 /* Au1500 base addresses (in KSEG1 region) */
0077 #define AU1500_MAC0_ADDR    0xB1500000
0078 #define AU1500_MAC1_ADDR    0xB1510000
0079 #define AU1500_MACEN_ADDR   0xB1520000
0080 #define AU1500_PCI_ADDR         0xB4005000
0081 
0082 /* Au1x00 gpio2 register offsets
0083  */
0084 #define gpio2_dir       0x0000
0085 #define gpio2_output    0x0008
0086 #define gpio2_pinstate  0x000c
0087 #define gpio2_inten     0x0010
0088 #define gpio2_enable    0x0014
0089 
0090 /* Au1x00 memory controller register offsets
0091  */
0092 #define mem_sdmode0     0x0000
0093 #define mem_sdmode1     0x0004
0094 #define mem_sdmode2     0x0008
0095 #define mem_sdaddr0     0x000C
0096 #define mem_sdaddr1     0x0010
0097 #define mem_sdaddr2     0x0014
0098 #define mem_sdrefcfg    0x0018
0099 #define mem_sdprecmd    0x001C
0100 #define mem_sdautoref   0x0020
0101 #define mem_sdwrmd0     0x0024
0102 #define mem_sdwrmd1     0x0028
0103 #define mem_sdwrmd2     0x002C
0104 #define mem_sdsleep     0x0030
0105 #define mem_sdsmcke     0x0034
0106 
0107 #define mem_stcfg0      0x1000
0108 #define mem_sttime0     0x1004
0109 #define mem_staddr0     0x1008
0110 #define mem_stcfg1      0x1010
0111 #define mem_sttime1     0x1014
0112 #define mem_staddr1     0x1018
0113 #define mem_stcfg2      0x1020
0114 #define mem_sttime2     0x1024
0115 #define mem_staddr2     0x1028
0116 #define mem_stcfg3      0x1030
0117 #define mem_sttime3     0x1034
0118 #define mem_staddr3     0x1038
0119 
0120 /*
0121  * Au1x00 peripheral register offsets
0122  */
0123 #define ac97_enable     0x0010
0124 #define usbh_enable     0x0007FFFC
0125 #define usbd_enable     0x0058
0126 #define irda_enable     0x0040
0127 #define macen_mac0      0x0000
0128 #define macen_mac1      0x0004
0129 #define i2s_enable      0x0008
0130 #define uart_enable     0x0100
0131 #define ssi_enable      0x0100
0132 
0133 #define sys_scratch0    0x0018
0134 #define sys_scratch1    0x001c
0135 #define sys_cntctrl     0x0014
0136 #define sys_freqctrl0   0x0020
0137 #define sys_freqctrl1   0x0024
0138 #define sys_clksrc      0x0028
0139 #define sys_pinfunc     0x002C
0140 #define sys_powerctrl   0x003C
0141 #define sys_endian      0x0038
0142 #define sys_wakesrc     0x005C
0143 #define sys_cpupll      0x0060
0144 #define sys_auxpll      0x0064
0145 #define sys_pininputen  0x0110
0146 
0147 #define pci_cmem            0x0000
0148 #define pci_config          0x0004
0149 #define pci_b2bmask_cch     0x0008
0150 #define pci_b2bbase0_venid  0x000C
0151 #define pci_b2bbase1_id     0x0010
0152 #define pci_mwmask_dev      0x0014
0153 #define pci_mwbase_rev_ccl  0x0018
0154 #define pci_err_addr        0x001C
0155 #define pci_spec_intack     0x0020
0156 #define pci_id              0x0100
0157 #define pci_statcmd         0x0104
0158 #define pci_classrev        0x0108
0159 #define pci_hdrtype         0x010C
0160 #define pci_mbar            0x0110
0161 
0162 /*
0163  * CSB250-specific values
0164  */
0165 
0166 #define SYS_CPUPLL      33
0167 #define SYS_POWERCTRL   1
0168 #define SYS_AUXPLL      8
0169 #define SYS_CNTCTRL     256
0170 
0171 /* RCE0: */
0172 #define MEM_STCFG0  0x00000203
0173 #define MEM_STTIME0 0x22080b20
0174 #define MEM_STADDR0 0x11f03fc0
0175 
0176 /* RCE1: */
0177 #define MEM_STCFG1  0x00000203
0178 #define MEM_STTIME1 0x22080b20
0179 #define MEM_STADDR1 0x11e03fc0
0180 
0181 /* RCE2: */
0182 #define MEM_STCFG2  0x00000244
0183 #define MEM_STTIME2 0x22080a20
0184 #define MEM_STADDR2 0x11803f00
0185 
0186 /* RCE3: */
0187 #define MEM_STCFG3  0x00000201
0188 #define MEM_STTIME3 0x22080b20
0189 #define MEM_STADDR3 0x11003f00
0190 
0191 /*
0192  * SDCS0 -
0193  * SDCS1 -
0194  * SDCS2 -
0195  */
0196 #define MEM_SDMODE0     0x00552229
0197 #define MEM_SDMODE1     0x00552229
0198 #define MEM_SDMODE2     0x00552229
0199 
0200 #define MEM_SDADDR0     0x001003F8
0201 #define MEM_SDADDR1     0x001023F8
0202 #define MEM_SDADDR2     0x001043F8
0203 
0204 #define MEM_SDREFCFG_D  0x74000c30  /* disable */
0205 #define MEM_SDREFCFG_E  0x76000c30  /* enable */
0206 #define MEM_SDWRMD0     0x00000023
0207 #define MEM_SDWRMD1     0x00000023
0208 #define MEM_SDWRMD2     0x00000023
0209 
0210 #define MEM_1MS         ((396000000/1000000) * 1000)
0211 
0212 #define AU1X00_IC_CFG0RD(x)       (*(volatile uint32_t*)(x + 0x40))
0213 #define AU1X00_IC_CFG0SET(x)      (*(volatile uint32_t*)(x + 0x40))
0214 #define AU1X00_IC_CFG0CLR(x)      (*(volatile uint32_t*)(x + 0x44))
0215 #define AU1X00_IC_CFG1RD(x)       (*(volatile uint32_t*)(x + 0x48))
0216 #define AU1X00_IC_CFG1SET(x)      (*(volatile uint32_t*)(x + 0x48))
0217 #define AU1X00_IC_CFG1CLR(x)      (*(volatile uint32_t*)(x + 0x4c))
0218 #define AU1X00_IC_CFG2RD(x)       (*(volatile uint32_t*)(x + 0x50))
0219 #define AU1X00_IC_CFG2SET(x)      (*(volatile uint32_t*)(x + 0x50))
0220 #define AU1X00_IC_CFG2CLR(x)      (*(volatile uint32_t*)(x + 0x54))
0221 #define AU1X00_IC_REQ0INT(x)      (*(volatile uint32_t*)(x + 0x54))
0222 #define AU1X00_IC_SRCRD(x)        (*(volatile uint32_t*)(x + 0x58))
0223 #define AU1X00_IC_SRCSET(x)       (*(volatile uint32_t*)(x + 0x58))
0224 #define AU1X00_IC_SRCCLR(x)       (*(volatile uint32_t*)(x + 0x5c))
0225 #define AU1X00_IC_REQ1INT(x)      (*(volatile uint32_t*)(x + 0x5c))
0226 #define AU1X00_IC_ASSIGNRD(x)     (*(volatile uint32_t*)(x + 0x60))
0227 #define AU1X00_IC_ASSIGNSET(x)    (*(volatile uint32_t*)(x + 0x60))
0228 #define AU1X00_IC_ASSIGNCLR(x)    (*(volatile uint32_t*)(x + 0x64))
0229 #define AU1X00_IC_WAKERD(x)       (*(volatile uint32_t*)(x + 0x68))
0230 #define AU1X00_IC_WAKESET(x)      (*(volatile uint32_t*)(x + 0x68))
0231 #define AU1X00_IC_WAKECLR(x)      (*(volatile uint32_t*)(x + 0x6c))
0232 #define AU1X00_IC_MASKRD(x)       (*(volatile uint32_t*)(x + 0x70))
0233 #define AU1X00_IC_MASKSET(x)      (*(volatile uint32_t*)(x + 0x70))
0234 #define AU1X00_IC_MASKCLR(x)      (*(volatile uint32_t*)(x + 0x74))
0235 #define AU1X00_IC_RISINGRD(x)     (*(volatile uint32_t*)(x + 0x78))
0236 #define AU1X00_IC_RISINGCLR(x)    (*(volatile uint32_t*)(x + 0x78))
0237 #define AU1X00_IC_FALLINGRD(x)    (*(volatile uint32_t*)(x + 0x7c))
0238 #define AU1X00_IC_FALLINGCLR(x)   (*(volatile uint32_t*)(x + 0x7c))
0239 #define AU1X00_IC_TESTBIT(x)      (*(volatile uint32_t*)(x + 0x80))
0240 #define AU1X00_IC_IRQ_MAC0        (bit(28))
0241 #define AU1X00_IC_IRQ_MAC1        (bit(29))
0242 #define AU1X00_IC_IRQ_TOY_MATCH0  (bit(15))
0243 #define AU1X00_IC_IRQ_TOY_MATCH1  (bit(16))
0244 #define AU1X00_IC_IRQ_TOY_MATCH2  (bit(17))
0245 
0246 
0247 
0248 #define AU1X00_SYS_TOYTRIM(x)    (*(volatile uint32_t*)(x + 0x00))
0249 #define AU1X00_SYS_TOYWRITE(x)   (*(volatile uint32_t*)(x + 0x04))
0250 #define AU1X00_SYS_TOYMATCH0(x)  (*(volatile uint32_t*)(x + 0x08))
0251 #define AU1X00_SYS_TOYMATCH1(x)  (*(volatile uint32_t*)(x + 0x0c))
0252 #define AU1X00_SYS_TOYMATCH2(x)  (*(volatile uint32_t*)(x + 0x10))
0253 #define AU1X00_SYS_CNTCTRL(x)    (*(volatile uint32_t*)(x + 0x14))
0254 #define AU1X00_SYS_SCRATCH0(x)   (*(volatile uint32_t*)(x + 0x18))
0255 #define AU1X00_SYS_SCRATCH1(x)   (*(volatile uint32_t*)(x + 0x1c))
0256 #define AU1X00_SYS_WAKEMSK(x)   (*(volatile uint32_t*)(x + 0x34))
0257 #define AU1X00_SYS_ENDIAN(x)     (*(volatile uint32_t*)(x + 0x38))
0258 #define AU1X00_SYS_POWERCTRL(x)  (*(volatile uint32_t*)(x + 0x3c))
0259 #define AU1X00_SYS_TOYREAD(x)    (*(volatile uint32_t*)(x + 0x40))
0260 #define AU1X00_SYS_RTCTRIM(x)    (*(volatile uint32_t*)(x + 0x44))
0261 #define AU1X00_SYS_RTCWRITE(x)   (*(volatile uint32_t*)(x + 0x48))
0262 #define AU1X00_SYS_RTCMATCH0(x)  (*(volatile uint32_t*)(x + 0x4c))
0263 #define AU1X00_SYS_RTCMATCH1(x)  (*(volatile uint32_t*)(x + 0x50))
0264 #define AU1X00_SYS_RTCMATCH2(x)  (*(volatile uint32_t*)(x + 0x54))
0265 #define AU1X00_SYS_RTCREAD(x)    (*(volatile uint32_t*)(x + 0x58))
0266 #define AU1X00_SYS_WAKESRC(x)    (*(volatile uint32_t*)(x + 0x5c))
0267 #define AU1X00_SYS_SLPPWR(x)     (*(volatile uint32_t*)(x + 0x78))
0268 #define AU1X00_SYS_SLEEP(x)      (*(volatile uint32_t*)(x + 0x7c))
0269 
0270 #define AU1X00_SYS_CNTCTRL_ERS   (bit(23))
0271 #define AU1X00_SYS_CNTCTRL_RTS   (bit(20))
0272 #define AU1X00_SYS_CNTCTRL_RM2   (bit(19))
0273 #define AU1X00_SYS_CNTCTRL_RM1   (bit(18))
0274 #define AU1X00_SYS_CNTCTRL_RM0   (bit(17))
0275 #define AU1X00_SYS_CNTCTRL_RS    (bit(16))
0276 #define AU1X00_SYS_CNTCTRL_BP    (bit(14))
0277 #define AU1X00_SYS_CNTCTRL_REN   (bit(13))
0278 #define AU1X00_SYS_CNTCTRL_BRT   (bit(12))
0279 #define AU1X00_SYS_CNTCTRL_TEN   (bit(11))
0280 #define AU1X00_SYS_CNTCTRL_BTT   (bit(10))
0281 #define AU1X00_SYS_CNTCTRL_E0    (bit(8))
0282 #define AU1X00_SYS_CNTCTRL_ETS   (bit(7))
0283 #define AU1X00_SYS_CNTCTRL_32S   (bit(5))
0284 #define AU1X00_SYS_CNTCTRL_TTS   (bit(4))
0285 #define AU1X00_SYS_CNTCTRL_TM2   (bit(3))
0286 #define AU1X00_SYS_CNTCTRL_TM1   (bit(2))
0287 #define AU1X00_SYS_CNTCTRL_TM0   (bit(1))
0288 #define AU1X00_SYS_CNTCTRL_TS    (bit(0))
0289 #define AU1X00_SYS_WAKEMSK_M20   (bit(8))
0290 
0291 #define AU1X00_MAC_CONTROL(x)         (*(volatile uint32_t*)(x + 0x00))
0292 #define AU1X00_MAC_ADDRHIGH(x)        (*(volatile uint32_t*)(x + 0x04))
0293 #define AU1X00_MAC_ADDRLOW(x)         (*(volatile uint32_t*)(x + 0x08))
0294 #define AU1X00_MAC_HASHHIGH(x)        (*(volatile uint32_t*)(x + 0x0c))
0295 #define AU1X00_MAC_HASHLOW(x)         (*(volatile uint32_t*)(x + 0x10))
0296 #define AU1X00_MAC_MIICTRL(x)         (*(volatile uint32_t*)(x + 0x14))
0297 #define AU1X00_MAC_MIIDATA(x)         (*(volatile uint32_t*)(x + 0x18))
0298 #define AU1X00_MAC_FLOWCTRL(x)        (*(volatile uint32_t*)(x + 0x1c))
0299 #define AU1X00_MAC_VLAN1(x)           (*(volatile uint32_t*)(x + 0x20))
0300 #define AU1X00_MAC_VLAN2(x)           (*(volatile uint32_t*)(x + 0x24))
0301 #define AU1X00_MAC_EN0                (*(volatile uint32_t*)(AU1X00_MACEN_ADDR + 0x0))
0302 #define AU1X00_MAC_EN1                (*(volatile uint32_t*)(AU1X00_MACEN_ADDR + 0x4))
0303 #define AU1X00_MAC_DMA_TX0_ADDR(x)    (*(volatile uint32_t*)(x + 0x000))
0304 #define AU1X00_MAC_DMA_TX1_ADDR(x)    (*(volatile uint32_t*)(x + 0x010))
0305 #define AU1X00_MAC_DMA_TX2_ADDR(x)    (*(volatile uint32_t*)(x + 0x020))
0306 #define AU1X00_MAC_DMA_TX3_ADDR(x)    (*(volatile uint32_t*)(x + 0x030))
0307 #define AU1X00_MAC_DMA_RX0_ADDR(x)    (*(volatile uint32_t*)(x + 0x100))
0308 #define AU1X00_MAC_DMA_RX1_ADDR(x)    (*(volatile uint32_t*)(x + 0x110))
0309 #define AU1X00_MAC_DMA_RX2_ADDR(x)    (*(volatile uint32_t*)(x + 0x120))
0310 #define AU1X00_MAC_DMA_RX3_ADDR(x)    (*(volatile uint32_t*)(x + 0x130))
0311 
0312 typedef struct {
0313     volatile uint32_t stat;
0314     volatile uint32_t addr;
0315     uint32_t _rsv0;
0316     uint32_t _rsv1;
0317 } au1x00_macdma_rx_t;
0318 
0319 
0320 typedef struct {
0321     volatile uint32_t stat;
0322     volatile uint32_t addr;
0323     volatile uint32_t len;
0324     uint32_t _rsv0;
0325 } au1x00_macdma_tx_t;
0326 
0327 #define AU1X00_MAC_CTRL_RA                (bit(31))
0328 #define AU1X00_MAC_CTRL_EM                (bit(30))
0329 #define AU1X00_MAC_CTRL_DO                (bit(23))
0330 #define AU1X00_MAC_CTRL_LM(x)             ((x) << 21)
0331 #define AU1X00_MAC_CTRL_LM_NORMAL         ((0) << 21)
0332 #define AU1X00_MAC_CTRL_LM_INTERNAL       ((1) << 21)
0333 #define AU1X00_MAC_CTRL_LM_EXTERNAL       ((2) << 21)
0334 #define AU1X00_MAC_CTRL_F                 (bit(20))
0335 #define AU1X00_MAC_CTRL_PM                (bit(19))
0336 #define AU1X00_MAC_CTRL_PR                (bit(18))
0337 #define AU1X00_MAC_CTRL_IF                (bit(17))
0338 #define AU1X00_MAC_CTRL_PB                (bit(16))
0339 #define AU1X00_MAC_CTRL_HO                (bit(15))
0340 #define AU1X00_MAC_CTRL_HP                (bit(13))
0341 #define AU1X00_MAC_CTRL_LC                (bit(12))
0342 #define AU1X00_MAC_CTRL_DB                (bit(11))
0343 #define AU1X00_MAC_CTRL_DR                (bit(10))
0344 #define AU1X00_MAC_CTRL_AP                (bit(8))
0345 #define AU1X00_MAC_CTRL_BL(x)             ((x) << 6)
0346 #define AU1X00_MAC_CTRL_DC                (bit(5))
0347 #define AU1X00_MAC_CTRL_TE                (bit(3))
0348 #define AU1X00_MAC_CTRL_RE                (bit(2))
0349 
0350 #define AU1X00_MAC_EN_JP                  (bit(6))
0351 #define AU1X00_MAC_EN_E2                  (bit(5))
0352 #define AU1X00_MAC_EN_E1                  (bit(4))
0353 #define AU1X00_MAC_EN_C                   (bit(3))
0354 #define AU1X00_MAC_EN_TS                  (bit(2))
0355 #define AU1X00_MAC_EN_E0                  (bit(1))
0356 #define AU1X00_MAC_EN_CE                  (bit(0))
0357 
0358 #define AU1X00_MAC_ADDRHIGH_MASK          (0xffff)_
0359 #define AU1X00_MAC_MIICTRL_PHYADDR(x)     ((x & 0x1f) << 11)
0360 #define AU1X00_MAC_MIICTRL_MIIREG(x)      ((x & 0x1f) << 6)
0361 #define AU1X00_MAC_MIICTRL_MW             (bit(1))
0362 #define AU1X00_MAC_MIICTRL_MB             (bit(0))
0363 #define AU1X00_MAC_MIIDATA_MASK           (0xffff)
0364 #define AU1X00_MAC_FLOWCTRL_PT(x)         (((x) & 0xffff) << 16)
0365 #define AU1X00_MAC_FLOWCTRL_PC            (bit(2))
0366 #define AU1X00_MAC_FLOWCTRL_FE            (bit(1))
0367 #define AU1X00_MAC_FLOWCTRL_FB            (bit(0))
0368 
0369 #define AU1X00_MAC_DMA_RXSTAT_MI          (bit(31))
0370 #define AU1X00_MAC_DMA_RXSTAT_PF          (bit(30))
0371 #define AU1X00_MAC_DMA_RXSTAT_FF          (bit(29))
0372 #define AU1X00_MAC_DMA_RXSTAT_BF          (bit(28))
0373 #define AU1X00_MAC_DMA_RXSTAT_MF          (bit(27))
0374 #define AU1X00_MAC_DMA_RXSTAT_UC          (bit(26))
0375 #define AU1X00_MAC_DMA_RXSTAT_CF          (bit(25))
0376 #define AU1X00_MAC_DMA_RXSTAT_LE          (bit(24))
0377 #define AU1X00_MAC_DMA_RXSTAT_V2          (bit(23))
0378 #define AU1X00_MAC_DMA_RXSTAT_V1          (bit(22))
0379 #define AU1X00_MAC_DMA_RXSTAT_CR          (bit(21))
0380 #define AU1X00_MAC_DMA_RXSTAT_DB          (bit(20))
0381 #define AU1X00_MAC_DMA_RXSTAT_ME          (bit(19))
0382 #define AU1X00_MAC_DMA_RXSTAT_FT          (bit(18))
0383 #define AU1X00_MAC_DMA_RXSTAT_CS          (bit(17))
0384 #define AU1X00_MAC_DMA_RXSTAT_FL          (bit(16))
0385 #define AU1X00_MAC_DMA_RXSTAT_RF          (bit(15))
0386 #define AU1X00_MAC_DMA_RXSTAT_WT          (bit(14))
0387 #define AU1X00_MAC_DMA_RXSTAT_LEN(x)      ((x) & 0x3fff)
0388 #define AU1X00_MAC_DMA_RXADDR_ADDR(x)     ((x) & ~0x1f)
0389 #define AU1X00_MAC_DMA_RXADDR_CB_MASK     (0x3 << 0x2)
0390 #define AU1X00_MAC_DMA_RXADDR_DN          (bit(1))
0391 #define AU1X00_MAC_DMA_RXADDR_EN          (bit(0))
0392 
0393 
0394 #define AU1X00_MAC_DMA_TXSTAT_PR          (bit(31))
0395 #define AU1X00_MAC_DMA_TXSTAT_CC_MASK     (0xf << 10)
0396 #define AU1X00_MAC_DMA_TXSTAT_LO          (bit(9))
0397 #define AU1X00_MAC_DMA_TXSTAT_DF          (bit(8))
0398 #define AU1X00_MAC_DMA_TXSTAT_UR          (bit(7))
0399 #define AU1X00_MAC_DMA_TXSTAT_EC          (bit(6))
0400 #define AU1X00_MAC_DMA_TXSTAT_LC          (bit(5))
0401 #define AU1X00_MAC_DMA_TXSTAT_ED          (bit(4))
0402 #define AU1X00_MAC_DMA_TXSTAT_LS          (bit(3))
0403 #define AU1X00_MAC_DMA_TXSTAT_NC          (bit(2))
0404 #define AU1X00_MAC_DMA_TXSTAT_JT          (bit(1))
0405 #define AU1X00_MAC_DMA_TXSTAT_FA          (bit(0))
0406 #define AU1X00_MAC_DMA_TXADDR_ADDR(x)     ((x) & ~0x1f)
0407 #define AU1X00_MAC_DMA_TXADDR_CB_MASK     (0x3 << 0x2)
0408 #define AU1X00_MAC_DMA_TXADDR_DN          (bit(1))
0409 #define AU1X00_MAC_DMA_TXADDR_EN          (bit(0))
0410 
0411 
0412 
0413 typedef struct {
0414     volatile uint32_t rxdata;
0415     volatile uint32_t txdata;
0416     volatile uint32_t inten;
0417     volatile uint32_t intcause;
0418     volatile uint32_t fifoctrl;
0419     volatile uint32_t linectrl;
0420     volatile uint32_t mdmctrl;
0421     volatile uint32_t linestat;
0422     volatile uint32_t mdmstat;
0423     volatile uint32_t clkdiv;
0424     volatile uint32_t _resv[54];
0425     volatile uint32_t enable;
0426 } au1x00_uart_t;
0427 
0428 extern au1x00_uart_t *uart0;
0429 extern au1x00_uart_t *uart3;
0430 
0431 void static inline au_sync(void)
0432 {
0433     __asm__ volatile ("sync");
0434 }
0435 
0436 
0437 extern void mips_default_isr( int vector );
0438 
0439 /* Generate a software interrupt */
0440 extern int assert_sw_irq(uint32_t irqnum);
0441 
0442 /* Clear a software interrupt */
0443 extern int negate_sw_irq(uint32_t irqnum);
0444 
0445 #endif