2 * NOTE: MICREL ethernet Physical layer
6 * Authors: Eric Benard (based on dm9161.h)
8 * SPDX-License-Identifier: GPL-2.0+
11 /* MICREL PHYSICAL LAYER TRANSCEIVER KS8721 */
15 #define KS8721_PHYID1 2
16 #define KS8721_PHYID2 3
18 #define KS8721_ANLPAR 5
20 #define KS8721_RECR 15
21 #define KS8721_MDINTR 27
22 #define KS8721_100BT 31
24 /* --Bit definitions: KS8721_BMCR */
25 #define KS8721_RESET (1 << 15)
26 #define KS8721_LOOPBACK (1 << 14)
27 #define KS8721_SPEED_SELECT (1 << 13)
28 #define KS8721_AUTONEG (1 << 12)
29 #define KS8721_POWER_DOWN (1 << 11)
30 #define KS8721_ISOLATE (1 << 10)
31 #define KS8721_RESTART_AUTONEG (1 << 9)
32 #define KS8721_DUPLEX_MODE (1 << 8)
33 #define KS8721_COLLISION_TEST (1 << 7)
34 #define KS8721_DISABLE (1 << 0)
36 /*--Bit definitions: KS8721_BMSR */
37 #define KS8721_100BASE_T4 (1 << 15)
38 #define KS8721_100BASE_TX_FD (1 << 14)
39 #define KS8721_100BASE_T4_HD (1 << 13)
40 #define KS8721_10BASE_T_FD (1 << 12)
41 #define KS8721_10BASE_T_HD (1 << 11)
42 #define KS8721_MF_PREAMB_SUPPR (1 << 6)
43 #define KS8721_AUTONEG_COMP (1 << 5)
44 #define KS8721_REMOTE_FAULT (1 << 4)
45 #define KS8721_AUTONEG_ABILITY (1 << 3)
46 #define KS8721_LINK_STATUS (1 << 2)
47 #define KS8721_JABBER_DETECT (1 << 1)
48 #define KS8721_EXTEND_CAPAB (1 << 0)
50 /*--Bit definitions: KS8721_PHYID */
51 #define KS8721_PHYID_OUI 0x0885
52 #define KS8721_LSB_MASK 0x3F
54 #define KS8721BL_MODEL 0x21
55 #define KS8721_MODELMASK 0x3F0
56 #define KS8721BL_REV 0x9
57 #define KS8721_REVMASK 0xF
59 /*--Bit definitions: KS8721_ANAR, KS8721_ANLPAR */
60 #define KS8721_NP (1 << 15)
61 #define KS8721_ACK (1 << 14)
62 #define KS8721_RF (1 << 13)
63 #define KS8721_PAUSE (1 << 10)
64 #define KS8721_T4 (1 << 9)
65 #define KS8721_TX_FDX (1 << 8)
66 #define KS8721_TX_HDX (1 << 7)
67 #define KS8721_10_FDX (1 << 6)
68 #define KS8721_10_HDX (1 << 5)
69 #define KS8721_AN_IEEE_802_3 0x0001
71 /****************** function prototypes **********************/
72 unsigned int ks8721_isphyconnected(AT91PS_EMAC p_mac);
73 unsigned char ks8721_getlinkspeed(AT91PS_EMAC p_mac);
74 unsigned char ks8721_autonegotiate(AT91PS_EMAC p_mac, int *status);
75 unsigned char ks8721_initphy(AT91PS_EMAC p_mac);