162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* $Date: 2005/03/07 23:59:05 $ $RCSfile: mv88e1xxx.h,v $ $Revision: 1.13 $ */ 362306a36Sopenharmony_ci#ifndef CHELSIO_MV8E1XXX_H 462306a36Sopenharmony_ci#define CHELSIO_MV8E1XXX_H 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef BMCR_SPEED1000 762306a36Sopenharmony_ci# define BMCR_SPEED1000 0x40 862306a36Sopenharmony_ci#endif 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef ADVERTISE_PAUSE 1162306a36Sopenharmony_ci# define ADVERTISE_PAUSE 0x400 1262306a36Sopenharmony_ci#endif 1362306a36Sopenharmony_ci#ifndef ADVERTISE_PAUSE_ASYM 1462306a36Sopenharmony_ci# define ADVERTISE_PAUSE_ASYM 0x800 1562306a36Sopenharmony_ci#endif 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* Gigabit MII registers */ 1862306a36Sopenharmony_ci#define MII_GBCR 9 /* 1000Base-T control register */ 1962306a36Sopenharmony_ci#define MII_GBSR 10 /* 1000Base-T status register */ 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/* 1000Base-T control register fields */ 2262306a36Sopenharmony_ci#define GBCR_ADV_1000HALF 0x100 2362306a36Sopenharmony_ci#define GBCR_ADV_1000FULL 0x200 2462306a36Sopenharmony_ci#define GBCR_PREFER_MASTER 0x400 2562306a36Sopenharmony_ci#define GBCR_MANUAL_AS_MASTER 0x800 2662306a36Sopenharmony_ci#define GBCR_MANUAL_CONFIG_ENABLE 0x1000 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* 1000Base-T status register fields */ 2962306a36Sopenharmony_ci#define GBSR_LP_1000HALF 0x400 3062306a36Sopenharmony_ci#define GBSR_LP_1000FULL 0x800 3162306a36Sopenharmony_ci#define GBSR_REMOTE_OK 0x1000 3262306a36Sopenharmony_ci#define GBSR_LOCAL_OK 0x2000 3362306a36Sopenharmony_ci#define GBSR_LOCAL_MASTER 0x4000 3462306a36Sopenharmony_ci#define GBSR_MASTER_FAULT 0x8000 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci/* Marvell PHY interrupt status bits. */ 3762306a36Sopenharmony_ci#define MV88E1XXX_INTR_JABBER 0x0001 3862306a36Sopenharmony_ci#define MV88E1XXX_INTR_POLARITY_CHNG 0x0002 3962306a36Sopenharmony_ci#define MV88E1XXX_INTR_ENG_DETECT_CHNG 0x0010 4062306a36Sopenharmony_ci#define MV88E1XXX_INTR_DOWNSHIFT 0x0020 4162306a36Sopenharmony_ci#define MV88E1XXX_INTR_MDI_XOVER_CHNG 0x0040 4262306a36Sopenharmony_ci#define MV88E1XXX_INTR_FIFO_OVER_UNDER 0x0080 4362306a36Sopenharmony_ci#define MV88E1XXX_INTR_FALSE_CARRIER 0x0100 4462306a36Sopenharmony_ci#define MV88E1XXX_INTR_SYMBOL_ERROR 0x0200 4562306a36Sopenharmony_ci#define MV88E1XXX_INTR_LINK_CHNG 0x0400 4662306a36Sopenharmony_ci#define MV88E1XXX_INTR_AUTONEG_DONE 0x0800 4762306a36Sopenharmony_ci#define MV88E1XXX_INTR_PAGE_RECV 0x1000 4862306a36Sopenharmony_ci#define MV88E1XXX_INTR_DUPLEX_CHNG 0x2000 4962306a36Sopenharmony_ci#define MV88E1XXX_INTR_SPEED_CHNG 0x4000 5062306a36Sopenharmony_ci#define MV88E1XXX_INTR_AUTONEG_ERR 0x8000 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci/* Marvell PHY specific registers. */ 5362306a36Sopenharmony_ci#define MV88E1XXX_SPECIFIC_CNTRL_REGISTER 16 5462306a36Sopenharmony_ci#define MV88E1XXX_SPECIFIC_STATUS_REGISTER 17 5562306a36Sopenharmony_ci#define MV88E1XXX_INTERRUPT_ENABLE_REGISTER 18 5662306a36Sopenharmony_ci#define MV88E1XXX_INTERRUPT_STATUS_REGISTER 19 5762306a36Sopenharmony_ci#define MV88E1XXX_EXT_PHY_SPECIFIC_CNTRL_REGISTER 20 5862306a36Sopenharmony_ci#define MV88E1XXX_RECV_ERR_CNTR_REGISTER 21 5962306a36Sopenharmony_ci#define MV88E1XXX_RES_REGISTER 22 6062306a36Sopenharmony_ci#define MV88E1XXX_GLOBAL_STATUS_REGISTER 23 6162306a36Sopenharmony_ci#define MV88E1XXX_LED_CONTROL_REGISTER 24 6262306a36Sopenharmony_ci#define MV88E1XXX_MANUAL_LED_OVERRIDE_REGISTER 25 6362306a36Sopenharmony_ci#define MV88E1XXX_EXT_PHY_SPECIFIC_CNTRL_2_REGISTER 26 6462306a36Sopenharmony_ci#define MV88E1XXX_EXT_PHY_SPECIFIC_STATUS_REGISTER 27 6562306a36Sopenharmony_ci#define MV88E1XXX_VIRTUAL_CABLE_TESTER_REGISTER 28 6662306a36Sopenharmony_ci#define MV88E1XXX_EXTENDED_ADDR_REGISTER 29 6762306a36Sopenharmony_ci#define MV88E1XXX_EXTENDED_REGISTER 30 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* PHY specific control register fields */ 7062306a36Sopenharmony_ci#define S_PSCR_MDI_XOVER_MODE 5 7162306a36Sopenharmony_ci#define M_PSCR_MDI_XOVER_MODE 0x3 7262306a36Sopenharmony_ci#define V_PSCR_MDI_XOVER_MODE(x) ((x) << S_PSCR_MDI_XOVER_MODE) 7362306a36Sopenharmony_ci#define G_PSCR_MDI_XOVER_MODE(x) (((x) >> S_PSCR_MDI_XOVER_MODE) & M_PSCR_MDI_XOVER_MODE) 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci/* Extended PHY specific control register fields */ 7662306a36Sopenharmony_ci#define S_DOWNSHIFT_ENABLE 8 7762306a36Sopenharmony_ci#define V_DOWNSHIFT_ENABLE (1 << S_DOWNSHIFT_ENABLE) 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define S_DOWNSHIFT_CNT 9 8062306a36Sopenharmony_ci#define M_DOWNSHIFT_CNT 0x7 8162306a36Sopenharmony_ci#define V_DOWNSHIFT_CNT(x) ((x) << S_DOWNSHIFT_CNT) 8262306a36Sopenharmony_ci#define G_DOWNSHIFT_CNT(x) (((x) >> S_DOWNSHIFT_CNT) & M_DOWNSHIFT_CNT) 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci/* PHY specific status register fields */ 8562306a36Sopenharmony_ci#define S_PSSR_JABBER 0 8662306a36Sopenharmony_ci#define V_PSSR_JABBER (1 << S_PSSR_JABBER) 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci#define S_PSSR_POLARITY 1 8962306a36Sopenharmony_ci#define V_PSSR_POLARITY (1 << S_PSSR_POLARITY) 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci#define S_PSSR_RX_PAUSE 2 9262306a36Sopenharmony_ci#define V_PSSR_RX_PAUSE (1 << S_PSSR_RX_PAUSE) 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci#define S_PSSR_TX_PAUSE 3 9562306a36Sopenharmony_ci#define V_PSSR_TX_PAUSE (1 << S_PSSR_TX_PAUSE) 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci#define S_PSSR_ENERGY_DETECT 4 9862306a36Sopenharmony_ci#define V_PSSR_ENERGY_DETECT (1 << S_PSSR_ENERGY_DETECT) 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci#define S_PSSR_DOWNSHIFT_STATUS 5 10162306a36Sopenharmony_ci#define V_PSSR_DOWNSHIFT_STATUS (1 << S_PSSR_DOWNSHIFT_STATUS) 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci#define S_PSSR_MDI 6 10462306a36Sopenharmony_ci#define V_PSSR_MDI (1 << S_PSSR_MDI) 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci#define S_PSSR_CABLE_LEN 7 10762306a36Sopenharmony_ci#define M_PSSR_CABLE_LEN 0x7 10862306a36Sopenharmony_ci#define V_PSSR_CABLE_LEN(x) ((x) << S_PSSR_CABLE_LEN) 10962306a36Sopenharmony_ci#define G_PSSR_CABLE_LEN(x) (((x) >> S_PSSR_CABLE_LEN) & M_PSSR_CABLE_LEN) 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ci#define S_PSSR_LINK 10 11262306a36Sopenharmony_ci#define V_PSSR_LINK (1 << S_PSSR_LINK) 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci#define S_PSSR_STATUS_RESOLVED 11 11562306a36Sopenharmony_ci#define V_PSSR_STATUS_RESOLVED (1 << S_PSSR_STATUS_RESOLVED) 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci#define S_PSSR_PAGE_RECEIVED 12 11862306a36Sopenharmony_ci#define V_PSSR_PAGE_RECEIVED (1 << S_PSSR_PAGE_RECEIVED) 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci#define S_PSSR_DUPLEX 13 12162306a36Sopenharmony_ci#define V_PSSR_DUPLEX (1 << S_PSSR_DUPLEX) 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci#define S_PSSR_SPEED 14 12462306a36Sopenharmony_ci#define M_PSSR_SPEED 0x3 12562306a36Sopenharmony_ci#define V_PSSR_SPEED(x) ((x) << S_PSSR_SPEED) 12662306a36Sopenharmony_ci#define G_PSSR_SPEED(x) (((x) >> S_PSSR_SPEED) & M_PSSR_SPEED) 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci#endif 129