generic: ar8216: add defines for the AR8316 POSTRIP register
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 10 Feb 2013 13:18:48 +0000 (13:18 +0000)
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 10 Feb 2013 13:18:48 +0000 (13:18 +0000)
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35539 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/generic/files/drivers/net/phy/ar8216.c
target/linux/generic/files/drivers/net/phy/ar8216.h

index ec6d232..720b0ee 100644 (file)
@@ -788,7 +788,7 @@ ar8316_hw_init(struct ar8216_priv *priv)
        u32 val, newval;
        struct mii_bus *bus;
 
-       val = priv->read(priv, 0x8);
+       val = priv->read(priv, AR8316_REG_POSTRIP);
 
        if (priv->phy->interface == PHY_INTERFACE_MODE_RGMII) {
                if (priv->port4_phy) {
@@ -812,7 +812,7 @@ ar8316_hw_init(struct ar8216_priv *priv)
        if (val == newval)
                goto out;
 
-       priv->write(priv, 0x8, newval);
+       priv->write(priv, AR8316_REG_POSTRIP, newval);
 
        /* Initialize the ports */
        bus = priv->mii_bus;
index c83bf44..95d9a96 100644 (file)
 #define AR8236_STATS_TXDEFER           0xa0
 #define AR8236_STATS_TXLATECOL         0xa4
 
+#define AR8316_REG_POSTRIP                     0x0008
+#define   AR8316_POSTRIP_MAC0_GMII_EN          BIT(0)
+#define   AR8316_POSTRIP_MAC0_RGMII_EN         BIT(1)
+#define   AR8316_POSTRIP_PHY4_GMII_EN          BIT(2)
+#define   AR8316_POSTRIP_PHY4_RGMII_EN         BIT(3)
+#define   AR8316_POSTRIP_MAC0_MAC_MODE         BIT(4)
+#define   AR8316_POSTRIP_RTL_MODE              BIT(5)
+#define   AR8316_POSTRIP_RGMII_RXCLK_DELAY_EN  BIT(6)
+#define   AR8316_POSTRIP_RGMII_TXCLK_DELAY_EN  BIT(7)
+#define   AR8316_POSTRIP_SERDES_EN             BIT(8)
+#define   AR8316_POSTRIP_SEL_ANA_RST           BIT(9)
+#define   AR8316_POSTRIP_GATE_25M_EN           BIT(10)
+#define   AR8316_POSTRIP_SEL_CLK25M            BIT(11)
+#define   AR8316_POSTRIP_HIB_PULSE_HW          BIT(12)
+#define   AR8316_POSTRIP_DBG_MODE_I            BIT(13)
+#define   AR8316_POSTRIP_MAC5_MAC_MODE         BIT(14)
+#define   AR8316_POSTRIP_MAC5_PHY_MODE         BIT(15)
+#define   AR8316_POSTRIP_POWER_DOWN_HW         BIT(16)
+#define   AR8316_POSTRIP_LPW_STATE_EN          BIT(17)
+#define   AR8316_POSTRIP_MAN_EN                        BIT(18)
+#define   AR8316_POSTRIP_PHY_PLL_ON            BIT(19)
+#define   AR8316_POSTRIP_LPW_EXIT              BIT(20)
+#define   AR8316_POSTRIP_TXDELAY_S0            BIT(21)
+#define   AR8316_POSTRIP_TXDELAY_S1            BIT(22)
+#define   AR8316_POSTRIP_RXDELAY_S0            BIT(23)
+#define   AR8316_POSTRIP_LED_OPEN_EN           BIT(24)
+#define   AR8316_POSTRIP_SPI_EN                        BIT(25)
+#define   AR8316_POSTRIP_RXDELAY_S1            BIT(26)
+#define   AR8316_POSTRIP_POWER_ON_SEL          BIT(31)
+
 #define AR8327_NUM_PORTS       7
 #define AR8327_NUM_PHYS                5
 #define AR8327_PORTS_ALL       0x7f