svn commit: r204137 - head/sys/mips/rmi

Randall Stewart rrs at FreeBSD.org
Sat Feb 20 17:24:34 UTC 2010


Author: rrs
Date: Sat Feb 20 17:24:33 2010
New Revision: 204137
URL: http://svn.freebsd.org/changeset/base/204137

Log:
  Fix for the rge driver for boards without rge6 and rge7.
  - changes to avoid adding theses instances on specific chips
  Obtained from:	C. Jayachandran - JC - c.jayachandran at gmail.com

Modified:
  head/sys/mips/rmi/board.c
  head/sys/mips/rmi/iodi.c

Modified: head/sys/mips/rmi/board.c
==============================================================================
--- head/sys/mips/rmi/board.c	Sat Feb 20 17:19:16 2010	(r204136)
+++ head/sys/mips/rmi/board.c	Sat Feb 20 17:24:33 2010	(r204137)
@@ -27,6 +27,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * *****************************RMI_2**********************************/
+#include <sys/cdefs.h>		/* RCS ID & Copyright macro defns */
+__FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
@@ -93,6 +95,7 @@ struct xlr_board_info xlr_board_info;
 int 
 xlr_board_info_setup()
 {
+
 	if (xlr_is_xls()) {
 		xlr_board_info.is_xls = 1;
 		xlr_board_info.nr_cpus = 8;
@@ -122,6 +125,18 @@ xlr_board_info_setup()
 		/* network block 1 */
 		xlr_board_info.gmac_block[1].type = XLR_GMAC;
 		xlr_board_info.gmac_block[1].enabled = 0xf;
+		if (xlr_is_xls4xx()) {
+			xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_GPIO_OFFSET);
+			uint32_t tmp;
+
+			/* some ports are not enabled on 4xx, figure this out
+			   from the GPIO fuse bank */
+			tmp = xlr_read_reg(mmio, 35);
+			if (tmp & (1<<28))
+				xlr_board_info.gmac_block[1].enabled &= ~0x8;
+			if (tmp & (1<<29))
+				xlr_board_info.gmac_block[1].enabled &= ~0x4;
+		}
 		xlr_board_info.gmac_block[1].credit_config = &xls_cc_table_gmac1;
 		xlr_board_info.gmac_block[1].station_txbase = MSGRNG_STNID_GMAC1_TX0;
 		xlr_board_info.gmac_block[1].station_rfr = MSGRNG_STNID_GMAC1_FR_0;

Modified: head/sys/mips/rmi/iodi.c
==============================================================================
--- head/sys/mips/rmi/iodi.c	Sat Feb 20 17:19:16 2010	(r204136)
+++ head/sys/mips/rmi/iodi.c	Sat Feb 20 17:24:33 2010	(r204137)
@@ -271,11 +271,15 @@ iodi_attach(device_t dev)
 			tmpd = device_add_child(dev, "rge", 5);
 			device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]);
 
-			tmpd = device_add_child(dev, "rge", 6);
-			device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]);
-
-			tmpd = device_add_child(dev, "rge", 7);
-			device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]);
+			if (xlr_board_info.gmac_block[1].enabled & 0x4) {
+				tmpd = device_add_child(dev, "rge", 6);
+				device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]);
+			}
+
+			if (xlr_board_info.gmac_block[1].enabled & 0x8) {
+				tmpd = device_add_child(dev, "rge", 7);
+				device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]);
+			}
 		} else if (xlr_board_info.gmac_block[1].type == XLR_XGMAC) {
 #if 0				/* XGMAC not yet */
 			tmpd = device_add_child(dev, "rge", 4);


More information about the svn-src-all mailing list