Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp104855pxf; Wed, 10 Mar 2021 22:22:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyomLOucxb/Hi/qW+kdYxFLAgSN2Yxzd+50OnPoOIgp6auzDzC0K1knoezLAFRhoCEuWXAI X-Received: by 2002:a17:906:ccde:: with SMTP id ot30mr1513057ejb.550.1615443772958; Wed, 10 Mar 2021 22:22:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1615443772; cv=pass; d=google.com; s=arc-20160816; b=RX+SodJHQh95VjlvP86vC0a2+5ZV9N/tvgxGer4BcTNMMQKY3cohAAbIDH8Sx49f/c //xFo3LcsexeW3WA77ir3mp2zT0/EsCSCsWdE/NuPufVO3hQu1w07MhtWfuKNySytKT0 upm6B7dbbBHyIX/VvaO53/ZslKL3D6+tk94KVxo5LpzXIbSYPs4dnqXq+4VQR4b9y8b7 jzV6eYaCm6wF8q5k2BUG7AzCa75rQl7BgOmUU8S6JXhekTsgHYVhVEjCiOw0NUQvYvHp Q4dIuDKsG9oCJTNJvGIcSG6Suy0Yaj9nYD/PRwKV9nO/hkW0CWa+TG9gON2w1LTfak/i zw4A== 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=XoRnjbAindRW1u463l4Q+5r4qWTfHb/DewqTC/ACjj0=; b=G5WMHt3FSnHkNwDdAbKrWBbcxvndatk3Wm99es7qsoknqAQH2UCvZwiMysOaLsMBiv ThvOYg5w1M9GvMNGX7eh5smL3MDdtOFKpbgU7CftxhsFywPIb+0OLId0diC/wZgO3Ter aKWZaGoehQrfdrJTW0/toFkCjjg0DZEU5Rx99Jgzo72oYEo9wKH9IEOpX/CNiSkLxlFc +HqdNFPnMSQUnebjOzbYn8EkjP96y1wtYI1gkkeX+qU/BY6o4fpCqIGigPEdCO8LJ72A NUyFpD3niMCU52V6F9jhnXD7or9UfAz0mEmS7SaXsYx+lMZsah0KnYnWj4YvND1O7nXj rdiQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=EhrKf+mJ; 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 q11si1199500edn.333.2021.03.10.22.22.29; Wed, 10 Mar 2021 22:22:52 -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=EhrKf+mJ; 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 S229897AbhCKGVe (ORCPT + 99 others); Thu, 11 Mar 2021 01:21:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbhCKGVF (ORCPT ); Thu, 11 Mar 2021 01:21:05 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0612.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::612]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27921C061574; Wed, 10 Mar 2021 22:21:05 -0800 (PST) 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 Content-Type: text/plain 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: =?us-ascii?Q?0xBhXTXgJ5jFGhDCN92Wbw8rguxqGW2+wsVnitCf/Yc0xXd6Q+ecbrZS/uee?= =?us-ascii?Q?VzUg+sDbx0SoXgM4j+H57z2Q8is1R4Gr/r1ZaJ4yfmRmP6EaOTwOvzkF6exj?= =?us-ascii?Q?eKCZGFMHqI2ZkIVT7VA2LWe17YnRAXkkkWqJEld+4cr6wUxs+WbdP+lhssle?= =?us-ascii?Q?vmJRSTpWzlam679pkNuQLIAD79nRwnTBZcoVGgEEHeKy3+etfu03dXUNAGHd?= =?us-ascii?Q?S+Ptb791pABCnePHO5t/+6DhWUj1pGNEuKCOjwf4WKb9Xo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VecNRZNN1WJvNS1d7Qe5xIILZz+HJJ49k8m7Z36nQ?= =?us-ascii?Q?vucHM9m5z9TBhAspGxZiD0ucIZeImv/vJeiczWMx1/A41swIGxq0kBRJzLFX?= =?us-ascii?Q?pHhCABN4elqoIYrKTp2y6j0Yanla+fQCtpP8bu5r/voYCGSoNEybsL/O88al?= =?us-ascii?Q?IGcesVhcbB2GS0/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 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: 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 -- 2.17.1