From owner-svn-src-head@freebsd.org Wed Dec 27 18:22:04 2017 Return-Path: Delivered-To: svn-src-head@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 17F1EEA582B; Wed, 27 Dec 2017 18:22:04 +0000 (UTC) (envelope-from kevans@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 D3F3C70542; Wed, 27 Dec 2017 18:22:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRIM2Lp034928; Wed, 27 Dec 2017 18:22:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRIM2og034927; Wed, 27 Dec 2017 18:22:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712271822.vBRIM2og034927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 27 Dec 2017 18:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327240 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 18:22:04 -0000 Author: kevans Date: Wed Dec 27 18:22:02 2017 New Revision: 327240 URL: https://svnweb.freebsd.org/changeset/base/327240 Log: if_awg: Respect rgmii-*id PHY configurations phy-mode can be one of: rgmii, rgmii-id, rgmii-txid, rgmii-rxid; as this was written, any of these alternate -id configurations would break as we fail to configure syscon for rgmii. Instead, simply check that phy-mode is configured for rgmii and we'll let the PHY driver handle any internal delay configuration. The pine64 should eventually specify phy-mode = "rgmii-txid" to address gigabit issues when rx delay is configured, motivating this change. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Dec 27 15:39:31 2017 (r327239) +++ head/sys/arm/allwinner/if_awg.c Wed Dec 27 18:22:02 2017 (r327240) @@ -1177,7 +1177,7 @@ awg_setup_phy(device_t dev) if (sc->res[_RES_SYSCON] != NULL) { reg = bus_read_4(sc->res[_RES_SYSCON], 0); reg &= ~(EMAC_CLK_PIT | EMAC_CLK_SRC | EMAC_CLK_RMII_EN); - if (strcmp(phy_type, "rgmii") == 0) + if (strncmp(phy_type, "rgmii", 5) == 0) reg |= EMAC_CLK_PIT_RGMII | EMAC_CLK_SRC_RGMII; else if (strcmp(phy_type, "rmii") == 0) reg |= EMAC_CLK_RMII_EN; @@ -1217,7 +1217,7 @@ awg_setup_phy(device_t dev) device_printf(dev, "EMAC clock: 0x%08x\n", reg); bus_write_4(sc->res[_RES_SYSCON], 0, reg); } else { - if (strcmp(phy_type, "rgmii") == 0) + if (strncmp(phy_type, "rgmii", 5) == 0) tx_parent_name = "emac_int_tx"; else tx_parent_name = "mii_phy_tx";