Nut/OS  4.10.3
API Reference
rtlregs.h
Go to the documentation of this file.
00001 #ifndef _DEV_RTLREGS_H_
00002 #define _DEV_RTLREGS_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  *
00035  */
00036 
00037 /*
00038  * $Log$
00039  * Revision 1.1  2005/07/26 18:02:40  haraldkipp
00040  * Moved from dev.
00041  *
00042  * Revision 1.1.1.1  2003/05/09 14:40:49  haraldkipp
00043  * Initial using 3.2.1
00044  *
00045  * Revision 1.7  2003/02/04 17:50:54  harald
00046  * Version 3 released
00047  *
00048  * Revision 1.6  2002/10/29 15:27:36  harald
00049  * *** empty log message ***
00050  *
00051  * Revision 1.5  2002/06/26 17:29:08  harald
00052  * First pre-release with 2.4 stack
00053  *
00054  */
00055 
00060 
00061 /*
00062  * Register offset applicable to all register pages.
00063  */
00064 #define NIC_CR 0x00        
00065 #define NIC_IOPORT 0x10    
00066 #define NIC_RESET 0x1f     
00068 /*
00069  * Page 0 register offsets.
00070  */
00071 #define NIC_PG0_CLDA0 0x01    
00072 #define NIC_PG0_PSTART 0x01   
00073 #define NIC_PG0_CLDA1 0x02    
00074 #define NIC_PG0_PSTOP 0x02    
00075 #define NIC_PG0_BNRY 0x03     
00076 #define NIC_PG0_TSR 0x04      
00077 #define NIC_PG0_TPSR 0x04     
00078 #define NIC_PG0_NCR 0x05      
00079 #define NIC_PG0_TBCR0 0x05    
00080 #define NIC_PG0_FIFO 0x06     
00081 #define NIC_PG0_TBCR1 0x06    
00082 #define NIC_PG0_ISR 0x07      
00083 #define NIC_PG0_CRDA0 0x08    
00084 #define NIC_PG0_RSAR0 0x08    
00086 #define NIC_PG0_CRDA1 0x09    
00087 #define NIC_PG0_RSAR1 0x09    
00089 #define NIC_PG0_RBCR0 0x0a    
00092 #define NIC_PG0_RBCR1 0x0b    
00095 #define NIC_PG0_RSR 0x0c      
00096 #define NIC_PG0_RCR 0x0c      
00097 #define NIC_PG0_CNTR0 0x0d    
00098 #define NIC_PG0_TCR 0x0d      
00099 #define NIC_PG0_CNTR1 0x0e    
00100 #define NIC_PG0_DCR 0x0e      
00101 #define NIC_PG0_CNTR2 0x0f    
00102 #define NIC_PG0_IMR 0x0f      
00104 /*
00105  * Page 1 register offsets.
00106  */
00107 #define NIC_PG1_PAR0 0x01     
00108 #define NIC_PG1_PAR1 0x02     
00109 #define NIC_PG1_PAR2 0x03     
00110 #define NIC_PG1_PAR3 0x04     
00111 #define NIC_PG1_PAR4 0x05     
00112 #define NIC_PG1_PAR5 0x06     
00113 #define NIC_PG1_CURR 0x07     
00116 #define NIC_PG1_MAR0 0x08     
00117 #define NIC_PG1_MAR1 0x09     
00118 #define NIC_PG1_MAR2 0x0a     
00119 #define NIC_PG1_MAR3 0x0b     
00120 #define NIC_PG1_MAR4 0x0c     
00121 #define NIC_PG1_MAR5 0x0d     
00122 #define NIC_PG1_MAR6 0x0e     
00123 #define NIC_PG1_MAR7 0x0f     
00125 /*
00126  * Page 2 register offsets.
00127  */
00128 #define NIC_PG2_PSTART 0x01   
00129 #define NIC_PG2_CLDA0 0x01    
00130 #define NIC_PG2_PSTOP 0x02    
00131 #define NIC_PG2_CLDA1 0x02    
00132 #define NIC_PG2_RNP 0x03      
00133 #define NIC_PG2_TSPR 0x04     
00134 #define NIC_PG2_LNP 0x05      
00135 #define NIC_PG2_ACU 0x06      
00136 #define NIC_PG2_ACL 0x07      
00137 #define NIC_PG2_RCR 0x0c      
00138 #define NIC_PG2_TCR 0x0d      
00139 #define NIC_PG2_DCR 0x0e      
00140 #define NIC_PG2_IMR 0x0f      
00142 /*
00143  * Page 3 register offsets.
00144  */
00145 #define NIC_PG3_EECR     0x01    
00146 #define NIC_PG3_BPAGE    0x02    
00147 #define NIC_PG3_CONFIG0  0x03    
00148 #define NIC_PG3_CONFIG1  0x04    
00149 #define NIC_PG3_CONFIG2  0x05    
00150 #define NIC_PG3_CONFIG3  0x06    
00151 #define NIC_PG3_CSNSAV   0x08    
00152 #define NIC_PG3_HLTCLK   0x09    
00153 #define NIC_PG3_INTR     0x0b    
00155 /*
00156  * Command register bits.
00157  */
00158 #define NIC_CR_STP 0x01    
00159 #define NIC_CR_STA 0x02    
00160 #define NIC_CR_TXP 0x04    
00161 #define NIC_CR_RD0 0x08    
00162 #define NIC_CR_RD1 0x10    
00163 #define NIC_CR_RD2 0x20    
00164 #define NIC_CR_PS0 0x40    
00165 #define NIC_CR_PS1 0x80    
00167 /*
00168  * Interrupt status register bits.
00169  */
00170 #define NIC_ISR_PRX 0x01      
00171 #define NIC_ISR_PTX 0x02      
00172 #define NIC_ISR_RXE 0x04      
00173 #define NIC_ISR_TXE 0x08      
00174 #define NIC_ISR_OVW 0x10      
00175 #define NIC_ISR_CNT 0x20      
00176 #define NIC_ISR_RDC 0x40      
00177 #define NIC_ISR_RST 0x80      
00179 /*
00180  * Interrupt mask register bits.
00181  */
00182 #define NIC_IMR_PRXE 0x01     
00183 #define NIC_IMR_PTXE 0x02     
00184 #define NIC_IMR_RXEE 0x04     
00185 #define NIC_IMR_TXEE 0x08     
00186 #define NIC_IMR_OVWE 0x10     
00187 #define NIC_IMR_CNTE 0x20     
00188 #define NIC_IMR_RCDE 0x40     
00190 /*
00191  * Data configuration register bits.
00192  */
00193 #define NIC_DCR_WTS 0x01      
00194 #define NIC_DCR_BOS 0x02      
00195 #define NIC_DCR_LAS 0x04      
00196 #define NIC_DCR_LS 0x08       
00197 #define NIC_DCR_AR 0x10       
00198 #define NIC_DCR_FT0 0x20      
00199 #define NIC_DCR_FT1 0x40      
00201 /*
00202  * Transmit configuration register bits.
00203  */
00204 #define NIC_TCR_CRC 0x01      
00205 #define NIC_TCR_LB0 0x02      
00206 #define NIC_TCR_LB1 0x04      
00207 #define NIC_TCR_ATD 0x08      
00208 #define NIC_TCR_OFST 0x10     
00210 /*
00211  * Transmit status register bits.
00212  */
00213 #define NIC_TSR_PTX 0x01      
00214 #define NIC_TSR_COL 0x04      
00215 #define NIC_TSR_ABT 0x08      
00216 #define NIC_TSR_CRS 0x10      
00217 #define NIC_TSR_FU 0x20       
00218 #define NIC_TSR_CDH 0x40      
00219 #define NIC_TSR_OWC 0x80      
00221 /*
00222  * Receive configuration register bits.
00223  */
00224 #define NIC_RCR_SEP 0x01      
00225 #define NIC_RCR_AR 0x02       
00226 #define NIC_RCR_AB 0x04       
00227 #define NIC_RCR_AM 0x08       
00228 #define NIC_RCR_PRO 0x10      
00229 #define NIC_RCR_MON 0x20      
00231 /*
00232  * Receive status register bits.
00233  */
00234 #define NIC_RSR_PRX 0x01      
00235 #define NIC_RSR_CRC 0x02      
00236 #define NIC_RSR_FAE 0x04      
00237 #define NIC_RSR_FO 0x08       
00238 #define NIC_RSR_MPA 0x10      
00239 #define NIC_RSR_PHY 0x20      
00240 #define NIC_RSR_DIS 0x40      
00241 #define NIC_RSR_DFR 0x80      
00243 /*
00244  * EEPROM command register bits.
00245  */
00246 #define NIC_EECR_EEM1  0x80    
00247 #define NIC_EECR_EEM0  0x40    
00252 #define NIC_EECR_EECS  0x08    
00253 #define NIC_EECR_EESK  0x04    
00254 #define NIC_EECR_EEDI  0x02    
00255 #define NIC_EECR_EEDO  0x01    
00257 /*
00258  * Configuration register 2 bits.
00259  */
00260 #define NIC_CONFIG2_PL1   0x80 
00261 #define NIC_CONFIG2_PL0   0x40 
00266 #define NIC_CONFIG2_BSELB 0x20 
00267 #define NIC_CONFIG2_BS4   0x10 
00268 #define NIC_CONFIG2_BS3   0x08
00269 #define NIC_CONFIG2_BS2   0x04
00270 #define NIC_CONFIG2_BS1   0x02
00271 #define NIC_CONFIG2_BS0   0x01
00272 
00273 /*
00274  * Configuration register 3 bits
00275  */
00276 #define NIC_CONFIG3_PNP     0x80 
00277 #define NIC_CONFIG3_FUDUP   0x40 
00278 #define NIC_CONFIG3_LEDS1   0x20 
00281 #define NIC_CONFIG3_LEDS0   0x10 
00284 #define NIC_CONFIG3_SLEEP   0x04 
00285 #define NIC_CONFIG3_PWRDN   0x02 
00286 #define NIC_CONFIG3_ACTIVEB 0x01 
00289 
00290 
00293 #define nic_read(reg) *(base + (reg))
00294 
00298 #define nic_write(reg, data) *(base + (reg)) = data
00299 
00300 #endif