]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net: keystone_net: remove SoC specific emac_regs structure
authorHao Zhang <hzhang@ti.com>
Mon, 29 Sep 2014 19:17:20 +0000 (22:17 +0300)
committerTom Rini <trini@ti.com>
Thu, 23 Oct 2014 15:27:05 +0000 (11:27 -0400)
This patch removes K2HK SOC specifc emac_regs structure, it uses
soc specific register offset to keep the network driver common across
all the Keystone II EVMs.

Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Hao Zhang <hzhang@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
arch/arm/include/asm/arch-keystone/emac_defs.h
drivers/net/keystone_net.c

index 9cd8925819922a08de3b915ac5b3e7399c9c6523..47e0ada907479f4566bd20dd3facb92c386f36d4 100644 (file)
@@ -202,21 +202,6 @@ struct mdio_regs {
        dv_reg          userphysel1;
 };
 
-/* Ethernet MAC Registers Structure */
-struct emac_regs {
-       dv_reg          idver;
-       dv_reg          maccontrol;
-       dv_reg          macstatus;
-       dv_reg          soft_reset;
-       dv_reg          rx_maxlen;
-       u32             rsvd0;
-       dv_reg          rx_pause;
-       dv_reg          tx_pause;
-       dv_reg          emcontrol;
-       dv_reg          pri_map;
-       u32             rsvd1[6];
-};
-
 #define SGMII_ACCESS(port, reg) \
        *((volatile unsigned int *)(sgmiis[port] + reg))
 
index 66532eef205753544b547f39e0d8e7f492837cb2..4abde57cc80d2c40a503713211902e6ba1b1ea6d 100644 (file)
@@ -45,8 +45,6 @@ static void keystone2_eth_mdio_enable(void);
 static int gen_get_link_speed(int phy_addr);
 
 /* EMAC Addresses */
-static volatile struct emac_regs       *adap_emac =
-       (struct emac_regs *)EMAC_EMACSL_BASE_ADDR;
 static volatile struct mdio_regs       *adap_mdio =
        (struct mdio_regs *)EMAC_MDIO_BASE_ADDR;
 
@@ -169,10 +167,10 @@ static void  __attribute__((unused))
         * Check if link detected is giga-bit
         * If Gigabit mode detected, enable gigbit in MAC
         */
-       writel(readl(&(adap_emac[eth_priv->slave_port - 1].maccontrol)) |
+       writel(readl(DEVICE_EMACSL_BASE(eth_priv->slave_port - 1) +
+                    CPGMACSL_REG_CTL) |
               EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
-              &(adap_emac[eth_priv->slave_port - 1].maccontrol))
-               ;
+              DEVICE_EMACSL_BASE(eth_priv->slave_port - 1) + CPGMACSL_REG_CTL);
 }
 
 int keystone_sgmii_link_status(int port)