From patchwork Fri Jul 15 21:59:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12919842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5157C433EF for ; Fri, 15 Jul 2022 22:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=tHFUFC90oc1+JS8ZFHUAmapq9deCzN4hG0SR8qj9IJk=; b=qsZmih7YEhAzbF qSvavgBCZ7Q41gD9DgqR2vAIlyBzrqyOOvWUDapS6FVKVLobEqrMPRWzntlcwx6/lgyigZXisUCen YtHSY1+sfoiMGcaVf44d+IX2qkWjXg+au7aca5bBKLIJs/kpPvtx+T4OTatKWxhwJeS0yNKKGvjTS yXdhS0vNwa0zk2NjcPAXHmb+NybEJxqJ2UcK0hxod0MgO7HvA5r893GfGLfuwEMoJt7JUo9P6dz/W xzqmZ5knZZYlnu1mOD2AcXZ4FkH7CfFdjmfsC/Y8TycHOorAXxQX4Pvt0ou3kNQYAuWVVCdf8PivF JZIDoViTDpxmDYWoiQzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTbU-00AiFy-Ou; Fri, 15 Jul 2022 22:16:10 +0000 Received: from mail-am6eur05on2087.outbound.protection.outlook.com ([40.107.22.87] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTMx-00AbF8-Dk for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2022 22:01:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PnfihahGVKsLZLAeZtd384envdsE3JJxvEp8QHm4QMMu9fhSBEsmzPP2RDxAPRVXuHyGV1DcfY9LHIKQeeWlgk/EH7RmRYhK9OZkm1Fsqr81ReLd82q+GJ4oZG6LYF5FfNx9g8eI7EX3iiUVzpO/scYGhH8DXaS2963E4ppfrRWWYHILe1V6rOozPaA3X5BMONcX5HCUftHmcsGwm6JEAgJWbcWDzd69oIJguqntsyWH/XggTEYVn6PYpr8PyfEQpP+6AT+Aggcz2HfZ8Vi970D7ZTweYr0+oVOOR3DCLrwB+kIvJRKLXMnz1UfRKrZtZPXioZM5LARFimMxSB2cTg== 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=olcQBbmzRcg1gnh3qf6bLgAGov4YUNKRcu6ttbNphqI=; b=MFluLrzQYWbefG87uK65RTjFj32gVIAuSWDk2Z5WQ9j7+OedVf73HGO1xxqoGUiLrBnynnZCq80viIWk7uwCaxlF4wlDNt1HdICSfcghzNOxrbGM0mVLYs5Iyp7kCMEqlBxg6TcPn0A5tJ94FHnB7VL8pszruPNvszP+tSLykVvHNlIuLQB6f1gtlDMAtNfyeAPX1orii5FgvqmtF2101Jx9W1gwZRwE7i46m/CiezPrv+xDFetJEwT93b+LunNht1dYvCP3CfnpRCl5LaPcGTJ9Y8005wde8V8WPsNlv5bq5VNM1bLLoC3NIp3od2cD+mMPcB9YBWzC2/T5zI2QSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=olcQBbmzRcg1gnh3qf6bLgAGov4YUNKRcu6ttbNphqI=; b=kXY5ZjLbm7Nxvuzxgy97HnuPA0SRZ7qCBcM85DC08orPSgZBrckbcxgiPQhUJTQ4WFc6WEiPzlMAz6Gb/6VBgvqd66lomGDLNtddM0YjGFDrjphLCCfbBZqnsPO7OrhJ1FjHVnZVrOIKw/LpF66szgdgigpNpAcGWtHPThLk57GFTYo4XVtYkSi+iOTXvCq9pwUw7anGYAgV7KnRxL/xWE28rbBFWKmXQ3aSZ9EEuemf8RTQYz5C4P8ynYLry/RJDCjgp6zfTagN0QuQBZ1n8vtPldrcquWdH+PaqtCeNCVXX+snUNVrACcKSYEBNcOae/BpLx+nGtD8sIv1qoO0bg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by GV2PR03MB8607.eurprd03.prod.outlook.com (2603:10a6:150:77::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 22:00:57 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558%7]) with mapi id 15.20.5438.015; Fri, 15 Jul 2022 22:00:57 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, Russell King , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH net-next v3 19/47] net: fman: Get PCS node in per-mac init Date: Fri, 15 Jul 2022 17:59:26 -0400 Message-Id: <20220715215954.1449214-20-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220715215954.1449214-1-sean.anderson@seco.com> References: <20220715215954.1449214-1-sean.anderson@seco.com> X-ClientProxiedBy: CH2PR10CA0009.namprd10.prod.outlook.com (2603:10b6:610:4c::19) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01a67b91-6fca-485a-ec0e-08da66ad7f1b X-MS-TrafficTypeDiagnostic: GV2PR03MB8607:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jXc4W+h0Yn9UCZZJnnyOK8T4APth8WzFiqk3tMA+segV0/lI8RpsdlM9imVAElX7LS62oqujqjwDYla+2DNp9d2N4lSkgsAmGSfgyEBGoygSQ+gbCwchkJPP5HO6GyFGQclFKdpLdpUsqAlw22N5qZ7uFaYa750pJ80hekjLM7JG2CHwq8anlJsp4dK0ZKUfhdpd93i1VREqtz4aTWA8S3GstHANdfq79HOuJtjfrLEhbIz+RQvIXu5fPMoOM7sarBkSqDxxvx5yW1DLND692tycvVcaSgqOC2MVdXpVMssmBDIOCk0NTQSmSEunc9U4JRuLj3U0VYZsywhZgPliwYhsrucAOZRL1DtutaYEUdNZgKyu021mJ0V6bEY0VlAfCc3wmyrckpGfsQaUbn/0XaEZsYjXKLaJlzIjvRm9zwsnmQ4JQjRBkwJ5Mvildz34R3Nh3Oyzu4qyVArzTTh+tYvxdaLz/yxIdFQWRsQfbI3UR2Z57+uGHlr7SeEf2tRUPGl0u2a50qtuH1piA2lmGxHZtgA/wKv/pqx3+Z1KRwuwNG2qnndEmhRgH+ApXNyeBxGP9fmRBr54WiL2VJEttnNdJW8u7mH1FQyah+EtUJzYDWAjYNRAobd3GQ82VByLmzy8kWxYazTfPzia6d2f85GeUpyIWhw5BnMVADiYS2Np4DWcgt4Ufa2e0v/fymVhfjVLeKEJL2XMG/3c7i5LjXG0eRLFkOe8g2mEkZmi0Sp6dqmxIKbjmdgifjQyR72pogzlNJarhl+dk2RSKCPJsVt6WdWsRSS8Lpx6tqYyYce0GgKsw71bbdJSjhxeNYM+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(396003)(136003)(39850400004)(376002)(346002)(186003)(38350700002)(66556008)(83380400001)(38100700002)(66946007)(110136005)(316002)(66476007)(36756003)(8676002)(4326008)(1076003)(2616005)(8936002)(86362001)(44832011)(6486002)(478600001)(6506007)(52116002)(107886003)(6666004)(41300700001)(5660300002)(54906003)(6512007)(2906002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BHoGofft4MwwswWPia0OQzgIvAABhS2KJO3lFl1rZw68dSD7GlBbDhXrzzsb8xSfoo9suCs+4S/50XGMGMffsEc8Vhi1v+Xpx51ue9bH68lqvxCIrrtPEJ0JHV1/AhfPrTdVu7rkmGC9uBrNxXWnz5gaVHPBj5jdwDzStqMSN1hDxh7+VnabreRYB+GQNcW3Iv9/1B3LVYTrFTVO/4WtvmqQxL+/lQZX+uFOwrmoWHEH+IMIL2o0Hv7RrM6A++2724ZIgLdPzOOjjc4+ZrYHunm2cI9ViSzl4R91MECB7P3mPTWFeyqUy1W3WA5OK0HDdFObXMI7c9PP4ndbgt5/V+nexd2bkb9Y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jIBYzZSotvg0HcXhcJ0I2LStDBZOavs8nBMhpMmQpGhDZRNAoYzLPXRmjmFtATDvmlkcewTK33zL5zvGHSzKK7My/Edi0OOShQzHYDZpJlDfgwQsQQ8fUUSaTJmeyFm7dBz/Zea/bbHAZudU7zFJXWxI7Y0GB32D4GUNbmFi6BZ1A== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01a67b91-6fca-485a-ec0e-08da66ad7f1b X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 22:00:57.5195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mg2fpactM/yv81ac8BZwFpc9Wl9Gn7uHhAZ2XpmBnmV7eoAfkY5UAG/GbDg4MRQ+qmvOV0uymLeEKr1oLSN0EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8607 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_150107_529744_74B23707 X-CRM114-Status: GOOD ( 13.93 ) 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 This moves the reading of the PCS property out of the generic probe and into the mac-specific initialization function. This reduces the mac-specific jobs done in the top-level probe function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 19 +++++++++---------- drivers/net/ethernet/freescale/fman/mac.h | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 6a4eaca83700..0af6f6c49284 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -32,7 +32,6 @@ struct mac_priv_s { void __iomem *vaddr; u8 cell_index; struct fman *fman; - struct device_node *internal_phy_node; /* List of multicast addresses */ struct list_head mc_addr_list; struct platform_device *eth_dev; @@ -85,12 +84,12 @@ static int set_fman_mac_params(struct mac_device *mac_dev, params->exception_cb = mac_exception; params->event_cb = mac_exception; params->dev_id = mac_dev; - params->internal_phy_node = priv->internal_phy_node; return 0; } -static int tgec_initialization(struct mac_device *mac_dev) +static int tgec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { int err; struct mac_priv_s *priv; @@ -138,7 +137,8 @@ static int tgec_initialization(struct mac_device *mac_dev) return err; } -static int dtsec_initialization(struct mac_device *mac_dev) +static int dtsec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { int err; struct mac_priv_s *priv; @@ -150,6 +150,7 @@ static int dtsec_initialization(struct mac_device *mac_dev) err = set_fman_mac_params(mac_dev, ¶ms); if (err) goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); mac_dev->fman_mac = dtsec_config(¶ms); if (!mac_dev->fman_mac) { @@ -190,7 +191,8 @@ static int dtsec_initialization(struct mac_device *mac_dev) return err; } -static int memac_initialization(struct mac_device *mac_dev) +static int memac_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { int err; struct mac_priv_s *priv; @@ -201,6 +203,7 @@ static int memac_initialization(struct mac_device *mac_dev) err = set_fman_mac_params(mac_dev, ¶ms); if (err) goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); if (priv->max_speed == SPEED_10000) params.phy_if = PHY_INTERFACE_MODE_XGMII; @@ -583,14 +586,10 @@ static int mac_probe(struct platform_device *_of_dev) if (of_device_is_compatible(mac_node, "fsl,fman-dtsec")) { setup_dtsec(mac_dev); - priv->internal_phy_node = of_parse_phandle(mac_node, - "tbi-handle", 0); } else if (of_device_is_compatible(mac_node, "fsl,fman-xgec")) { setup_tgec(mac_dev); } else if (of_device_is_compatible(mac_node, "fsl,fman-memac")) { setup_memac(mac_dev); - priv->internal_phy_node = of_parse_phandle(mac_node, - "pcsphy-handle", 0); } else { dev_err(dev, "MAC node (%pOF) contains unsupported MAC\n", mac_node); @@ -783,7 +782,7 @@ static int mac_probe(struct platform_device *_of_dev) put_device(&phy->mdio.dev); } - err = mac_dev->init(mac_dev); + err = mac_dev->init(mac_dev, mac_node); if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index 95f67b4efb61..e4329c7d5001 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -35,7 +35,7 @@ struct mac_device { bool promisc; bool allmulti; - int (*init)(struct mac_device *mac_dev); + int (*init)(struct mac_device *mac_dev, struct device_node *mac_node); int (*enable)(struct fman_mac *mac_dev); int (*disable)(struct fman_mac *mac_dev); void (*adjust_link)(struct mac_device *mac_dev);