Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1631425pxb; Thu, 28 Oct 2021 07:17:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJijz3OdpeNf0AJzwkIB1bkBNn7qL3inpFe3NkCERrb7KkgdniqmXIsyP0enG6cKZ9RWS+ X-Received: by 2002:a62:7858:0:b0:47c:1cf3:d95 with SMTP id t85-20020a627858000000b0047c1cf30d95mr4718074pfc.60.1635430674833; Thu, 28 Oct 2021 07:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635430674; cv=none; d=google.com; s=arc-20160816; b=EF1wdowobRtQ5CAeLT9spinjH5BKTJgDw4kglkILObFxShjSO/bn7ouy9sVzSocSGR C5tDZIXC/1+uryR97XA6xVGnmqBl1skwOjqV/MQUmlr22VFZw30/p0GD08J8cOw9fcgR gvGTD9hFgI0xc/rkUNk03oGWI9UEYaLwcC7xGSaS1bw6oLityRpyHqLSTI1hBrulmD5N A0X2FiH31eCJnkYRmwpw1j5yzqX+NlodAy9XEXjbOxp/X1PQ+KDFEmBxQ528svbUiMr5 lVUGbIWMTqRgYdIUQPLJOQRhVB1NhMzmVEBF0FEXjweuB8/VDQlwIiwG7LbnaHUAOjRt zAgw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=tBpuuNH49Q3x88KtHzCne4SAnbPeEofm2NvfLfM2td0=; b=Ky/NRnQtIj/DjLPkpULQYhhLY9hrwrKczxctd4LfI4ZDlyWHGKR7+5YScb7c3TC1Sw +lHAHhFxvbYPq4rbc+jn6aWO5hF00pEFxp5FjNB4Dl0b1YKOKFHYIvyZyI9KcFXAssud ngrVIv5oeflRw0YsQs0c/gVkBTdYfdCc9rxuDJVQf15w2kBobWCxSGZMz+rta4oN7TGP wBKWRGGqxmLAdvX4DlgrpGjXGwh1tvXv24aN9JYYpl8h8b1ufdKLFrbHRH7ZnGsS1esr g4Io9D1XuhChdpwKUnlJt4rA+aR6MXho7m71tU2Ok246XUWHb76HU+pLQOucUckEW6kO HBgw== 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 i126si4151787pgc.122.2021.10.28.07.17.40; Thu, 28 Oct 2021 07:17:54 -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 S231211AbhJ1ORy convert rfc822-to-8bit (ORCPT + 99 others); Thu, 28 Oct 2021 10:17:54 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:35233 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbhJ1ORx (ORCPT ); Thu, 28 Oct 2021 10:17:53 -0400 Received: (Authenticated sender: clement.leger@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id C564320002; Thu, 28 Oct 2021 14:15:22 +0000 (UTC) Date: Thu, 28 Oct 2021 16:15:22 +0200 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Vladimir Oltean Cc: "David S. Miller" , Jakub Kicinski , Rob Herring , Claudiu Manoil , Alexandre Belloni , "UNGLinuxDriver@microchip.com" , Andrew Lunn , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/3] net: ocelot: add support to get mac from device-tree Message-ID: <20211028161522.6b711bb2@xps-bootlin> In-Reply-To: <20211028140611.m7whuwrzqxp2t53f@skbuf> References: <20211028134932.658167-1-clement.leger@bootlin.com> <20211028134932.658167-2-clement.leger@bootlin.com> <20211028140611.m7whuwrzqxp2t53f@skbuf> Organization: Bootlin X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 Le Thu, 28 Oct 2021 14:06:12 +0000, Vladimir Oltean a écrit : > On Thu, Oct 28, 2021 at 03:49:30PM +0200, Clément Léger wrote: > > 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_vsc7514.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index > > d51f799e4e86..c39118e5b3ee 100644 --- > > a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ > > b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -526,7 +526,10 @@ > > static int ocelot_chip_init(struct ocelot *ocelot, const struct > > ocelot_ops *ops) ocelot_pll5_init(ocelot); > > > > - eth_random_addr(ocelot->base_mac); > > + ret = of_get_mac_address(ocelot->dev->of_node, > > ocelot->base_mac); > > Why not per port? This is pretty strange, I think. Hi Vladimir, Currently, all ports share the same base mac address (5 first bytes). The final mac address per port is computed in ocelot_probe_port by adding the port number as the last byte of the mac_address provided. Clément > > > + if (ret) > > + eth_random_addr(ocelot->base_mac); > > + > > ocelot->base_mac[5] &= 0xf0; > > > > return 0; > > -- > > 2.33.0 >