1 1.2 pooka /* $NetBSD: emac3reg.h,v 1.3 2014/03/31 11:25:49 martin Exp $ */ 2 1.1 uch 3 1.1 uch /* 4 1.1 uch * Copyright 2001 Wasabi Systems, Inc. 5 1.1 uch * All rights reserved. 6 1.1 uch * 7 1.1 uch * Written by Simon Burge and Eduardo Horvath for Wasabi Systems, Inc. 8 1.1 uch * 9 1.1 uch * Redistribution and use in source and binary forms, with or without 10 1.1 uch * modification, are permitted provided that the following conditions 11 1.1 uch * are met: 12 1.1 uch * 1. Redistributions of source code must retain the above copyright 13 1.1 uch * notice, this list of conditions and the following disclaimer. 14 1.1 uch * 2. Redistributions in binary form must reproduce the above copyright 15 1.1 uch * notice, this list of conditions and the following disclaimer in the 16 1.1 uch * documentation and/or other materials provided with the distribution. 17 1.1 uch * 3. All advertising materials mentioning features or use of this software 18 1.1 uch * must display the following acknowledgement: 19 1.1 uch * This product includes software developed for the NetBSD Project by 20 1.1 uch * Wasabi Systems, Inc. 21 1.1 uch * 4. The name of Wasabi Systems, Inc. may not be used to endorse 22 1.1 uch * or promote products derived from this software without specific prior 23 1.1 uch * written permission. 24 1.1 uch * 25 1.1 uch * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 26 1.1 uch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27 1.1 uch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 1.1 uch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 29 1.1 uch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 1.1 uch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 1.1 uch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 1.1 uch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 1.1 uch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 1.1 uch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 1.1 uch * POSSIBILITY OF SUCH DAMAGE. 36 1.1 uch */ 37 1.1 uch 38 1.1 uch /* 39 1.1 uch * SCPH-10190 EMAC3 40 1.1 uch * Ethernet MAC Registers 41 1.1 uch * based on arch/powerpc/include/ibm4xx/ibm405gp.h of EMAC0 register define. 42 1.1 uch */ 43 1.1 uch 44 1.1 uch #define EMAC3_MR0 0x00 /* Mode Register 0 */ 45 1.1 uch #define MR0_RXI 0x80000000 /* Receive MAC Idle */ 46 1.1 uch #define MR0_TXI 0x40000000 /* Transmit MAC Idle */ 47 1.1 uch #define MR0_SRST 0x20000000 /* Soft Reset */ 48 1.1 uch #define MR0_TXE 0x10000000 /* Transmit MAC Enable */ 49 1.1 uch #define MR0_RXE 0x08000000 /* Receive MAC Enable */ 50 1.1 uch #define MR0_WKE 0x04000000 /* Wake-up Enable */ 51 1.1 uch 52 1.1 uch #define EMAC3_MR1 0x04 /* Mode Register 1 */ 53 1.1 uch #define MR1_FDE 0x80000000 /* Full-Duplex Enable */ 54 1.1 uch #define MR1_ILE 0x40000000 /* Internal Loop-back Enable */ 55 1.1 uch #define MR1_VLE 0x20000000 /* VLAN Enable */ 56 1.1 uch #define MR1_EIFC 0x10000000 /* Enable Integrated Flow Control */ 57 1.1 uch #define MR1_APP 0x08000000 /* Allow Pause Packet */ 58 1.1 uch #define MR1_IST 0x01000000 /* Ignore SQE Test */ 59 1.1 uch #define MR1_MF_MASK 0x00c00000 /* Medium Frequency mask */ 60 1.1 uch #define MR1_MF_10MBS 0x00000000 /* 10MB/sec */ 61 1.1 uch #define MR1_MF_100MBS 0x00400000 /* 100MB/sec */ 62 1.1 uch #define MR1_RFS_MASK 0x00300000 /* Receive FIFO size */ 63 1.1 uch #define MR1_RFS_512 0x00000000 /* 512 bytes */ 64 1.1 uch #define MR1_RFS_1KB 0x00100000 /* 1kByte */ 65 1.1 uch #define MR1_RFS_2KB 0x00200000 /* 2kByte */ 66 1.1 uch #define MR1_RFS_4KB 0x00300000 /* 4kByte */ 67 1.1 uch #define MR1_TFS_MASK 0x000c0000 /* Transmit FIFO size */ 68 1.1 uch #define MR1_TFS_1KB 0x00040000 /* 1kByte */ 69 1.1 uch #define MR1_TFS_2KB 0x00080000 /* 2kByte */ 70 1.1 uch #define MR1_TR0_MASK 0x00018000 /* Transmit Request 0 */ 71 1.1 uch #define MR1_TR0_SINGLE 0x00000000 /* Single Packet mode */ 72 1.1 uch #define MR1_TR0_MULTIPLE 0x00008000 /* Multiple Packet mode */ 73 1.1 uch #define MR1_TR0_DEPENDANT 0x00010000 /* Dependent Mode */ 74 1.1 uch #define MR1_TR1_MASK 0x00006000 /* Transmit Request 1 */ 75 1.1 uch #define MR1_TR1_SINGLE 0x00000000 /* Single Packet mode */ 76 1.1 uch #define MR1_TR1_MULTIPLE 0x00002000 /* Multiply Packet mode */ 77 1.1 uch #define MR1_TR1_DEPENDANT 0x00004000 /* Dependent Mode */ 78 1.1 uch 79 1.1 uch #define EMAC3_TMR0 0x08 /* Transmit Mode Register 0 */ 80 1.1 uch #define TMR0_GNP0 0x80000000 /* Get New Packet for Channel 0 */ 81 1.1 uch #define TMR0_GNP1 0x40000000 /* Get New Packet for Channel 1 */ 82 1.1 uch #define TMR0_GNPD 0x20000000 /* Get New Packet for Dependent mode */ 83 1.1 uch #define TMR0_FC_MASK 0x10000000 /* First Channel */ 84 1.1 uch #define TMR0_FC_CHAN0 0x00000000 /* Channel 0 */ 85 1.1 uch #define TMR0_FC_CHAN1 0x10000000 /* Channel 1 */ 86 1.1 uch 87 1.1 uch #define EMAC3_TMR1 0x0c /* Transmit Mode Register 1 */ 88 1.1 uch #define TMR1_TLR_MASK 0xf8000000 /* Transmit Low Request */ 89 1.1 uch #define TMR1_TLR_SHIFT 27 90 1.1 uch #define TMR1_TUR_MASK 0x00ff0000 /* Transmit Urgent Request */ 91 1.1 uch #define TMR1_TUR_SHIFT 16 92 1.1 uch 93 1.1 uch #define EMAC3_RMR 0x10 /* Receive Mode Register */ 94 1.1 uch #define RMR_SP 0x80000000 /* Strip Padding */ 95 1.1 uch #define RMR_SFCS 0x40000000 /* Strip FCS */ 96 1.1 uch #define RMR_RRP 0x20000000 /* Receive Runt Packets */ 97 1.1 uch #define RMR_RFP 0x10000000 /* Receive FCS Packets */ 98 1.1 uch #define RMR_ROP 0x08000000 /* Receive Oversize Packets */ 99 1.1 uch #define RMR_RPIR 0x04000000 /* Receive Packets with In Range Error */ 100 1.1 uch #define RMR_PPP 0x02000000 /* Propagate Pause Packet */ 101 1.1 uch #define RMR_PME 0x01000000 /* Promiscuous Mode Enable */ 102 1.1 uch #define RMR_PMME 0x00800000 /* Promiscuous Multicast Mode Enable */ 103 1.1 uch #define RMR_IAE 0x00400000 /* Individual Address Enable */ 104 1.1 uch #define RMR_MIAE 0x00200000 /* Multiple Individual Address Enable */ 105 1.1 uch #define RMR_BAE 0x00100000 /* Broadcast Address Enable */ 106 1.1 uch #define RMR_MAE 0x00080000 /* Multicast Address Enable */ 107 1.1 uch 108 1.1 uch #define EMAC3_ISR 0x14 /* Interrupt Status Register */ 109 1.1 uch #define ISR_OVR 0x02000000 /* Overrun Error */ 110 1.1 uch #define ISR_PP 0x01000000 /* Pause Packet */ 111 1.1 uch #define ISR_BP 0x00800000 /* Bad Packet */ 112 1.1 uch #define ISR_RP 0x00400000 /* Runt Packet */ 113 1.1 uch #define ISR_SE 0x00200000 /* Short Event */ 114 1.1 uch #define ISR_ALE 0x00100000 /* Alignment Error */ 115 1.1 uch #define ISR_BFCS 0x00080000 /* Bad FCS */ 116 1.1 uch #define ISR_PTLE 0x00040000 /* Packet Too Long Error */ 117 1.1 uch #define ISR_ORE 0x00020000 /* Out of Range Error */ 118 1.1 uch #define ISR_IRE 0x00010000 /* In Range Error */ 119 1.1 uch #define ISR_DBDM 0x00000200 /* Dead Bit Dependent Mode */ 120 1.1 uch #define ISR_DB0 0x00000100 /* Dead Bit 0 */ 121 1.1 uch #define ISR_SE0 0x00000080 /* SQE Error 0 */ 122 1.1 uch #define ISR_TE0 0x00000040 /* Transmit Error 0 */ 123 1.1 uch #define ISR_DB1 0x00000020 /* Dead Bit 1 */ 124 1.1 uch #define ISR_SE1 0x00000010 /* SQE Error 1 */ 125 1.1 uch #define ISR_TE1 0x00000008 /* Transmit Error 1 */ 126 1.1 uch #define ISR_MOS 0x00000002 /* MMA Operation Succeeded */ 127 1.1 uch #define ISR_MOF 0x00000001 /* MMA Operation Failed */ 128 1.1 uch 129 1.1 uch #define EMAC3_ISER 0x18 /* Interrupt Status Enable Register */ 130 1.1 uch #define ISER_OVR ISR_OVR 131 1.1 uch #define ISER_PP ISR_PP 132 1.1 uch #define ISER_BP ISR_BP 133 1.1 uch #define ISER_RP ISR_RP 134 1.1 uch #define ISER_SE ISR_SE 135 1.1 uch #define ISER_ALE ISR_ALE 136 1.1 uch #define ISER_BFCS ISR_BFCS 137 1.1 uch #define ISER_PTLE ISR_PTLE 138 1.1 uch #define ISER_ORE ISR_ORE 139 1.1 uch #define ISER_IRE ISR_IRE 140 1.1 uch #define ISER_DBDM ISR_DBDM 141 1.1 uch #define ISER_DB0 ISR_DB0 142 1.1 uch #define ISER_SE0 ISR_SE0 143 1.1 uch #define ISER_TE0 ISR_TE0 144 1.1 uch #define ISER_DB1 ISR_DB1 145 1.1 uch #define ISER_SE1 ISR_SE1 146 1.1 uch #define ISER_TE1 ISR_TE1 147 1.1 uch #define ISER_MOS ISR_MOS 148 1.1 uch #define ISER_MOF ISR_MOF 149 1.1 uch 150 1.1 uch #define EMAC3_IAHR 0x1c /* Individual Address High Register */ 151 1.1 uch #define EMAC3_IALR 0x20 /* Individual Address Low Register */ 152 1.1 uch #define EMAC3_VTPID 0x24 /* VLAN TPID Register */ 153 1.1 uch #define EMAC3_VTCI 0x28 /* VLAN TCI Register */ 154 1.1 uch #define EMAC3_PTR 0x2c /* Pause Timer Register */ 155 1.1 uch #define EMAC3_IAHT1 0x30 /* Individual Address Hash Table 1 */ 156 1.1 uch #define EMAC3_IAHT2 0x34 /* Individual Address Hash Table 2 */ 157 1.1 uch #define EMAC3_IAHT3 0x38 /* Individual Address Hash Table 3 */ 158 1.1 uch #define EMAC3_IAHT4 0x3c /* Individual Address Hash Table 4 */ 159 1.1 uch #define EMAC3_GAHT1 0x40 /* Group Address Hash Table 1 */ 160 1.1 uch #define EMAC3_GAHT2 0x44 /* Group Address Hash Table 2 */ 161 1.1 uch #define EMAC3_GAHT3 0x48 /* Group Address Hash Table 3 */ 162 1.1 uch #define EMAC3_GAHT4 0x4c /* Group Address Hash Table 4 */ 163 1.1 uch #define EMAC3_LSAH 0x50 /* Last Source Address High */ 164 1.1 uch #define EMAC3_LSAL 0x54 /* Last Source Address Low */ 165 1.1 uch #define EMAC3_IPGVR 0x58 /* Inter-Packet Gap Value Register */ 166 1.1 uch 167 1.1 uch #define EMAC3_STACR 0x5c /* STA Control Register */ 168 1.1 uch #define STACR_PHYD 0xffff0000 /* PHY data mask */ 169 1.1 uch #define STACR_PHYDSHIFT 16 170 1.1 uch #define STACR_OC 0x00008000 /* operation complete */ 171 1.1 uch #define STACR_PHYE 0x00004000 /* PHY error */ 172 1.1 uch #define STACR_WRITE 0x00002000 /* STA command - write */ 173 1.1 uch #define STACR_READ 0x00001000 /* STA command - read */ 174 1.1 uch #define STACR_OPBC_MASK 0x00000c00 /* OPB bus clock freq mask */ 175 1.1 uch #define STACR_OPBC_50MHZ 0x00000000 /* OPB bus clock freq - 50MHz */ 176 1.1 uch #define STACR_OPBC_66MHZ 0x00000400 /* OPB bus clock freq - 66MHz */ 177 1.1 uch #define STACR_OPBC_83MHZ 0x00000800 /* OPB bus clock freq - 83MHz */ 178 1.1 uch #define STACR_OPBC_100MHZ 0x00000c00 /* OPB bus clock freq - 100MHz */ 179 1.1 uch #define STACR_PCDA 0x000003e0 /* PHY cmd dest address mask */ 180 1.1 uch #define STACR_PCDASHIFT 5 181 1.1 uch #define STACR_PRA 0x0000001f /* PHY register address mask */ 182 1.1 uch #define STACR_PRASHIFT 0 183 1.1 uch 184 1.1 uch #define EMAC3_TRTR 0x60 /* Transmit Request Threshold Register */ 185 1.1 uch #define TRTR_64 0x00000000 /* 64 bytes */ 186 1.1 uch #define TRTR_128 0x08000000 /* 128 bytes */ 187 1.1 uch #define TRTR_192 0x10000000 /* 192 bytes */ 188 1.1 uch #define TRTR_256 0x18000000 /* 256 bytes */ 189 1.1 uch /* ... and so on +64 until ... */ 190 1.1 uch #define TRTR_2048 0xf8000000 /* 2048 bytes */ 191 1.1 uch #define TRTR_MASK 0xf8000000 192 1.1 uch #define TRTR_SHIFT 27 193 1.1 uch 194 1.1 uch #define EMAC3_RWMR 0x64 /* Receive Low/High Water Mark Register */ 195 1.1 uch #define RWMR_RLWM_MASK 0xff800000 /* Receive Low Water Mark */ 196 1.1 uch #define RWMR_RLWM_SHIFT 23 197 1.1 uch #define RWMR_RHWM_MASK 0x0000ff80 /* Receive High Water Mark */ 198 1.1 uch #define RWMR_RHWM_SHIFT 7 199 1.1 uch 200 1.1 uch #define EMAC3_OCTX 0x68 /* Number of Octets Transmitted */ 201 1.1 uch #define EMAC3_OCRX 0x6c /* Number of Octets Received */ 202 1.1 uch 203 1.1 uch 204 1.1 uch /* 205 1.1 uch * MAL buffer descriptor control/status bit definitions, in the 206 1.1 uch * md_stat_ctrl field of the MAL descriptor <playstation2/dev/if_smapreg.h> 207 1.1 uch */ 208 1.1 uch 209 1.1 uch /* EMAC transmit control definitions */ 210 1.1 uch #define EMAC_TXC_GFCS 0x0200 /* Generate FCS */ 211 1.1 uch #define EMAC_TXC_GPAD 0x0100 /* Generate padding */ 212 1.1 uch #define EMAC_TXC_ISA 0x0080 /* Insert Source Address */ 213 1.1 uch #define EMAC_TXC_RSA 0x0040 /* Replace Source Address */ 214 1.1 uch #define EMAC_TXC_IVT 0x0020 /* Insert VLAN Tag */ 215 1.1 uch #define EMAC_TXC_RVT 0x0010 /* Replace VLAN Tag */ 216 1.1 uch 217 1.1 uch /* EMAC transmit status definitions */ 218 1.1 uch #define EMAC_TXS_BFCS 0x0200 /* Bad FCS */ 219 1.1 uch #define EMAC_TXS_BPP 0x0100 /* Bad previous packet */ 220 1.1 uch #define EMAC_TXS_LCS 0x0080 /* Loss of carrier sense */ 221 1.1 uch #define EMAC_TXS_ED 0x0040 /* Excessive deferral */ 222 1.1 uch #define EMAC_TXS_EC 0x0020 /* Excessive collisions */ 223 1.1 uch #define EMAC_TXS_LC 0x0010 /* Late collision */ 224 1.1 uch #define EMAC_TXS_MC 0x0008 /* Multiple collision */ 225 1.1 uch #define EMAC_TXS_SC 0x0004 /* Single collision */ 226 1.1 uch #define EMAC_TXS_UR 0x0002 /* Underrun */ 227 1.1 uch #define EMAC_TXS_SQE 0x0001 /* Signal Quality Error */ 228 1.1 uch 229 1.1 uch /* EMAC receive status definitions */ 230 1.1 uch #define EMAC_RXS_OE 0x0200 /* Overrun error */ 231 1.1 uch #define EMAC_RXS_PP 0x0100 /* Pause packet received */ 232 1.1 uch #define EMAC_RXS_BP 0x0080 /* Bad packet */ 233 1.1 uch #define EMAC_RXS_RP 0x0040 /* Runt packet */ 234 1.1 uch #define EMAC_RXS_SE 0x0020 /* Short event */ 235 1.1 uch #define EMAC_RXS_AE 0x0010 /* Alignment error */ 236 1.1 uch #define EMAC_RXS_BFCS 0x0008 /* Bad FCS */ 237 1.1 uch #define EMAC_RXS_PTL 0x0004 /* Packet too long */ 238 1.1 uch #define EMAC_RXS_ORE 0x0002 /* Out of range error */ 239 1.1 uch #define EMAC_RXS_IRE 0x0001 /* In range error */ 240