| 1 |
610 |
jeremybenn |
//*****************************************************************************
|
| 2 |
|
|
//
|
| 3 |
|
|
// hw_ethernet.h - Macros used when accessing the Ethernet hardware.
|
| 4 |
|
|
//
|
| 5 |
|
|
// Copyright (c) 2006-2008 Luminary Micro, Inc. All rights reserved.
|
| 6 |
|
|
//
|
| 7 |
|
|
// Software License Agreement
|
| 8 |
|
|
//
|
| 9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
| 10 |
|
|
// exclusively on LMI's microcontroller products.
|
| 11 |
|
|
//
|
| 12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
| 13 |
|
|
// applicable copyright laws. All rights are reserved. You may not combine
|
| 14 |
|
|
// this software with "viral" open-source software in order to form a larger
|
| 15 |
|
|
// program. Any use in violation of the foregoing restrictions may subject
|
| 16 |
|
|
// the user to criminal sanctions under applicable laws, as well as to civil
|
| 17 |
|
|
// liability for the breach of the terms and conditions of this license.
|
| 18 |
|
|
//
|
| 19 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
| 20 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
| 21 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
| 22 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
| 23 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
| 24 |
|
|
//
|
| 25 |
|
|
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
|
| 26 |
|
|
//
|
| 27 |
|
|
//*****************************************************************************
|
| 28 |
|
|
|
| 29 |
|
|
#ifndef __HW_ETHERNET_H__
|
| 30 |
|
|
#define __HW_ETHERNET_H__
|
| 31 |
|
|
|
| 32 |
|
|
//*****************************************************************************
|
| 33 |
|
|
//
|
| 34 |
|
|
// The following are defines for the MAC register offsets in the Ethernet
|
| 35 |
|
|
// Controller.
|
| 36 |
|
|
//
|
| 37 |
|
|
//*****************************************************************************
|
| 38 |
|
|
#define MAC_O_RIS 0x00000000 // Ethernet MAC Raw Interrupt
|
| 39 |
|
|
// Status
|
| 40 |
|
|
#define MAC_O_IACK 0x00000000 // Interrupt Acknowledge Register
|
| 41 |
|
|
#define MAC_O_IM 0x00000004 // Interrupt Mask Register
|
| 42 |
|
|
#define MAC_O_RCTL 0x00000008 // Receive Control Register
|
| 43 |
|
|
#define MAC_O_TCTL 0x0000000C // Transmit Control Register
|
| 44 |
|
|
#define MAC_O_DATA 0x00000010 // Data Register
|
| 45 |
|
|
#define MAC_O_IA0 0x00000014 // Individual Address Register 0
|
| 46 |
|
|
#define MAC_O_IA1 0x00000018 // Individual Address Register 1
|
| 47 |
|
|
#define MAC_O_THR 0x0000001C // Threshold Register
|
| 48 |
|
|
#define MAC_O_MCTL 0x00000020 // Management Control Register
|
| 49 |
|
|
#define MAC_O_MDV 0x00000024 // Management Divider Register
|
| 50 |
|
|
#define MAC_O_MTXD 0x0000002C // Management Transmit Data Reg
|
| 51 |
|
|
#define MAC_O_MRXD 0x00000030 // Management Receive Data Reg
|
| 52 |
|
|
#define MAC_O_NP 0x00000034 // Number of Packets Register
|
| 53 |
|
|
#define MAC_O_TR 0x00000038 // Transmission Request Register
|
| 54 |
|
|
#define MAC_O_TS 0x0000003C // Timer Support Register
|
| 55 |
|
|
|
| 56 |
|
|
//*****************************************************************************
|
| 57 |
|
|
//
|
| 58 |
|
|
// The following are defines for the bit fields in the MAC_IACK register.
|
| 59 |
|
|
//
|
| 60 |
|
|
//*****************************************************************************
|
| 61 |
|
|
#define MAC_IACK_PHYINT 0x00000040 // Clear PHY Interrupt
|
| 62 |
|
|
#define MAC_IACK_MDINT 0x00000020 // Clear MDI Transaction Complete
|
| 63 |
|
|
#define MAC_IACK_RXER 0x00000010 // Clear RX Error
|
| 64 |
|
|
#define MAC_IACK_FOV 0x00000008 // Clear RX FIFO Overrun
|
| 65 |
|
|
#define MAC_IACK_TXEMP 0x00000004 // Clear TX FIFO Empy
|
| 66 |
|
|
#define MAC_IACK_TXER 0x00000002 // Clear TX Error
|
| 67 |
|
|
#define MAC_IACK_RXINT 0x00000001 // Clear RX Packet Available
|
| 68 |
|
|
|
| 69 |
|
|
//*****************************************************************************
|
| 70 |
|
|
//
|
| 71 |
|
|
// The following are defines for the bit fields in the MAC_IM register.
|
| 72 |
|
|
//
|
| 73 |
|
|
//*****************************************************************************
|
| 74 |
|
|
#define MAC_IM_PHYINTM 0x00000040 // Mask PHY Interrupt
|
| 75 |
|
|
#define MAC_IM_MDINTM 0x00000020 // Mask MDI Transaction Complete
|
| 76 |
|
|
#define MAC_IM_RXERM 0x00000010 // Mask RX Error
|
| 77 |
|
|
#define MAC_IM_FOVM 0x00000008 // Mask RX FIFO Overrun
|
| 78 |
|
|
#define MAC_IM_TXEMPM 0x00000004 // Mask TX FIFO Empy
|
| 79 |
|
|
#define MAC_IM_TXERM 0x00000002 // Mask TX Error
|
| 80 |
|
|
#define MAC_IM_RXINTM 0x00000001 // Mask RX Packet Available
|
| 81 |
|
|
|
| 82 |
|
|
//*****************************************************************************
|
| 83 |
|
|
//
|
| 84 |
|
|
// The following are defines for the bit fields in the MAC_RCTL register.
|
| 85 |
|
|
//
|
| 86 |
|
|
//*****************************************************************************
|
| 87 |
|
|
#define MAC_RCTL_RSTFIFO 0x00000010 // Clear the Receive FIFO
|
| 88 |
|
|
#define MAC_RCTL_BADCRC 0x00000008 // Reject Packets With Bad CRC
|
| 89 |
|
|
#define MAC_RCTL_PRMS 0x00000004 // Enable Promiscuous Mode
|
| 90 |
|
|
#define MAC_RCTL_AMUL 0x00000002 // Enable Multicast Packets
|
| 91 |
|
|
#define MAC_RCTL_RXEN 0x00000001 // Enable Ethernet Receiver
|
| 92 |
|
|
|
| 93 |
|
|
//*****************************************************************************
|
| 94 |
|
|
//
|
| 95 |
|
|
// The following are defines for the bit fields in the MAC_TCTL register.
|
| 96 |
|
|
//
|
| 97 |
|
|
//*****************************************************************************
|
| 98 |
|
|
#define MAC_TCTL_DUPLEX 0x00000010 // Enable Duplex mode
|
| 99 |
|
|
#define MAC_TCTL_CRC 0x00000004 // Enable CRC Generation
|
| 100 |
|
|
#define MAC_TCTL_PADEN 0x00000002 // Enable Automatic Padding
|
| 101 |
|
|
#define MAC_TCTL_TXEN 0x00000001 // Enable Ethernet Transmitter
|
| 102 |
|
|
|
| 103 |
|
|
//*****************************************************************************
|
| 104 |
|
|
//
|
| 105 |
|
|
// The following are defines for the bit fields in the MAC_IA0 register.
|
| 106 |
|
|
//
|
| 107 |
|
|
//*****************************************************************************
|
| 108 |
|
|
#define MAC_IA0_MACOCT4_M 0xFF000000 // MAC Address Octet 4.
|
| 109 |
|
|
#define MAC_IA0_MACOCT3_M 0x00FF0000 // MAC Address Octet 3.
|
| 110 |
|
|
#define MAC_IA0_MACOCT2_M 0x0000FF00 // MAC Address Octet 2.
|
| 111 |
|
|
#define MAC_IA0_MACOCT1_M 0x000000FF // MAC Address Octet 1.
|
| 112 |
|
|
#define MAC_IA0_MACOCT4_S 24
|
| 113 |
|
|
#define MAC_IA0_MACOCT3_S 16
|
| 114 |
|
|
#define MAC_IA0_MACOCT2_S 8
|
| 115 |
|
|
#define MAC_IA0_MACOCT1_S 0
|
| 116 |
|
|
|
| 117 |
|
|
//*****************************************************************************
|
| 118 |
|
|
//
|
| 119 |
|
|
// The following are defines for the bit fields in the MAC_IA1 register.
|
| 120 |
|
|
//
|
| 121 |
|
|
//*****************************************************************************
|
| 122 |
|
|
#define MAC_IA1_MACOCT6_M 0x0000FF00 // MAC Address Octet 6.
|
| 123 |
|
|
#define MAC_IA1_MACOCT5_M 0x000000FF // MAC Address Octet 5.
|
| 124 |
|
|
#define MAC_IA1_MACOCT6_S 8
|
| 125 |
|
|
#define MAC_IA1_MACOCT5_S 0
|
| 126 |
|
|
|
| 127 |
|
|
//*****************************************************************************
|
| 128 |
|
|
//
|
| 129 |
|
|
// The following are defines for the bit fields in the MAC_TXTH register.
|
| 130 |
|
|
//
|
| 131 |
|
|
//*****************************************************************************
|
| 132 |
|
|
#define MAC_THR_THRESH_M 0x0000003F // Threshold Value.
|
| 133 |
|
|
#define MAC_THR_THRESH_S 0
|
| 134 |
|
|
|
| 135 |
|
|
//*****************************************************************************
|
| 136 |
|
|
//
|
| 137 |
|
|
// The following are defines for the bit fields in the MAC_MCTL register.
|
| 138 |
|
|
//
|
| 139 |
|
|
//*****************************************************************************
|
| 140 |
|
|
#define MAC_MCTL_REGADR_M 0x000000F8 // MII Register Address.
|
| 141 |
|
|
#define MAC_MCTL_WRITE 0x00000002 // Next MII Transaction is Write
|
| 142 |
|
|
#define MAC_MCTL_START 0x00000001 // Start MII Transaction
|
| 143 |
|
|
#define MAC_MCTL_REGADR_S 3
|
| 144 |
|
|
|
| 145 |
|
|
//*****************************************************************************
|
| 146 |
|
|
//
|
| 147 |
|
|
// The following are defines for the bit fields in the MAC_MDV register.
|
| 148 |
|
|
//
|
| 149 |
|
|
//*****************************************************************************
|
| 150 |
|
|
#define MAC_MDV_DIV_M 0x000000FF // Clock Divider.
|
| 151 |
|
|
#define MAC_MDV_DIV_S 0
|
| 152 |
|
|
|
| 153 |
|
|
//*****************************************************************************
|
| 154 |
|
|
//
|
| 155 |
|
|
// The following are defines for the bit fields in the MAC_MTXD register.
|
| 156 |
|
|
//
|
| 157 |
|
|
//*****************************************************************************
|
| 158 |
|
|
#define MAC_MTXD_MDTX_M 0x0000FFFF // MII Register Transmit Data.
|
| 159 |
|
|
#define MAC_MTXD_MDTX_S 0
|
| 160 |
|
|
|
| 161 |
|
|
//*****************************************************************************
|
| 162 |
|
|
//
|
| 163 |
|
|
// The following are defines for the bit fields in the MAC_MRXD register.
|
| 164 |
|
|
//
|
| 165 |
|
|
//*****************************************************************************
|
| 166 |
|
|
#define MAC_MRXD_MDRX_M 0x0000FFFF // MII Register Receive Data.
|
| 167 |
|
|
#define MAC_MRXD_MDRX_S 0
|
| 168 |
|
|
|
| 169 |
|
|
//*****************************************************************************
|
| 170 |
|
|
//
|
| 171 |
|
|
// The following are defines for the bit fields in the MAC_NP register.
|
| 172 |
|
|
//
|
| 173 |
|
|
//*****************************************************************************
|
| 174 |
|
|
#define MAC_NP_NPR_M 0x0000003F // Number of Packets in Receive
|
| 175 |
|
|
// FIFO.
|
| 176 |
|
|
#define MAC_NP_NPR_S 0
|
| 177 |
|
|
|
| 178 |
|
|
//*****************************************************************************
|
| 179 |
|
|
//
|
| 180 |
|
|
// The following are defines for the bit fields in the MAC_TXRQ register.
|
| 181 |
|
|
//
|
| 182 |
|
|
//*****************************************************************************
|
| 183 |
|
|
#define MAC_TR_NEWTX 0x00000001 // Start an Ethernet Transmission
|
| 184 |
|
|
|
| 185 |
|
|
//*****************************************************************************
|
| 186 |
|
|
//
|
| 187 |
|
|
// The following are defines for the bit fields in the MAC_TS register.
|
| 188 |
|
|
//
|
| 189 |
|
|
//*****************************************************************************
|
| 190 |
|
|
#define MAC_TS_TSEN 0x00000001 // Enable Timestamp Logic
|
| 191 |
|
|
|
| 192 |
|
|
//*****************************************************************************
|
| 193 |
|
|
//
|
| 194 |
|
|
// The following are defines for the Ethernet Controller PHY registers.
|
| 195 |
|
|
//
|
| 196 |
|
|
//*****************************************************************************
|
| 197 |
|
|
#define PHY_MR24 0x00000018 // Ethernet PHY Management Register
|
| 198 |
|
|
// 24 -MDI/MDIX Control
|
| 199 |
|
|
#define PHY_MR23 0x00000017 // Ethernet PHY Management Register
|
| 200 |
|
|
// 23 - LED Configuration
|
| 201 |
|
|
#define PHY_MR19 0x00000013 // Ethernet PHY Management Register
|
| 202 |
|
|
// 19 - Transceiver Control
|
| 203 |
|
|
#define PHY_MR18 0x00000012 // Ethernet PHY Management Register
|
| 204 |
|
|
// 18 - Diagnostic
|
| 205 |
|
|
#define PHY_MR17 0x00000011 // Ethernet PHY Management Register
|
| 206 |
|
|
// 17 - Interrupt Control/Status
|
| 207 |
|
|
#define PHY_MR16 0x00000010 // Ethernet PHY Management Register
|
| 208 |
|
|
// 16 - Vendor-Specific
|
| 209 |
|
|
#define PHY_MR6 0x00000006 // Ethernet PHY Management Register
|
| 210 |
|
|
// 6 - Auto-Negotiation Expansion
|
| 211 |
|
|
#define PHY_MR5 0x00000005 // Ethernet PHY Management Register
|
| 212 |
|
|
// 5 - Auto-Negotiation Link
|
| 213 |
|
|
// Partner Base Page Ability
|
| 214 |
|
|
#define PHY_MR4 0x00000004 // Ethernet PHY Management Register
|
| 215 |
|
|
// 4 - Auto-Negotiation
|
| 216 |
|
|
// Advertisement
|
| 217 |
|
|
#define PHY_MR3 0x00000003 // Ethernet PHY Management Register
|
| 218 |
|
|
// 3 - PHY Identifier 2
|
| 219 |
|
|
#define PHY_MR2 0x00000002 // Ethernet PHY Management Register
|
| 220 |
|
|
// 2 - PHY Identifier 1
|
| 221 |
|
|
#define PHY_MR1 0x00000001 // Ethernet PHY Management Register
|
| 222 |
|
|
// 1 - Status
|
| 223 |
|
|
#define PHY_MR0 0x00000000 // Ethernet PHY Management Register
|
| 224 |
|
|
// 0 - Control
|
| 225 |
|
|
|
| 226 |
|
|
//*****************************************************************************
|
| 227 |
|
|
//
|
| 228 |
|
|
// The following are defines for the bit fields in the PHY_MR0 register.
|
| 229 |
|
|
//
|
| 230 |
|
|
//*****************************************************************************
|
| 231 |
|
|
#define PHY_MR0_RESET 0x00008000 // Reset Registers.
|
| 232 |
|
|
#define PHY_MR0_LOOPBK 0x00004000 // Loopback Mode.
|
| 233 |
|
|
#define PHY_MR0_SPEEDSL 0x00002000 // Speed Select.
|
| 234 |
|
|
#define PHY_MR0_ANEGEN 0x00001000 // Auto-Negotiation Enable.
|
| 235 |
|
|
#define PHY_MR0_PWRDN 0x00000800 // Power Down.
|
| 236 |
|
|
#define PHY_MR0_ISO 0x00000400 // Isolate.
|
| 237 |
|
|
#define PHY_MR0_RANEG 0x00000200 // Restart Auto-Negotiation.
|
| 238 |
|
|
#define PHY_MR0_DUPLEX 0x00000100 // Set Duplex Mode.
|
| 239 |
|
|
#define PHY_MR0_COLT 0x00000080 // Collision Test.
|
| 240 |
|
|
|
| 241 |
|
|
//*****************************************************************************
|
| 242 |
|
|
//
|
| 243 |
|
|
// The following are defines for the bit fields in the MAC_O_RIS register.
|
| 244 |
|
|
//
|
| 245 |
|
|
//*****************************************************************************
|
| 246 |
|
|
#define MAC_RIS_PHYINT 0x00000040 // PHY Interrupt.
|
| 247 |
|
|
#define MAC_RIS_MDINT 0x00000020 // MII Transaction Complete.
|
| 248 |
|
|
#define MAC_RIS_RXER 0x00000010 // Receive Error.
|
| 249 |
|
|
#define MAC_RIS_FOV 0x00000008 // FIFO Overrrun.
|
| 250 |
|
|
#define MAC_RIS_TXEMP 0x00000004 // Transmit FIFO Empty.
|
| 251 |
|
|
#define MAC_RIS_TXER 0x00000002 // Transmit Error.
|
| 252 |
|
|
#define MAC_RIS_RXINT 0x00000001 // Packet Received.
|
| 253 |
|
|
|
| 254 |
|
|
//*****************************************************************************
|
| 255 |
|
|
//
|
| 256 |
|
|
// The following are defines for the bit fields in the PHY_MR1 register.
|
| 257 |
|
|
//
|
| 258 |
|
|
//*****************************************************************************
|
| 259 |
|
|
#define PHY_MR1_100X_F 0x00004000 // 100BASE-TX Full-Duplex Mode.
|
| 260 |
|
|
#define PHY_MR1_100X_H 0x00002000 // 100BASE-TX Half-Duplex Mode.
|
| 261 |
|
|
#define PHY_MR1_10T_F 0x00001000 // 10BASE-T Full-Duplex Mode.
|
| 262 |
|
|
#define PHY_MR1_10T_H 0x00000800 // 10BASE-T Half-Duplex Mode.
|
| 263 |
|
|
#define PHY_MR1_MFPS 0x00000040 // Management Frames with Preamble
|
| 264 |
|
|
// Suppressed.
|
| 265 |
|
|
#define PHY_MR1_ANEGC 0x00000020 // Auto-Negotiation Complete.
|
| 266 |
|
|
#define PHY_MR1_RFAULT 0x00000010 // Remote Fault.
|
| 267 |
|
|
#define PHY_MR1_ANEGA 0x00000008 // Auto-Negotiation.
|
| 268 |
|
|
#define PHY_MR1_LINK 0x00000004 // Link Made.
|
| 269 |
|
|
#define PHY_MR1_JAB 0x00000002 // Jabber Condition.
|
| 270 |
|
|
#define PHY_MR1_EXTD 0x00000001 // Extended Capabilities.
|
| 271 |
|
|
|
| 272 |
|
|
//*****************************************************************************
|
| 273 |
|
|
//
|
| 274 |
|
|
// The following are defines for the bit fields in the PHY_MR2 register.
|
| 275 |
|
|
//
|
| 276 |
|
|
//*****************************************************************************
|
| 277 |
|
|
#define PHY_MR2_OUI_M 0x0000FFFF // Organizationally Unique
|
| 278 |
|
|
// Identifier[21:6].
|
| 279 |
|
|
#define PHY_MR2_OUI_S 0
|
| 280 |
|
|
|
| 281 |
|
|
//*****************************************************************************
|
| 282 |
|
|
//
|
| 283 |
|
|
// The following are defines for the bit fields in the PHY_MR3 register.
|
| 284 |
|
|
//
|
| 285 |
|
|
//*****************************************************************************
|
| 286 |
|
|
#define PHY_MR3_OUI_M 0x0000FC00 // Organizationally Unique
|
| 287 |
|
|
// Identifier[5:0].
|
| 288 |
|
|
#define PHY_MR3_MN_M 0x000003F0 // Model Number.
|
| 289 |
|
|
#define PHY_MR3_RN_M 0x0000000F // Revision Number.
|
| 290 |
|
|
#define PHY_MR3_OUI_S 10
|
| 291 |
|
|
#define PHY_MR3_MN_S 4
|
| 292 |
|
|
#define PHY_MR3_RN_S 0
|
| 293 |
|
|
|
| 294 |
|
|
//*****************************************************************************
|
| 295 |
|
|
//
|
| 296 |
|
|
// The following are defines for the bit fields in the PHY_MR4 register.
|
| 297 |
|
|
//
|
| 298 |
|
|
//*****************************************************************************
|
| 299 |
|
|
#define PHY_MR4_NP 0x00008000 // Next Page.
|
| 300 |
|
|
#define PHY_MR4_RF 0x00002000 // Remote Fault.
|
| 301 |
|
|
#define PHY_MR4_A3 0x00000100 // Technology Ability Field[3].
|
| 302 |
|
|
#define PHY_MR4_A2 0x00000080 // Technology Ability Field[2].
|
| 303 |
|
|
#define PHY_MR4_A1 0x00000040 // Technology Ability Field[1].
|
| 304 |
|
|
#define PHY_MR4_A0 0x00000020 // Technology Ability Field[0].
|
| 305 |
|
|
#define PHY_MR4_S_M 0x0000001F // Selector Field.
|
| 306 |
|
|
#define PHY_MR4_S_S 0
|
| 307 |
|
|
|
| 308 |
|
|
//*****************************************************************************
|
| 309 |
|
|
//
|
| 310 |
|
|
// The following are defines for the bit fields in the PHY_MR5 register.
|
| 311 |
|
|
//
|
| 312 |
|
|
//*****************************************************************************
|
| 313 |
|
|
#define PHY_MR5_NP 0x00008000 // Next Page.
|
| 314 |
|
|
#define PHY_MR5_ACK 0x00004000 // Acknowledge.
|
| 315 |
|
|
#define PHY_MR5_RF 0x00002000 // Remote Fault.
|
| 316 |
|
|
#define PHY_MR5_A_M 0x00001FE0 // Technology Ability Field.
|
| 317 |
|
|
#define PHY_MR5_S_M 0x0000001F // Selector Field.
|
| 318 |
|
|
#define PHY_MR5_S_8023 0x00000001 // IEEE Std 802.3
|
| 319 |
|
|
#define PHY_MR5_S_8029 0x00000002 // IEEE Std 802.9 ISLAN-16T
|
| 320 |
|
|
#define PHY_MR5_S_8025 0x00000003 // IEEE Std 802.5
|
| 321 |
|
|
#define PHY_MR5_S_1394 0x00000004 // IEEE Std 1394
|
| 322 |
|
|
#define PHY_MR5_A_S 5
|
| 323 |
|
|
|
| 324 |
|
|
//*****************************************************************************
|
| 325 |
|
|
//
|
| 326 |
|
|
// The following are defines for the bit fields in the PHY_MR6 register.
|
| 327 |
|
|
//
|
| 328 |
|
|
//*****************************************************************************
|
| 329 |
|
|
#define PHY_MR6_PDF 0x00000010 // Parallel Detection Fault.
|
| 330 |
|
|
#define PHY_MR6_LPNPA 0x00000008 // Link Partner is Next Page Able.
|
| 331 |
|
|
#define PHY_MR6_PRX 0x00000002 // New Page Received.
|
| 332 |
|
|
#define PHY_MR6_LPANEGA 0x00000001 // Link Partner is Auto-Negotiation
|
| 333 |
|
|
// Able.
|
| 334 |
|
|
|
| 335 |
|
|
//*****************************************************************************
|
| 336 |
|
|
//
|
| 337 |
|
|
// The following are defines for the bit fields in the MAC_O_DATA register.
|
| 338 |
|
|
//
|
| 339 |
|
|
//*****************************************************************************
|
| 340 |
|
|
#define MAC_DATA_TXDATA_M 0xFFFFFFFF // Transmit FIFO Data.
|
| 341 |
|
|
#define MAC_DATA_RXDATA_M 0xFFFFFFFF // Receive FIFO Data.
|
| 342 |
|
|
#define MAC_DATA_RXDATA_S 0
|
| 343 |
|
|
#define MAC_DATA_TXDATA_S 0
|
| 344 |
|
|
|
| 345 |
|
|
//*****************************************************************************
|
| 346 |
|
|
//
|
| 347 |
|
|
// The following are defines for the bit fields in the PHY_MR16 register.
|
| 348 |
|
|
//
|
| 349 |
|
|
//*****************************************************************************
|
| 350 |
|
|
#define PHY_MR16_RPTR 0x00008000 // Repeater Mode.
|
| 351 |
|
|
#define PHY_MR16_INPOL 0x00004000 // Interrupt Polarity.
|
| 352 |
|
|
#define PHY_MR16_TXHIM 0x00001000 // Transmit High Impedance Mode.
|
| 353 |
|
|
#define PHY_MR16_SQEI 0x00000800 // SQE Inhibit Testing.
|
| 354 |
|
|
#define PHY_MR16_NL10 0x00000400 // Natural Loopback Mode.
|
| 355 |
|
|
#define PHY_MR16_APOL 0x00000020 // Auto-Polarity Disable.
|
| 356 |
|
|
#define PHY_MR16_RVSPOL 0x00000010 // Receive Data Polarity.
|
| 357 |
|
|
#define PHY_MR16_PCSBP 0x00000002 // PCS Bypass.
|
| 358 |
|
|
#define PHY_MR16_RXCC 0x00000001 // Receive Clock Control.
|
| 359 |
|
|
|
| 360 |
|
|
//*****************************************************************************
|
| 361 |
|
|
//
|
| 362 |
|
|
// The following are defines for the bit fields in the PHY_MR17 register.
|
| 363 |
|
|
//
|
| 364 |
|
|
//*****************************************************************************
|
| 365 |
|
|
#define PHY_MR17_JABBER_IE 0x00008000 // Jabber Interrupt Enable.
|
| 366 |
|
|
#define PHY_MR17_RXER_IE 0x00004000 // Receive Error Interrupt Enable.
|
| 367 |
|
|
#define PHY_MR17_PRX_IE 0x00002000 // Page Received Interrupt Enable.
|
| 368 |
|
|
#define PHY_MR17_PDF_IE 0x00001000 // Parallel Detection Fault
|
| 369 |
|
|
// Interrupt Enable.
|
| 370 |
|
|
#define PHY_MR17_LPACK_IE 0x00000800 // LP Acknowledge Interrupt Enable.
|
| 371 |
|
|
#define PHY_MR17_LSCHG_IE 0x00000400 // Link Status Change Interrupt
|
| 372 |
|
|
// Enable.
|
| 373 |
|
|
#define PHY_MR17_RFAULT_IE 0x00000200 // Remote Fault Interrupt Enable.
|
| 374 |
|
|
#define PHY_MR17_ANEGCOMP_IE 0x00000100 // Auto-Negotiation Complete
|
| 375 |
|
|
// Interrupt Enable.
|
| 376 |
|
|
#define PHY_MR17_JABBER_INT 0x00000080 // Jabber Event Interrupt.
|
| 377 |
|
|
#define PHY_MR17_RXER_INT 0x00000040 // Receive Error Interrupt.
|
| 378 |
|
|
#define PHY_MR17_PRX_INT 0x00000020 // Page Receive Interrupt.
|
| 379 |
|
|
#define PHY_MR17_PDF_INT 0x00000010 // Parallel Detection Fault
|
| 380 |
|
|
// Interrupt.
|
| 381 |
|
|
#define PHY_MR17_LPACK_INT 0x00000008 // LP Acknowledge Interrupt.
|
| 382 |
|
|
#define PHY_MR17_LSCHG_INT 0x00000004 // Link Status Change Interrupt.
|
| 383 |
|
|
#define PHY_MR17_RFAULT_INT 0x00000002 // Remote Fault Interrupt.
|
| 384 |
|
|
#define PHY_MR17_ANEGCOMP_INT 0x00000001 // Auto-Negotiation Complete
|
| 385 |
|
|
// Interrupt.
|
| 386 |
|
|
|
| 387 |
|
|
//*****************************************************************************
|
| 388 |
|
|
//
|
| 389 |
|
|
// The following are defines for the bit fields in the PHY_MR18 register.
|
| 390 |
|
|
//
|
| 391 |
|
|
//*****************************************************************************
|
| 392 |
|
|
#define PHY_MR18_ANEGF 0x00001000 // Auto-Negotiation Failure.
|
| 393 |
|
|
#define PHY_MR18_DPLX 0x00000800 // Duplex Mode.
|
| 394 |
|
|
#define PHY_MR18_RATE 0x00000400 // Rate.
|
| 395 |
|
|
#define PHY_MR18_RXSD 0x00000200 // Receive Detection.
|
| 396 |
|
|
#define PHY_MR18_RX_LOCK 0x00000100 // Receive PLL Lock.
|
| 397 |
|
|
|
| 398 |
|
|
//*****************************************************************************
|
| 399 |
|
|
//
|
| 400 |
|
|
// The following are defines for the bit fields in the PHY_MR19 register.
|
| 401 |
|
|
//
|
| 402 |
|
|
//*****************************************************************************
|
| 403 |
|
|
#define PHY_MR19_TXO_M 0x0000C000 // Transmit Amplitude Selection.
|
| 404 |
|
|
#define PHY_MR19_TXO_00DB 0x00000000 // Gain set for 0.0dB of insertion
|
| 405 |
|
|
// loss
|
| 406 |
|
|
#define PHY_MR19_TXO_04DB 0x00004000 // Gain set for 0.4dB of insertion
|
| 407 |
|
|
// loss
|
| 408 |
|
|
#define PHY_MR19_TXO_08DB 0x00008000 // Gain set for 0.8dB of insertion
|
| 409 |
|
|
// loss
|
| 410 |
|
|
#define PHY_MR19_TXO_12DB 0x0000C000 // Gain set for 1.2dB of insertion
|
| 411 |
|
|
// loss
|
| 412 |
|
|
|
| 413 |
|
|
//*****************************************************************************
|
| 414 |
|
|
//
|
| 415 |
|
|
// The following are defines for the bit fields in the PHY_MR23 register.
|
| 416 |
|
|
//
|
| 417 |
|
|
//*****************************************************************************
|
| 418 |
|
|
#define PHY_MR23_LED1_M 0x000000F0 // LED1 Source.
|
| 419 |
|
|
#define PHY_MR23_LED1_LINK 0x00000000 // Link OK
|
| 420 |
|
|
#define PHY_MR23_LED1_RXTX 0x00000010 // RX or TX Activity (Default LED1)
|
| 421 |
|
|
#define PHY_MR23_LED1_TX 0x00000020 // TX Activity
|
| 422 |
|
|
#define PHY_MR23_LED1_RX 0x00000030 // RX Activity
|
| 423 |
|
|
#define PHY_MR23_LED1_COL 0x00000040 // Collision
|
| 424 |
|
|
#define PHY_MR23_LED1_100 0x00000050 // 100BASE-TX mode
|
| 425 |
|
|
#define PHY_MR23_LED1_10 0x00000060 // 10BASE-T mode
|
| 426 |
|
|
#define PHY_MR23_LED1_DUPLEX 0x00000070 // Full-Duplex
|
| 427 |
|
|
#define PHY_MR23_LED1_LINKACT 0x00000080 // Link OK & Blink=RX or TX
|
| 428 |
|
|
// Activity
|
| 429 |
|
|
#define PHY_MR23_LED0_M 0x0000000F // LED0 Source.
|
| 430 |
|
|
#define PHY_MR23_LED0_LINK 0x00000000 // Link OK (Default LED0)
|
| 431 |
|
|
#define PHY_MR23_LED0_RXTX 0x00000001 // RX or TX Activity
|
| 432 |
|
|
#define PHY_MR23_LED0_TX 0x00000002 // TX Activity
|
| 433 |
|
|
#define PHY_MR23_LED0_RX 0x00000003 // RX Activity
|
| 434 |
|
|
#define PHY_MR23_LED0_COL 0x00000004 // Collision
|
| 435 |
|
|
#define PHY_MR23_LED0_100 0x00000005 // 100BASE-TX mode
|
| 436 |
|
|
#define PHY_MR23_LED0_10 0x00000006 // 10BASE-T mode
|
| 437 |
|
|
#define PHY_MR23_LED0_DUPLEX 0x00000007 // Full-Duplex
|
| 438 |
|
|
#define PHY_MR23_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
|
| 439 |
|
|
// Activity
|
| 440 |
|
|
|
| 441 |
|
|
//*****************************************************************************
|
| 442 |
|
|
//
|
| 443 |
|
|
// The following are defines for the bit fields in the PHY_MR24 register.
|
| 444 |
|
|
//
|
| 445 |
|
|
//*****************************************************************************
|
| 446 |
|
|
#define PHY_MR24_PD_MODE 0x00000080 // Parallel Detection Mode.
|
| 447 |
|
|
#define PHY_MR24_AUTO_SW 0x00000040 // Auto-Switching Enable.
|
| 448 |
|
|
#define PHY_MR24_MDIX 0x00000020 // Auto-Switching Configuration.
|
| 449 |
|
|
#define PHY_MR24_MDIX_CM 0x00000010 // Auto-Switching Complete.
|
| 450 |
|
|
#define PHY_MR24_MDIX_SD_M 0x0000000F // Auto-Switching Seed.
|
| 451 |
|
|
#define PHY_MR24_MDIX_SD_S 0
|
| 452 |
|
|
|
| 453 |
|
|
//*****************************************************************************
|
| 454 |
|
|
//
|
| 455 |
|
|
// The following definitions are deprecated.
|
| 456 |
|
|
//
|
| 457 |
|
|
//*****************************************************************************
|
| 458 |
|
|
#ifndef DEPRECATED
|
| 459 |
|
|
|
| 460 |
|
|
//*****************************************************************************
|
| 461 |
|
|
//
|
| 462 |
|
|
// The following are deprecated defines for the MAC register offsets in the
|
| 463 |
|
|
// Ethernet Controller.
|
| 464 |
|
|
//
|
| 465 |
|
|
//*****************************************************************************
|
| 466 |
|
|
#define MAC_O_IS 0x00000000 // Interrupt Status Register
|
| 467 |
|
|
#define MAC_O_MADD 0x00000028 // Management Address Register
|
| 468 |
|
|
|
| 469 |
|
|
//*****************************************************************************
|
| 470 |
|
|
//
|
| 471 |
|
|
// The following are deprecated defines for the reset values of the MAC
|
| 472 |
|
|
// registers.
|
| 473 |
|
|
//
|
| 474 |
|
|
//*****************************************************************************
|
| 475 |
|
|
#define MAC_RV_MDV 0x00000080
|
| 476 |
|
|
#define MAC_RV_IM 0x0000007F
|
| 477 |
|
|
#define MAC_RV_THR 0x0000003F
|
| 478 |
|
|
#define MAC_RV_RCTL 0x00000008
|
| 479 |
|
|
#define MAC_RV_IA0 0x00000000
|
| 480 |
|
|
#define MAC_RV_TCTL 0x00000000
|
| 481 |
|
|
#define MAC_RV_DATA 0x00000000
|
| 482 |
|
|
#define MAC_RV_MRXD 0x00000000
|
| 483 |
|
|
#define MAC_RV_TR 0x00000000
|
| 484 |
|
|
#define MAC_RV_IS 0x00000000
|
| 485 |
|
|
#define MAC_RV_NP 0x00000000
|
| 486 |
|
|
#define MAC_RV_MCTL 0x00000000
|
| 487 |
|
|
#define MAC_RV_MTXD 0x00000000
|
| 488 |
|
|
#define MAC_RV_IA1 0x00000000
|
| 489 |
|
|
#define MAC_RV_IACK 0x00000000
|
| 490 |
|
|
#define MAC_RV_MADD 0x00000000
|
| 491 |
|
|
|
| 492 |
|
|
//*****************************************************************************
|
| 493 |
|
|
//
|
| 494 |
|
|
// The following are deprecated defines for the bit fields in the MAC_IS
|
| 495 |
|
|
// register.
|
| 496 |
|
|
//
|
| 497 |
|
|
//*****************************************************************************
|
| 498 |
|
|
#define MAC_IS_PHYINT 0x00000040 // PHY Interrupt
|
| 499 |
|
|
#define MAC_IS_MDINT 0x00000020 // MDI Transaction Complete
|
| 500 |
|
|
#define MAC_IS_RXER 0x00000010 // RX Error
|
| 501 |
|
|
#define MAC_IS_FOV 0x00000008 // RX FIFO Overrun
|
| 502 |
|
|
#define MAC_IS_TXEMP 0x00000004 // TX FIFO Empy
|
| 503 |
|
|
#define MAC_IS_TXER 0x00000002 // TX Error
|
| 504 |
|
|
#define MAC_IS_RXINT 0x00000001 // RX Packet Available
|
| 505 |
|
|
|
| 506 |
|
|
//*****************************************************************************
|
| 507 |
|
|
//
|
| 508 |
|
|
// The following are deprecated defines for the bit fields in the MAC_IA0
|
| 509 |
|
|
// register.
|
| 510 |
|
|
//
|
| 511 |
|
|
//*****************************************************************************
|
| 512 |
|
|
#define MAC_IA0_MACOCT4 0xFF000000 // 4th Octet of MAC address
|
| 513 |
|
|
#define MAC_IA0_MACOCT3 0x00FF0000 // 3rd Octet of MAC address
|
| 514 |
|
|
#define MAC_IA0_MACOCT2 0x0000FF00 // 2nd Octet of MAC address
|
| 515 |
|
|
#define MAC_IA0_MACOCT1 0x000000FF // 1st Octet of MAC address
|
| 516 |
|
|
|
| 517 |
|
|
//*****************************************************************************
|
| 518 |
|
|
//
|
| 519 |
|
|
// The following are deprecated defines for the bit fields in the MAC_IA1
|
| 520 |
|
|
// register.
|
| 521 |
|
|
//
|
| 522 |
|
|
//*****************************************************************************
|
| 523 |
|
|
#define MAC_IA1_MACOCT6 0x0000FF00 // 6th Octet of MAC address
|
| 524 |
|
|
#define MAC_IA1_MACOCT5 0x000000FF // 5th Octet of MAC address
|
| 525 |
|
|
|
| 526 |
|
|
//*****************************************************************************
|
| 527 |
|
|
//
|
| 528 |
|
|
// The following are deprecated defines for the bit fields in the MAC_TXTH
|
| 529 |
|
|
// register.
|
| 530 |
|
|
//
|
| 531 |
|
|
//*****************************************************************************
|
| 532 |
|
|
#define MAC_THR_THRESH 0x0000003F // Transmit Threshold Value
|
| 533 |
|
|
|
| 534 |
|
|
//*****************************************************************************
|
| 535 |
|
|
//
|
| 536 |
|
|
// The following are deprecated defines for the bit fields in the MAC_MCTL
|
| 537 |
|
|
// register.
|
| 538 |
|
|
//
|
| 539 |
|
|
//*****************************************************************************
|
| 540 |
|
|
#define MAC_MCTL_REGADR 0x000000F8 // Address for Next MII Transaction
|
| 541 |
|
|
|
| 542 |
|
|
//*****************************************************************************
|
| 543 |
|
|
//
|
| 544 |
|
|
// The following are deprecated defines for the bit fields in the MAC_MDV
|
| 545 |
|
|
// register.
|
| 546 |
|
|
//
|
| 547 |
|
|
//*****************************************************************************
|
| 548 |
|
|
#define MAC_MDV_DIV 0x000000FF // Clock Divider for MDC for TX
|
| 549 |
|
|
|
| 550 |
|
|
//*****************************************************************************
|
| 551 |
|
|
//
|
| 552 |
|
|
// The following are deprecated defines for the bit fields in the MAC_MTXD
|
| 553 |
|
|
// register.
|
| 554 |
|
|
//
|
| 555 |
|
|
//*****************************************************************************
|
| 556 |
|
|
#define MAC_MTXD_MDTX 0x0000FFFF // Data for Next MII Transaction
|
| 557 |
|
|
|
| 558 |
|
|
//*****************************************************************************
|
| 559 |
|
|
//
|
| 560 |
|
|
// The following are deprecated defines for the bit fields in the MAC_MRXD
|
| 561 |
|
|
// register.
|
| 562 |
|
|
//
|
| 563 |
|
|
//*****************************************************************************
|
| 564 |
|
|
#define MAC_MRXD_MDRX 0x0000FFFF // Data Read from Last MII Trans.
|
| 565 |
|
|
|
| 566 |
|
|
//*****************************************************************************
|
| 567 |
|
|
//
|
| 568 |
|
|
// The following are deprecated defines for the bit fields in the MAC_NP
|
| 569 |
|
|
// register.
|
| 570 |
|
|
//
|
| 571 |
|
|
//*****************************************************************************
|
| 572 |
|
|
#define MAC_NP_NPR 0x0000003F // Number of RX Frames in FIFO
|
| 573 |
|
|
|
| 574 |
|
|
#endif
|
| 575 |
|
|
|
| 576 |
|
|
#endif // __HW_ETHERNET_H__
|