Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/allwinner Better safe than sorry: do the full c...



details:   https://anonhg.NetBSD.org/src/rev/6e593d835e00
branches:  trunk
changeset: 332156:6e593d835e00
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Sep 09 10:03:43 2014 +0000

description:
Better safe than sorry: do the full clock setup, and pass the MII clock
used (depending on board configuration, we use RGMII mode) to the
core attach function.

diffstat:

 sys/arch/arm/allwinner/awin_gige.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r d1bb0d09d873 -r 6e593d835e00 sys/arch/arm/allwinner/awin_gige.c
--- a/sys/arch/arm/allwinner/awin_gige.c        Tue Sep 09 07:18:35 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_gige.c        Tue Sep 09 10:03:43 2014 +0000
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_gige.c,v 1.5 2014/09/08 14:26:16 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_gige.c,v 1.6 2014/09/09 10:03:43 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -129,7 +129,20 @@
        aprint_normal_dev(self, "interrupting on irq %d\n",
             loc->loc_intr);
 
-       dwc_gmac_attach(&sc->sc_core, ep);
+       /*
+        * Enable GMAC clock
+        */
+       awin_reg_set_clear(aio->aio_core_bst, aio->aio_ccm_bsh,
+           AWIN_AHB_GATING1_REG, AWIN_AHB_GATING1_GMAC, 0);
+       /*
+        * We use RGMII phy mode, set up clock accordingly
+        */
+       awin_reg_set_clear(aio->aio_core_bst, aio->aio_ccm_bsh,
+           AWIN_GMAC_CLK_REG, 4, 3);
+       awin_reg_set_clear(aio->aio_core_bst, aio->aio_ccm_bsh,
+           AWIN_GMAC_CLK_REG, 2, 0);
+
+       dwc_gmac_attach(&sc->sc_core, ep, 2);
 }
 
 



Home | Main Index | Thread Index | Old Index