Module Name:    src
Committed By:   jmcneill
Date:           Thu Nov  6 23:19:39 UTC 2014

Modified Files:
        src/sys/arch/arm/allwinner: awin_gige.c
        src/sys/arch/evbarm/awin: awin_machdep.c

Log Message:
extra (undocumented) clk init bits for bananapi gmac


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/allwinner/awin_gige.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/awin/awin_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/allwinner/awin_gige.c
diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.16 src/sys/arch/arm/allwinner/awin_gige.c:1.17
--- src/sys/arch/arm/allwinner/awin_gige.c:1.16	Mon Oct 20 20:02:16 2014
+++ src/sys/arch/arm/allwinner/awin_gige.c	Thu Nov  6 23:19:38 2014
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_gige.c,v 1.16 2014/10/20 20:02:16 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_gige.c,v 1.17 2014/11/06 23:19:38 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -169,6 +169,13 @@ awin_gige_attach(device_t parent, device
 		phy_type = "rgmii";
 	if (strcmp(phy_type, "rgmii") == 0) {
 		clkreg = AWIN_GMAC_CLK_PIT | AWIN_GMAC_CLK_TCS_INT_RGMII;
+	} else if (strcmp(phy_type, "rgmii-bpi") == 0) {
+		clkreg = AWIN_GMAC_CLK_PIT | AWIN_GMAC_CLK_TCS_INT_RGMII;
+		/*
+		 * These magic bits seem to be necessary for RGMII at gigabit
+		 * speeds on Banana Pi.
+		 */
+		clkreg |= __BITS(11,10);
 	} else if (strcmp(phy_type, "gmii") == 0) {
 		clkreg = AWIN_GMAC_CLK_TCS_INT_RGMII;
 	} else if (strcmp(phy_type, "mii") == 0) {

Index: src/sys/arch/evbarm/awin/awin_machdep.c
diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.23 src/sys/arch/evbarm/awin/awin_machdep.c:1.24
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.23	Thu Oct 30 00:32:55 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Thu Nov  6 23:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.23 2014/10/30 00:32:55 jmcneill Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.24 2014/11/06 23:19:38 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.23 2014/10/30 00:32:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.24 2014/11/06 23:19:38 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -742,6 +742,7 @@ awin_device_register(device_t self, void
 #endif
 #if AWIN_BOARD == AWIN_bpi
 		prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren");
+		prop_dictionary_set_cstring(dict, "phy-type", "rgmii-bpi");
 #endif
 		return;
 	}

Reply via email to