Author: yongari
Date: Wed Oct 10 04:38:29 2012
New Revision: 241392
URL: http://svn.freebsd.org/changeset/base/241392

Log:
  Fix a long standing VCPU reset sequence bug on BCM5906.
  The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to
  control the bootcode execution and to pick up configuration data
  stored inside the EEPROM.
  The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET
  bit to decide which booting procedure to choose.
  Data sheet indicates the VCPU of BCM5906 should set
  BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c   Wed Oct 10 02:35:10 2012        (r241391)
+++ head/sys/dev/bge/if_bge.c   Wed Oct 10 04:38:29 2012        (r241392)
@@ -3616,6 +3616,15 @@ bge_reset(struct bge_softc *sc)
                }
        }
 
+       if (sc->bge_asicrev == BGE_ASICREV_BCM5906) {
+               val = CSR_READ_4(sc, BGE_VCPU_STATUS);
+               CSR_WRITE_4(sc, BGE_VCPU_STATUS,
+                   val | BGE_VCPU_STATUS_DRV_RESET);
+               val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL);
+               CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL,
+                   val & ~BGE_VCPU_EXT_CTRL_HALT_CPU);
+       }
+
        /*
         * Set GPHY Power Down Override to leave GPHY
         * powered up in D0 uninitialized.
@@ -3627,15 +3636,6 @@ bge_reset(struct bge_softc *sc)
        /* Issue global reset */
        write_op(sc, BGE_MISC_CFG, reset);
 
-       if (sc->bge_asicrev == BGE_ASICREV_BCM5906) {
-               val = CSR_READ_4(sc, BGE_VCPU_STATUS);
-               CSR_WRITE_4(sc, BGE_VCPU_STATUS,
-                   val | BGE_VCPU_STATUS_DRV_RESET);
-               val = CSR_READ_4(sc, BGE_VCPU_EXT_CTRL);
-               CSR_WRITE_4(sc, BGE_VCPU_EXT_CTRL,
-                   val & ~BGE_VCPU_EXT_CTRL_HALT_CPU);
-       }
-
        DELAY(1000);
 
        /* XXX: Broadcom Linux driver. */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to