blob: 90ed178087293276e07e912516c9ca87b9ccd13f [file] [log] [blame]
Tom Rixd8380c92009-09-27 07:47:24 -05001/*
2 * NOTE: MICREL ethernet Physical layer
3 *
4 * Version: KS8721.h
5 *
6 * Authors: Eric Benard (based on dm9161.h)
7 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Tom Rixd8380c92009-09-27 07:47:24 -05009 */
10
11/* MICREL PHYSICAL LAYER TRANSCEIVER KS8721 */
12
13#define KS8721_BMCR 0
14#define KS8721_BMSR 1
15#define KS8721_PHYID1 2
16#define KS8721_PHYID2 3
17#define KS8721_ANAR 4
18#define KS8721_ANLPAR 5
19#define KS8721_ANER 6
20#define KS8721_RECR 15
21#define KS8721_MDINTR 27
22#define KS8721_100BT 31
23
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)
35
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)
49
50/*--Bit definitions: KS8721_PHYID */
51#define KS8721_PHYID_OUI 0x0885
52#define KS8721_LSB_MASK 0x3F
53
54#define KS8721BL_MODEL 0x21
55#define KS8721_MODELMASK 0x3F0
56#define KS8721BL_REV 0x9
57#define KS8721_REVMASK 0xF
58
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
70
71/****************** function prototypes **********************/
72unsigned int ks8721_isphyconnected(AT91PS_EMAC p_mac);
73unsigned char ks8721_getlinkspeed(AT91PS_EMAC p_mac);
74unsigned char ks8721_autonegotiate(AT91PS_EMAC p_mac, int *status);
75unsigned char ks8721_initphy(AT91PS_EMAC p_mac);