From owner-svn-src-all@FreeBSD.ORG Sat Feb 12 02:41:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 802B1106564A; Sat, 12 Feb 2011 02:41:33 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53E728FC14; Sat, 12 Feb 2011 02:41:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1C2fXTZ082320; Sat, 12 Feb 2011 02:41:33 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1C2fXPb082317; Sat, 12 Feb 2011 02:41:33 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201102120241.p1C2fXPb082317@svn.freebsd.org> From: Juli Mallett Date: Sat, 12 Feb 2011 02:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218594 - in head/sys/mips/cavium: . octe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Feb 2011 02:41:33 -0000 Author: jmallett Date: Sat Feb 12 02:41:33 2011 New Revision: 218594 URL: http://svn.freebsd.org/changeset/base/218594 Log: The Lanner MR-730 uses the first two MACs at its MAC base for the 10/100 management ports, and gigabit ports start at an offset of 2 from the MAC base. Modified: head/sys/mips/cavium/if_octm.c head/sys/mips/cavium/octe/ethernet-common.c Modified: head/sys/mips/cavium/if_octm.c ============================================================================== --- head/sys/mips/cavium/if_octm.c Sat Feb 12 02:14:19 2011 (r218593) +++ head/sys/mips/cavium/if_octm.c Sat Feb 12 02:41:33 2011 (r218594) @@ -64,6 +64,8 @@ #include #include +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. */ Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Sat Feb 12 02:14:19 2011 (r218593) +++ head/sys/mips/cavium/octe/ethernet-common.c Sat Feb 12 02:41:33 2011 (r218594) @@ -279,6 +279,20 @@ int cvm_oct_common_init(struct ifnet *if 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++;