blackfin: Initialize the EMAC VLAN with proper default value
authorAaron Wu <Aaron.Wu@analog.com>
Wed, 23 Nov 2011 03:23:56 +0000 (11:23 +0800)
committerSonic Zhang <sonic.zhang@analog.com>
Fri, 7 Feb 2014 03:18:06 +0000 (11:18 +0800)
EMAC_VLANx regs is not properly initiallized in u-boot, once it's overwrite in the
kernel when DSA enabled, hot reset will lead to bringing up EMAC fail in u-boot.

Signed-off-by: Aaron Wu <Aaron.Wu@analog.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
arch/blackfin/include/asm/mach-common/bits/emac.h
drivers/net/bfin_mac.c

index 7a43bbb1a39ab134e271cda65351ddf1a1898555..4c9bc9dc57151c2b1bb71b58ccdfde36af3a2729 100644 (file)
 #define        TX_GE1024_CNT   0x00200000      /* 1024-Max-Byte TX Frames Sent */
 #define        TX_ABORT_CNT    0x00400000      /* TX Frames Aborted */
 
+/*default value for EMAC_VLANx reg*/
+#define EMAC_VLANX_DEF_VAL 0xFFFF
+
 #endif
index 0ffd59d49780ec5ddf76a357079dd74ccbc72031..42e208cfb60fcc79f0cd0fd1d565c3facf5543e8 100644 (file)
@@ -259,6 +259,8 @@ static int bfin_miiphy_init(struct eth_device *dev, int *opmode)
                *opmode = 0;
 
        bfin_write_EMAC_MMC_CTL(RSTC | CROLL);
+       bfin_write_EMAC_VLAN1(EMAC_VLANX_DEF_VAL);
+       bfin_write_EMAC_VLAN2(EMAC_VLANX_DEF_VAL);
 
        /* Initialize the TX DMA channel registers */
        bfin_write_DMA2_X_COUNT(0);