summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2010-02-20 17:24:33 +0000
committerrrs <rrs@FreeBSD.org>2010-02-20 17:24:33 +0000
commitb41b03a2e00f8a2bc31f957f52bd31365caa5f32 (patch)
treecfcd45286e9dca0b9c3713ec000dc847b11a426b /sys/mips
parentf70d155673710bc1423bb490ac1b48e2a78b95d6 (diff)
downloadFreeBSD-src-b41b03a2e00f8a2bc31f957f52bd31365caa5f32.zip
FreeBSD-src-b41b03a2e00f8a2bc31f957f52bd31365caa5f32.tar.gz
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@gmail.com
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/rmi/board.c15
-rw-r--r--sys/mips/rmi/iodi.c14
2 files changed, 24 insertions, 5 deletions
diff --git a/sys/mips/rmi/board.c b/sys/mips/rmi/board.c
index 932fee2..ae7b43f 100644
--- a/sys/mips/rmi/board.c
+++ b/sys/mips/rmi/board.c
@@ -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;
diff --git a/sys/mips/rmi/iodi.c b/sys/mips/rmi/iodi.c
index 76796ad..dd8780b 100644
--- a/sys/mips/rmi/iodi.c
+++ b/sys/mips/rmi/iodi.c
@@ -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);
OpenPOWER on IntegriCloud