adm8511reg.h revision 6716431ba7de213d5c318e58dc24c8a36da9b068
/*
* @(#)adm8511reg.h 1.1 09/06/20
* Register dehinitsions of ADMtek ADM8511 Fast Ethernet to USB controller.
* Codeded by Masayuki Murayama(KHF04453@nifty.ne.jp)
* This file is public domain.
*/
#ifndef __ADM8511_H__
#define __ADM8511_H__
/* Ethernet control register 0: offset 0 */
#define EC0_TXE 0x80U
#define EC0_RXE 0x40U
#define EC0_RXFCE 0x20U
#define EC0_WOE 0x10U
#define EC0_RXSA 0x08U
#define EC0_SBO 0x04U
#define EC0_RXMA 0x02U
#define EC0_RXCS 0x01U
#define EC0_BITS \
"\020" \
"\010TXE" \
"\007RXE" \
"\006RXFCE" \
"\005WOE" \
"\004RXSA" \
"\003SBO" \
"\002RXMA" \
"\001RXCS"
/* Ethernet control register 1: offset 1 */
#define EC1_FD 0x20U
#define EC1_BITS \
"\020" \
"\006FD" \
"\005100M" \
"\004RM"
/* Ethernet control register 2: offset 2 */
#define EC2_RPNC 0x40U
#define EC2_LEEPRS 0x20U
#define EC2_EEPRW 0x10U
#define EC2_LB 0x08U
#define EC2_PROM 0x04U
#define EC2_RXBP 0x02U
#define EC2_EP3RC 0x01U
#define EC2_BITS \
"\020" \
"\010MEPS" \
"\007RPNC" \
"\006LEEPRS" \
"\005EEPRW" \
"\004LB" \
"\003PROM" \
"\002RXBP" \
"\001EP3RC"
/* Recieve Packet number based Flow Control register: offset 0x1a */
#define RPNBFC_PN_SHIFT 1
/* Occupied Recieve FIFO based Flow Control register: offset 0x1b */
#define ORFBFC_RXS_SHIFT 1
#define ORFBFC_RXS_UNIT 1024U
/* EP1 control register: offset 0x1c */
#define EP1C_BITS \
"\020" \
"\010EP1S0E"
/* Rx FIFO Control register: offset 0x1d */
/* EEPROM offset register: offset 0x20 */
/* EEPROM access control register: offset 0x23 */
#define EECTRL_DONE 0x04
#define EECTRL_RD 0x02
#define EECTRL_WR 0x01
#define EECTRL_BITS \
"\020" \
"\003DONE" \
"\002RD" \
"\001WR"
/* PHY control register: offset 28 */
#define PHYCTRL_BITS \
"\020" \
"\010DO" \
"\007RDPHY" \
"\006WRPHY"
/* Internal PHY control register: offset 7b */
#define IPHYC_EPHY 0x02
#define IPHYC_PHYR 0x01
#define IPHYC_BITS \
"\020" \
"\002EPHY" \
"\001PHYR"
/* GPIO45 register: offset 7c */
#define GPIO54_5OE 0x20
#define GPIO54_5O 0x10
#define GPIO54_5I 0x08
#define GPIO54_4OE 0x04
#define GPIO54_4O 0x02
#define GPIO54_4I 0x01
/* GPIO01 register: offset 7e */
#define GPIO10_1OE 0x20
#define GPIO10_1O 0x10
#define GPIO10_1I 0x08
#define GPIO10_0OE 0x04
#define GPIO10_0O 0x02
#define GPIO10_0I 0x01
/* GPIO23 register: offset 7f */
#define GPIO32_3OE 0x20
#define GPIO32_3O 0x10
#define GPIO32_3I 0x08
#define GPIO32_2OE 0x04
#define GPIO32_2O 0x02
#define GPIO32_2I 0x01
/* rx status at the end of received packets */
/* byte 0 and 1 is packet length in little endian */
/* byte 2 is receive status */
#define RSR_DRIBBLE 0x10
#define RSR_CRC 0x08
#define RSR_RUNT 0x04
#define RSR_LONG 0x02
#define RSR_MULTI 0x01
#define RSR_ERRORS \
#define RSR_BITS \
"\020" \
"\005DRIBBLE" \
"\004CRC" \
"\003RUNT" \
"\002LONG" \
"\001MULTI"
/* byte 3 is reserved */
/* TEST register: offset 80 */
#endif /* __ADM8511_H__ */