From patchwork Mon Feb 8 15:12:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 12075833 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.3 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,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 91F97C433E0 for ; Mon, 8 Feb 2021 15:15:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 4558D64F1A for ; Mon, 8 Feb 2021 15:15:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4558D64F1A 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=wAL8AM5V9u+wnT3pVJmKNVA6gwnmFBQnMirkW4V5qxo=; b=Sb35EOQQDCp0vReKS6DM0D1c/z xz29xN6IwHdBmmPe7csP3NW60V0IR7ayUS4Q1a4aTMZyA7cu26eVMtGerFtcg++z12hlsyBHF1FOJ OUp/ksCBB2AIhkS7s6JXxjqC3RAS2lQS18ZBNHVNw0ew88LgGdMgX6+Sssf6dG+kGHlc1rcOkkveH Z1aGDwCFFH/1CFI9INkswldIurdlgYciriOhQEaJxFCXJxRkWKwTZNhvtj0kuH428ndlwfmT9YeeR pRQCI1Sz4P5hP0HRcu2Qq2WkhJNopzX74OzDbT007s8RDsrdEnK86v/wM1tyCNiyFmy6OH9kVI1Vw ifuEq32w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l98EE-0004z7-3Y; Mon, 08 Feb 2021 15:13:30 +0000 Received: from mail-db8eur05on2074.outbound.protection.outlook.com ([40.107.20.74] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l98E8-0004vN-NE for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 15:13:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EhB1hXBmOftDsM/GNmaarXQ6DH7NTt99Wvi0ll9h2xX0vDrkbMRT9BcRhozNuN8bepucLgzGv4V++6EklT/OhrUYzl9fctRqrMi2xqeR5MZ1WKy533fNpzdZZsh/2J9kJ0Kg//Afg33GGi7qIaTaBGOL02pHLp0KNk6YBVbHlX2/S3NtTaSxubo+cfMkQ2Jf3cemp7nf1e1zHVpYbA6buLJBlpnpzgDs6h3VywZz/2JGtY/w60/ZxMerBIQHRzMuRQ2QIBfJr7uJxOFUsYbhNcKojcpj+sW1fYfukasCoNxjQpb80MEvvpHC9p94dX/K4flVq8HrwHEFz4StoJxHxw== 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=H+5yzSsyfsdcAQVk5iLfJN/F9rJ8Plk/O4oRJKZ96w4=; b=ZjX/AmplGcfV/1XbUTJmthnGxszQSIkn8KTszP+IPQ6CaE4+839z/PZ1eNdiQ5NToGksyVELpo8uc2TrvGbA5zwEHyQJbR6ccAUSf82VuqApUg6CSNx3GhbBxBtr/NrjEEy78NALIG012zTBmqwPrDbnD48+a3jMQkLmEmgV3LnNocZCpjolmQSmv/645YKi8cC/ZCFAKAZMtUeA1svIOh4tNh/xLSJ9CBPhpYoYHFBIxkUL+T3VKo+lfHRODpOVlb+I5Zye7bFPKVikIOHHEauXHfbSpUxAoEFkn88Z5h+bFYUukciT+AHzIvfLo3d4kDZ3ijjA2MRBkjfRcQedYg== 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=H+5yzSsyfsdcAQVk5iLfJN/F9rJ8Plk/O4oRJKZ96w4=; b=kshEmpkQJ4iUg8dFYGssNOuHLdSrmaPHv1j1xy6Wfriqp00EnHwQsjG+at8rGiQC37iG+UTiezKXnlcDB4kjnMgdk6XiVhlw76cEyO31wmpxlTlW48GsYVrwjHTp18JNhiuAm1ZAEaSnSOzUsAEuv45hkX5POUBSluqTlD5fz8Y= 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 AM0PR04MB6435.eurprd04.prod.outlook.com (2603:10a6:208:176::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.23; Mon, 8 Feb 2021 15:13:18 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::e90e:b1d6:18a2:2d42]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::e90e:b1d6:18a2:2d42%6]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 15:13:18 +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 Subject: [net-next PATCH v5 00/15] ACPI support for dpaa2 driver Date: Mon, 8 Feb 2021 20:42:29 +0530 Message-Id: <20210208151244.16338-1-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR04CA0176.apcprd04.prod.outlook.com (2603:1096:4:14::14) 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 SG2PR04CA0176.apcprd04.prod.outlook.com (2603:1096:4:14::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 15:13:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7650e3e0-e55a-488d-39d1-08d8cc441085 X-MS-TrafficTypeDiagnostic: AM0PR04MB6435: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1775; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xl9W5F3xTjYLnVtd+cuflWOYwCOGJprBdax0jLl6ghiVt01kjZVK+LYzNFoEDDzNM26ouCX+lSbI+T3dtku89KWBtXmyU4IhWEdIfqV8tyakhK+tq8zJMRU2yzHbUZmGZo4dMxQkJnKX0wid00DLJwwPq2PzSGlNhPHC78qqmIDeBAqoI1MffYjmMMo4KT9SLZuHFpK8xWtVoNVSaSUKN9ZpG1t6J1vKywywzuSrDGpth3LZZ2m5q1Fl4ZGpTFGG4AOIvWFwyiB1o0oUikhPcJl041yFKSdkvlM5L1SjlNZjNT69iWf8GuSoKu7o0cshdr8UjYMNZYWHIfcq2GzsHDDrMWX6U2g2xwbyGkH74buBg4Q/q5XNk7bjJvU4tgZDeu145TBateLE6BA8NZgiBd2aKhBSGQgpzZV/AAoc4RdoamFV40HmVnk5ojgKqo6MvYIMOJoAu75nYinBwluPx3wV857cOWbymb3nEkWjYurpNvmWqLXzpQaJM1OODIwzC4Sf7l2fh+V3mSR6sUaY+GFI5MmmceR46eWHuGYu3nJwAAvyJPvmGlL5HEo4ummwqF7PlHijHL8d2ZNFPXoUN2oPfMAArQWz2Op8COVcNy8= 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)(376002)(346002)(396003)(8936002)(54906003)(7416002)(52116002)(110136005)(186003)(16526019)(316002)(55236004)(956004)(6486002)(6666004)(1006002)(4326008)(2906002)(478600001)(6512007)(1076003)(6506007)(5660300002)(921005)(44832011)(83380400001)(86362001)(66556008)(26005)(2616005)(66476007)(66946007)(8676002)(110426009); DIR:OUT; SFP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AzgS6x19r8uQaUcnWZ0dtSHZ993GJkglsnxNFiTCrFKMeBgV6DJCBF97EXTTdmlZx+KzgFbC9HmHgSpKF3UvZkyBkw5Iys/BGRz6WCAi4ffQr+TP45Jw2Ggv1B55UzHVnk3DSy6Ygg/TBcYyE18LYkQBHDSKxokL52sMloVj0gnnymjHZjwV+ds+Bs9mkoLaowoIaPz98N4O5SbMMKgxmIqCQvzTni2KyCpxoI3Je5tUgxpYHL/kUA4LEQtpsI3/ivrLVkqt3FThVqNkt04uIArEy X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7650e3e0-e55a-488d-39d1-08d8cc441085 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 15:13:18.2062 (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: nDFO8gz6ddv2sRivMe/hm496qW3SeuNPsVPq1DtsiIfZ2fThsVUjFZs+uep/D1NTG9U3A7YDquSSvzZbkLjYiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6435 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_101324_785674_ED06E1F1 X-CRM114-Status: GOOD ( 17.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Ioana Radulescu , netdev@vger.kernel.org, Jamie Iles , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Calvin Johnson , Diana Madalina Craciun , linux-acpi@vger.kernel.org, Rob Herring , Len Brown , linux.cj@gmail.com, Jakub Kicinski , Heiner Kallweit , Frank Rowand , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor 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: T2080RDB, LS1046ARDB, LS2088ARDB and LX2160ARDB 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 (15): 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: 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() 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 | 1 + drivers/acpi/utils.c | 14 ++ .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 91 +++++++----- drivers/net/ethernet/freescale/xgmac_mdio.c | 11 +- drivers/net/mdio/Kconfig | 7 + drivers/net/mdio/Makefile | 1 + drivers/net/mdio/acpi_mdio.c | 51 +++++++ drivers/net/mdio/of_mdio.c | 79 +---------- drivers/net/phy/mdio_bus.c | 86 +++++++++++ drivers/net/phy/phy_device.c | 106 ++++++++++++++ drivers/net/phy/phylink.c | 53 ++++--- include/linux/acpi.h | 7 + include/linux/acpi_mdio.h | 27 ++++ include/linux/mdio.h | 2 + include/linux/of_mdio.h | 6 +- include/linux/phy.h | 32 +++++ include/linux/phylink.h | 3 + 18 files changed, 578 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 include/linux/acpi_mdio.h