From owner-svn-src-all@freebsd.org Tue Nov 15 22:30:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BD5CC443E2; Tue, 15 Nov 2016 22:30:26 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 680291FAB; Tue, 15 Nov 2016 22:30:26 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAFMUPXr090544; Tue, 15 Nov 2016 22:30:25 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAFMUPep090542; Tue, 15 Nov 2016 22:30:25 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201611152230.uAFMUPep090542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Tue, 15 Nov 2016 22:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308702 - head/sys/dev/etherswitch/ip17x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 15 Nov 2016 22:30:26 -0000 Author: mizhka Date: Tue Nov 15 22:30:25 2016 New Revision: 308702 URL: https://svnweb.freebsd.org/changeset/base/308702 Log: [etherswitch] enable phy4/mac4 of ip175c If MII1 interface is disabled, then enable phy4/mac4. Submitted by: Hiroki Mori Reviewed by: mizhka, adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6832 Modified: head/sys/dev/etherswitch/ip17x/ip175c.c head/sys/dev/etherswitch/ip17x/ip175c.h Modified: head/sys/dev/etherswitch/ip17x/ip175c.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175c.c Tue Nov 15 22:18:52 2016 (r308701) +++ head/sys/dev/etherswitch/ip17x/ip175c.c Tue Nov 15 22:30:25 2016 (r308702) @@ -234,6 +234,13 @@ ip175c_get_vlan_mode(struct ip17x_softc void ip175c_attach(struct ip17x_softc *sc) { + uint32_t data; + + data = ip17x_readphy(sc->sc_dev, IP175C_MII_PHY, IP175C_MII_CTL_REG); + device_printf(sc->sc_dev, "MII: %x\n", data); + /* check mii1 interface if disabled then phy4 and mac4 hold on switch */ + if((data & (1 << IP175C_MII_MII1_RMII_EN)) == 0) + sc->phymask |= 0x10; sc->hal.ip17x_reset = ip175c_reset; sc->hal.ip17x_hw_setup = ip175c_hw_setup; Modified: head/sys/dev/etherswitch/ip17x/ip175c.h ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175c.h Tue Nov 15 22:18:52 2016 (r308701) +++ head/sys/dev/etherswitch/ip17x/ip175c.h Tue Nov 15 22:30:25 2016 (r308702) @@ -35,6 +35,9 @@ #define IP175C_MODE_REG 31 #define IP175C_RESET_PHY 30 #define IP175C_RESET_REG 0 +#define IP175C_MII_PHY 31 +#define IP175C_MII_CTL_REG 5 +#define IP175C_MII_MII1_RMII_EN 8 #define IP175C_LAST_VLAN 15