summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/mips/cavium/if_octm.c27
-rw-r--r--sys/mips/cavium/octe/ethernet-common.c14
2 files changed, 37 insertions, 4 deletions
diff --git a/sys/mips/cavium/if_octm.c b/sys/mips/cavium/if_octm.c
index f2db3a9..68969ee 100644
--- a/sys/mips/cavium/if_octm.c
+++ b/sys/mips/cavium/if_octm.c
@@ -64,6 +64,8 @@
#include <contrib/octeon-sdk/cvmx-interrupt.h>
#include <contrib/octeon-sdk/cvmx-mgmt-port.h>
+extern cvmx_bootinfo_t *octeon_bootinfo;
+
struct octm_softc {
struct ifnet *sc_ifp;
device_t sc_dev;
@@ -173,10 +175,27 @@ octm_attach(device_t dev)
return (ENXIO);
}
- mac = cvmx_mgmt_port_get_mac(sc->sc_port);
- if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) {
- device_printf(dev, "unable to read MAC.\n");
- return (ENXIO);
+ switch (cvmx_sysinfo_get()->board_type) {
+#if defined(OCTEON_VENDOR_LANNER)
+ case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
+ /*
+ * The MR-730 uses its first two MACs for the management
+ * ports.
+ */
+ mac = 0;
+ memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base,
+ 6);
+ mac += sc->sc_port;
+ cvmx_mgmt_port_set_mac(sc->sc_port, mac);
+ break;
+#endif
+ default:
+ mac = cvmx_mgmt_port_get_mac(sc->sc_port);
+ if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) {
+ device_printf(dev, "unable to read MAC.\n");
+ return (ENXIO);
+ }
+ break;
}
/* No watermark for input ring. */
diff --git a/sys/mips/cavium/octe/ethernet-common.c b/sys/mips/cavium/octe/ethernet-common.c
index b107749..415c3d4 100644
--- a/sys/mips/cavium/octe/ethernet-common.c
+++ b/sys/mips/cavium/octe/ethernet-common.c
@@ -279,6 +279,20 @@ int cvm_oct_common_init(struct ifnet *ifp)
octeon_bootinfo->mac_addr_base[5] + count};
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
+ switch (cvmx_sysinfo_get()->board_type) {
+#if defined(OCTEON_VENDOR_LANNER)
+ case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
+ /*
+ * The MR-730 uses its first two MACs for the management
+ * ports.
+ */
+ mac[5] += 2;
+ break;
+#endif
+ default:
+ break;
+ }
+
ifp->if_mtu = ETHERMTU;
count++;
OpenPOWER on IntegriCloud