From owner-svn-src-head@freebsd.org Wed Jun 20 14:45:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E679101CBED; Wed, 20 Jun 2018 14:45:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121097D1B1; Wed, 20 Jun 2018 14:45:27 +0000 (UTC) (envelope-from manu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4D8E239CB; Wed, 20 Jun 2018 14:45:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KEjQdg072281; Wed, 20 Jun 2018 14:45:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KEjQai072280; Wed, 20 Jun 2018 14:45:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806201445.w5KEjQai072280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 20 Jun 2018 14:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335443 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 335443 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.26 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, 20 Jun 2018 14:45:27 -0000 Author: manu Date: Wed Jun 20 14:45:26 2018 New Revision: 335443 URL: https://svnweb.freebsd.org/changeset/base/335443 Log: if_rk_dwc: Fix delays handling The property are named {t,r}x_delay and not {t,r}-delay. The upper bits of the register are a mask of which bits is allowed to be written, set it otherwise we write nothing. OF_getencprop returns <0 = for an error. Pointy Hat: myself Reported by: jmcneill (delay and mask bits) Modified: head/sys/arm64/rockchip/if_dwc_rk.c Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Wed Jun 20 13:30:35 2018 (r335442) +++ head/sys/arm64/rockchip/if_dwc_rk.c Wed Jun 20 14:45:26 2018 (r335443) @@ -70,16 +70,17 @@ rk3328_set_delays(struct syscon *grf, phandle_t node) { uint32_t tx, rx; - if (OF_getencprop(node, "tx-delay", &tx, sizeof(tx)) >= 0) + if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) tx = 0x30; - if (OF_getencprop(node, "rx-delay", &rx, sizeof(rx)) >= 0) + if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) rx = 0x10; tx = ((tx & RK3328_GRF_MAC_CON0_TX_MASK) << RK3328_GRF_MAC_CON0_TX_SHIFT); rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) << RK3328_GRF_MAC_CON0_RX_SHIFT); - SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx); + + SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); } static int