Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1009238ybz; Wed, 29 Apr 2020 13:21:13 -0700 (PDT) X-Google-Smtp-Source: APiQypJ55wSHeexWZnRvP/UmBSR6+1u2Gr4B8S5CVXOeXNFHGsKCvKOx8PSwq/rSXquEBybv+ntK X-Received: by 2002:aa7:df8a:: with SMTP id b10mr4209802edy.263.1588191672996; Wed, 29 Apr 2020 13:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588191672; cv=none; d=google.com; s=arc-20160816; b=dKZW4CKw+3MarrRQCua5ddOe+3gs1dfUM/6jL8dWqc7qWgSyvXygqErWfXT6gkZhyy iMo++Uk2EiUazr9Px9qD1S+vn9IO/PhxDmnIyDSDRw4laSAv1fjqnLsXmAAzS+ITznPG zQnll2IuNQ/YDsPyMa6B807/0iZd6fKvttmFmCxMRapQnw3WJSqW+ft3Oy+vi0l6T0mv XcnO386cAzJDs4WCmsNdA3oS+rXR33aNZNjVdRTIl0iugSvqJVB1WaEvkZswRdMxieHB /3wEXKvRBXoYdkg69VTDmMZ7dtNUp72/AVp0zOdM35v4hPLL+8IfN1IqxVyaV+Xg9u5y zBtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GrVPUcTD2l9oJ0HPXx8l+PhUQ6rIzd+t7iX8qFgDDUE=; b=jS4mAc1lEL6pjq6i0umR4gzck2VtOqWOYnCIeZDg6XnTM8F+n/3yskj/FhihzGtHlf LY3iAXfukUYbYK2uqsFc77jw2OblcfzI7MmhzO5Ta+eb5D3c0SLiej1VDcHgd5HqvnA3 ELHaiiaH/nNxA0oSIz8hZCQoxyXqmfB0P9sp9JOPX4xWGXvxNYkzHutLi9/GDtoVNUff AuMTG+ereNPD0lJbmYTEXMwfZVYpAF3ohB7yNLz5Fiay/ZdesT8rCvk8McA8+cdrDjn+ GT9BANDRPdVcNtI6bZOP6GIsikLNDv1JVuu8oTCp9wSGfwJlBn5LxKPd6C/K26UC9E7l hdwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=ipE94I2o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si3864270edv.243.2020.04.29.13.20.49; Wed, 29 Apr 2020 13:21:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=ipE94I2o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbgD2URZ (ORCPT + 99 others); Wed, 29 Apr 2020 16:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbgD2URU (ORCPT ); Wed, 29 Apr 2020 16:17:20 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87F8FC03C1AE; Wed, 29 Apr 2020 13:17:20 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id u16so3468680wmc.5; Wed, 29 Apr 2020 13:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GrVPUcTD2l9oJ0HPXx8l+PhUQ6rIzd+t7iX8qFgDDUE=; b=ipE94I2oDHFBOK1wvyXv2dDCEJ+N4Iszv0sQleLMdWCyHveYpujY5johVU8kihYH9g Q7Mvf7UdOXUqBLc+R2xZks9rvgRzyn3pL4zurFd2YBqz9lByXmau8QYKuhkD+14Fn8tp Y/WJAgqkwxSN3441r2bv9I99b/EBoORAg9bRHbxaE4zOx9OifBcXW3OEx+0aIMVDnTnv bN0KuMUidxZT4TORBaoScSFlGk40WcxUfYWruGgESQ3T+72m6rtw64WqNT6vDhx6ZWCv rwIWOTKtw4QElEb19488qaxyVRxaKsCI08m+4+qpQcuztJdItKanL0/Ll2+F/12ze6so EmjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GrVPUcTD2l9oJ0HPXx8l+PhUQ6rIzd+t7iX8qFgDDUE=; b=GtFuEpnwiA5Rqgqumt6kVi5Nic+A76H5mnVT2ljSquDahHY/pqiTx8qrQgCorEVPud hUhYUqGI3a1OWf6DYwNhMFw5Mi3v8pche5yziy4EWrGzITTluOVLgXvTtDHBzdYLKOyy cnz2BCZ4MOaJjoLx0YwNB20Oe8bqIDb+ZySBStXQirvTr5okIlIMG2V4s9E//b4Uo+lu zmwsEpCsgQil2NzhBoo8pNOz5rI8wAkOXI740jT7cPKqLDztx4IiO6W0hhU/vK+zh9AX C4StOenayZ12DGsulXAds/sPS4LJxKYIxs6kD65T5bHocqLd872IsdRXvuPdzGVvzN8X WIIA== X-Gm-Message-State: AGi0Pub3wYIPq13FV3LbqQtuigy+ornUiC1cznf9YXJ01K0hzJ0kYqj3 hbS7LXoGxPwf/Gzcp+MHjok= X-Received: by 2002:a1c:6402:: with SMTP id y2mr5205603wmb.116.1588191438299; Wed, 29 Apr 2020 13:17:18 -0700 (PDT) Received: from localhost.localdomain (p200300F137142E00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:3714:2e00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id q143sm9923623wme.31.2020.04.29.13.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 13:17:17 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org Cc: jianxin.pan@amlogic.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Martin Blumenstingl Subject: [PATCH RFC v2 05/11] net: stmmac: dwmac-meson8b: Add the PRG_ETH0_ADJ_* bits Date: Wed, 29 Apr 2020 22:16:38 +0200 Message-Id: <20200429201644.1144546-6-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429201644.1144546-1-martin.blumenstingl@googlemail.com> References: <20200429201644.1144546-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PRG_ETH0_ADJ_* are used for applying the RGMII RX delay. The public datasheets only have very limited description for these registers, but Jianxin Pan provided more detailed documentation from an (unnamed) Amlogic engineer. Add the PRG_ETH0_ADJ_* bits along with the improved description. Suggested-by: Jianxin Pan Signed-off-by: Martin Blumenstingl --- .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c index 1d7526ee09dd..70075628c58e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -48,6 +48,27 @@ #define PRG_ETH0_INVERTED_RMII_CLK BIT(11) #define PRG_ETH0_TX_AND_PHY_REF_CLK BIT(12) +/* Bypass (= 0, the signal from the GPIO input directly connects to the + * internal sampling) or enable (= 1) the internal logic for RXEN and RXD[3:0] + * timing tuning. + */ +#define PRG_ETH0_ADJ_ENABLE BIT(13) +/* Controls whether the RXEN and RXD[3:0] signals should be aligned with the + * input RX rising/falling edge and sent to the Ethernet internals. This sets + * the automatically delay and skew automatically (internally). + */ +#define PRG_ETH0_ADJ_SETUP BIT(14) +/* An internal counter based on the "timing-adjustment" clock. The counter is + * cleared on both, the falling and rising edge of the RX_CLK. This selects the + * delay (= the counter value) when to start sampling RXEN and RXD[3:0]. + */ +#define PRG_ETH0_ADJ_DELAY GENMASK(19, 15) +/* Adjusts the skew between each bit of RXEN and RXD[3:0]. If a signal has a + * large input delay, the bit for that signal (RXEN = bit 0, RXD[3] = bit 1, + * ...) can be configured to be 1 to compensate for a delay of about 1ns. + */ +#define PRG_ETH0_ADJ_SKEW GENMASK(24, 20) + #define MUX_CLK_NUM_PARENTS 2 struct meson8b_dwmac; -- 2.26.2