aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/jme.h
diff options
context:
space:
mode:
authorGuo-Fu Tseng <cooldavid@cooldavid.org>2011-02-13 13:27:35 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-13 23:43:20 -0500
commit4872b11fdbbf78665230b2bb5864b1611dcb4a25 (patch)
treedaa51591b2f7f2b515a549d98ed92d61f66475fb /drivers/net/jme.h
parent19d96017d1b5b1c9b709bc21a398ea793256644c (diff)
jme: PHY Power control for new chip
After main chip rev 5, the hardware support more power saving control registers. Some Non-Linux drivers might turn off the phy power with new interfaces, this patch makes it possible for Linux to turn it on again. Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jme.h')
-rw-r--r--drivers/net/jme.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index 32b2a9ddbcd6..c3764fc151c9 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -103,6 +103,37 @@ enum jme_spi_op_bits {
103#define HALF_US 500 /* 500 ns */ 103#define HALF_US 500 /* 500 ns */
104#define JMESPIIOCTL SIOCDEVPRIVATE 104#define JMESPIIOCTL SIOCDEVPRIVATE
105 105
106#define PCI_PRIV_PE1 0xE4
107
108enum pci_priv_pe1_bit_masks {
109 PE1_ASPMSUPRT = 0x00000003, /*
110 * RW:
111 * Aspm_support[1:0]
112 * (R/W Port of 5C[11:10])
113 */
114 PE1_MULTIFUN = 0x00000004, /* RW: Multi_fun_bit */
115 PE1_RDYDMA = 0x00000008, /* RO: ~link.rdy_for_dma */
116 PE1_ASPMOPTL = 0x00000030, /* RW: link.rx10s_option[1:0] */
117 PE1_ASPMOPTH = 0x000000C0, /* RW: 10_req=[3]?HW:[2] */
118 PE1_GPREG0 = 0x0000FF00, /*
119 * SRW:
120 * Cfg_gp_reg0
121 * [7:6] phy_giga BG control
122 * [5] CREQ_N as CREQ_N1 (CPPE# as CREQ#)
123 * [4:0] Reserved
124 */
125 PE1_GPREG0_PBG = 0x0000C000, /* phy_giga BG control */
126 PE1_GPREG1 = 0x00FF0000, /* RW: Cfg_gp_reg1 */
127 PE1_REVID = 0xFF000000, /* RO: Rev ID */
128};
129
130enum pci_priv_pe1_values {
131 PE1_GPREG0_ENBG = 0x00000000, /* en BG */
132 PE1_GPREG0_PDD3COLD = 0x00004000, /* giga_PD + d3cold */
133 PE1_GPREG0_PDPCIESD = 0x00008000, /* giga_PD + pcie_shutdown */
134 PE1_GPREG0_PDPCIEIDDQ = 0x0000C000, /* giga_PD + pcie_iddq */
135};
136
106/* 137/*
107 * Dynamic(adaptive)/Static PCC values 138 * Dynamic(adaptive)/Static PCC values
108 */ 139 */
@@ -499,6 +530,7 @@ enum jme_iomap_regs {
499 JME_PMCS = JME_MAC | 0x60, /* Power Management Control/Stat */ 530 JME_PMCS = JME_MAC | 0x60, /* Power Management Control/Stat */
500 531
501 532
533 JME_PHY_PWR = JME_PHY | 0x24, /* New PHY Power Ctrl Register */
502 JME_PHY_CS = JME_PHY | 0x28, /* PHY Ctrl and Status Register */ 534 JME_PHY_CS = JME_PHY | 0x28, /* PHY Ctrl and Status Register */
503 JME_PHY_LINK = JME_PHY | 0x30, /* PHY Link Status Register */ 535 JME_PHY_LINK = JME_PHY | 0x30, /* PHY Link Status Register */
504 JME_SMBCSR = JME_PHY | 0x40, /* SMB Control and Status */ 536 JME_SMBCSR = JME_PHY | 0x40, /* SMB Control and Status */
@@ -835,6 +867,21 @@ enum jme_pmcs_bit_masks {
835}; 867};
836 868
837/* 869/*
870 * New PHY Power Control Register
871 */
872enum jme_phy_pwr_bit_masks {
873 PHY_PWR_DWN1SEL = 0x01000000, /* Phy_giga.p_PWR_DOWN1_SEL */
874 PHY_PWR_DWN1SW = 0x02000000, /* Phy_giga.p_PWR_DOWN1_SW */
875 PHY_PWR_DWN2 = 0x04000000, /* Phy_giga.p_PWR_DOWN2 */
876 PHY_PWR_CLKSEL = 0x08000000, /*
877 * XTL_OUT Clock select
878 * (an internal free-running clock)
879 * 0: xtl_out = phy_giga.A_XTL25_O
880 * 1: xtl_out = phy_giga.PD_OSC
881 */
882};
883
884/*
838 * Giga PHY Status Registers 885 * Giga PHY Status Registers
839 */ 886 */
840enum jme_phy_link_bit_mask { 887enum jme_phy_link_bit_mask {
@@ -1191,6 +1238,11 @@ static inline int is_buggy250(unsigned short device, u8 chiprev)
1191 return device == PCI_DEVICE_ID_JMICRON_JMC250 && chiprev == 0x11; 1238 return device == PCI_DEVICE_ID_JMICRON_JMC250 && chiprev == 0x11;
1192} 1239}
1193 1240
1241static inline int new_phy_power_ctrl(u8 chip_main_rev)
1242{
1243 return chip_main_rev >= 5;
1244}
1245
1194/* 1246/*
1195 * Function prototypes 1247 * Function prototypes
1196 */ 1248 */