Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

rtlregs.h

00001 #ifndef _DEV_RTLREGS_H_
00002 #define _DEV_RTLREGS_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2002 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. All advertising materials mentioning features or use of this
00017  *    software must display the following acknowledgement:
00018  *
00019  *    This product includes software developed by egnite Software GmbH
00020  *    and its contributors.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00023  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00026  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00029  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00030  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00032  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00033  * SUCH DAMAGE.
00034  *
00035  * For additional information see http://www.ethernut.de/
00036  *
00037  * -
00038  * Portions Copyright (C) 2000 David J. Hudson <dave@humbug.demon.co.uk>
00039  *
00040  * This file is distributed in the hope that it will be useful, but WITHOUT
00041  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00042  * FITNESS FOR A PARTICULAR PURPOSE.
00043  *
00044  * You can redistribute this file and/or modify it under the terms of the GNU
00045  * General Public License (GPL) as published by the Free Software Foundation;
00046  * either version 2 of the License, or (at your discretion) any later version.
00047  * See the accompanying file "copying-gpl.txt" for more details.
00048  *
00049  * As a special exception to the GPL, permission is granted for additional
00050  * uses of the text contained in this file.  See the accompanying file
00051  * "copying-liquorice.txt" for details.
00052  * -
00053  * Portions Copyright (c) 1983, 1993 by
00054  *  The Regents of the University of California.  All rights reserved.
00055  *
00056  * Redistribution and use in source and binary forms, with or without
00057  * modification, are permitted provided that the following conditions
00058  * are met:
00059  * 1. Redistributions of source code must retain the above copyright
00060  *    notice, this list of conditions and the following disclaimer.
00061  * 2. Redistributions in binary form must reproduce the above copyright
00062  *    notice, this list of conditions and the following disclaimer in the
00063  *    documentation and/or other materials provided with the distribution.
00064  * 3. All advertising materials mentioning features or use of this software
00065  *    must display the following acknowledgement:
00066  *  This product includes software developed by the University of
00067  *  California, Berkeley and its contributors.
00068  * 4. Neither the name of the University nor the names of its contributors
00069  *    may be used to endorse or promote products derived from this software
00070  *    without specific prior written permission.
00071  *
00072  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00073  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00074  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00075  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00076  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00077  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00078  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00079  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00080  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00081  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00082  * SUCH DAMAGE.
00083  */
00084 
00085 /*
00086  * $Log: rtlregs.h,v $
00087  * Revision 1.2  2003/01/24 12:01:07  przemko
00088  * Obciecie dosowych znakow konca lini
00089  *
00090  * Revision 1.1.1.1  2002/12/07 07:16:53  marwi
00091  *
00092  *
00093  * Revision 1.2  2002/08/01 19:50:38  harald
00094  * First public release
00095  *
00096  * Revision 1.1  2002/08/01 17:34:30  harald
00097  * First check in
00098  *
00099  * Revision 1.5  2002/06/26 17:29:08  harald
00100  * First pre-release with 2.4 stack
00101  *
00102  */
00103 
00108 /*
00109  * Register offset applicable to all register pages.
00110  */
00111 #define NIC_CR 0x00        
00112 #define NIC_IOPORT 0x10    
00113 #define NIC_RESET 0x1f     
00115 /*
00116  * Page 0 register offsets.
00117  */
00118 #define NIC_PG0_CLDA0 0x01    
00119 #define NIC_PG0_PSTART 0x01   
00120 #define NIC_PG0_CLDA1 0x02    
00121 #define NIC_PG0_PSTOP 0x02    
00122 #define NIC_PG0_BNRY 0x03     
00123 #define NIC_PG0_TSR 0x04      
00124 #define NIC_PG0_TPSR 0x04     
00125 #define NIC_PG0_NCR 0x05      
00126 #define NIC_PG0_TBCR0 0x05    
00127 #define NIC_PG0_FIFO 0x06     
00128 #define NIC_PG0_TBCR1 0x06    
00129 #define NIC_PG0_ISR 0x07      
00130 #define NIC_PG0_CRDA0 0x08    
00131 #define NIC_PG0_RSAR0 0x08    
00133 #define NIC_PG0_CRDA1 0x09    
00134 #define NIC_PG0_RSAR1 0x09    
00136 #define NIC_PG0_RBCR0 0x0a    
00139 #define NIC_PG0_RBCR1 0x0b    
00142 #define NIC_PG0_RSR 0x0c      
00143 #define NIC_PG0_RCR 0x0c      
00144 #define NIC_PG0_CNTR0 0x0d    
00145 #define NIC_PG0_TCR 0x0d      
00146 #define NIC_PG0_CNTR1 0x0e    
00147 #define NIC_PG0_DCR 0x0e      
00148 #define NIC_PG0_CNTR2 0x0f    
00149 #define NIC_PG0_IMR 0x0f      
00151 /*
00152  * Page 1 register offsets.
00153  */
00154 #define NIC_PG1_PAR0 0x01     
00155 #define NIC_PG1_PAR1 0x02     
00156 #define NIC_PG1_PAR2 0x03     
00157 #define NIC_PG1_PAR3 0x04     
00158 #define NIC_PG1_PAR4 0x05     
00159 #define NIC_PG1_PAR5 0x06     
00160 #define NIC_PG1_CURR 0x07     
00163 #define NIC_PG1_MAR0 0x08     
00164 #define NIC_PG1_MAR1 0x09     
00165 #define NIC_PG1_MAR2 0x0a     
00166 #define NIC_PG1_MAR3 0x0b     
00167 #define NIC_PG1_MAR4 0x0c     
00168 #define NIC_PG1_MAR5 0x0d     
00169 #define NIC_PG1_MAR6 0x0e     
00170 #define NIC_PG1_MAR7 0x0f     
00172 /*
00173  * Page 2 register offsets.
00174  */
00175 #define NIC_PG2_PSTART 0x01   
00176 #define NIC_PG2_CLDA0 0x01    
00177 #define NIC_PG2_PSTOP 0x02    
00178 #define NIC_PG2_CLDA1 0x02    
00179 #define NIC_PG2_RNP 0x03      
00180 #define NIC_PG2_TSPR 0x04     
00181 #define NIC_PG2_LNP 0x05      
00182 #define NIC_PG2_ACU 0x06      
00183 #define NIC_PG2_ACL 0x07      
00184 #define NIC_PG2_RCR 0x0c      
00185 #define NIC_PG2_TCR 0x0d      
00186 #define NIC_PG2_DCR 0x0e      
00187 #define NIC_PG2_IMR 0x0f      
00189 /*
00190  * Page 3 register offsets.
00191  */
00192 #define NIC_PG3_EECR     0x01    
00193 #define NIC_PG3_BPAGE    0x02    
00194 #define NIC_PG3_CONFIG0  0x03    
00195 #define NIC_PG3_CONFIG1  0x04    
00196 #define NIC_PG3_CONFIG2  0x05    
00197 #define NIC_PG3_CONFIG3  0x06    
00198 #define NIC_PG3_CSNSAV   0x08    
00199 #define NIC_PG3_HLTCLK   0x09    
00200 #define NIC_PG3_INTR     0x0b    
00202 /*
00203  * Command register bits.
00204  */
00205 #define NIC_CR_STP 0x01    
00206 #define NIC_CR_STA 0x02    
00207 #define NIC_CR_TXP 0x04    
00208 #define NIC_CR_RD0 0x08    
00209 #define NIC_CR_RD1 0x10    
00210 #define NIC_CR_RD2 0x20    
00211 #define NIC_CR_PS0 0x40    
00212 #define NIC_CR_PS1 0x80    
00214 /*
00215  * Interrupt status register bits.
00216  */
00217 #define NIC_ISR_PRX 0x01      
00218 #define NIC_ISR_PTX 0x02      
00219 #define NIC_ISR_RXE 0x04      
00220 #define NIC_ISR_TXE 0x08      
00221 #define NIC_ISR_OVW 0x10      
00222 #define NIC_ISR_CNT 0x20      
00223 #define NIC_ISR_RDC 0x40      
00224 #define NIC_ISR_RST 0x80      
00226 /*
00227  * Interrupt mask register bits.
00228  */
00229 #define NIC_IMR_PRXE 0x01     
00230 #define NIC_IMR_PTXE 0x02     
00231 #define NIC_IMR_RXEE 0x04     
00232 #define NIC_IMR_TXEE 0x08     
00233 #define NIC_IMR_OVWE 0x10     
00234 #define NIC_IMR_CNTE 0x20     
00235 #define NIC_IMR_RCDE 0x40     
00237 /*
00238  * Data configuration register bits.
00239  */
00240 #define NIC_DCR_WTS 0x01      
00241 #define NIC_DCR_BOS 0x02      
00242 #define NIC_DCR_LAS 0x04      
00243 #define NIC_DCR_LS 0x08       
00244 #define NIC_DCR_AR 0x10       
00245 #define NIC_DCR_FT0 0x20      
00246 #define NIC_DCR_FT1 0x40      
00248 /*
00249  * Transmit configuration register bits.
00250  */
00251 #define NIC_TCR_CRC 0x01      
00252 #define NIC_TCR_LB0 0x02      
00253 #define NIC_TCR_LB1 0x04      
00254 #define NIC_TCR_ATD 0x08      
00255 #define NIC_TCR_OFST 0x10     
00257 /*
00258  * Transmit status register bits.
00259  */
00260 #define NIC_TSR_PTX 0x01      
00261 #define NIC_TSR_COL 0x04      
00262 #define NIC_TSR_ABT 0x08      
00263 #define NIC_TSR_CRS 0x10      
00264 #define NIC_TSR_FU 0x20       
00265 #define NIC_TSR_CDH 0x40      
00266 #define NIC_TSR_OWC 0x80      
00268 /*
00269  * Receive configuration register bits.
00270  */
00271 #define NIC_RCR_SEP 0x01      
00272 #define NIC_RCR_AR 0x02       
00273 #define NIC_RCR_AB 0x04       
00274 #define NIC_RCR_AM 0x08       
00275 #define NIC_RCR_PRO 0x10      
00276 #define NIC_RCR_MON 0x20      
00278 /*
00279  * Receive status register bits.
00280  */
00281 #define NIC_RSR_PRX 0x01      
00282 #define NIC_RSR_CRC 0x02      
00283 #define NIC_RSR_FAE 0x04      
00284 #define NIC_RSR_FO 0x08       
00285 #define NIC_RSR_MPA 0x10      
00286 #define NIC_RSR_PHY 0x20      
00287 #define NIC_RSR_DIS 0x40      
00288 #define NIC_RSR_DFR 0x80      
00290 /*
00291  * EEPROM command register bits.
00292  */
00293 #define NIC_EECR_EEM1  0x80    
00294 #define NIC_EECR_EEM0  0x40    
00299 #define NIC_EECR_EECS  0x08    
00300 #define NIC_EECR_EESK  0x04    
00301 #define NIC_EECR_EEDI  0x02    
00302 #define NIC_EECR_EEDO  0x01    
00304 /*
00305  * Configuration register 2 bits.
00306  */
00307 #define NIC_CONFIG2_PL1   0x80 
00308 #define NIC_CONFIG2_PL0   0x40 
00313 #define NIC_CONFIG2_BSELB 0x20 
00314 #define NIC_CONFIG2_BS4   0x10 
00315 #define NIC_CONFIG2_BS3   0x08
00316 #define NIC_CONFIG2_BS2   0x04
00317 #define NIC_CONFIG2_BS1   0x02
00318 #define NIC_CONFIG2_BS0   0x01
00319 
00320 /*
00321  * Configuration register 3 bits
00322  */
00323 #define NIC_CONFIG3_PNP     0x80 
00324 #define NIC_CONFIG3_FUDUP   0x40 
00325 #define NIC_CONFIG3_LEDS1   0x20 
00328 #define NIC_CONFIG3_LEDS0   0x10 
00331 #define NIC_CONFIG3_SLEEP   0x04 
00332 #define NIC_CONFIG3_PWRDN   0x02 
00333 #define NIC_CONFIG3_ACTIVEB 0x01 
00339 #define nic_read(reg) *(base + (reg))
00340 
00344 #define nic_write(reg, data) *(base + (reg)) = data
00345 
00346 #endif

Generated on Thu Jan 30 22:30:52 2003 for EduNet by doxygen1.2.18