aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/jme.h
diff options
context:
space:
mode:
authorakeemting <akeem@jmicron.com>2008-12-04 00:19:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-04 00:19:16 -0500
commit4f40bf46897ddb57f149c0758f0cef0cc7782f7f (patch)
tree98a0e6000bf92f26b0a2f75afbe8daf8f6f602d5 /drivers/net/jme.h
parent59e4220a1112bf65924bc2e47b5757911b6f349b (diff)
jme: GHC register control fix for new hardware
Due to the hardware design, except the first chip on the market, other chips needs to setup the clock source for MAC processor implicitly through Global Host Control Register(GHC). (Strange design huh?) 10/100M uses the PCI-E as clock source, and 1G uses GPHY. And I reordered the code a little, to make it easier to read. Found-by: "Ethan" <ethanhsiao@jmicron.com> Fixed-by: "akeemting" <akeem@jmicron.com> Signed-off-by: "Guo-Fu Tseng" <cooldavid@cooldavid.org> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jme.h')
-rw-r--r--drivers/net/jme.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index f863aee6648b..adaf3ddbf783 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -815,16 +815,30 @@ static inline u32 smi_phy_addr(int x)
815 * Global Host Control 815 * Global Host Control
816 */ 816 */
817enum jme_ghc_bit_mask { 817enum jme_ghc_bit_mask {
818 GHC_SWRST = 0x40000000, 818 GHC_SWRST = 0x40000000,
819 GHC_DPX = 0x00000040, 819 GHC_DPX = 0x00000040,
820 GHC_SPEED = 0x00000030, 820 GHC_SPEED = 0x00000030,
821 GHC_LINK_POLL = 0x00000001, 821 GHC_LINK_POLL = 0x00000001,
822}; 822};
823 823
824enum jme_ghc_speed_val { 824enum jme_ghc_speed_val {
825 GHC_SPEED_10M = 0x00000010, 825 GHC_SPEED_10M = 0x00000010,
826 GHC_SPEED_100M = 0x00000020, 826 GHC_SPEED_100M = 0x00000020,
827 GHC_SPEED_1000M = 0x00000030, 827 GHC_SPEED_1000M = 0x00000030,
828};
829
830enum jme_ghc_to_clk {
831 GHC_TO_CLK_OFF = 0x00000000,
832 GHC_TO_CLK_GPHY = 0x00400000,
833 GHC_TO_CLK_PCIE = 0x00800000,
834 GHC_TO_CLK_INVALID = 0x00C00000,
835};
836
837enum jme_ghc_txmac_clk {
838 GHC_TXMAC_CLK_OFF = 0x00000000,
839 GHC_TXMAC_CLK_GPHY = 0x00100000,
840 GHC_TXMAC_CLK_PCIE = 0x00200000,
841 GHC_TXMAC_CLK_INVALID = 0x00300000,
828}; 842};
829 843
830/* 844/*