/* Copyright © 2005 Agere Systems Inc. * All rights reserved. * http://www.agere.com * * SOFTWARE LICENSE * * This software is provided subject to the following terms and conditions, * which you should read carefully before using the software. Using this * software indicates your acceptance of these terms and conditions. If you do * not agree with these terms and conditions, do not use the software. * * Copyright © 2005 Agere Systems Inc. * All rights reserved. * * Redistribution and use in source or binary forms, with or without * modifications, are permitted provided that the following conditions are met: * * . Redistributions of source code must retain the above copyright notice, this * list of conditions and the following Disclaimer as comments in the code as * well as in the documentation and/or other materials provided with the * distribution. * * . Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following Disclaimer in the documentation * and/or other materials provided with the distribution. * * . Neither the name of Agere Systems Inc. nor the names of the contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * Disclaimer * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * */ #define DRIVER_NAME … /* EEPROM registers */ /* LBCIF Register Groups (addressed via 32-bit offsets) */ #define LBCIF_DWORD0_GROUP … #define LBCIF_DWORD1_GROUP … /* LBCIF Registers (addressed via 8-bit offsets) */ #define LBCIF_ADDRESS_REGISTER … #define LBCIF_DATA_REGISTER … #define LBCIF_CONTROL_REGISTER … #define LBCIF_STATUS_REGISTER … /* LBCIF Control Register Bits */ #define LBCIF_CONTROL_SEQUENTIAL_READ … #define LBCIF_CONTROL_PAGE_WRITE … #define LBCIF_CONTROL_EEPROM_RELOAD … #define LBCIF_CONTROL_TWO_BYTE_ADDR … #define LBCIF_CONTROL_I2C_WRITE … #define LBCIF_CONTROL_LBCIF_ENABLE … /* LBCIF Status Register Bits */ #define LBCIF_STATUS_PHY_QUEUE_AVAIL … #define LBCIF_STATUS_I2C_IDLE … #define LBCIF_STATUS_ACK_ERROR … #define LBCIF_STATUS_GENERAL_ERROR … #define LBCIF_STATUS_CHECKSUM_ERROR … #define LBCIF_STATUS_EEPROM_PRESENT … /* START OF GLOBAL REGISTER ADDRESS MAP */ /* 10bit registers * * Tx queue start address reg in global address map at address 0x0000 * tx queue end address reg in global address map at address 0x0004 * rx queue start address reg in global address map at address 0x0008 * rx queue end address reg in global address map at address 0x000C */ /* structure for power management control status reg in global address map * located at address 0x0010 * jagcore_rx_rdy bit 9 * jagcore_tx_rdy bit 8 * phy_lped_en bit 7 * phy_sw_coma bit 6 * rxclk_gate bit 5 * txclk_gate bit 4 * sysclk_gate bit 3 * jagcore_rx_en bit 2 * jagcore_tx_en bit 1 * gigephy_en bit 0 */ #define ET_PM_PHY_SW_COMA … #define ET_PMCSR_INIT … /* Interrupt status reg at address 0x0018 */ #define ET_INTR_TXDMA_ISR … #define ET_INTR_TXDMA_ERR … #define ET_INTR_RXDMA_XFR_DONE … #define ET_INTR_RXDMA_FB_R0_LOW … #define ET_INTR_RXDMA_FB_R1_LOW … #define ET_INTR_RXDMA_STAT_LOW … #define ET_INTR_RXDMA_ERR … #define ET_INTR_WATCHDOG … #define ET_INTR_WOL … #define ET_INTR_PHY … #define ET_INTR_TXMAC … #define ET_INTR_RXMAC … #define ET_INTR_MAC_STAT … #define ET_INTR_SLV_TIMEOUT … /* Interrupt mask register at address 0x001C * Interrupt alias clear mask reg at address 0x0020 * Interrupt status alias reg at address 0x0024 * * Same masks as above */ /* Software reset reg at address 0x0028 * 0: txdma_sw_reset * 1: rxdma_sw_reset * 2: txmac_sw_reset * 3: rxmac_sw_reset * 4: mac_sw_reset * 5: mac_stat_sw_reset * 6: mmc_sw_reset *31: selfclr_disable */ #define ET_RESET_ALL … /* SLV Timer reg at address 0x002C (low 24 bits) */ /* MSI Configuration reg at address 0x0030 */ #define ET_MSI_VECTOR … #define ET_MSI_TC … /* Loopback reg located at address 0x0034 */ #define ET_LOOP_MAC … #define ET_LOOP_DMA … /* GLOBAL Module of JAGCore Address Mapping * Located at address 0x0000 */ struct global_regs { … }; /* START OF TXDMA REGISTER ADDRESS MAP */ /* txdma control status reg at address 0x1000 */ #define ET_TXDMA_CSR_HALT … #define ET_TXDMA_DROP_TLP … #define ET_TXDMA_CACHE_THRS … #define ET_TXDMA_CACHE_SHIFT … #define ET_TXDMA_SNGL_EPKT … #define ET_TXDMA_CLASS … /* structure for txdma packet ring base address hi reg in txdma address map * located at address 0x1004 * Defined earlier (u32) */ /* structure for txdma packet ring base address low reg in txdma address map * located at address 0x1008 * Defined earlier (u32) */ /* structure for txdma packet ring number of descriptor reg in txdma address * map. Located at address 0x100C * * 31-10: unused * 9-0: pr ndes */ #define ET_DMA12_MASK … #define ET_DMA12_WRAP … #define ET_DMA10_MASK … #define ET_DMA10_WRAP … #define ET_DMA4_MASK … #define ET_DMA4_WRAP … #define INDEX12(x) … #define INDEX10(x) … #define INDEX4(x) … /* 10bit DMA with wrap * txdma tx queue write address reg in txdma address map at 0x1010 * txdma tx queue write address external reg in txdma address map at 0x1014 * txdma tx queue read address reg in txdma address map at 0x1018 * * u32 * txdma status writeback address hi reg in txdma address map at0x101C * txdma status writeback address lo reg in txdma address map at 0x1020 * * 10bit DMA with wrap * txdma service request reg in txdma address map at 0x1024 * structure for txdma service complete reg in txdma address map at 0x1028 * * 4bit DMA with wrap * txdma tx descriptor cache read index reg in txdma address map at 0x102C * txdma tx descriptor cache write index reg in txdma address map at 0x1030 * * txdma error reg in txdma address map at address 0x1034 * 0: PyldResend * 1: PyldRewind * 4: DescrResend * 5: DescrRewind * 8: WrbkResend * 9: WrbkRewind */ /* Tx DMA Module of JAGCore Address Mapping * Located at address 0x1000 */ struct txdma_regs { … }; /* END OF TXDMA REGISTER ADDRESS MAP */ /* START OF RXDMA REGISTER ADDRESS MAP */ /* structure for control status reg in rxdma address map * Located at address 0x2000 * * CSR * 0: halt * 1-3: tc * 4: fbr_big_endian * 5: psr_big_endian * 6: pkt_big_endian * 7: dma_big_endian * 8-9: fbr0_size * 10: fbr0_enable * 11-12: fbr1_size * 13: fbr1_enable * 14: unused * 15: pkt_drop_disable * 16: pkt_done_flush * 17: halt_status * 18-31: unused */ #define ET_RXDMA_CSR_HALT … #define ET_RXDMA_CSR_FBR0_SIZE_LO … #define ET_RXDMA_CSR_FBR0_SIZE_HI … #define ET_RXDMA_CSR_FBR0_ENABLE … #define ET_RXDMA_CSR_FBR1_SIZE_LO … #define ET_RXDMA_CSR_FBR1_SIZE_HI … #define ET_RXDMA_CSR_FBR1_ENABLE … #define ET_RXDMA_CSR_HALT_STATUS … /* structure for dma writeback lo reg in rxdma address map * located at address 0x2004 * Defined earlier (u32) */ /* structure for dma writeback hi reg in rxdma address map * located at address 0x2008 * Defined earlier (u32) */ /* structure for number of packets done reg in rxdma address map * located at address 0x200C * * 31-8: unused * 7-0: num done */ /* structure for max packet time reg in rxdma address map * located at address 0x2010 * * 31-18: unused * 17-0: time done */ /* structure for rx queue read address reg in rxdma address map * located at address 0x2014 * Defined earlier (u32) */ /* structure for rx queue read address external reg in rxdma address map * located at address 0x2018 * Defined earlier (u32) */ /* structure for rx queue write address reg in rxdma address map * located at address 0x201C * Defined earlier (u32) */ /* structure for packet status ring base address lo reg in rxdma address map * located at address 0x2020 * Defined earlier (u32) */ /* structure for packet status ring base address hi reg in rxdma address map * located at address 0x2024 * Defined earlier (u32) */ /* structure for packet status ring number of descriptors reg in rxdma address * map. Located at address 0x2028 * * 31-12: unused * 11-0: psr ndes */ #define ET_RXDMA_PSR_NUM_DES_MASK … /* structure for packet status ring available offset reg in rxdma address map * located at address 0x202C * * 31-13: unused * 12: psr avail wrap * 11-0: psr avail */ /* structure for packet status ring full offset reg in rxdma address map * located at address 0x2030 * * 31-13: unused * 12: psr full wrap * 11-0: psr full */ /* structure for packet status ring access index reg in rxdma address map * located at address 0x2034 * * 31-5: unused * 4-0: psr_ai */ /* structure for packet status ring minimum descriptors reg in rxdma address * map. Located at address 0x2038 * * 31-12: unused * 11-0: psr_min */ /* structure for free buffer ring base lo address reg in rxdma address map * located at address 0x203C * Defined earlier (u32) */ /* structure for free buffer ring base hi address reg in rxdma address map * located at address 0x2040 * Defined earlier (u32) */ /* structure for free buffer ring number of descriptors reg in rxdma address * map. Located at address 0x2044 * * 31-10: unused * 9-0: fbr ndesc */ /* structure for free buffer ring 0 available offset reg in rxdma address map * located at address 0x2048 * Defined earlier (u32) */ /* structure for free buffer ring 0 full offset reg in rxdma address map * located at address 0x204C * Defined earlier (u32) */ /* structure for free buffer cache 0 full offset reg in rxdma address map * located at address 0x2050 * * 31-5: unused * 4-0: fbc rdi */ /* structure for free buffer ring 0 minimum descriptor reg in rxdma address map * located at address 0x2054 * * 31-10: unused * 9-0: fbr min */ /* structure for free buffer ring 1 base address lo reg in rxdma address map * located at address 0x2058 - 0x205C * Defined earlier (RXDMA_FBR_BASE_LO_t and RXDMA_FBR_BASE_HI_t) */ /* structure for free buffer ring 1 number of descriptors reg in rxdma address * map. Located at address 0x2060 * Defined earlier (RXDMA_FBR_NUM_DES_t) */ /* structure for free buffer ring 1 available offset reg in rxdma address map * located at address 0x2064 * Defined Earlier (RXDMA_FBR_AVAIL_OFFSET_t) */ /* structure for free buffer ring 1 full offset reg in rxdma address map * located at address 0x2068 * Defined Earlier (RXDMA_FBR_FULL_OFFSET_t) */ /* structure for free buffer cache 1 read index reg in rxdma address map * located at address 0x206C * Defined Earlier (RXDMA_FBC_RD_INDEX_t) */ /* structure for free buffer ring 1 minimum descriptor reg in rxdma address map * located at address 0x2070 * Defined Earlier (RXDMA_FBR_MIN_DES_t) */ /* Rx DMA Module of JAGCore Address Mapping * Located at address 0x2000 */ struct rxdma_regs { … }; /* END OF RXDMA REGISTER ADDRESS MAP */ /* START OF TXMAC REGISTER ADDRESS MAP */ /* structure for control reg in txmac address map * located at address 0x3000 * * bits * 31-8: unused * 7: cklseg_disable * 6: ckbcnt_disable * 5: cksegnum * 4: async_disable * 3: fc_disable * 2: mcif_disable * 1: mif_disable * 0: txmac_en */ #define ET_TX_CTRL_FC_DISABLE … #define ET_TX_CTRL_TXMAC_ENABLE … /* structure for shadow pointer reg in txmac address map * located at address 0x3004 * 31-27: reserved * 26-16: txq rd ptr * 15-11: reserved * 10-0: txq wr ptr */ /* structure for error count reg in txmac address map * located at address 0x3008 * * 31-12: unused * 11-8: reserved * 7-4: txq_underrun * 3-0: fifo_underrun */ /* structure for max fill reg in txmac address map * located at address 0x300C * 31-12: unused * 11-0: max fill */ /* structure for cf parameter reg in txmac address map * located at address 0x3010 * 31-16: cfep * 15-0: cfpt */ /* structure for tx test reg in txmac address map * located at address 0x3014 * 31-17: unused * 16: reserved * 15: txtest_en * 14-11: unused * 10-0: txq test pointer */ /* structure for error reg in txmac address map * located at address 0x3018 * * 31-9: unused * 8: fifo_underrun * 7-6: unused * 5: ctrl2_err * 4: txq_underrun * 3: bcnt_err * 2: lseg_err * 1: segnum_err * 0: seg0_err */ /* structure for error interrupt reg in txmac address map * located at address 0x301C * * 31-9: unused * 8: fifo_underrun * 7-6: unused * 5: ctrl2_err * 4: txq_underrun * 3: bcnt_err * 2: lseg_err * 1: segnum_err * 0: seg0_err */ /* structure for error interrupt reg in txmac address map * located at address 0x3020 * * 31-2: unused * 1: bp_req * 0: bp_xonxoff */ /* Tx MAC Module of JAGCore Address Mapping */ struct txmac_regs { … }; /* END OF TXMAC REGISTER ADDRESS MAP */ /* START OF RXMAC REGISTER ADDRESS MAP */ /* structure for rxmac control reg in rxmac address map * located at address 0x4000 * * 31-7: reserved * 6: rxmac_int_disable * 5: async_disable * 4: mif_disable * 3: wol_disable * 2: pkt_filter_disable * 1: mcif_disable * 0: rxmac_en */ #define ET_RX_CTRL_WOL_DISABLE … #define ET_RX_CTRL_RXMAC_ENABLE … /* structure for Wake On Lan Control and CRC 0 reg in rxmac address map * located at address 0x4004 * 31-16: crc * 15-12: reserved * 11: ignore_pp * 10: ignore_mp * 9: clr_intr * 8: ignore_link_chg * 7: ignore_uni * 6: ignore_multi * 5: ignore_broad * 4-0: valid_crc 4-0 */ /* structure for CRC 1 and CRC 2 reg in rxmac address map * located at address 0x4008 * * 31-16: crc2 * 15-0: crc1 */ /* structure for CRC 3 and CRC 4 reg in rxmac address map * located at address 0x400C * * 31-16: crc4 * 15-0: crc3 */ /* structure for Wake On Lan Source Address Lo reg in rxmac address map * located at address 0x4010 * * 31-24: sa3 * 23-16: sa4 * 15-8: sa5 * 7-0: sa6 */ #define ET_RX_WOL_LO_SA3_SHIFT … #define ET_RX_WOL_LO_SA4_SHIFT … #define ET_RX_WOL_LO_SA5_SHIFT … /* structure for Wake On Lan Source Address Hi reg in rxmac address map * located at address 0x4014 * * 31-16: reserved * 15-8: sa1 * 7-0: sa2 */ #define ET_RX_WOL_HI_SA1_SHIFT … /* structure for Wake On Lan mask reg in rxmac address map * located at address 0x4018 - 0x4064 * Defined earlier (u32) */ /* structure for Unicast Packet Filter Address 1 reg in rxmac address map * located at address 0x4068 * * 31-24: addr1_3 * 23-16: addr1_4 * 15-8: addr1_5 * 7-0: addr1_6 */ #define ET_RX_UNI_PF_ADDR1_3_SHIFT … #define ET_RX_UNI_PF_ADDR1_4_SHIFT … #define ET_RX_UNI_PF_ADDR1_5_SHIFT … /* structure for Unicast Packet Filter Address 2 reg in rxmac address map * located at address 0x406C * * 31-24: addr2_3 * 23-16: addr2_4 * 15-8: addr2_5 * 7-0: addr2_6 */ #define ET_RX_UNI_PF_ADDR2_3_SHIFT … #define ET_RX_UNI_PF_ADDR2_4_SHIFT … #define ET_RX_UNI_PF_ADDR2_5_SHIFT … /* structure for Unicast Packet Filter Address 1 & 2 reg in rxmac address map * located at address 0x4070 * * 31-24: addr2_1 * 23-16: addr2_2 * 15-8: addr1_1 * 7-0: addr1_2 */ #define ET_RX_UNI_PF_ADDR2_1_SHIFT … #define ET_RX_UNI_PF_ADDR2_2_SHIFT … #define ET_RX_UNI_PF_ADDR1_1_SHIFT … /* structure for Multicast Hash reg in rxmac address map * located at address 0x4074 - 0x4080 * Defined earlier (u32) */ /* structure for Packet Filter Control reg in rxmac address map * located at address 0x4084 * * 31-23: unused * 22-16: min_pkt_size * 15-4: unused * 3: filter_frag_en * 2: filter_uni_en * 1: filter_multi_en * 0: filter_broad_en */ #define ET_RX_PFCTRL_MIN_PKT_SZ_SHIFT … #define ET_RX_PFCTRL_FRAG_FILTER_ENABLE … #define ET_RX_PFCTRL_UNICST_FILTER_ENABLE … #define ET_RX_PFCTRL_MLTCST_FILTER_ENABLE … #define ET_RX_PFCTRL_BRDCST_FILTER_ENABLE … /* structure for Memory Controller Interface Control Max Segment reg in rxmac * address map. Located at address 0x4088 * * 31-10: reserved * 9-2: max_size * 1: fc_en * 0: seg_en */ #define ET_RX_MCIF_CTRL_MAX_SEG_SIZE_SHIFT … #define ET_RX_MCIF_CTRL_MAX_SEG_FC_ENABLE … #define ET_RX_MCIF_CTRL_MAX_SEG_ENABLE … /* structure for Memory Controller Interface Water Mark reg in rxmac address * map. Located at address 0x408C * * 31-26: unused * 25-16: mark_hi * 15-10: unused * 9-0: mark_lo */ /* structure for Rx Queue Dialog reg in rxmac address map. * located at address 0x4090 * * 31-26: reserved * 25-16: rd_ptr * 15-10: reserved * 9-0: wr_ptr */ /* structure for space available reg in rxmac address map. * located at address 0x4094 * * 31-17: reserved * 16: space_avail_en * 15-10: reserved * 9-0: space_avail */ /* structure for management interface reg in rxmac address map. * located at address 0x4098 * * 31-18: reserved * 17: drop_pkt_en * 16-0: drop_pkt_mask */ /* structure for Error reg in rxmac address map. * located at address 0x409C * * 31-4: unused * 3: mif * 2: async * 1: pkt_filter * 0: mcif */ /* Rx MAC Module of JAGCore Address Mapping */ struct rxmac_regs { … }; /* END OF RXMAC REGISTER ADDRESS MAP */ /* START OF MAC REGISTER ADDRESS MAP */ /* structure for configuration #1 reg in mac address map. * located at address 0x5000 * * 31: soft reset * 30: sim reset * 29-20: reserved * 19: reset rx mc * 18: reset tx mc * 17: reset rx func * 16: reset tx fnc * 15-9: reserved * 8: loopback * 7-6: reserved * 5: rx flow * 4: tx flow * 3: syncd rx en * 2: rx enable * 1: syncd tx en * 0: tx enable */ #define ET_MAC_CFG1_SOFT_RESET … #define ET_MAC_CFG1_SIM_RESET … #define ET_MAC_CFG1_RESET_RXMC … #define ET_MAC_CFG1_RESET_TXMC … #define ET_MAC_CFG1_RESET_RXFUNC … #define ET_MAC_CFG1_RESET_TXFUNC … #define ET_MAC_CFG1_LOOPBACK … #define ET_MAC_CFG1_RX_FLOW … #define ET_MAC_CFG1_TX_FLOW … #define ET_MAC_CFG1_RX_ENABLE … #define ET_MAC_CFG1_TX_ENABLE … #define ET_MAC_CFG1_WAIT … /* structure for configuration #2 reg in mac address map. * located at address 0x5004 * 31-16: reserved * 15-12: preamble * 11-10: reserved * 9-8: if mode * 7-6: reserved * 5: huge frame * 4: length check * 3: undefined * 2: pad crc * 1: crc enable * 0: full duplex */ #define ET_MAC_CFG2_PREAMBLE_SHIFT … #define ET_MAC_CFG2_IFMODE_MASK … #define ET_MAC_CFG2_IFMODE_1000 … #define ET_MAC_CFG2_IFMODE_100 … #define ET_MAC_CFG2_IFMODE_HUGE_FRAME … #define ET_MAC_CFG2_IFMODE_LEN_CHECK … #define ET_MAC_CFG2_IFMODE_PAD_CRC … #define ET_MAC_CFG2_IFMODE_CRC_ENABLE … #define ET_MAC_CFG2_IFMODE_FULL_DPLX … /* structure for Interpacket gap reg in mac address map. * located at address 0x5008 * * 31: reserved * 30-24: non B2B ipg 1 * 23: undefined * 22-16: non B2B ipg 2 * 15-8: Min ifg enforce * 7-0: B2B ipg * * structure for half duplex reg in mac address map. * located at address 0x500C * 31-24: reserved * 23-20: Alt BEB trunc * 19: Alt BEB enable * 18: BP no backoff * 17: no backoff * 16: excess defer * 15-12: re-xmit max * 11-10: reserved * 9-0: collision window */ /* structure for Maximum Frame Length reg in mac address map. * located at address 0x5010: bits 0-15 hold the length. */ /* structure for Reserve 1 reg in mac address map. * located at address 0x5014 - 0x5018 * Defined earlier (u32) */ /* structure for Test reg in mac address map. * located at address 0x501C * test: bits 0-2, rest unused */ /* structure for MII Management Configuration reg in mac address map. * located at address 0x5020 * * 31: reset MII mgmt * 30-6: unused * 5: scan auto increment * 4: preamble suppress * 3: undefined * 2-0: mgmt clock reset */ #define ET_MAC_MIIMGMT_CLK_RST … /* structure for MII Management Command reg in mac address map. * located at address 0x5024 * bit 1: scan cycle * bit 0: read cycle */ /* structure for MII Management Address reg in mac address map. * located at address 0x5028 * 31-13: reserved * 12-8: phy addr * 7-5: reserved * 4-0: register */ #define ET_MAC_MII_ADDR(phy, reg) … /* structure for MII Management Control reg in mac address map. * located at address 0x502C * 31-16: reserved * 15-0: phy control */ /* structure for MII Management Status reg in mac address map. * located at address 0x5030 * 31-16: reserved * 15-0: phy control */ #define ET_MAC_MIIMGMT_STAT_PHYCRTL_MASK … /* structure for MII Management Indicators reg in mac address map. * located at address 0x5034 * 31-3: reserved * 2: not valid * 1: scanning * 0: busy */ #define ET_MAC_MGMT_BUSY … #define ET_MAC_MGMT_WAIT … /* structure for Interface Control reg in mac address map. * located at address 0x5038 * * 31: reset if module * 30-28: reserved * 27: tbi mode * 26: ghd mode * 25: lhd mode * 24: phy mode * 23: reset per mii * 22-17: reserved * 16: speed * 15: reset pe100x * 14-11: reserved * 10: force quiet * 9: no cipher * 8: disable link fail * 7: reset gpsi * 6-1: reserved * 0: enable jabber protection */ #define ET_MAC_IFCTRL_GHDMODE … #define ET_MAC_IFCTRL_PHYMODE … /* structure for Interface Status reg in mac address map. * located at address 0x503C * * 31-10: reserved * 9: excess_defer * 8: clash * 7: phy_jabber * 6: phy_link_ok * 5: phy_full_duplex * 4: phy_speed * 3: pe100x_link_fail * 2: pe10t_loss_carrier * 1: pe10t_sqe_error * 0: pe10t_jabber */ /* structure for Mac Station Address, Part 1 reg in mac address map. * located at address 0x5040 * * 31-24: Octet6 * 23-16: Octet5 * 15-8: Octet4 * 7-0: Octet3 */ #define ET_MAC_STATION_ADDR1_OC6_SHIFT … #define ET_MAC_STATION_ADDR1_OC5_SHIFT … #define ET_MAC_STATION_ADDR1_OC4_SHIFT … /* structure for Mac Station Address, Part 2 reg in mac address map. * located at address 0x5044 * * 31-24: Octet2 * 23-16: Octet1 * 15-0: reserved */ #define ET_MAC_STATION_ADDR2_OC2_SHIFT … #define ET_MAC_STATION_ADDR2_OC1_SHIFT … /* MAC Module of JAGCore Address Mapping */ struct mac_regs { … }; /* END OF MAC REGISTER ADDRESS MAP */ /* START OF MAC STAT REGISTER ADDRESS MAP */ /* structure for Carry Register One and it's Mask Register reg located in mac * stat address map address 0x6130 and 0x6138. * * 31: tr64 * 30: tr127 * 29: tr255 * 28: tr511 * 27: tr1k * 26: trmax * 25: trmgv * 24-17: unused * 16: rbyt * 15: rpkt * 14: rfcs * 13: rmca * 12: rbca * 11: rxcf * 10: rxpf * 9: rxuo * 8: raln * 7: rflr * 6: rcde * 5: rcse * 4: rund * 3: rovr * 2: rfrg * 1: rjbr * 0: rdrp */ /* structure for Carry Register Two Mask Register reg in mac stat address map. * located at address 0x613C * * 31-20: unused * 19: tjbr * 18: tfcs * 17: txcf * 16: tovr * 15: tund * 14: trfg * 13: tbyt * 12: tpkt * 11: tmca * 10: tbca * 9: txpf * 8: tdfr * 7: tedf * 6: tscl * 5: tmcl * 4: tlcl * 3: txcl * 2: tncl * 1: tpfh * 0: tdrp */ /* MAC STATS Module of JAGCore Address Mapping */ struct macstat_regs { … }; /* END OF MAC STAT REGISTER ADDRESS MAP */ /* START OF MMC REGISTER ADDRESS MAP */ /* Main Memory Controller Control reg in mmc address map. * located at address 0x7000 */ #define ET_MMC_ENABLE … #define ET_MMC_ARB_DISABLE … #define ET_MMC_RXMAC_DISABLE … #define ET_MMC_TXMAC_DISABLE … #define ET_MMC_TXDMA_DISABLE … #define ET_MMC_RXDMA_DISABLE … #define ET_MMC_FORCE_CE … /* Main Memory Controller Host Memory Access Address reg in mmc * address map. Located at address 0x7004. Top 16 bits hold the address bits */ #define ET_SRAM_REQ_ACCESS … #define ET_SRAM_WR_ACCESS … #define ET_SRAM_IS_CTRL … /* structure for Main Memory Controller Host Memory Access Data reg in mmc * address map. Located at address 0x7008 - 0x7014 * Defined earlier (u32) */ /* Memory Control Module of JAGCore Address Mapping */ struct mmc_regs { … }; /* END OF MMC REGISTER ADDRESS MAP */ /* JAGCore Address Mapping */ struct address_map { … }; /* Defines for generic MII registers 0x00 -> 0x0F can be found in * include/linux/mii.h */ /* some defines for modem registers that seem to be 'reserved' */ #define PHY_INDEX_REG … #define PHY_DATA_REG … #define PHY_MPHY_CONTROL_REG … /* defines for specified registers */ #define PHY_LOOPBACK_CONTROL … /* TRU_VMI_LOOPBACK_CONTROL_2_REG 20 */ #define PHY_REGISTER_MGMT_CONTROL … #define PHY_CONFIG … #define PHY_PHY_CONTROL … #define PHY_INTERRUPT_MASK … #define PHY_INTERRUPT_STATUS … #define PHY_PHY_STATUS … #define PHY_LED_1 … #define PHY_LED_2 … /* TRU_VMI_LINK_CONTROL_REG 29 */ /* TRU_VMI_TIMING_CONTROL_REG */ /* MI Register 10: Gigabit basic mode status reg(Reg 0x0A) */ #define ET_1000BT_MSTR_SLV … /* MI Register 16 - 18: Reserved Reg(0x10-0x12) */ /* MI Register 19: Loopback Control Reg(0x13) * 15: mii_en * 14: pcs_en * 13: pmd_en * 12: all_digital_en * 11: replica_en * 10: line_driver_en * 9-0: reserved */ /* MI Register 20: Reserved Reg(0x14) */ /* MI Register 21: Management Interface Control Reg(0x15) * 15-11: reserved * 10-4: mi_error_count * 3: reserved * 2: ignore_10g_fr * 1: reserved * 0: preamble_suppress_en */ /* MI Register 22: PHY Configuration Reg(0x16) * 15: crs_tx_en * 14: reserved * 13-12: tx_fifo_depth * 11-10: speed_downshift * 9: pbi_detect * 8: tbi_rate * 7: alternate_np * 6: group_mdio_en * 5: tx_clock_en * 4: sys_clock_en * 3: reserved * 2-0: mac_if_mode */ #define ET_PHY_CONFIG_TX_FIFO_DEPTH … #define ET_PHY_CONFIG_FIFO_DEPTH_8 … #define ET_PHY_CONFIG_FIFO_DEPTH_16 … #define ET_PHY_CONFIG_FIFO_DEPTH_32 … #define ET_PHY_CONFIG_FIFO_DEPTH_64 … /* MI Register 23: PHY CONTROL Reg(0x17) * 15: reserved * 14: tdr_en * 13: reserved * 12-11: downshift_attempts * 10-6: reserved * 5: jabber_10baseT * 4: sqe_10baseT * 3: tp_loopback_10baseT * 2: preamble_gen_en * 1: reserved * 0: force_int */ /* MI Register 24: Interrupt Mask Reg(0x18) * 15-10: reserved * 9: mdio_sync_lost * 8: autoneg_status * 7: hi_bit_err * 6: np_rx * 5: err_counter_full * 4: fifo_over_underflow * 3: rx_status * 2: link_status * 1: automatic_speed * 0: int_en */ /* MI Register 25: Interrupt Status Reg(0x19) * 15-10: reserved * 9: mdio_sync_lost * 8: autoneg_status * 7: hi_bit_err * 6: np_rx * 5: err_counter_full * 4: fifo_over_underflow * 3: rx_status * 2: link_status * 1: automatic_speed * 0: int_en */ /* MI Register 26: PHY Status Reg(0x1A) * 15: reserved * 14-13: autoneg_fault * 12: autoneg_status * 11: mdi_x_status * 10: polarity_status * 9-8: speed_status * 7: duplex_status * 6: link_status * 5: tx_status * 4: rx_status * 3: collision_status * 2: autoneg_en * 1: pause_en * 0: asymmetric_dir */ #define ET_PHY_AUTONEG_STATUS … #define ET_PHY_POLARITY_STATUS … #define ET_PHY_SPEED_STATUS … #define ET_PHY_DUPLEX_STATUS … #define ET_PHY_LSTATUS … #define ET_PHY_AUTONEG_ENABLE … /* MI Register 27: LED Control Reg 1(0x1B) * 15-14: reserved * 13-12: led_dup_indicate * 11-10: led_10baseT * 9-8: led_collision * 7-4: reserved * 3-2: pulse_dur * 1: pulse_stretch1 * 0: pulse_stretch0 */ /* MI Register 28: LED Control Reg 2(0x1C) * 15-12: led_link * 11-8: led_tx_rx * 7-4: led_100BaseTX * 3-0: led_1000BaseT */ #define ET_LED2_LED_LINK … #define ET_LED2_LED_TXRX … #define ET_LED2_LED_100TX … #define ET_LED2_LED_1000T … /* defines for LED control reg 2 values */ #define LED_VAL_1000BT … #define LED_VAL_100BTX … #define LED_VAL_10BT … #define LED_VAL_1000BT_100BTX … #define LED_VAL_LINKON … #define LED_VAL_TX … #define LED_VAL_RX … #define LED_VAL_TXRX … #define LED_VAL_DUPLEXFULL … #define LED_VAL_COLLISION … #define LED_VAL_LINKON_ACTIVE … #define LED_VAL_LINKON_RECV … #define LED_VAL_DUPLEXFULL_COLLISION … #define LED_VAL_BLINK … #define LED_VAL_ON … #define LED_VAL_OFF … #define LED_LINK_SHIFT … #define LED_TXRX_SHIFT … #define LED_100TX_SHIFT … /* MI Register 29 - 31: Reserved Reg(0x1D - 0x1E) */