]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cpsw: remember the silicon version
authorRichard Cochran <richardcochran@gmail.com>
Mon, 29 Oct 2012 08:45:14 +0000 (08:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Nov 2012 16:21:29 +0000 (12:21 -0400)
This patch lets the CPSW driver remember the version number in order to
support the two different variants already in the wild.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index b4ca370a4e6709fdcadc6265043a7d1893b8fef0..5c427cf1ef87942d5d605aa83ce3c24aead9b228 100644 (file)
@@ -76,6 +76,8 @@ do {                                                          \
 #define CPSW_MINOR_VERSION(reg)                (reg & 0xff)
 #define CPSW_RTL_VERSION(reg)          ((reg >> 11) & 0x1f)
 
+#define CPSW_VERSION_1         0x19010a
+#define CPSW_VERSION_2         0x19010c
 #define CPDMA_RXTHRESH         0x0c0
 #define CPDMA_RXFREE           0x0e0
 #define CPDMA_TXHDP            0x00
@@ -216,6 +218,7 @@ struct cpsw_priv {
        struct cpsw_wr_regs __iomem     *wr_regs;
        struct cpsw_host_regs __iomem   *host_port_regs;
        u32                             msg_enable;
+       u32                             version;
        struct net_device_stats         stats;
        int                             rx_packet_max;
        int                             host_port;
@@ -540,6 +543,7 @@ static int cpsw_ndo_open(struct net_device *ndev)
        pm_runtime_get_sync(&priv->pdev->dev);
 
        reg = __raw_readl(&priv->regs->id_ver);
+       priv->version = reg;
 
        dev_info(priv->dev, "initializing cpsw version %d.%d (%d)\n",
                 CPSW_MAJOR_VERSION(reg), CPSW_MINOR_VERSION(reg),