From patchwork Mon Jun 22 08:19:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 191311 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp829965ile; Mon, 22 Jun 2020 01:20:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUQjplc3F3YxhSxE2R9eKqRTBeyWxRnJGYSBz48Y0w9CHEP7nV4RM2ArinBKtEHigSNKv5 X-Received: by 2002:aa7:cd41:: with SMTP id v1mr15633851edw.378.1592814017327; Mon, 22 Jun 2020 01:20:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1592814017; cv=pass; d=google.com; s=arc-20160816; b=0AHB8kFJbdfn2XbE3SZ5jeO1VuPbPKvuYhE1G2w7wYJL4jp+5PCMRYFq2WveB9cU49 QWVEdxW7gZAgp6mIQXpMMHMBdKnUtLvYyn/PK4O4aEI270NjymkEXir4DPnYWgAfu2Fg Wp1whCzgkWxZEe4UEgdDrGSC7sRXAyItBlT48cmm/rthAOr8xP5a1j5+6hcYYXYCWrGy 9JsQ8eHFVCMPo0ZfEW8wJHan57G2xT9AMuCXcAxdMMfwNpALaEhhuJQo3n9cwEvLyqwJ c3/11gCJSXAKIXmh4rqdVeWOCyN2gO0uHQCq4VkO/qzFwkVqLTedf5PDkZ4VZvYGK2jf tFtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MdXrf3B7jXtCp9ePlyoUBxNRhxhHmmd8MtH0ZOd19Mc=; b=N/1EMIVOBkip4ZVCGwciPwcMtG5Ei5ghC122bXR96C3C3gbX0MYJzFq4qvaOs9VL/N W+nQ9ACC5pWgl1E2rOCv2X9PM5c5Rju2beDtMMecfC0sbFA0XvUjI0VlEQTMYmnUGsbx XJrbnBGDf/8UZLGe1M0K80dbH/Aox8YxvLTPkbZqWOmk8qGzOBYZl6mYHvHEnX2fQfFD wlKIREWt8Qs7+/on8Dn54oPKz9T5bR9pzBP2ZYYwWa6ZTymeNYVNGv/lhbKe8yOK2Cev 1QHSc/APsdZkJm7pVSTjJnnv8DLXbrUcBd1QNxDB3hzvDvRKOqJyw6CBgoVB5WabTkQ8 6rLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=HWQagWxO; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by7si3863850edb.540.2020.06.22.01.20.17; Mon, 22 Jun 2020 01:20:17 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=HWQagWxO; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbgFVIUQ (ORCPT + 9 others); Mon, 22 Jun 2020 04:20:16 -0400 Received: from mail-eopbgr140084.outbound.protection.outlook.com ([40.107.14.84]:64487 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726459AbgFVIUO (ORCPT ); Mon, 22 Jun 2020 04:20:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BIhNaNrrBcaoTJctQaJCab03c/x3PSGSX+VuteV3oZXt5r3/6f5VPXxV6bJGC0zrjRJVCGfkHgiitoV4UXugHhoW8Fm6EnwZuevD6E02BTU9PYnfoXAOzKLEwfjfzNMVISEFUBWTAkIW+PON79FL4NVCiVLBHbuyzTuYNtNc5PKzErGOBiLWBi3CJ5LOo+8XFPvKgRWE5/s72wTL+BtaqvJBMzpFMTrO6DqQT4qn716sitq1WKX+7g/xulS6alJHA9BYtXEJXyvgynrEdvkehoLdGeDMICDFtr0Lk6teb4YqTANS0OHJv/y69BOiM+HzArjop38yl0Eve4r+zEJE2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MdXrf3B7jXtCp9ePlyoUBxNRhxhHmmd8MtH0ZOd19Mc=; b=YMaKloRciWTds+V5qZCclKbbo5lO+rbs+qndi8cOtlVOctqj+6C5Io+AJMiVN9p4kCUz8RKfw6enA9WtBzVKQ1HYNNFwQTkdRxFs5GLg2NnMvU9rw9Hs0fmkciJUXsTl2KJ+KzylpJ76QDxMvp38PT0qIIJoXTQm6Uk3cUPqjcUIzd8b7c74F/RWab8nIzyJZGftBRSYs28F7jUuwAjHpGFeFpqPATK/SOcoxSIrsAPZ5FH919AW2B+yl0Vu2KuLuf0jBlDeu/fK2YgXte6rNPKryA+H3cI9UjY9sAc8HHVcV2YCNJy7aYgxr/KpoDpl5DJY7p+9BIhj9kpj9KDcmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MdXrf3B7jXtCp9ePlyoUBxNRhxhHmmd8MtH0ZOd19Mc=; b=HWQagWxOMdiePkjOaqFogAscqP4Lv8VaBbVctIDMcBTGldDSoJoHOOSF30J1CG8jLMETPKWyg/fRtX0zdufRllZaRE1RW926YgA/2+ajxnPuvzGhZExDvGBTQKAz7Iy031GZlPqHl5WZ0/s967w85JQhUypL/0bgrO+o95W7OsI= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB4371.eurprd04.prod.outlook.com (2603:10a6:208:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Mon, 22 Jun 2020 08:20:03 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::7dda:a30:6b25:4d45]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::7dda:a30:6b25:4d45%7]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 08:20:03 +0000 From: Calvin Johnson To: Jeremy Linton , Russell King - ARM Linux admin , Jon , Cristi Sovaiala , Ioana Ciornei , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Madalin Bucur Cc: linux.cj@gmail.com, netdev@vger.kernel.org, Calvin Johnson Subject: [net-next PATCH v2 1/3] net: phy: Allow mdio buses to auto-probe c45 devices Date: Mon, 22 Jun 2020 13:49:12 +0530 Message-Id: <20200622081914.2807-2-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200622081914.2807-1-calvin.johnson@oss.nxp.com> References: <20200622081914.2807-1-calvin.johnson@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0220.apcprd06.prod.outlook.com (2603:1096:4:68::28) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0220.apcprd06.prod.outlook.com (2603:1096:4:68::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23 via Frontend Transport; Mon, 22 Jun 2020 08:20:00 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 76616bc9-07c6-4584-7dee-08d816851043 X-MS-TrafficTypeDiagnostic: AM0PR04MB4371: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UMApVIf6ptpzrTaVyLH9f1YKmffOTzXav7B4gwieGHMbPdxlxG9XCg+G0hdzeuKPa9FQA+o6AY0DnHOJVNvGQIrZulGYcoYH79Woi75xAP+bxndvdChAEl9N8G6DbPaUafB8oIRkmYLLFiZZQyu+OA8Dj8Mecw6iApMG98M+Wekj/ny8JaoMFM+MLxU5dkReSxOjEawP1vOMMQs8dWUZlMbgbRJd1cm91tGmSntavaHfTuBd7QwA3iPIRRItWJeKfgK53304u3kH0hr36jD/H2xv3o/7CDBVNHQeONHwLpPzTW6LUd8HXzx5+28+fQ/rMIHjLBzrxImeKam0EjZnc6jNYCCU5cLVNDKMKcYq9fVxpqWmO8YLNquw9EX1eKjL X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB5636.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(39860400002)(366004)(136003)(396003)(346002)(16526019)(186003)(1076003)(2906002)(44832011)(478600001)(8936002)(8676002)(2616005)(1006002)(6666004)(316002)(956004)(66946007)(6512007)(66476007)(6636002)(66556008)(26005)(110136005)(83380400001)(4326008)(6506007)(55236004)(52116002)(6486002)(86362001)(5660300002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: sMzJzvCpayYayx+q5IfJN0DQQQpA2Tosdrw2a7kpAaKZOoP8UXNRCeIFuxpgRDw7Wq80gQ76ohi/nwtqsD2lkrJh1rfkFSwWDe4yHxzlo1s3AVj/l7yBkrX+yt9YXLEM9J5OBT5wqkgPMSSAvPqeEtLLQahL/yJiCZ4srPZY2xL5KyMcovw4rF3Zsamr/o6xzklqk42Nqyb9wYWzau7yMHYma5qHi6XNzm8XR8QwfYIaYbWbaSgGKdGzUlN4JyTQKzkjyX4dAAz3uyE8XsI69/tDJeCM9jJqp9Cy7X9gukkerj2rtK4Ib2NFvPV7ke2uORHY9x6qy32RaxBXYYqp27Sf/IYDUz8LueAbPhOPWiZ3ZeBYpz9WWxpDa7br8c9vbn8MOWwHdFlyKQSmln8qTn8Sm/as0nnTwO6qhMA2VSJto63RvIxlz6hrdX6ViNJZo47quBV2+nStp/ym9yRZ4a4wBD28BPJvZj30rXvRkNs= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76616bc9-07c6-4584-7dee-08d816851043 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 08:20:03.6952 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rc/NGxe64wEo2V1tAqwyHAj9qEE0mV+Vtl3HvzvZ95XWW0jl8899WTB7NnoHBdGCvYBUNa6XbvphoppMcFu8Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4371 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jeremy Linton The mdiobus_scan logic is currently hardcoded to only work with c22 devices. This works fairly well in most cases, but its possible that a c45 device doesn't respond despite being a standard phy. If the parent hardware is capable, it makes sense to scan for c22 devices before falling back to c45. As we want this to reflect the capabilities of the STA, lets add a field to the mii_bus structure to represent the capability. That way devices can opt into the extended scanning. Existing users should continue to default to c22 only scanning as long as they are zero'ing the structure before use. Signed-off-by: Jeremy Linton Signed-off-by: Calvin Johnson --- Changes in v2: - Reserve "0" to mean that no mdiobus capabilities have been declared. drivers/net/phy/mdio_bus.c | 17 +++++++++++++++-- include/linux/phy.h | 8 ++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 6ceee82b2839..e6c179b89907 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -739,10 +739,23 @@ EXPORT_SYMBOL(mdiobus_free); */ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) { - struct phy_device *phydev; + struct phy_device *phydev = ERR_PTR(-ENODEV); int err; - phydev = get_phy_device(bus, addr, false); + switch (bus->probe_capabilities) { + case MDIOBUS_C22: + phydev = get_phy_device(bus, addr, false); + break; + case MDIOBUS_C45: + phydev = get_phy_device(bus, addr, true); + break; + case MDIOBUS_C22_C45: + phydev = get_phy_device(bus, addr, false); + if (IS_ERR(phydev)) + phydev = get_phy_device(bus, addr, true); + break; + } + if (IS_ERR(phydev)) return phydev; diff --git a/include/linux/phy.h b/include/linux/phy.h index 9248dd2ce4ca..7860d56c6bf5 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -298,6 +298,14 @@ struct mii_bus { /* RESET GPIO descriptor pointer */ struct gpio_desc *reset_gpiod; + /* bus capabilities, used for probing */ + enum { + MDIOBUS_NO_CAP = 0, + MDIOBUS_C22, + MDIOBUS_C45, + MDIOBUS_C22_C45, + } probe_capabilities; + /* protect access to the shared element */ struct mutex shared_lock; From patchwork Mon Jun 22 08:19:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 191312 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp830204ile; Mon, 22 Jun 2020 01:20:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxWrTEM6/oOxJtNcoEaAB1r4eQXaoG02BeVQqdasIaUPBYQ9KpzSVfNOEr/jv5gZWzsBpG X-Received: by 2002:a50:8a66:: with SMTP id i93mr49374edi.244.1592814039705; Mon, 22 Jun 2020 01:20:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1592814039; cv=pass; d=google.com; s=arc-20160816; b=hWc1/8eIV2G+zO1iMoODKLx3Mds1Mxfq3mBSteF/DxqlKsYeC9be6M1JMOL7+H/JSx LU/bZ1YhQ13kusV2vd8Tt9zjjmRKQrCFxDv5acM/wRAqoFogOJGivi3eoWBjL/Qv91Oe h1s5W7BCuFeQBdyXmO4rRPEWn+HwwkVf+/iYYgyOGBFtSoIkbDKVHc17xP96Z+P6+Xdf fCkADddhktnRR77vBrzZpKrdpOSNtln9fB3u/lWGMTPIhKXhP+9DLhlh26g/+XLgqwN6 4m2hhVaofJY6qxH6pS65XrpaSQATKqq6oquMUlcesDS4cRvBVydI/G2Y3ADXM6pQXus1 nphA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=H9uxmQdzlzSPbJJogLFm0pYKRl8SZMNOSruORNvqwE4=; b=QXHVARWTQIUQ8b1cZI9DvAVaqct8LJ1H5lppO6KNOOnWvUmcNojGHG1pTlSvxdNWK9 5sJG1+KqVsPTYvtDiJEaUKKz9wlshPxBBGCGkXSrAz5S4ZObqVJy2C5xgt7UHo66wrfO PtvAC/lqyaTJwAGvtCroQX+9eRvPQpgHbt4eST1olbRLjvH9OQRTBygAk3iQwayNJLGg 4edThQr+MPpEjmq6R1IhNyO+0HF5QzQ0z6r/wjO+RhXSEVvMR/uHEcfKjjukPZgB84kF Po1BZ773CUNno4WZOc53GmUHQKX0cQN7JnKSZt5Q2X/sQlBVSoeYUZ+KtXh30EzEgkaN /nrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=VBvaRhsj; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by7si3863850edb.540.2020.06.22.01.20.39; Mon, 22 Jun 2020 01:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=VBvaRhsj; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbgFVIUi (ORCPT + 9 others); Mon, 22 Jun 2020 04:20:38 -0400 Received: from mail-eopbgr140043.outbound.protection.outlook.com ([40.107.14.43]:14131 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726080AbgFVIUi (ORCPT ); Mon, 22 Jun 2020 04:20:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IgCadeabNN0apcsw2oW+cW+JJJBpLd1OYGeapo9UJwH3fYFrOSLkq+3aOpLGSmIdwXixosv1+m80zJiPbRqf0R6vRUCOLCCnBZm/mDeMPDhm5lg4ypY935M1L4/HlUZaopEi7Wyk9jJ++5JM/xKHwahH5qJzDZWhweKzWWlG52mwNsKwb6IqWT+XSlBLMphgfFxmyd/PfHoScQgqFOg3Pm++0yQVVvAWFoU7V7HGUSGiXppVbL75naAEZLO7Zm5RZ2bLC093C27IfIvh6Hvd1PW+FZPz0QUEnFrmBaq8AIiWcaTeonqqI+/l0knY7t4pBwTGnI1z2aJS8/6HP18Iag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H9uxmQdzlzSPbJJogLFm0pYKRl8SZMNOSruORNvqwE4=; b=n6jdJIxNRA51lCj5ocE9uHSsTwIPXV1w2295S1yCeGYNlFtY5ZqtKfDEPiEJsdQq5/+Nwtyeol0RB4sFVY7CFr1a+50CliyEwdzAxNvaicZAojBrwQ6XFDnZE9a/zK5baCZ5fe4QkPCxYN4QA2e0snvj8wU5QlqfMRp9oVvq2OD3klvH4Jx9xJzgn1xas8Fgzv+txhMn525KdjKajIb98Qy8N4g2A0tD5iw+lFLuYeiC7y8mhqA0GFF0eB7KLQguJJDRc+PUQxPJkfOO58BmB+oOkJtXC9Nt4oXnJ/0nQHaBR0C9eBB+hoWqIIIAhvVgAVZBGTGAF73V1FfHXTsjRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H9uxmQdzlzSPbJJogLFm0pYKRl8SZMNOSruORNvqwE4=; b=VBvaRhsjaDNcJVfD35qjBpOqXmJxgC7yszDxn+9qyX99R15GMI8gX6bSarVizfCGrD3jkY0Lmbcx28XuJJvfbPyLYmbHVUCgFV311Dzz4cMaFMOEiZKgZIJGeRVsfovgFrcknWL2pxuPcB9NUmaBty6RhmrHs6Z4PElSwod1ESM= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6401.eurprd04.prod.outlook.com (2603:10a6:208:172::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 08:20:34 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::7dda:a30:6b25:4d45]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::7dda:a30:6b25:4d45%7]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 08:20:34 +0000 From: Calvin Johnson To: Jeremy Linton , Russell King - ARM Linux admin , Jon , Cristi Sovaiala , Ioana Ciornei , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Madalin Bucur Cc: linux.cj@gmail.com, netdev@vger.kernel.org, Calvin Johnson Subject: [net-next PATCH v2 3/3] net/fsl: enable extended scanning in xgmac_mdio Date: Mon, 22 Jun 2020 13:49:14 +0530 Message-Id: <20200622081914.2807-4-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200622081914.2807-1-calvin.johnson@oss.nxp.com> References: <20200622081914.2807-1-calvin.johnson@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0220.apcprd06.prod.outlook.com (2603:1096:4:68::28) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0220.apcprd06.prod.outlook.com (2603:1096:4:68::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23 via Frontend Transport; Mon, 22 Jun 2020 08:20:31 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2d6d8092-9089-42ca-ac75-08d816852293 X-MS-TrafficTypeDiagnostic: AM0PR04MB6401: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: siNuXKA+NgRmlMAeCDQ5DMriMYVpQOpNUR/ICoVFeRHp7lXRdfe4BSH0QUCEd2wJ3+YEQ626jXDFkv4rgS0Xt4skHVQc2Wh4N4IeuSCEvKarj8823q2e3hKaVsCHQPZHahkgqXUG4rrUK2XGhSyPNgJDzO/5eEmnESc6BAFRyPNjOIZe+eStwSk+EiZgVbrA9Wd2T0sQPp2LPR51CdRKKnch9q0y+SiIjvcEq8fUr2I5X1WfgCaMmYI6voJQP8tCIUzvsGp3FhBAjoOIiUC19jGsXHopIj5/aMjPMQ6wqsj1haZ5plr3d4UMkI5vtsfDTEycsAuxQol6Go+gyTq1vb7EBa/P0qpmCDVJOjVIZ+ATwAfMugvfvqpd74M5Cijo X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB5636.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(2906002)(6512007)(66556008)(110136005)(1076003)(5660300002)(44832011)(66946007)(66476007)(6486002)(4326008)(86362001)(8676002)(956004)(6666004)(1006002)(316002)(26005)(16526019)(52116002)(55236004)(186003)(6506007)(4744005)(6636002)(478600001)(8936002)(2616005)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: C8m1yTsng/pdk/m3FcKCKVfkyr32BQrnB/zSHJ9LmiTSFJQo5NZnZGjH5pFxas4Rnd1OSBLMGYI5EA4Tv7IPIigutWF6VR89TbVAQg9EiVUMkVocHYqUijn4ieQ28C7eXAygSUd68sq3N/xV0im5Qkhc4FJioij7pz9MPhqRdO2TFidvGrfjrETn0v2lIrU3sogIbKU2V4JVGvUK+Meu33MkQmlr7nJWCpYueoSIe7PMEcdsWnYDzEIP2t5HOJQHYJ+wuMSDelJe/1rNtTCI5CIO++tRc3j10npAxs4vNk5gCyxPump4JPoM4scRh+JUlx70cFgFMs0dscIQiBnHUodoxgqepcNs4dLSDfxk19WfCsbSam4RXF2QGbCT+9bJ2ffqDcVvXL/KOPUQhgvzQp4FO+0fguQXH30oqBxepjDQkIpA8Gw/PhHltBe3TGXOueM2BVDVr7sEX2Uu6zQ+gAtPJN+V6FVR/FypLLFRhCQVZmkdM3BLt4aDFGtvypxN X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d6d8092-9089-42ca-ac75-08d816852293 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 08:20:34.2957 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NVf1mxnalBuBXHf3++GF4P8THhKfCy3DkkVGSOjkJpsbw9DVC6h6mV5b1RIZHec01qTinRoZLa78xM3s7aXv5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6401 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jeremy Linton Since we know the xgmac hardware always has a c45 compliant bus, let's try scanning for c22 capable PHYs first. If we fail to find any, then it will fall back to c45 automatically. Signed-off-by: Jeremy Linton Signed-off-by: Calvin Johnson --- Changes in v2: None drivers/net/ethernet/freescale/xgmac_mdio.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index b4ed5f837975..98be51d8b08c 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -268,6 +268,7 @@ static int xgmac_mdio_probe(struct platform_device *pdev) bus->read = xgmac_mdio_read; bus->write = xgmac_mdio_write; bus->parent = &pdev->dev; + bus->probe_capabilities = MDIOBUS_C22_C45; snprintf(bus->id, MII_BUS_ID_SIZE, "%pa", &res->start); /* Set the PHY base address */