From patchwork Tue Nov 3 21:09:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Brunner X-Patchwork-Id: 7547181 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18D32BEEA4 for ; Tue, 3 Nov 2015 21:11:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45FC820734 for ; Tue, 3 Nov 2015 21:11:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61B992071A for ; Tue, 3 Nov 2015 21:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756081AbbKCVLc (ORCPT ); Tue, 3 Nov 2015 16:11:32 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:34060 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755259AbbKCVLa (ORCPT ); Tue, 3 Nov 2015 16:11:30 -0500 Received: by wmff134 with SMTP id f134so94925295wmf.1; Tue, 03 Nov 2015 13:11:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=TJKug703GB7hj1yxQU3XFEizifORaXL9T8Ve7ggfUSs=; b=OMGfasLQhRcKaT+/nwAvjTZ2KtXJFFKiR7pHsYDRC2aJUfHg/8akrgWhOG8YM9soo0 TYra+o6m/y8+XkuKa4+aeifsV0vQt/2OJSv9RYLMYVdX9uiTHq68i2+DnTXctfSC29nX HmV+9W4iDS5ck1XIpioE5CgQRUVIfWFVE/jkUN3grCqmkAZtbOp3DlFj7um8OhNoY7lY JBeiwdzO+z7KnAtjsiVB8aOPyNobztRFALw45NBYgcw1QSsSqUoiAnwbJMWHp6pHH0aT gc4ukYYk3m1IkY7uoxG7dPm+jUglinzWD1lF/Yipi3w1eGojkVirSCvIvn0/ZI8W5XSE PN8Q== X-Received: by 10.28.141.136 with SMTP id p130mr23119945wmd.56.1446585089447; Tue, 03 Nov 2015 13:11:29 -0800 (PST) Received: from localhost.localnet ([213.185.142.42]) by smtp.googlemail.com with ESMTPSA id c1sm29447170wjf.19.2015.11.03.13.11.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 13:11:28 -0800 (PST) From: Markus Brunner To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Subject: [PATCH] drivers: net: cpsw: Add support for fixed-link PHY Date: Tue, 03 Nov 2015 22:09:51 +0100 Message-ID: <2251323.UEGYDRRlj7@localhost> User-Agent: KMail/4.14.10 (Linux/4.3.0-rc6; KDE/4.14.13; x86_64; ; ) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for a fixed-link devicetree sub-node in case the the cpsw MAC is directly connected to a non-mdio PHY/device. Signed-off-by: Markus Brunner Acked-by: Mugunthan V N --- Documentation/devicetree/bindings/net/cpsw.txt | 5 +++++ drivers/net/ethernet/ti/cpsw.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -upNr linux-4.3.orig/Documentation/devicetree/bindings/net/cpsw.txt linux-4.3/Documentation/devicetree/bindings/net/cpsw.txt --- linux-4.3.orig/Documentation/devicetree/bindings/net/cpsw.txt 2015-11-03 17:21:40.000000000 +0100 +++ linux-4.3/Documentation/devicetree/bindings/net/cpsw.txt 2015-11-02 16:53:43.000000000 +0100 @@ -41,6 +41,11 @@ Optional properties: - mac-address : See ethernet.txt file in the same directory - phy-handle : See ethernet.txt file in the same directory +Slave sub-nodes: +- fixed-link : See fixed-link.txt file in the same directory + Either the properties phy_id and phy-mode, + or the sub-node fixed-link can be specified + Note: "ti,hwmods" field is used to fetch the base address and irq resources from TI, omap hwmod data base during device registration. Future plan is to migrate hwmod data base contents into device tree diff -upNr linux-4.3.orig/drivers/net/ethernet/ti/cpsw.c linux-4.3/drivers/net/ethernet/ti/cpsw.c --- linux-4.3.orig/drivers/net/ethernet/ti/cpsw.c 2015-11-03 17:18:00.000000000 +0100 +++ linux-4.3/drivers/net/ethernet/ti/cpsw.c 2015-11-03 17:04:08.000000000 +0100 @@ -2037,6 +2037,19 @@ static int cpsw_probe_dt(struct cpsw_pri continue; priv->phy_node = of_parse_phandle(slave_node, "phy-handle", 0); + if (of_phy_is_fixed_link(slave_node)) { + struct phy_device *pd; + + ret = of_phy_register_fixed_link(slave_node); + if (ret) + return ret; + pd = of_phy_find_device(slave_node); + if (!pd) + return -ENODEV; + snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), + PHY_ID_FMT, pd->bus->id, pd->phy_id); + goto no_phy_slave; + } parp = of_get_property(slave_node, "phy_id", &lenp); if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { dev_err(&pdev->dev, "Missing slave[%d] phy_id property\n", i);