3 * Copyright 2007 Free Software Foundation, Inc.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef INCLUDED_ETH_MAC_REGS_H
20 #define INCLUDED_ETH_MAC_REGS_H
23 * See opencores.org 10_100_1000 Mbps Tri-mode Ethernet MAC Specification
25 * In reality, these are 16-bit regs, but are assigned
26 * on 32-bit boundaries. Because we're little endian,
27 * declaring them "int" works.
30 volatile int tx_hwmark;
31 volatile int tx_lwmark;
33 //! if set, send pause frames automatically
34 volatile int pause_frame_send_en;
36 //! quanta value for pause frame in units of 512 bit times.
37 volatile int pause_quanta_set;
40 volatile int full_duplex;
41 volatile int max_retry;
42 volatile int mac_tx_add_en;
43 volatile int mac_tx_add_prom_data;
44 volatile int mac_tx_add_prom_add;
45 volatile int mac_tx_add_prom_wr;
47 //! if set, other end can pause us (i.e., we pay attention to pause frames)
48 volatile int tx_pause_en;
50 // Flow Control high and low water marks
51 //! when space available (in 32-bit lines) > hwmark, send un-pause frame
52 volatile int fc_hwmark;
54 //! when space avail (in 32-bit lines) < lwmark, send pause frame
55 volatile int fc_lwmark;
57 volatile int mac_rx_add_chk_en;
58 volatile int mac_rx_add_prom_data;
59 volatile int mac_rx_add_prom_add;
60 volatile int mac_rx_add_prom_wr;
61 volatile int broadcast_filter_en;
62 volatile int broadcast_bucket_depth;
63 volatile int broadcast_bucket_interval;
64 volatile int rx_append_crc;
65 volatile int rx_hwmark;
66 volatile int rx_lwmark;
67 volatile int crc_chk_en;
68 volatile int rx_ifg_set;
69 volatile int rx_max_length;
70 volatile int rx_min_length;
71 volatile int rmon_rd_addr; // performance counter access
72 volatile int rmon_rd_apply;
73 volatile int rmon_rd_grant; // READONLY
74 volatile int rmon_rd_dout; // READONLY
75 volatile int dummy; // READONLY
76 volatile int line_loop_en;
78 volatile int miimoder;
79 volatile int miicommand;
80 volatile int miiaddress;
81 volatile int miitx_data;
82 volatile int miirx_data;
83 volatile int miistatus;
84 volatile int fc_padtime;
87 // miicommand register
88 #define MIIC_SCANSSTAT (1 << 0) // Scan status
89 #define MIIC_RSTAT (1 << 1) // Read status
90 #define MIIC_WCTRLDATA (1 << 2) // Write control data
93 #define MIIS_LINKFAIL (1 << 0) // The link failed
94 #define MIIS_BUSY (1 << 1) // The MII is busy (operation in progress)
95 #define MIIS_NVALID (1 << 2) // The data in the status register is invalid
96 // This it is only valid when the scan status is active.
98 #endif /* INCLUDED_ETH_MAC_REGS_H */