From patchwork Thu Nov 23 12:14:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 746657 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="1ggO+kOl" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2058.outbound.protection.outlook.com [40.107.7.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26003D5C; Thu, 23 Nov 2023 04:15:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hKlLEQX04e4A+LKyJFrzVX7xpiN+al4REMJSjyG3w5n35L6wJSFRbp/LgN6XU0robopm77ppT/tGRHN3Qhw9gcd1pC6EIGa9CSEFgIsvhvWLAN4pdGuhKGHBDk7pfBrE0ijoxX/Py8S9t3XVwd9YIj3ZDXfMcK2V/Mrvua+7GsXm0P9dpkzfF/Pmd0gDpg6/Deu4bRJV67FXxzJZKp/EPdzLXWts4u7ue3j9S8tiI3ibJiYCUNdrljUxbWd1uQwtUF/ByCg2yar5lEr+If7J58s2l93RzZ/uj4m0gqSGtAw2MTYDnFNbCxWf0gnvo68d1XxNNyInOiWiBFlZq2cfKA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AIfnaEo4N2Z/UP01LfKx32JgwuHl3fG1jrAMsr9MbfE=; b=NRfK34uDBnCE97LlboktJe5Vo4n+3a+OpZkyuo9SF7h3G4rFKOu8Mru8nimghunslYfJUcORCp2w+y9RsY9pY8Q2iLNxBOERaFv9LB8Rr5DESIIpz0smWDIde30bU86M0WM6OGTPYa6guZIR8zBx4+HlhVZYHrZv6zqVDZk2VQP46DjMecJv5cMxxa+hx040GFowydu56pL18hWmU7Sa2KQ1Oq3trL9pVrTGJ2A9yLfNHRRGTC/J9f5hXU8e82Lt+oD1pEPdocc/0XcH9Y0G+B7ykFJhOSyaUFpV70Qd81Ea7EvE6HTvdERZ9a1pHhY2SFuBkoacv7LB6Kw3Jitq8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AIfnaEo4N2Z/UP01LfKx32JgwuHl3fG1jrAMsr9MbfE=; b=1ggO+kOlnsXUHOAovCCunEaUvCrn3b7mZgqtPe1bFkLatzZPqZbWscKJqZ+c8/khv/vILkc3NDQFoCsbAeTJUbjsjCfkMo3OHY0bAGA5T8hKkAuayWVeN2tyGAcheaRIdxwXKzXBCnYVME1+I24zg/nWjuAFnx9HCZo2H6novIo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by DU0PR08MB8423.eurprd08.prod.outlook.com (2603:10a6:10:405::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 12:15:17 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6b40:1e6f:7c94:71dc]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6b40:1e6f:7c94:71dc%4]) with mapi id 15.20.7025.020; Thu, 23 Nov 2023 12:15:17 +0000 From: Javier Carrasco Date: Thu, 23 Nov 2023 13:14:14 +0100 Subject: [PATCH RFC WIP 2/2] net: stmmac: dwmac-rk: add support for PHY wake on LAN Message-Id: <20231123-dwmac-rk_phy_wol-v1-2-bf4e718081b9@wolfvision.net> References: <20231123-dwmac-rk_phy_wol-v1-0-bf4e718081b9@wolfvision.net> In-Reply-To: <20231123-dwmac-rk_phy_wol-v1-0-bf4e718081b9@wolfvision.net> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , David Wu , Alexandre Torgue , Jose Abreu , Maxime Coquelin Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Javier Carrasco X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1700741701; l=948; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=L+4DG9qvsMLMaPm6QeM3H7V9nATvHLre3SHjaPYMid8=; b=pgp8Dm0BP4blHZcJ6r6YuxjSY6KhK5aZmtXcCHc46Fomuu2r6XJc9kJp3akfP8aSSdfvCmes1 2MhbndH2oPCBVdU65liKUO8KJv5AeKbDvzTMGMEHvtavryS0STVmNvJ X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-ClientProxiedBy: VI1PR06CA0227.eurprd06.prod.outlook.com (2603:10a6:802:2c::48) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DU0PR08MB8423:EE_ X-MS-Office365-Filtering-Correlation-Id: ea339c67-63f0-46ae-1854-08dbec1dd37b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QUl1IOReLpf3dxNKBZ5HHm+HQLAXmOxuNx598HnUiyXD9dJWACLU86hvaQ0BbY1KZ5yDFv9S+sp1SXSLGmr03LQfRoJXsvuaGgD/h6ymjrV99dhcgvyuvHKEPq/s4GdPKRylyZ3Oeqr1ip3ZmuT233nS88DED/zfzCX1UGXPXQ6u+xMebMLakToFFy7cYI5k+UQebNCzW7aH7kQQK7qnTHovyC/hc/Bu5exnw5jvH3kOREz9aLdy0BPtsp/o9JHaJIKV45IXPYJPwD5ZEvnbEKJrN+ganF9TXHRgIIAibxj9gfZeU7/4o5IgZDxVC+mn/bHwho1keOfu7YWyQP1bh3puQs4eqZcWnrLaRt31CgldGlFhfhe3HgFvVfd/iJ0dSGJ9uBFUqnR33poOW5YDV0GSGJN0eELnJ7NGBwSCIZ1/NHbillvNtJVq/UfPurHrDYX4hnTMbizBtnop/OQyT4FSxo7dAZSG/Mt9K+shypOpO0ETAx5b6xYmwYZepvo9gYe1zR+Qix/II2RjRcDClegtjO9SZfmb2QAMpm2dC7kEWk2Loai4yhUAPh/9zSfB/QHimdXSIV5+KzWCVzcWE3W0skX2mhLbZw2dT6B6FeP3qz1b66poPwBlt1764Ea9K69UbR2CO4FxqLxGcpLWWg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4974.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(376002)(346002)(366004)(39850400004)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(921008)(26005)(2906002)(7416002)(4744005)(38100700002)(66556008)(66946007)(2616005)(107886003)(44832011)(5660300002)(41300700001)(8936002)(4326008)(8676002)(6486002)(86362001)(38350700005)(478600001)(66476007)(36756003)(110136005)(316002)(6512007)(6666004)(52116002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-M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d?= =?utf-8?q?YT00UW5XVykdNgtivj0pSeeKUXgGQiB2PdBSSEXGQKpRB+LGLAW9Fgq+Q31nMAVHY?= =?utf-8?q?cP4z6VheWvQ41DMlMN9nIHhEjLqi3AEuE69/HTvbvmPsBnJiSCwDHm4rzyNna9M9h?= =?utf-8?q?5+POP0aQ/D35fnq6RegTpynst7frAR8/PgORaLZA4IMC4XUAjgdrjjIqLiFjH+hi3?= =?utf-8?q?3V8wmefWc8SW/jNku5MsGTgDkN5YwZc2zGniuPOUgG9FYPlW6YkDHRlbF5HH9zRGx?= =?utf-8?q?eOmnY4QQgu5h11+VHeN5mg+zFPVr5anB9IZuBXdycoLRx2wRMm4XnhOxQfO99paXc?= =?utf-8?q?/4EHU+sCX8CU6VfcPW4fBHVwr45JKuxr7YKro8BiDAuLMtl4unxzdGMg+w5QZjXT/?= =?utf-8?q?kDGD1hUHQeBPPBwgiT5SmSM1UfiUozgpu2O7BmQKyJABeRLimaP8i6wzeePlsGV0C?= =?utf-8?q?zZDxIPOFk9GZfyvBCb4fVC3GPaq7WCx65vki1oxdwPW5BHrEv5B1Ef1QPOm0iV0kY?= =?utf-8?q?ARBpAcql4lPApN3lo3A6QCiJxag4NbWD2vRYwscJgXmPSJpjUxQk9mb8a32Ndvx6h?= =?utf-8?q?VKbMr027qIco9OXhaKc57Tql4COqNUOZ85Bm56KCAENza8hD5jMSYAfPfpUjxjAMI?= =?utf-8?q?yHw4poYT1EL+kuPcfs4nEzPOSheSJ3B1I5h9cffas6zsa9t+0dSeYXkaj4F2FgMfc?= =?utf-8?q?bx0Kfw/nEz6cfAA+dXwE79SEbwozZE9XHPHj2SW+E48yzhJbWxFXIng=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: ea339c67-63f0-46ae-1854-08dbec1dd37b X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 12:15:05.0661 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yUT45QtFPuoIXKLDaGmqkWphvweITQZnFmd5deET9wEJWYAqcagJZi4Lf/zlqisvzRQEjwPye9xGGPrjKAPchKnDlyOa06HkqAuptN3Mfeg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8423 PHY WOL will be used if the rockhip,phy-wol property is defined. MAC WOL will be preferred otherwise. Signed-off-by: Javier Carrasco --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 382e8de1255d..c543566b4f90 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1694,6 +1694,11 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev, dev_info(dev, "integrated PHY? (%s).\n", bsp_priv->integrated_phy ? "yes" : "no"); + if (of_property_read_bool(dev->of_node, "rockchip,phy-wol")) + plat->flags |= STMMAC_FLAG_USE_PHY_WOL; + else + plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL; + bsp_priv->pdev = pdev; return bsp_priv;