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
This commit is contained in:
@@ -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;
|
||||
|
||||
+8
-4
@@ -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]);
|
||||
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]);
|
||||
}
|
||||
|
||||
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 & 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);
|
||||
|
||||
Reference in New Issue
Block a user