195ad0a1fSWilko Bulte /* $OpenBSD: yukonreg.h,v 1.2 2003/08/12 05:23:06 nate Exp $ */ 260727d8bSWarner Losh /*- 395ad0a1fSWilko Bulte * Copyright (c) 2003 Nathan L. Binkert <binkertn@umich.edu> 495ad0a1fSWilko Bulte * 595ad0a1fSWilko Bulte * Permission to use, copy, modify, and distribute this software for any 695ad0a1fSWilko Bulte * purpose with or without fee is hereby granted, provided that the above 795ad0a1fSWilko Bulte * copyright notice and this permission notice appear in all copies. 895ad0a1fSWilko Bulte * 995ad0a1fSWilko Bulte * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1095ad0a1fSWilko Bulte * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1195ad0a1fSWilko Bulte * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1295ad0a1fSWilko Bulte * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1395ad0a1fSWilko Bulte * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1495ad0a1fSWilko Bulte * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1595ad0a1fSWilko Bulte * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1695ad0a1fSWilko Bulte */ 1795ad0a1fSWilko Bulte 1895ad0a1fSWilko Bulte /* General Purpose Status Register (GPSR) */ 1995ad0a1fSWilko Bulte #define YUKON_GPSR 0x0000 2095ad0a1fSWilko Bulte 2195ad0a1fSWilko Bulte #define YU_GPSR_SPEED 0x8000 /* speed 0 - 10Mbps, 1 - 100Mbps */ 2295ad0a1fSWilko Bulte #define YU_GPSR_DUPLEX 0x4000 /* 0 - half duplex, 1 - full duplex */ 23919133a8SPyun YongHyeon #define YU_GPSR_FCTL_TX 0x2000 /* Tx flow control, 1 - disabled */ 2495ad0a1fSWilko Bulte #define YU_GPSR_LINK 0x1000 /* link status (down/up) */ 2595ad0a1fSWilko Bulte #define YU_GPSR_PAUSE 0x0800 /* flow control enable/disable */ 2695ad0a1fSWilko Bulte #define YU_GPSR_TX_IN_PROG 0x0400 /* transmit in progress */ 2795ad0a1fSWilko Bulte #define YU_GPSR_EXCESS_COL 0x0200 /* excessive collisions occurred */ 2895ad0a1fSWilko Bulte #define YU_GPSR_LATE_COL 0x0100 /* late collision occurred */ 2995ad0a1fSWilko Bulte #define YU_GPSR_MII_PHY_STC 0x0020 /* MII PHY status change */ 3095ad0a1fSWilko Bulte #define YU_GPSR_GIG_SPEED 0x0010 /* Gigabit Speed (0 - use speed bit) */ 3195ad0a1fSWilko Bulte #define YU_GPSR_PARTITION 0x0008 /* partition mode */ 32919133a8SPyun YongHyeon #define YU_GPSR_FCTL_RX 0x0004 /* Rx flow control, 1 - disabled */ 33919133a8SPyun YongHyeon #define YU_GPSR_PROMS_EN 0x0002 /* promiscuous mode, 1 - enabled */ 3495ad0a1fSWilko Bulte 3595ad0a1fSWilko Bulte /* General Purpose Control Register (GPCR) */ 3695ad0a1fSWilko Bulte #define YUKON_GPCR 0x0004 3795ad0a1fSWilko Bulte 38919133a8SPyun YongHyeon #define YU_GPCR_FCTL_TX_DIS 0x2000 /* Disable Tx flow control 802.3x */ 3995ad0a1fSWilko Bulte #define YU_GPCR_TXEN 0x1000 /* Transmit Enable */ 4095ad0a1fSWilko Bulte #define YU_GPCR_RXEN 0x0800 /* Receive Enable */ 41919133a8SPyun YongHyeon #define YU_GPCR_BURSTEN 0x0400 /* Burst Mode Enable */ 42919133a8SPyun YongHyeon #define YU_GPCR_LPBK 0x0200 /* MAC Loopback Enable */ 4395ad0a1fSWilko Bulte #define YU_GPCR_PAR 0x0100 /* Partition Enable */ 44919133a8SPyun YongHyeon #define YU_GPCR_GIG 0x0080 /* Gigabit Speed 1000Mbps */ 4595ad0a1fSWilko Bulte #define YU_GPCR_FLP 0x0040 /* Force Link Pass */ 4695ad0a1fSWilko Bulte #define YU_GPCR_DUPLEX 0x0020 /* Duplex Enable */ 47919133a8SPyun YongHyeon #define YU_GPCR_FCTL_RX_DIS 0x0010 /* Disable Rx flow control 802.3x */ 48919133a8SPyun YongHyeon #define YU_GPCR_SPEED 0x0008 /* Port Speed 100Mbps */ 49919133a8SPyun YongHyeon #define YU_GPCR_DPLX_DIS 0x0004 /* Disable Auto-Update for duplex */ 50919133a8SPyun YongHyeon #define YU_GPCR_FCTL_DIS 0x0002 /* Disable Auto-Update for 802.3x */ 51919133a8SPyun YongHyeon #define YU_GPCR_SPEED_DIS 0x0001 /* Disable Auto-Update for speed */ 5295ad0a1fSWilko Bulte 5395ad0a1fSWilko Bulte /* Transmit Control Register (TCR) */ 5495ad0a1fSWilko Bulte #define YUKON_TCR 0x0008 5595ad0a1fSWilko Bulte 5695ad0a1fSWilko Bulte #define YU_TCR_FJ 0x8000 /* force jam / flow control */ 5795ad0a1fSWilko Bulte #define YU_TCR_CRCD 0x4000 /* insert CRC (0 - enable) */ 5895ad0a1fSWilko Bulte #define YU_TCR_PADD 0x2000 /* pad packets to 64b (0 - enable) */ 5995ad0a1fSWilko Bulte #define YU_TCR_COLTH 0x1c00 /* collision threshold */ 6095ad0a1fSWilko Bulte 6195ad0a1fSWilko Bulte /* Receive Control Register (RCR) */ 6295ad0a1fSWilko Bulte #define YUKON_RCR 0x000c 6395ad0a1fSWilko Bulte 6495ad0a1fSWilko Bulte #define YU_RCR_UFLEN 0x8000 /* unicast filter enable */ 6595ad0a1fSWilko Bulte #define YU_RCR_MUFLEN 0x4000 /* multicast filter enable */ 6695ad0a1fSWilko Bulte #define YU_RCR_CRCR 0x2000 /* remove CRC */ 6795ad0a1fSWilko Bulte #define YU_RCR_PASSFC 0x1000 /* pass flow control packets */ 6895ad0a1fSWilko Bulte 6995ad0a1fSWilko Bulte /* Transmit Flow Control Register (TFCR) */ 7095ad0a1fSWilko Bulte #define YUKON_TFCR 0x0010 /* Pause Time */ 7195ad0a1fSWilko Bulte 7295ad0a1fSWilko Bulte /* Transmit Parameter Register (TPR) */ 7395ad0a1fSWilko Bulte #define YUKON_TPR 0x0014 7495ad0a1fSWilko Bulte 7595ad0a1fSWilko Bulte #define YU_TPR_JAM_LEN(x) (((x) & 0x3) << 14) 7695ad0a1fSWilko Bulte #define YU_TPR_JAM_IPG(x) (((x) & 0x1f) << 9) 7795ad0a1fSWilko Bulte #define YU_TPR_JAM2DATA_IPG(x) (((x) & 0x1f) << 4) 7895ad0a1fSWilko Bulte 7995ad0a1fSWilko Bulte /* Serial Mode Register (SMR) */ 8095ad0a1fSWilko Bulte #define YUKON_SMR 0x0018 8195ad0a1fSWilko Bulte 8295ad0a1fSWilko Bulte #define YU_SMR_DATA_BLIND(x) (((x) & 0x1f) << 11) 8395ad0a1fSWilko Bulte #define YU_SMR_LIMIT4 0x0400 /* reset after 16 / 4 collisions */ 8495ad0a1fSWilko Bulte #define YU_SMR_MFL_JUMBO 0x0100 /* max frame length for jumbo frames */ 8595ad0a1fSWilko Bulte #define YU_SMR_MFL_VLAN 0x0200 /* max frame length + vlan tag */ 8695ad0a1fSWilko Bulte #define YU_SMR_IPG_DATA(x) ((x) & 0x1f) 8795ad0a1fSWilko Bulte 8895ad0a1fSWilko Bulte /* Source Address Low #1 (SAL1) */ 8995ad0a1fSWilko Bulte #define YUKON_SAL1 0x001c /* SA1[15:0] */ 9095ad0a1fSWilko Bulte 9195ad0a1fSWilko Bulte /* Source Address Middle #1 (SAM1) */ 9295ad0a1fSWilko Bulte #define YUKON_SAM1 0x0020 /* SA1[31:16] */ 9395ad0a1fSWilko Bulte 9495ad0a1fSWilko Bulte /* Source Address High #1 (SAH1) */ 9595ad0a1fSWilko Bulte #define YUKON_SAH1 0x0024 /* SA1[47:32] */ 9695ad0a1fSWilko Bulte 9795ad0a1fSWilko Bulte /* Source Address Low #2 (SAL2) */ 9895ad0a1fSWilko Bulte #define YUKON_SAL2 0x0028 /* SA2[15:0] */ 9995ad0a1fSWilko Bulte 10095ad0a1fSWilko Bulte /* Source Address Middle #2 (SAM2) */ 10195ad0a1fSWilko Bulte #define YUKON_SAM2 0x002c /* SA2[31:16] */ 10295ad0a1fSWilko Bulte 10395ad0a1fSWilko Bulte /* Source Address High #2 (SAH2) */ 10495ad0a1fSWilko Bulte #define YUKON_SAH2 0x0030 /* SA2[47:32] */ 10595ad0a1fSWilko Bulte 10695ad0a1fSWilko Bulte /* Multicatst Address Hash Register 1 (MCAH1) */ 10795ad0a1fSWilko Bulte #define YUKON_MCAH1 0x0034 10895ad0a1fSWilko Bulte 10995ad0a1fSWilko Bulte /* Multicatst Address Hash Register 2 (MCAH2) */ 11095ad0a1fSWilko Bulte #define YUKON_MCAH2 0x0038 11195ad0a1fSWilko Bulte 11295ad0a1fSWilko Bulte /* Multicatst Address Hash Register 3 (MCAH3) */ 11395ad0a1fSWilko Bulte #define YUKON_MCAH3 0x003c 11495ad0a1fSWilko Bulte 11595ad0a1fSWilko Bulte /* Multicatst Address Hash Register 4 (MCAH4) */ 11695ad0a1fSWilko Bulte #define YUKON_MCAH4 0x0040 11795ad0a1fSWilko Bulte 11895ad0a1fSWilko Bulte /* Transmit Interrupt Register (TIR) */ 11995ad0a1fSWilko Bulte #define YUKON_TIR 0x0044 12095ad0a1fSWilko Bulte 12195ad0a1fSWilko Bulte #define YU_TIR_OUT_UNICAST 0x0001 /* Num Unicast Packets Transmitted */ 12295ad0a1fSWilko Bulte #define YU_TIR_OUT_BROADCAST 0x0002 /* Num Broadcast Packets Transmitted */ 12395ad0a1fSWilko Bulte #define YU_TIR_OUT_PAUSE 0x0004 /* Num Pause Packets Transmitted */ 12495ad0a1fSWilko Bulte #define YU_TIR_OUT_MULTICAST 0x0008 /* Num Multicast Packets Transmitted */ 12595ad0a1fSWilko Bulte #define YU_TIR_OUT_OCTETS 0x0030 /* Num Bytes Transmitted */ 12695ad0a1fSWilko Bulte #define YU_TIR_OUT_64_OCTETS 0x0000 /* Num Packets Transmitted */ 12795ad0a1fSWilko Bulte #define YU_TIR_OUT_127_OCTETS 0x0000 /* Num Packets Transmitted */ 12895ad0a1fSWilko Bulte #define YU_TIR_OUT_255_OCTETS 0x0000 /* Num Packets Transmitted */ 12995ad0a1fSWilko Bulte #define YU_TIR_OUT_511_OCTETS 0x0000 /* Num Packets Transmitted */ 13095ad0a1fSWilko Bulte #define YU_TIR_OUT_1023_OCTETS 0x0000 /* Num Packets Transmitted */ 13195ad0a1fSWilko Bulte #define YU_TIR_OUT_1518_OCTETS 0x0000 /* Num Packets Transmitted */ 13295ad0a1fSWilko Bulte #define YU_TIR_OUT_MAX_OCTETS 0x0000 /* Num Packets Transmitted */ 13395ad0a1fSWilko Bulte #define YU_TIR_OUT_SPARE 0x0000 /* Num Packets Transmitted */ 13495ad0a1fSWilko Bulte #define YU_TIR_OUT_COLLISIONS 0x0000 /* Num Packets Transmitted */ 13595ad0a1fSWilko Bulte #define YU_TIR_OUT_LATE 0x0000 /* Num Packets Transmitted */ 13695ad0a1fSWilko Bulte 13795ad0a1fSWilko Bulte /* Receive Interrupt Register (RIR) */ 13895ad0a1fSWilko Bulte #define YUKON_RIR 0x0048 13995ad0a1fSWilko Bulte 14095ad0a1fSWilko Bulte /* Transmit and Receive Interrupt Register (TRIR) */ 14195ad0a1fSWilko Bulte #define YUKON_TRIR 0x004c 14295ad0a1fSWilko Bulte 14395ad0a1fSWilko Bulte /* Transmit Interrupt Mask Register (TIMR) */ 14495ad0a1fSWilko Bulte #define YUKON_TIMR 0x0050 14595ad0a1fSWilko Bulte 14695ad0a1fSWilko Bulte /* Receive Interrupt Mask Register (RIMR) */ 14795ad0a1fSWilko Bulte #define YUKON_RIMR 0x0054 14895ad0a1fSWilko Bulte 14995ad0a1fSWilko Bulte /* Transmit and Receive Interrupt Mask Register (TRIMR) */ 15095ad0a1fSWilko Bulte #define YUKON_TRIMR 0x0058 15195ad0a1fSWilko Bulte 15295ad0a1fSWilko Bulte /* SMI Control Register (SMICR) */ 15395ad0a1fSWilko Bulte #define YUKON_SMICR 0x0080 15495ad0a1fSWilko Bulte 15595ad0a1fSWilko Bulte #define YU_SMICR_PHYAD(x) (((x) & 0x1f) << 11) 15695ad0a1fSWilko Bulte #define YU_SMICR_REGAD(x) (((x) & 0x1f) << 6) 15795ad0a1fSWilko Bulte #define YU_SMICR_OPCODE 0x0020 /* opcode (0 - write, 1 - read) */ 15895ad0a1fSWilko Bulte #define YU_SMICR_OP_READ 0x0020 /* opcode read */ 15995ad0a1fSWilko Bulte #define YU_SMICR_OP_WRITE 0x0000 /* opcode write */ 16095ad0a1fSWilko Bulte #define YU_SMICR_READ_VALID 0x0010 /* read valid */ 16195ad0a1fSWilko Bulte #define YU_SMICR_BUSY 0x0008 /* busy (writing) */ 16295ad0a1fSWilko Bulte 16395ad0a1fSWilko Bulte /* SMI Data Register (SMIDR) */ 16495ad0a1fSWilko Bulte #define YUKON_SMIDR 0x0084 16595ad0a1fSWilko Bulte 166*453130d9SPedro F. Giffuni /* PHY Address Register (PAR) */ 16795ad0a1fSWilko Bulte #define YUKON_PAR 0x0088 16895ad0a1fSWilko Bulte 16995ad0a1fSWilko Bulte #define YU_PAR_MIB_CLR 0x0020 /* MIB Counters Clear Mode */ 17095ad0a1fSWilko Bulte #define YU_PAR_LOAD_TSTCNT 0x0010 /* Load count 0xfffffff0 into cntr */ 171919133a8SPyun YongHyeon 172919133a8SPyun YongHyeon /* Receive status */ 173919133a8SPyun YongHyeon #define YU_RXSTAT_FOFL 0x00000001 /* Rx FIFO overflow */ 174919133a8SPyun YongHyeon #define YU_RXSTAT_CRCERR 0x00000002 /* CRC error */ 175919133a8SPyun YongHyeon #define YU_RXSTAT_FRAGMENT 0x00000008 /* fragment */ 176919133a8SPyun YongHyeon #define YU_RXSTAT_LONGERR 0x00000010 /* too long packet */ 177919133a8SPyun YongHyeon #define YU_RXSTAT_MIIERR 0x00000020 /* MII error */ 178919133a8SPyun YongHyeon #define YU_RXSTAT_BADFC 0x00000040 /* bad flow-control packet */ 179919133a8SPyun YongHyeon #define YU_RXSTAT_GOODFC 0x00000080 /* good flow-control packet */ 180919133a8SPyun YongHyeon #define YU_RXSTAT_RXOK 0x00000100 /* receice OK (Good packet) */ 181919133a8SPyun YongHyeon #define YU_RXSTAT_BROADCAST 0x00000200 /* broadcast packet */ 182919133a8SPyun YongHyeon #define YU_RXSTAT_MULTICAST 0x00000400 /* multicast packet */ 183919133a8SPyun YongHyeon #define YU_RXSTAT_RUNT 0x00000800 /* undersize packet */ 184919133a8SPyun YongHyeon #define YU_RXSTAT_JABBER 0x00001000 /* jabber packet */ 185919133a8SPyun YongHyeon #define YU_RXSTAT_VLAN 0x00002000 /* VLAN packet */ 186919133a8SPyun YongHyeon #define YU_RXSTAT_LENSHIFT 16 187919133a8SPyun YongHyeon 188919133a8SPyun YongHyeon #define YU_RXSTAT_BYTES(x) ((x) >> YU_RXSTAT_LENSHIFT) 189