From patchwork Thu Mar 11 06:19:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 12130355 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 3B142C433E6 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 105C064F34 for ; Thu, 11 Mar 2021 06:23:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 105C064F34 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:References:In-Reply-To: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:List-Owner; bh=baFjM6OxYBL26sNAajWWfEB0t6vyuV6EOcNQ6NxXywE=; b=k1j3Gfofot4DBDPWnzP09ZK25 lfxXdmyVTiSP+dPWZxFvnS7kDXdBC4WbYWVmZ+aZ2bnowyjS+xPoNHWpmOqUyrwSzkKreD/0pQF1Q 71BZabqkbmcsWEFm5KSQ3YUrSEnFopeIWG09WdUgHSQ2ily5dLUx74FZ5imlTZTrltiUYG8qhMnAo /HwjIP3OGDR9KGrYASHkEtuhz3lmYcWYCSZXSFHMWNWbL0ngtasktS5Xjz6CE0+yWzCiRULqfljux IaOVFdIaWeli1HFniyrdqbO8vBFhZBmMha1I3phafwZEQRFH4gPbDDidaxaFh7SHTW7uO84qjzpDR LmuP4L4+g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKEgz-008SJD-Ss; Thu, 11 Mar 2021 06:21:06 +0000 Received: from mail-eopbgr80078.outbound.protection.outlook.com ([40.107.8.78] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKEgr-008SHy-Iv 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=Z308nNrkKMnyrS+ObIg5OTPsMS7lFcgNt/c/JdyFTcBySNpoZGo7oQzSCCTA55H3uNR/PFxL/yrMzhmLiVgxLuMU9z/a74SIs/eZjffM2kekeoGiA9PoNtYGYbYXddAJaZmzYvzBLcSMCGfeX+qgMwvut+p6sDpMx5OA4Ie7+Du8V6SPDIcHemyIbiwyY5v8zraaXxXeUKz6Cjg9wKoCMHXz4lLO2s5kQS9QrV91ycbX9eETqnk+TUH8+VJ9QwC3VaOPfU3sK6Y0R0UWYprgkuPCSHOsKM/X+Xn3RfOUPS7msxkEEEmy1WB6FrB/ovPKsxuSvxUF0GKrljS+WsDOwA== 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=ywfRFD+alcZoBdD7gV1eSqnbgfkHyn/q3/vr1iPftP0=; b=Pja1W8z1GmmmthVTdBwlkh9+7tKtBS91vUMHHuJk70WgflETaStrmp9gaVolgoAX52E6bE+g/kwdNxPyAP4wYde8UQHeJchtLsaaG2CCw4mzJzXvae0RLZXW9SC/yeteKl+bTcaH+eC5SwUnZRMKwurMwP6E5dyQl6cTVZQ/vBsVKJgq90dliDZQbxFgZldgJBGrxnWZhlsdvK22MYoJBcu6hmP9Q/4QLyd2oVKv8oLuOg+Ez4H3J+RE0Bx5P+pO116A0Lf2zMdNPNW04uM1Ybu7BTT7fYo4WPs4X3XAGJ4YcnpqSDnpBSJ27CB3bX9IT0QoHqSIMBndzfplrafI3w== 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=ywfRFD+alcZoBdD7gV1eSqnbgfkHyn/q3/vr1iPftP0=; b=LRRkBZjVtsWhR5K46QGjOUvFxf3cSiMtzpp/jlXFAmzpYmCyYoPaltDaRq98z0iv17E7m5RiMZq1m2hh3VZkIC07Rd7swwhmbNgyn8rtDgLQmkoFosxld4sqRoobocBGhzplKwGshoRE5eZM2FCbRRAyKV38+moz38v+5/DA1dw= 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.3912.27; Thu, 11 Mar 2021 06:20:52 +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:52 +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 , Len Brown , "Rafael J. Wysocki" Subject: [net-next PATCH v7 01/16] Documentation: ACPI: DSD: Document MDIO PHY Date: Thu, 11 Mar 2021 11:49:56 +0530 Message-Id: <20210311062011.8054-2-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> References: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> 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:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 10f97422-76a9-4771-695c-08d8e455d1b5 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:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6y7mOLvW/pUyNn6c3Bh/Cg4wilYBZLqmhX2k+sAOnJW1LyBtSnchsqiowHop5idRlHBok47u7AoTLg63r0INR1fgqlX22cE6XhrMDIq7VLGX1cDfJo6OiSnOQCVED8wbgEHZP7+ZhdNXJg/NhjAt8RfPXR93ubGulSnRTY6nJZgoLianKTDk6eFFTrsjhmN1mdon3XtLS3fDR/43BFaqWY0byaLu0V8+ybgoICN40ZU2zgzWaBVJ6atuYCUHnvFszqeC3UqC0BLdbULOuIjhQP9ON3lp5um1tYAEJNv5+fR3PPrIdIlnK4lfjBkS4UysIiiyD65IMNyIGJrZwt9zuAK1WsQP7+ZITkJIIx0uJlA9IeXpLVpOgDiIeMC/GuAofWTRU8MFYtsjGyW/XGRNVdw/1DLoa1cZIn7dWtPUTnN9RZQSSlQf6bEFyKXUrAxUFfBDZr+qTLIs/vao72Whpq4NyZsFj8xyjxTBPkupA8w3aFhI9u5WzIgOhMTSu5MlRS5ItYTPk5ZTdhSZairwg1WLd7l5soVKkV8hHc0nc1aA/fHrF6l7A1DIwVuu7YKuqCp9qGUsjGpJmosApkbT++r4WwH1h1ZKam6xIJ98UmMlbi61NkLuPMvL1UBnWdoPc4qKXkRmYRb4PHee2KVxSTtg8kRWp6gzrl7Jh1s5af0= 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)(39860400002)(366004)(376002)(136003)(346002)(396003)(6512007)(2906002)(7416002)(8676002)(6486002)(2616005)(186003)(6506007)(86362001)(26005)(921005)(83380400001)(110136005)(16526019)(956004)(55236004)(316002)(66556008)(44832011)(66476007)(8936002)(1006002)(966005)(4326008)(1076003)(6666004)(66946007)(478600001)(52116002)(54906003)(5660300002)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: dlW7zb1zQLAzXhQKMrgL5yG6DlaABx7athdeydei9fgzjyMprafzUn3b0a9SJvYCCpANLxFZcJIHtV3MP2bBi/oiuV664HwcczcV001cMG8+4HEyJQABs4YKSzODT03DyjxNOnfVPTOh4DlbI9F7BSZv/KQZmnKAW95Fk4KRM7tv4lgfsLP2ZmM0DnDUkPPjscOUfkM6jNuCfYjOhdYcpzd9bv5gOptMI8brZE1llOy26/YTSWOmEmkqKL43Vd/9cSG4REUJatt2TrO8Sfk+09uplW7ZJuRgNWx/t3CN6io7SkNI2mVP4aLILPb/H8Yc5NJeTJOKEqAW9mzuQEFeDS9E5YtSMhqGoBfS1Gk2GW6TIt+tatYM1ijOzcIe7wXQ/CCyOdNRRfA6hfL4Vpbq7hwEExi0UjGHVOX/gfRAhDJ1siFGabqSzLN1bE7mpyFch82w/nfPWGdpQTIGSK9JN+IytNfHqLPV1Zmthji/FUVDI6wpmtJc4GX3Iw8xjLNfMShgoJtEol7DndlTaawNn+3/ggGi0DN8hZCH9OwKf7cIURyDLZ4STu2unR4Te9qF8kM01RnZdUcI0gdJstrhvKDG2K1tuQqU4ePUmev1zlSvfngAY9NYY9pXnJUq6pNAl+36FXCAuLWKO11+GJKez5/P4y8PwWWC0b8lAw544UyVCQch4STzH8ij0uyrNztInDidb3dfimiT988DARG+EVkNgFai8snIpV5C3tJVa3mF7OnS1K3jNGGHk6pkUSG8ZFMgkNBbTGE2o/pheC9PSGGSBZ43DaCDLm4qGnmuEE+yJxJ3Owah40kfswZAQwauvV+EtHDWZAXngIf1JLc7E/UoGC9sTHr+eq5X/Ftql1quntMx9rboHd77CXMElUWPlJhLa9HnQIQiPCNBeLOD2vt6QwMhsXRiTjalY60lmaa29Oz70p78E4WiiwtW3b6rJmy09QiSB2NDjEZK4uNa3bszkSOlxkWw2ci/NWQyq7W/THCRQmDpaJorcurT7GNsEHN3Owsi+DVCNKLeazZZ8Bd7FkUA3/f5OWk1L/dcvYtjni2KUcOUVh9gYVdS7rAsPCmVj5qmSknpdFXHhULRPC5hWfE88aOuh6iCGrdZ1QSpJ6lFlNRY4z3yj/cGvy5Ovnpe0S3Ieod3Mj2YjShpp4TKM9f6LnJQdAd79QOgLB42tjxF/cu2bXsAv0a/dUwReUI6zZtA4tzIYtf3yEYUNJiepa1dkW1U+F/BlFSU+WVNyMv+Mk3ygah/dKE4Pc3XT05skj2orI6huf+3dUnErGWxfNBgWggqLShOHvKg/WsAAjACf60WPN7gvNDfewuk X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10f97422-76a9-4771-695c-08d8e455d1b5 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:51.8733 (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: cLMZZFdwEHYy9pGJdNyFOmqORSXI6oFGCpDYFJBNX0dpTM9ymE3VdgSBg2Zj+44M1YhYX9Rg/on7z0rDTA7fqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3442 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_062057_740383_0FE2B988 X-CRM114-Status: GOOD ( 17.87 ) 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 Introduce ACPI mechanism to get PHYs registered on a MDIO bus and provide them to be connected to MAC. Describe properties "phy-handle" and "phy-mode". Signed-off-by: Calvin Johnson --- Changes in v7: None Changes in v6: - Minor cleanup Changes in v5: - More cleanup Changes in v4: - More cleanup Changes in v3: None Changes in v2: - Updated with more description in document Documentation/firmware-guide/acpi/dsd/phy.rst | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 Documentation/firmware-guide/acpi/dsd/phy.rst diff --git a/Documentation/firmware-guide/acpi/dsd/phy.rst b/Documentation/firmware-guide/acpi/dsd/phy.rst new file mode 100644 index 000000000000..7d01ae8b3cc6 --- /dev/null +++ b/Documentation/firmware-guide/acpi/dsd/phy.rst @@ -0,0 +1,133 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================= +MDIO bus and PHYs in ACPI +========================= + +The PHYs on an MDIO bus [1] are probed and registered using +fwnode_mdiobus_register_phy(). + +Later, for connecting these PHYs to their respective MACs, the PHYs registered +on the MDIO bus have to be referenced. + +This document introduces two _DSD properties that are to be used +for connecting PHYs on the MDIO bus [3] to the MAC layer. + +These properties are defined in accordance with the "Device +Properties UUID For _DSD" [2] document and the +daffd814-6eba-4d8c-8a91-bc9bbf4aa301 UUID must be used in the Device +Data Descriptors containing them. + +phy-handle +---------- +For each MAC node, a device property "phy-handle" is used to reference +the PHY that is registered on an MDIO bus. This is mandatory for +network interfaces that have PHYs connected to MAC via MDIO bus. + +During the MDIO bus driver initialization, PHYs on this bus are probed +using the _ADR object as shown below and are registered on the MDIO bus. + +:: + Scope(\_SB.MDI0) + { + Device(PHY1) { + Name (_ADR, 0x1) + } // end of PHY1 + + Device(PHY2) { + Name (_ADR, 0x2) + } // end of PHY2 + } + +Later, during the MAC driver initialization, the registered PHY devices +have to be retrieved from the MDIO bus. For this, the MAC driver needs +references to the previously registered PHYs which are provided +as device object references (e.g. \_SB.MDI0.PHY1). + +phy-mode +-------- +The "phy-mode" _DSD property is used to describe the connection to +the PHY. The valid values for "phy-mode" are defined in [4]. + +The following ASL example illustrates the usage of these properties. + +DSDT entry for MDIO node +------------------------ + +The MDIO bus has an SoC component (MDIO controller) and a platform +component (PHYs on the MDIO bus). + +a) Silicon Component +This node describes the MDIO controller, MDI0 +--------------------------------------------- +:: + Scope(_SB) + { + Device(MDI0) { + Name(_HID, "NXP0006") + Name(_CCA, 1) + Name(_UID, 0) + Name(_CRS, ResourceTemplate() { + Memory32Fixed(ReadWrite, MDI0_BASE, MDI_LEN) + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) + { + MDI0_IT + } + }) // end of _CRS for MDI0 + } // end of MDI0 + } + +b) Platform Component +The PHY1 and PHY2 nodes represent the PHYs connected to MDIO bus MDI0 +--------------------------------------------------------------------- +:: + Scope(\_SB.MDI0) + { + Device(PHY1) { + Name (_ADR, 0x1) + } // end of PHY1 + + Device(PHY2) { + Name (_ADR, 0x2) + } // end of PHY2 + } + +DSDT entries representing MAC nodes +----------------------------------- + +Below are the MAC nodes where PHY nodes are referenced. +phy-mode and phy-handle are used as explained earlier. +------------------------------------------------------ +:: + Scope(\_SB.MCE0.PR17) + { + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package (2) {"phy-mode", "rgmii-id"}, + Package (2) {"phy-handle", \_SB.MDI0.PHY1} + } + }) + } + + Scope(\_SB.MCE0.PR18) + { + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package (2) {"phy-mode", "rgmii-id"}, + Package (2) {"phy-handle", \_SB.MDI0.PHY2}} + } + }) + } + +References +========== + +[1] Documentation/networking/phy.rst + +[2] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf + +[3] Documentation/firmware-guide/acpi/DSD-properties-rules.rst + +[4] Documentation/devicetree/bindings/net/ethernet-controller.yaml