From patchwork Thu Mar 11 06:19:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 12130353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 086D2C433DB for ; Thu, 11 Mar 2021 06:23:16 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1792C64FCE for ; Thu, 11 Mar 2021 06:23:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1792C64FCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=aZ64WzKhcHjFR2jXWf7BekfAZnHfF0UxpzyEDL6Wv3c=; b=ba8LBi+azbDVA2YqvfFYwMlUAe C1jH5etxjGxU0B+lhxm0AXyQUE8HYooqm6wxnfXJsUU+CVIu1hQCyOfGEwqQCXEaUNJhBxq5AjNFX CYN+aNyp+LMu94UOEM7D41/RE7r8wOVtLCzVLAuat58z+SmCIzfD8Kk9312k+atNZPpNqCI4qc00Q h/h+nZR30SCfJNi+17hvAymDFo79NmyNTLSj2cz1GYBU3pEI3I22jsIJtxQeG29EF0xdiaFM5ECNg 2VRnh6bLj0SmwoidPduChVuFZ5tH6A4bnZ+ZSYXMvTovQjLNLjFJP1Og6sC8w4SA597O8XqXTANTm bvGe4aAw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKEh7-008SM1-DW; Thu, 11 Mar 2021 06:21:13 +0000 Received: from mail-eopbgr70087.outbound.protection.outlook.com ([40.107.7.87] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKEgr-008SI0-Vf for linux-arm-kernel@lists.infradead.org; Thu, 11 Mar 2021 06:21:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ga1WsgQ1dus8ZHFdI6Fv1ktx8iFu2lIRNAehC9bGYhtE306qGiFgAW2zEpHgRu4f8co6Jd+XAVP6GGh1Z9OIIvLFLbDgJuM/4Ell3/DnYHGUOvpfU47gPRKSbpalt6im57jAiiQxcz+LO/CuD880G7C8veThDTpAFOSFOaQg/ppH0Bq+fJ5Oox+1MZ83dh67+Id2pY+Nyg8hUyFxbN7vyahc75KQNkbGXXQWUZYaHDkZzQhH6KkVzuFcWLSOUbZ2imUxLPT77tltgrJjmSQbAvnQuR7NhztgG3/6TAPv1dRJjbpvbqV5ieiYT3J39FV0ka5gKYcYKhHgn7DmVwzxNw== 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=XoRnjbAindRW1u463l4Q+5r4qWTfHb/DewqTC/ACjj0=; b=i1GbrYU6NLMwRAVKZ4ehqaDeBtuVsZ/JNgkLQSdXoC/QvJxtozzUZAtF4HvvqABaEWHGJYHLcEfy2C2UUB37DITanpt49hBPx8/BBiE0aHkhcgNWz/Xwn8Ql4/xxth3Xylf9zzooxs2dCmwBA+QB9DYPtsY4bWfDBc9kGt5uiuRMm8Dk44/ZAtsfURI9vh4FqlBRJGs7M02NXneof3B+ysR+FwpOUI7y7T66Zot0A6SqEBl39OhTe7ta0xwooMnmQdP6Q5JGjmimkjh4B+Hpbo7M2Kzw/sNzmAGwVwwbJeLgExVgGaJkWlsXNbiy0fYTSC7jfzAmdl9xPKC2e3zorQ== 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=XoRnjbAindRW1u463l4Q+5r4qWTfHb/DewqTC/ACjj0=; b=EhrKf+mJ9q+o2YQ3vuSTEVf+A+cWLj0uRe6QsCc5uFFmfeMAYIWOnpaGTGCkOiy46C3vOQDZvHvoncPtKmwQSMUuSYIOAIIreL9KmpnoAj091/hiDvcPcdPz67HVS5lwASxukMLqgyGGbAloNFVMTaslP5bJ+FeMie/KAb/6lJQ= 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 AM0PR04MB5473.eurprd04.prod.outlook.com (2603:10a6:208:112::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.26; Thu, 11 Mar 2021 06:20:43 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::1cd:7101:5570:cd79]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::1cd:7101:5570:cd79%7]) with mapi id 15.20.3912.027; Thu, 11 Mar 2021 06:20:43 +0000 From: Calvin Johnson To: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap Cc: linux-arm-kernel@lists.infradead.org, Diana Madalina Craciun , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux.cj@gmail.com, netdev@vger.kernel.org, Laurentiu Tudor , Calvin Johnson , "David S. Miller" , Frank Rowand , Heiner Kallweit , Ioana Radulescu , Jakub Kicinski , Jamie Iles , Len Brown , "Rafael J. Wysocki" , Rob Herring , devicetree@vger.kernel.org Subject: [net-next PATCH v7 00/16] ACPI support for dpaa2 driver Date: Thu, 11 Mar 2021 11:49:55 +0530 Message-Id: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: HKAPR03CA0026.apcprd03.prod.outlook.com (2603:1096:203:c9::13) 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 HKAPR03CA0026.apcprd03.prod.outlook.com (2603:1096:203:c9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.9 via Frontend Transport; Thu, 11 Mar 2021 06:20:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 592cf5bc-a881-4b4f-c467-08d8e455cc6f X-MS-TrafficTypeDiagnostic: AM0PR04MB5473: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:313; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Bu72NCsSbqCmtIdub9/ks5BIQpRpcixZnHV78E1D+PJ0URh2/3IiewHZA01FSyo1EulDmTeYqaG4tjXNB4fB7aAL6NWMhqDdkQseb7DLsnsnhN8cF53iF/LHktty8cCd/Xp/wLmPWKaJo73hi1gAZV+C7RY5RjKqCSh7Fz3fpDYyRQVAWXYMJA2DcN0Wk7QIAjf1CuQmpXm2vYfn4c9P8SKBXxjeKGr8sffAoFiiqu/sUywiDdZlcpymj0olzE8qNguyK2mra25QUmAfRa7YNb+FsqssiWNEBr0CtJcUFhUlJbKP5Xie4c1yatWbvwIeTzOLE6PMd2j+DUpECCyRiG30Xmg4lKuzrl1oOl0O1U0+3yX/abaLMoPCr84kzJskv3WvXK2SS3BByZIrdQcMb+BiAMuERQ3FVS6gNoQuioBMcHkaaYPLxc6sWq0/Jcrlk410z13HZsRkiogA4XJf/M260ux/EIkqsC3NOK+qa85CRaBM/V+8gg9Ajqp9EzcDns+BgZjeCns04EhvnizJQwPiUJ5fVhpPCqSjofzV00BTjmLHDX6NsZFQLZUhrWlJPrUJLN97/cLwxt0feAT7J09bUhzo408R3/BUbhFVCY= 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; SFS:(4636009)(366004)(39860400002)(136003)(346002)(376002)(396003)(44832011)(186003)(54906003)(66476007)(52116002)(5660300002)(110136005)(1076003)(66946007)(2906002)(316002)(16526019)(6666004)(6486002)(921005)(4326008)(478600001)(83380400001)(6506007)(26005)(2616005)(6512007)(8936002)(7416002)(55236004)(1006002)(8676002)(86362001)(66556008)(956004)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0xBhXTXgJ5jFGhDCN92Wbw8rguxqGW2+wsVnitCf/Yc0xXd6Q+ecbrZS/ueeVzUg+sDbx0SoXgM4j+H57z2Q8is1R4Gr/r1ZaJ4yfmRmP6EaOTwOvzkF6exjeKCZGFMHqI2ZkIVT7VA2LWe17YnRAXkkkWqJEld+4cr6wUxs+WbdP+lhsslevmJRSTpWzlam679pkNuQLIAD79nRwnTBZcoVGgEEHeKy3+etfu03dXUNAGHdS+Ptb791pABCnePHO5t/+6DhWUj1pGNEuKCOjwf4WKb9Xo70pbjVQUvJY1eiPYjSFppOO5ZE0py/fyQPmM3XKBt3cfaUsiVeMA+nAWNonN0yQAEWj3WVMaTP7xKzWN6Y479VGFn3AmgSaOWKRoVsFCXF9V+2zgM5ecc9KvZoG01Nte0Qbm7pHEcAPWCwOCHu0GdcgctnKJVQnV5xaLPXktz9J6B9cvfjkSx0ky7u4wYJlbiuM8TZbpkWey863OnHEytm1gV6cQ2tOvfpnno84OHI11tsZUtq52NIvP0DfThJa9NpyRK7LG99YZlxwjSWNyc5VJWqGtbkrJ+uaKh/Qk+b248SbuZ8oVZK1MP85LxmkwESVFyyq04uY4htXfWdl6is4bbUNs5yxsD9J02iINB5gzX0Z4qcmzdbQE1zWIeF02wnM2YIRSl/qdmpLZHO/540AJ+DOf1Le//U4LQjMqH4JZuhWQVY84zfBxxS2eStuEakb+8N9Gq0eelhwascGCwhPqJOIqv+V8bZHg0WEdKz43+FhtlMlbAqmXLU3b9we0TwqRrqJu49QAzlY4ybbzJfHb6j7NVRABTxfyKPFKSXsZRIUbwSsCQlC/LUg58kOtvkxLo4GqesGnAnpxXIiQguZBavFIQ/umr9nFZoiaIt9C05TX7Gfl1ruLrySLR9jF8TRWC9P6+wQW07ngEKxU6hxjcJuqAQWJ2g1oQucNdNowCsMBk/w9ah/XvvSQGONgE9c12Acl4kUAeXcQYHlUnAtmhv41zs1Cas7tdIxr3fOaAJU+Vg8twKvMDbIpwrR2PHKZN8nj5ZziKcZl8yGALEvUkdCrJa/K0DTeJ2aWzYYQs/WJ2dbLp19HBC1UK1udxh091aGw2+jFeuaUabo4FhJqRv+Mv9g7+YODl0uR1VecNRZNN1WJvNS1d7Qe5xIILZz+HJJ49k8m7Z36nQvucHM9m5z9TBhAspGxZiD0ucIZeImv/vJeiczWMx1/A41swIGxq0kBRJzLFXpHhCABN4elqoIYrKTp2y6j0Yanla+fQCtpP8bu5r/voYCGSoNEybsL/O88alIGcesVhcbB2GS0/wJbrkI94r X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 592cf5bc-a881-4b4f-c467-08d8e455cc6f X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2021 06:20:43.0332 (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: LYgzgwiF7jAFavj1qQ5chW6bQMDEWOkxc0xbrG4dLmMR+jf1f3ydhhhIOEwUMXZntcfZdqAWISmHK6nqGEpmzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5473 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_062058_316145_DED28595 X-CRM114-Status: GOOD ( 18.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch set provides ACPI support to DPAA2 network drivers. It also introduces new fwnode based APIs to support phylink and phy layers Following functions are defined: phylink_fwnode_phy_connect() fwnode_mdiobus_register_phy() fwnode_mdiobus_register() fwnode_get_phy_id() fwnode_phy_find_device() device_phy_find_device() fwnode_get_phy_node() fwnode_mdio_find_device() acpi_get_local_address() First one helps in connecting phy to phylink instance. Next three helps in getting phy_id and registering phy to mdiobus Next two help in finding a phy on a mdiobus. Next one helps in getting phy_node from a fwnode. Last one is used to get local address from _ADR object. Corresponding OF functions are refactored. Tested-on: LX2160ARDB Changes in v7: - correct fwnode_mdio_find_device() description - check NULL in unregister_mii_timestamper() - Call unregister_mii_timestamper() without NULL check - Create fwnode_mdio.c and move fwnode_mdiobus_register_phy() - include fwnode_mdio.h - Include headers directly used in acpi_mdio.c - Move fwnode_mdiobus_register() to fwnode_mdio.c - Include fwnode_mdio.h - Alphabetically sort header inclusions - remove unnecassary checks Changes in v6: - Minor cleanup - fix warning for function parameter of fwnode_mdio_find_device() - Initialize mii_ts to NULL - use GENMASK() and ACPI_COMPANION_SET() - some cleanup - remove unwanted header inclusion - remove OF check for fixed-link - use dev_fwnode() - remove useless else - replace of_device_is_available() to fwnode_device_is_available() Changes in v5: - More cleanup - Replace fwnode_get_id() with acpi_get_local_address() - add missing MODULE_LICENSE() - replace fwnode_get_id() with OF and ACPI function calls - replace fwnode_get_id() with OF and ACPI function calls Changes in v4: - More cleanup - Improve code structure to handle all cases - Remove redundant else from fwnode_mdiobus_register() - Cleanup xgmac_mdio_probe() - call phy_device_free() before returning Changes in v3: - Add more info on legacy DT properties "phy" and "phy-device" - Redefine fwnode_phy_find_device() to follow of_phy_find_device() - Use traditional comparison pattern - Use GENMASK - Modified to retrieve reg property value for ACPI as well - Resolved compilation issue with CONFIG_ACPI = n - Added more info into documentation - Use acpi_mdiobus_register() - Avoid unnecessary line removal - Remove unused inclusion of acpi.h Changes in v2: - Updated with more description in document - use reverse christmas tree ordering for local variables - Refactor OF functions to use fwnode functions Calvin Johnson (16): Documentation: ACPI: DSD: Document MDIO PHY net: phy: Introduce fwnode_mdio_find_device() net: phy: Introduce phy related fwnode functions of: mdio: Refactor of_phy_find_device() net: phy: Introduce fwnode_get_phy_id() of: mdio: Refactor of_get_phy_id() net: mii_timestamper: check NULL in unregister_mii_timestamper() net: mdiobus: Introduce fwnode_mdiobus_register_phy() of: mdio: Refactor of_mdiobus_register_phy() ACPI: utils: Introduce acpi_get_local_address() net: mdio: Add ACPI support code for mdio net: mdiobus: Introduce fwnode_mdiobus_register() net/fsl: Use fwnode_mdiobus_register() net: phylink: introduce phylink_fwnode_phy_connect() net: phylink: Refactor phylink_of_phy_connect() net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver Documentation/firmware-guide/acpi/dsd/phy.rst | 133 ++++++++++++++++++ MAINTAINERS | 2 + drivers/acpi/utils.c | 14 ++ .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 84 ++++++----- drivers/net/ethernet/freescale/xgmac_mdio.c | 22 +-- drivers/net/mdio/Kconfig | 16 +++ drivers/net/mdio/Makefile | 4 +- drivers/net/mdio/acpi_mdio.c | 56 ++++++++ drivers/net/mdio/fwnode_mdio.c | 98 +++++++++++++ drivers/net/mdio/of_mdio.c | 80 +---------- drivers/net/phy/mii_timestamper.c | 3 + drivers/net/phy/phy_device.c | 109 +++++++++++++- drivers/net/phy/phylink.c | 41 ++++-- include/linux/acpi.h | 7 + include/linux/acpi_mdio.h | 25 ++++ include/linux/fwnode_mdio.h | 29 ++++ include/linux/of_mdio.h | 6 +- include/linux/phy.h | 31 ++++ include/linux/phylink.h | 3 + 19 files changed, 631 insertions(+), 132 deletions(-) create mode 100644 Documentation/firmware-guide/acpi/dsd/phy.rst create mode 100644 drivers/net/mdio/acpi_mdio.c create mode 100644 drivers/net/mdio/fwnode_mdio.c create mode 100644 include/linux/acpi_mdio.h create mode 100644 include/linux/fwnode_mdio.h