Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp184892pxb; Wed, 3 Nov 2021 02:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFmnRJcHfyh+FmjCoMFjkUfqHLhZ/q5vIsKbr0aBrrD1cmJK5njtfcrmwwcGPHxGQrD5Pd X-Received: by 2002:a6b:db0d:: with SMTP id t13mr11060070ioc.171.1635931303005; Wed, 03 Nov 2021 02:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635931302; cv=none; d=google.com; s=arc-20160816; b=f6QEARbE5Ye8wS8/eTC5SP7vdvKhPWTRJ5TCJP/TlH9RUfrhpjwc/Oo4kFNhGwfBTF rbgIbnZvr8FkJvtvwHNi3jeSUsgmjnK2LsB0TmQIflHYoIGqtI7VfH6FRtIVdZspTPwv gZYSyigrpqMQVEnGyYpaKKIjRNnEZA4Q8dna43+bupjLlSdn6Z1/tdWW/OnRZaCt2eTf oYHjBnP2Pojf3Ycb++S9mR6Jn6f9L650KtCadrskFrx7fHSJ2LHluPkHpdpmpeT3uxN0 bXlj8OJBhUOCBM6vWZGe3121OvtRZZN1OwAwtlxhw4ZrIXbe4Zdowg820nShTuHKFhdx jy8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D3mVE/OUQYwa1Llp8zRHwSs+cGku3ZwIpkIo2hI3H7U=; b=G0Lg4Rx+ezk3eoZk6MiJ91Gnnk+DoIpgkfuHDFlN65UsjiIc73Iv0R9vTPLUscw57V UIAk+V2IAGgIBdFiGXkZTjXsF5ly3cduNpziJadNZrLYfLFgbK1Mm4F+XgUYFANlOjwy kFg0Vq5TEZnwJyY9FQA3AGTZx5IF7bQcNa0+nphaUo3dne5g/G9Ph6qXsvt3/jGT97ft MNnvosIyB7OBPG6xFuVU9MXoONl+Jgfanee3GQye8rkcIg0kdhMW8qTIqudDNkkFem5G FSl8+2PsZ01yjiGO+B9XfQhuKkh1UnwBrEnsc4M8sYJHWDi6d3lFPH+esXbPjDXU+eBH upuQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si2502473ilf.149.2021.11.03.02.21.31; Wed, 03 Nov 2021 02:21:42 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232087AbhKCJXG (ORCPT + 99 others); Wed, 3 Nov 2021 05:23:06 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:50557 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231904AbhKCJXD (ORCPT ); Wed, 3 Nov 2021 05:23:03 -0400 Received: (Authenticated sender: clement.leger@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id CB062100012; Wed, 3 Nov 2021 09:20:25 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: "David S. Miller" , Jakub Kicinski , Rob Herring , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni Subject: [PATCH v2 1/6] net: ocelot: add support to get port mac from device-tree Date: Wed, 3 Nov 2021 10:19:38 +0100 Message-Id: <20211103091943.3878621-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211103091943.3878621-1-clement.leger@bootlin.com> References: <20211103091943.3878621-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to get mac from device-tree using of_get_mac_address. Signed-off-by: Clément Léger --- drivers/net/ethernet/mscc/ocelot_net.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index eaeba60b1bba..d76def435b23 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -1704,7 +1704,10 @@ int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target, NETIF_F_HW_TC; dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC; - eth_hw_addr_gen(dev, ocelot->base_mac, port); + err = of_get_mac_address(portnp, dev->dev_addr); + if (err) + eth_hw_addr_gen(dev, ocelot->base_mac, port); + ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr, OCELOT_VLAN_UNAWARE_PVID, ENTRYTYPE_LOCKED); -- 2.33.0