xref: /openbmc/u-boot/cmd/aspeed/nettest/phy.h (revision fabbeb33)
1 /*
2  *  This program is distributed in the hope that it will be useful,
3  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5  *  GNU General Public License for more details.
6  *
7  *  You should have received a copy of the GNU General Public License
8  *  along with this program; if not, write to the Free Software
9  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
10  */
11 
12 #ifndef PHY_H
13 #define PHY_H
14 
15 //
16 // Define
17 //
18 
19 #define PHY_IS_VALID(dat)                                                      \
20 	(((dat & 0xffff) != 0xffff) && ((dat & 0xffff) != 0x0))
21 
22 // Define PHY basic register
23 #define PHY_REG_BMCR    0x00 // Basic Mode Control Register
24 #define PHY_REG_BMSR    0x01 // Basic Mode Status Register
25 #define PHY_REG_ID_1    0x02
26 #define PHY_REG_ID_2    0x03
27 #define PHY_ANER        0x06 // Auto-negotiation Expansion Register
28 #define PHY_GBCR        0x09 // 1000Base-T Control Register
29 #define PHY_SR          0x11 // PHY Specific Status Register
30 #define PHY_INER        0x12 // Interrupt Enable Register
31 
32 #define PHYID3_Mask                0xfc00         //0xffc0
33 
34 /* --- Note for SettingPHY chip ---
35 void phy_xxxx (int loop_phy) {
36 
37 	if ( BurstEnable ) {
38         // IEEE test
39 	}
40 	else if (loop_phy) {
41         // Internal loop back
42 	}
43 	else {
44         // external loop back
45 	}
46 }
47 ----------------------------------- */
48 
49 #endif // PHY_H
50