From patchwork Tue Jan 12 13:40:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 12013511 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 EA594C433E6 for ; Tue, 12 Jan 2021 13:43:57 +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 65498230FC for ; Tue, 12 Jan 2021 13:43:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65498230FC 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=oxdjnpPqsQxs/s+8Xx4X3VgKfb3cKcNf7oUrTGQBO2g=; b=b02m+5wMFfNFVicSTfZMg6uLOx nTbJPdztCAFI1dn6axT2PR8ImaBgruZ6aeUOiCBwd7A+7ZHpPfStvM7yy2m56Bi2yNqkm5lo9UPce rpxULtH0emi2uDH2YVxpoG7RcIR5GXqQUGJ3qTKbJ7vsJRA7xqWBjHRqDsLWYvSSLiLNJ44uRZ07G 87wkeNMKHRDlfMRlqe/GvmTKo6DFDv3R1vaX54ijcW8VxdaboYRLUQbl2O6KA+dgoh6WYDP6J8EFM mcG19AubqfdP3KHh96PY1EBVDoca9QXkdO748xbvj4vAL2ROhnpLwMTSfca4zL1QeUL0H5SDQ/Zy9 BR+Bmu5A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzJvc-0008LR-3r; Tue, 12 Jan 2021 13:41:44 +0000 Received: from mail-eopbgr130079.outbound.protection.outlook.com ([40.107.13.79] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzJvQ-0008GQ-TR for linux-arm-kernel@lists.infradead.org; Tue, 12 Jan 2021 13:41:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UUMTXPgvxFso/Rk4JpIG2eku9RMmcgsdEn7HZhKrox+t2hRVBbyZAnTEOhdVur9P4ssNbGoggBMtTroYJuRQUMCsNo/I58w4x6jG214ccgYcHhMs8jExaz7Bs7EuAGOqskvDws02xM4jx8X0GyUII9dgMs2ECGZtnWVeeIUd0vVZzsXDISHEnJ6U7+AfiKPxjdNxT49K+9J33RwLMSTPFQQ9wdqhR7L2qRKJ+0jOJ5ind/0znEDdrzQiVvQvGvnbPTQKytaNspm2+Qgh2uL3h3Mvx664jJUM86TEiOSfcCZvDgF1umBv8eAUCo43HnDtr5whcsnScHWu/yZtmTb4nw== 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=vGkeKAeKlUyXo1rlk2m3pbs0N7Y0Af+lLeR7+GVBUVE=; b=P2++mvFEk2BD4qKq7dHAi+oZvDPDXfY+JwFLmSiK1YKewWq3q4puNtt6xSLyJBk8u7WodOsuGDcjzaUHNWitbBG8vtS1mM8S7703/SYg/C35dysIatxMcM0f1cIPzwUBTtoTVVcGRfpftb/5XDFzpkrYgGwyFgr8RsG9Dr2QWCiCOsElHhK9O3HAmhTh/DUG64eQrqTE7oObXA+bDSWpo/SvJe4L005OxOC8SzxwR9xH7C5c0qIQdErrAejeAQSyh/SQfmAnsbED63k9ZC/vWKfQ2iuARIxFWgfqCOwKKWvj7aG7DaQ9qGdtsW6H0jc3ZMtoru5BGhi0SSWuqgWygQ== 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=vGkeKAeKlUyXo1rlk2m3pbs0N7Y0Af+lLeR7+GVBUVE=; b=S5CZs5bYBI54Ondz79XzM0wy6WHSCICYudz/W0z6nDKw9zBF07dSqf5pDRLQRU7aAvVOrPqU6xFMgMpYAyMVbJWRDllJUbnzUI7Xp5oRWyLx4t08c7TyxeQpD7doQWaRr9RcwVTe7xnebWDRXaILh65APOPbVfhRhT4fFaU6uqc= 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 AM0PR04MB6964.eurprd04.prod.outlook.com (2603:10a6:208:18a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Tue, 12 Jan 2021 13:41:27 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a891:518d:935c:30dd]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a891:518d:935c:30dd%5]) with mapi id 15.20.3742.012; Tue, 12 Jan 2021 13:41:27 +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 Subject: [net-next PATCH v3 00/15] ACPI support for dpaa2 driver Date: Tue, 12 Jan 2021 19:10:39 +0530 Message-Id: <20210112134054.342-1-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR02CA0047.apcprd02.prod.outlook.com (2603:1096:3:18::35) 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 SG2PR02CA0047.apcprd02.prod.outlook.com (2603:1096:3:18::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Tue, 12 Jan 2021 13:41:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 92278690-892f-4609-9d5b-08d8b6ffc2d2 X-MS-TrafficTypeDiagnostic: AM0PR04MB6964: 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: zIemhFfQUpvfyWsCz+IqzDT6kk2Jyoq6lLZ5e9t3gkPa39k6gbAiKnS4HgK/rFnQv8BJ1Gx3rSN9NQUR5giEJHb1tkbGhdfsbQISTyVDzbggQBRMf3TCl+nxdLeoa5Jl0B3nT29nj896UiQkpsyetXAOtriidPKW6UemBNnpUCR8U2GFaL3aQwny6WKC58Z0Fl6w+QHDsQ3ch3SYea+YGwuA7rE1mJdQ2wQ0hdr6lH9+bakUFGSJ2TA4ALXwammucXziLYR26/TdoRbRhUYpbfHmxoDmTpmVUtM8J71kGTYMz1IQWuUb1yGcZ1kCinOBVOtnn5aGezlfN8gRTrTjrf1eZl9Ii0imSzxGOqto3dPQi8vwp1BllrLTuMxqHcUkvHYdemQ+3aScZF/5M+RZmu7ai813Y+ypydyh2+a3x49HD/iqPy6RHlsE1H8dGXaYWTWZqwIx91G5yv2sCLuzqQ== 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)(39850400004)(346002)(376002)(136003)(396003)(366004)(1076003)(6512007)(7416002)(1006002)(5660300002)(52116002)(6666004)(8936002)(6506007)(16526019)(186003)(26005)(55236004)(66476007)(83380400001)(921005)(478600001)(7406005)(66946007)(66556008)(6486002)(8676002)(86362001)(44832011)(2906002)(110136005)(2616005)(4326008)(956004)(54906003)(316002)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6YgmmtZrWm9yDAlXBB5t+5FUIovxTNgj29arC4en7ORfoTCgg/h60zD02DjcO1Gh3EYspz0l6QyzkjcAoCjoJlB/UmtZFmEPYQu0DTEwjNBCHpjqRlnVlYDB57Kujg9hDRmCv306dCYg9S1uSEUiFahoNWkfT0p2iYve0b0EuvsHFjr5KYnPWku09mfWDuDsDlROkzlvPdxHhmTvR8x3Wwoupi13JtAiPumg1foIjWnTLp7X9i6oxQyQUxdNWVLAhJVkeLrGaKIm4f6QKwmXh5x4BIbawmgTcdq2a2xA+snLcLOfzKtf5EWy6m2s0uVrd75vpaU4qVMIl50dzfYp91hOGlO/rUAMLF8ZFYrbQr17lVVRt28iEbiK2k1m2Niqt+8rKoTWwNRAKAZY9t5Ijg4y6NwY8VcXq03hZrZx8cX4riaYcWYl1pOHY2ioG67W7bn5f+LHY2aOe0n6B5uizANCuFzoV6MsZANLj6imPTCgIYX3hw6xz8Te7cbkPlKO8NX3ZJ5GKX3pdBGerspsJnALpnV8O2LANiOIb676NmJJZihVsWXxr09YcK6SvkhTbHf/YWEybDYdnP7vAsYtBwq4HMLM3IoJ0RN+tr4MOA3HOuVSudqDnprmAKT0Ta13zBLGlTfOkDGShxZVYR4j521aApkYVbM9CimZrq76GmuHwH6WHV9Ec6+A8zaoU0UFfGPc0UUyVInfCuKIa9rng0wkfrfYD9THDdjTrq7kFV/OASsZ59AJcXJDMV9CRx95aPzvdZll7+6Msyd6rgad33afm0rLHxw+YkIEeq4fxOhTU9nBbAhgaCayoR2loj1Cc0eeMveipYkJIJ10wimS8VaMp9/91dkGLqlBdojD/xn2KfQqV7TgPV0FluDAKKpSkm5bc/kbROG89wMGwMV2czedsr63meVXaTyE07NClQkRVE5yt3JMAfRQN8zCyIb8+rHuvp3lNxNP07+zzphpmu9Daah0cwxKGPQyP2AakFuKLGrGRB28O2NR6OWggMlZ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2021 13:41:27.3354 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 92278690-892f-4609-9d5b-08d8b6ffc2d2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1pU8mWQO8JALzL1SM6UIEG4oQMlDI0SvJmc+Ue7VOW9MGGU+wfj6kiucXSZVaa8C/riLCZrE/Dg4mLNLdUuZ6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6964 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210112_084133_011814_ABA5706E X-CRM114-Status: GOOD ( 17.82 ) 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: Frank Rowand , Laurent Pinchart , Ioana Radulescu , linux-acpi@vger.kernel.org, Jamie Iles , Diana Madalina Craciun , Bartosz Golaszewski , Jakub Kicinski , Len Brown , devicetree@vger.kernel.org, Rob Herring , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor , Saravana Kannan , netdev@vger.kernel.org, Randy Dunlap , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Calvin Johnson , linux.cj@gmail.com, Greg Kroah-Hartman , "David S. Miller" , Heiner Kallweit 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() fwnode_get_id() 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 fwnode ID. Corresponding OF functions are refactored. END 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() device property: Introduce fwnode_get_id() 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 | 129 ++++++++++++++++++ MAINTAINERS | 1 + drivers/base/property.c | 33 +++++ .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 87 +++++++----- drivers/net/ethernet/freescale/xgmac_mdio.c | 12 +- drivers/net/mdio/Kconfig | 7 + drivers/net/mdio/Makefile | 1 + drivers/net/mdio/acpi_mdio.c | 49 +++++++ drivers/net/mdio/of_mdio.c | 79 +---------- drivers/net/phy/mdio_bus.c | 87 ++++++++++++ drivers/net/phy/phy_device.c | 106 ++++++++++++++ drivers/net/phy/phylink.c | 49 ++++--- 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 + include/linux/property.h | 1 + 18 files changed, 579 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