Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6916861ybp; Wed, 16 Oct 2019 00:35:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzLvLEzQ5+KGLDICA8+sOkufSG9I7obgPw1DyATaNFik/r0wMqlVNad2LYMZrYhc1eEtib X-Received: by 2002:a17:906:4ac8:: with SMTP id u8mr38968995ejt.193.1571211351335; Wed, 16 Oct 2019 00:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571211351; cv=none; d=google.com; s=arc-20160816; b=ORSYJCI4Gk9frhne7nYN/4PCXJIQCeNGzHUa5hrFNEioKtoReyiPGbDlMacdddcFUk WbpUIWL7MBbL0t0TlldH3AISn4k2CjVIIdXXGHJjraH0Wn1w0no2nscBxskLXve7t7hZ j22/3g3GT69gx/mYvxY1/lUVDZ9b534piYWwjg+TcmFu/fMKDwoBzrKJobp/VSZvlk70 mPzUVAaVVhk5KlZtLvLKv0Y6F6faArPMLx3W1OicJHHXvsuy7aGPNaSjlx5aUOJp8r03 h15AZGp9PHhnozJxz+RdKYpW5AFrnnL5rTDLB6Vydj14ieyR6ICZ/M/t81V9VxrqV9q3 PdWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=NkSOV4rPEF/xBI+7HXeWnh44zpsrJpGnj8aP9uw8FXY=; b=XArx2J7pXc0Kz8ocm0bfb2QC8O1l5SulE1oby0Mk6aN/6Vsb7c9Zm22SIbkCLM8U7T mmUPaZ6LzDYceSwYegQvtut3bvsKFNBo9k5OeKIE2VRBtivA1PafoDgKPVjUVHJOaEA1 zrwSSKX1lqjr+S0nCO7t43sR1a6rnnad3XIoTjyZbna6XpiSrHF5/BZN9UuF6mDDQAQ2 u4EYb0zBc8C9/IFRg3sqFKBsyMAmtP1GsjBKlX8VqA4PAHc5ywZcc+dYxl8XdVs35zA2 jeILGjy/3sMTqnsPGbVgS9yf9N5GlQsGNJex7D7nS03kP6ur7l/YDauqTq6pY2J7GmGI id0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LyXxGJ8p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j46si17548909eda.9.2019.10.16.00.35.27; Wed, 16 Oct 2019 00:35:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LyXxGJ8p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390025AbfJOWuS (ORCPT + 99 others); Tue, 15 Oct 2019 18:50:18 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33044 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbfJOWuR (ORCPT ); Tue, 15 Oct 2019 18:50:17 -0400 Received: by mail-pf1-f193.google.com with SMTP id q10so13425700pfl.0; Tue, 15 Oct 2019 15:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=NkSOV4rPEF/xBI+7HXeWnh44zpsrJpGnj8aP9uw8FXY=; b=LyXxGJ8p/rAeB9QrMKMqbjNO98NMw9b9qnM8Ek1zfx/ukcCUD04g3axxdwqzT3EwwK ks3SJuoI2TzA1yRfNXa9bZzYMxP2GADdtVu6J544gsjWbdv7mGp/Bm62c9eJudBPaDAf aD8827n+pWax61HDiRugnfNEEOIghHlEb3BsKoRnumWCrDH67+LHcb9fjg3ZEEui8Ouo mDeez794kmXyP7L3BFR3aEb9SE7Vy6U7k1Pi//uLXnTLS/QuPz2vJH0KBlMFuzjOHIhw pNGIoP+7tklqGa1eqVqldpqEGYXMJTb16KGGH/WOJzdUZyrsA+tj9OZ8yn+jEXStTFsl vwsQ== 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; bh=NkSOV4rPEF/xBI+7HXeWnh44zpsrJpGnj8aP9uw8FXY=; b=IN1YMI1C/OTJQNWy8/j+X0mZL53PlsPYX+zcYofjUZXlfnU56W1N7ZRRgXS7mmeY3O S1wx6FDuq3ocJ5GZok2DFJe02eLv4usgnOSGWRnRYtIAULnlNojx0f0Bq+3/yjKX1osE QyB1rlb2LcPp+ZEj/pwYqCg1aEB5vtaAxl9iwRvMiZrsapRGcKMzmKfD0WmtWqQoii84 2cqLwof8lk9HQwdQT+tKPC23W261GOYrGBLou/AMolfT6IiSplMVREFkYslPeZhDq3Nt 5Nfyf82FjwRsxiLRdwF5BPuP3X94DWycWCUmT+2gUbr5LyUjzw07/s5TTLTttIcjB3Y7 j9zw== X-Gm-Message-State: APjAAAXeJhonK6Jx1syTAUudHKlWDhXXsfLUUrdtjkm8zr0tBK4EYcdE mnZ1FNzHQZkKkJkdwwZjG2Q9tvp2 X-Received: by 2002:a63:da04:: with SMTP id c4mr40093706pgh.172.1571179816262; Tue, 15 Oct 2019 15:50:16 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x12sm20106171pfm.130.2019.10.15.15.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 15:50:15 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , "David S. Miller" , linux-kernel@vger.kernel.org (open list), hkallweit1@gmail.com, bcm-kernel-feedback-list@broadcom.com, olteanv@gmail.com, rmk+kernel@armlinux.org.uk, cphealy@gmail.com, Jose Abreu Subject: [PATCH net-next 0/2] net: phy: Add ability to debug RGMII connections Date: Tue, 15 Oct 2019 15:49:51 -0700 Message-Id: <20191015224953.24199-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This patch series is primarily intended to reduce the amount of support involved with bringing up RGMII connections with the PHY library (or PHYLINK) for that matter. The idea consists in looping back a packet we just crafted and check whether it did came back correctly, if that is the case, we are good, else we must try configuring the PHY for different delays until it either works or we bail out. As indicated in the commit message, future improvements could probably be done in order to converge faster on the appropriate configuration. This is intended to be PHY centric, and we are not playing with delays on the MAC side other than through the parsing of the phydev->interface. The typical output would look like this: [ 62.668701] bcmgenet 8f00000.ethernet eth0: Trying "rgmii-txid" PHY interface [ 62.676094] bcmgenet 8f00000.ethernet eth0: Determined "rgmii-txid" to be correct Feedback highly welcome on this! Florian Fainelli (2): net: phy: Use genphy_loopback() by default net: phy: Add ability to debug RGMII connections .../ABI/testing/sysfs-class-net-phydev | 11 + drivers/net/phy/Kconfig | 9 + drivers/net/phy/Makefile | 1 + drivers/net/phy/phy-rgmii-debug.c | 269 ++++++++++++++++++ drivers/net/phy/phy_device.c | 33 ++- include/linux/phy.h | 9 + 6 files changed, 331 insertions(+), 1 deletion(-) create mode 100644 drivers/net/phy/phy-rgmii-debug.c -- 2.17.1