Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7007193pxb; Wed, 17 Feb 2021 21:33:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw04DSE5QxcNapF+iTLEcukzuoUQEokZTyIz8tb6juAOB2S8kvvD9n7dzYajUCDay8fIepy X-Received: by 2002:a05:6402:1148:: with SMTP id g8mr2228912edw.339.1613626429514; Wed, 17 Feb 2021 21:33:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613626429; cv=pass; d=google.com; s=arc-20160816; b=MhWm/ksp5sT+QBO1guExyErWepHPJUwwZGq3E8943AG6w85QD0hpmsFwaKiHGAccYF 48Uezlefqoqwi+cG+6E316lnawBaNBtD9PDjGNw0VRMxGNiOcuDv9PlPSSA9/VA2LPl2 +nHw+pbss76ofWSRrIknGJ6Wxwsjxpum/QhKDviP94L2GTC4N1TVv3a3RYuAANNM1+5L X1PEZsF7KG3oPhRoZ7i9Bv+UW31HtEsbHq1gKqNyACblkA6kOc16Ys6uuGXW22K190+c e0rCULSEDRk1ITOHewvktm7+7Rm3K2hijszQiZAerD9sbqOzpk2qW/Zg3QdbaphKQD+L NZig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Vnml+DT01xH8hxzVZ2tLyoyDoxVFzIJfBOfmkhQMlqE=; b=c1XyO0SkxbI6q0LEOOjkEk/igyJ7I8IFIxbOqnQfxjp9yZj+GYduGGmq8Xvq4FyeUt ljoDlXaomcDNQ8y611FkjpQDJZs17xA2I2GevQGTilVSPmA/kPsH4l9AYcc1QamAxy1k Rn7djSfNA3KnOkoIbPS2k29A2VQJX62/3XekI+AkyxmEFQW6yuAIkqy4LSWV7ZbxrIWu SGRzJp8cpGy98kt4dqWG9lwbVfQAdWDB1nTZ+K6Z4mogZvdTQc21Q92+W0dseWRljEgz d/HZuRcmXaukN9YDfN/i1R998sSUjF6pUkttOwPVhH7hl2rYBiFLc7YoP+XfEJ8g/tgR ApYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ByGNWTd1; 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 y1si2857426edp.72.2021.02.17.21.33.26; Wed, 17 Feb 2021 21:33:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=ByGNWTd1; 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S230133AbhBRF20 (ORCPT + 99 others); Thu, 18 Feb 2021 00:28:26 -0500 Received: from mail-am6eur05on2076.outbound.protection.outlook.com ([40.107.22.76]:48096 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229656AbhBRF2S (ORCPT ); Thu, 18 Feb 2021 00:28:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gRDoKNWiM4anNPyBrCnyYfxvOzXyrq2OPkZsSvnCmaBvCxSQyH6LHSKz1im8elQbSxSfajyfXB5SBrrAOlckuQ4gtNbX6VFSjAXqF4Tgzb6gpdbZHCFIRvFwS6zyTq4J9UK7IVoI+vUvLadC6NUz3Nm1Y3tyWEHsJi7yzJvNxasV8J7S15Nqlf2MP1Ai8hEGvdTTTwIxHCrJdpeixOjXohYVsTCW3/Mx3mW9HBH7cJ5dMDY98PIarK18VvBJrDxESz0MLf8gymrWq6fj2FhNp4cTN8YXEr8K0mOo/ZIrGD5SgnCOzOp6COER4CmZ0KM17OA/9GnBcu0Sdr7M3efVrw== 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=Vnml+DT01xH8hxzVZ2tLyoyDoxVFzIJfBOfmkhQMlqE=; b=Guzx7bQwU6GXq4qC+z1/A0jT1y9DbyDHmtIuyTQjvsyTMuJ4bd1wNQBcKFGaDe2RSx5WyZrEBP5fh1fQtEetYimww8tugid93CJC72kQdi8H2Aagav8pFKesVGg9DBkT8vBdx4af1lTAqgZ7wPyR381/2mLBuavK8I9dTRgderYW+vWX3dSQQGlZ+f8zU6x77B+5zWpl0cO65lr0swb96sQYUyLtsgGyyOXQ8EGK7ToAS+5DsxPibauzdeXk56Bd7vA8K+omYp3B21BNDWA1uV39M1P+9Dyl1UI0cSV7dkS8lhlshwJGjhROT0ktldE6Vt6Oqm9AzybyBkuy9N4vQg== 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=Vnml+DT01xH8hxzVZ2tLyoyDoxVFzIJfBOfmkhQMlqE=; b=ByGNWTd1qRpw9bfXpxxd4FLi9bcxsycLUcR3gnSXYc4bYP8qm8Fh8uWOvwdo8InoIT2YjANYe+gQKnl8JDbe5LweRY3ZVNwqaVTEvne+/d0uGymwnoZnQXfmNDouG2No50p2R2BwBSg4G4rNxvX+TxVvBfvbjcr4otSW+NazWFY= 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 AM0PR0402MB3442.eurprd04.prod.outlook.com (2603:10a6:208:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.42; Thu, 18 Feb 2021 05:27:25 +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.3846.042; Thu, 18 Feb 2021 05:27:25 +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-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-acpi@vger.kernel.org, Laurentiu Tudor , Diana Madalina Craciun , linux-arm-kernel@lists.infradead.org, linux.cj@gmail.com, 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 v6 00/15] ACPI support for dpaa2 driver Date: Thu, 18 Feb 2021 10:56:39 +0530 Message-Id: <20210218052654.28995-1-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR02CA0051.apcprd02.prod.outlook.com (2603:1096:4:54::15) 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 SG2PR02CA0051.apcprd02.prod.outlook.com (2603:1096:4:54::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Thu, 18 Feb 2021 05:27:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3aa7adf4-1d9d-4b29-561e-08d8d3cde014 X-MS-TrafficTypeDiagnostic: AM0PR0402MB3442: 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: lizLrFpS8ke0vNynpFmgN5m+U+ytOtobnQTiEez8L5u4tcULLkDkv4wo54Zi60OsJbjzkIToij1S0XTUNatF1s77XT5+T/ly3GrWjYL1ZfWSFZGv1ZAsyMhVmQ8R4/+U/M5vnPE1OQCwXfDB4BGXw1rGcElJqQNuhbJ03MNzaSUwEe6zpTHlbaoRu1MMNFPZj0dvL4RJgqk32aey4Uk6YaME30uWke7kbDnSQo8rH7KSH42VpJHVJlm74Z86b21Bxjnz652AbqMkngcZrsqfVZUuGbge3dawBoVl7zctdl6uK+Z5H2MKQ/yFah+W1jhpeXB+MjGQLAh5iuN062jI5MZBJTWVTTVA3JjF3JaukGqOn7G6E09129Dy0xwU/iMsEobWcAIuos+tqTcWhRm/5b7XpAAQB+hgGZtMYyddlKHcOEFZ11EcaiECtk2Lf4A3h6Bl3fUgSK4B+jkGjIy+hbEaO1S3dqteQXOgUWBd64So5N+Yw9J5wAAi9l3x7ft/AfHWdpSjOsityTLCMJwq/70xbkoSDPzd58lC5FVs3bMG7//+3MhY9o7dsEZ/WCrcU7d7WGOQ/X3NT1A9YkjQMLYuSkf0ywaJi9n4QkD9ivg= 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)(346002)(136003)(39860400002)(376002)(396003)(44832011)(6486002)(26005)(7416002)(16526019)(110136005)(956004)(2616005)(186003)(55236004)(83380400001)(1076003)(6666004)(4326008)(316002)(1006002)(54906003)(8936002)(5660300002)(921005)(2906002)(52116002)(478600001)(86362001)(8676002)(6512007)(66946007)(6506007)(66476007)(66556008)(110426009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?Em8UVYzhcQ5E5e3mVe7ZyECTZCOLb2aT3+XDHHNySzvLrZ7kQigCSbsWhO1i?= =?us-ascii?Q?wZGcPm5gt0I5BAkr7MHds67wL8URTBr7Z9biz4Y4MUA2isW8Jvm3zL4s7S/Y?= =?us-ascii?Q?6jsi67qDe1cM53/y4Nscvgp9YpvBeoc/SlYfhTSWELZgBu6UxrDEFiAcOe/M?= =?us-ascii?Q?1Hm1/1SpqOpNCa1uPQpffSWNgyTNtfCHOSIY5qgPypVRuIA4iAEyAE81N5Vy?= =?us-ascii?Q?FougmAnKOj5UyWVrMpyAyVAnpniziInwJgeHIcSoZiYn61Ble8uK7/+tRmGT?= =?us-ascii?Q?LUJ0B3t6tghKDnY1B7JFjz5q5puNry7MB8p4Rbk8CNLyNTuKxyVAGMIIyjKz?= =?us-ascii?Q?xua+eN8qwt/sFc6pA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TL2?= =?us-ascii?Q?x82Sd30cwdmfjrLvxOJAZvasR2fSchvAvPLhUZ2Vo0befzmJa9aiCSb1drJY?= =?us-ascii?Q?VtqrPvVM2ADBabTe/RBsY5m5?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3aa7adf4-1d9d-4b29-561e-08d8d3cde014 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2021 05:27:25.6189 (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: vpW7cW+ei8dmuzUy/dVkAy4LgCEDU0vjvBexODquA/wasqarGsA/4ktYxwpuezFDgjlqsle7erksXv1q4mjBYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3442 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 v6: - Minor cleanup - 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 (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() 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 | 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 | 41 ++++-- include/linux/acpi.h | 7 + include/linux/acpi_mdio.h | 25 ++++ include/linux/mdio.h | 2 + include/linux/of_mdio.h | 6 +- include/linux/phy.h | 32 +++++ include/linux/phylink.h | 3 + 18 files changed, 570 insertions(+), 126 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 -- 2.17.1