Message ID | 20221117215557.1277033-7-miquel.raynal@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641339wrr; Thu, 17 Nov 2022 13:58:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4zjB6VHs6NCAOobDjdGmoESChgC0o2yAmcdHy0xd6GuJ7AK++j3rWR12ex2fFhiQTzRuiH X-Received: by 2002:a17:902:ee89:b0:188:7a1f:fb18 with SMTP id a9-20020a170902ee8900b001887a1ffb18mr4788684pld.0.1668722281194; Thu, 17 Nov 2022 13:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722281; cv=none; d=google.com; s=arc-20160816; b=Z3lv+/yaQut/j0Rx1YF6sVbcGMm9c6HA56uDCRRclqIBKK1FkMeDnRs3znsli7H2Fw XtTj9Jooh5nySxBSXsQXZCnv/AqTu3XCqsrYAukBzOikTez257VqCtq2zdSac6vju+jN vbq2kooiMxEj0eWzd1qg/JDw++e45/uG4U8seCk1/eIdLSCzxzuDPhqRxw5q8MtY0dKZ zEuC2EkFWWQKA/e2ZF/D9AAxm7+K1T/+9uo5e0VHxn3Znji+xhYCHyFH1YVhfBEkXHoW Fws02LWBPHYr47D4mW47xSfPxoIf9Y7EY9XbGqE+9HesyZebP6hGOozBeiaOQ4TNPXXq uKmw== 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 :dkim-signature; bh=pnwcTEHTghwysLoyLNFVglyZaxT5Ls5k3YuYD2ZlLQk=; b=oXDS6i5dfqTasutVSVPNwod1/UZ0L4dCXS0XLJ8hlRPtSn5QD6SoKn/uVZrbDVf+bz F5FOdn6MHfT0pykLKj32AoNlRubqqDpVPhbQHn58a/pEeeclk0MoggP1Iwl4vtmfdjm7 0YiOo2pcOQDXo4GDKpAzMlkBsyr8/1QvXBCenl2yT5Qkd3X/EqRZN1+IKPr31P8Wnvpc tkoNE20Yz9Cmk62Mol/wR8JcRhT+rE2KluScaTDiDCZlv9Y+Q+hDLjKCFvzpEsBHuxuU 7XMiNV3skT8zHhibbALW7NJPFHv5/5J2REKNMznhf8JH7ibbcNhipB3+SFp1YF93ItFa ZuUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pGduEhje; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a170902d3d300b001825b1375ebsi1854322plb.544.2022.11.17.13.57.47; Thu, 17 Nov 2022 13:58:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pGduEhje; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241045AbiKQV5D (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 16:57:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241014AbiKQV4g (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 16:56:36 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0694C720AF; Thu, 17 Nov 2022 13:56:12 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 2F74E1C0002; Thu, 17 Nov 2022 21:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnwcTEHTghwysLoyLNFVglyZaxT5Ls5k3YuYD2ZlLQk=; b=pGduEhjemQPZpFe5yPmEqyzpTHt+2IF7nJ0J79XTjsXLCnJ6FaMTCtWNYI4y5b9Ir5oNO0 siuTj+UeXGN94dZ4kUWDf2pEeR96X/rph/aHn9UGUC3OseFPmwnSLGs6RRYQod5ItahMt5 V07els7hoQ8ncswGxXbeUHqRpbjL9bFagFpeSJpgazZgF/IXTKGtHR+mupY/0bRm9BCjda RTtHPlW1XAw6DeIM7PULKz56KWNWeVYLIlmww7/qKR6xLaQKJj0ARBJ4tNKDpqFqYYH/79 OOjXjHRLtf9Y7R3/0YFrJs3eG6/03t8O0XNfN0ty9IfjpDKfW8/ge4QO6UK+pw== From: Miquel Raynal <miquel.raynal@bootlin.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, devicetree@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Eric Dumazet <edumazet@google.com>, netdev@vger.kernel.org Cc: Marcin Wojtas <mw@semihalf.com>, Russell King <linux@armlinux.org.uk>, Taras Chornyi <tchornyi@marvell.com>, <linux-kernel@vger.kernel.org>, Robert Marko <robert.marko@sartura.hr>, Luka Perkov <luka.perkov@sartura.hr>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Michael Walle <michael@walle.cc>, Miquel Raynal <miquel.raynal@bootlin.com> Subject: [PATCH net-next 6/6] net: mvpp2: Consider NVMEM cells as possible MAC address source Date: Thu, 17 Nov 2022 22:55:57 +0100 Message-Id: <20221117215557.1277033-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782134926212929?= X-GMAIL-MSGID: =?utf-8?q?1749782134926212929?= |
Series |
Marvell nvmem mac addresses support
|
|
Commit Message
Miquel Raynal
Nov. 17, 2022, 9:55 p.m. UTC
The ONIE standard describes the organization of tlv (type-length-value)
arrays commonly stored within NVMEM devices on common networking
hardware.
Several drivers already make use of NVMEM cells for purposes like
retrieving a default MAC address provided by the manufacturer.
What made ONIE tables unusable so far was the fact that the information
where "dynamically" located within the table depending on the
manufacturer wishes, while Linux NVMEM support only allowed statically
defined NVMEM cells. Fortunately, this limitation was eventually tackled
with the introduction of discoverable cells through the use of NVMEM
layouts, making it possible to extract and consistently use the content
of tables like ONIE's tlv arrays.
Parsing this table at runtime in order to get various information is now
possible. So, because many Marvell networking switches already follow
this standard, let's consider using NVMEM cells as a new valid source of
information when looking for a base MAC address, which is one of the
primary uses of these new fields. Indeed, manufacturers following the
ONIE standard are encouraged to provide a default MAC address there, so
let's eventually use it if no other MAC address has been found using the
existing methods.
Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
Hi Miquel, czw., 17 lis 2022 o 22:56 Miquel Raynal <miquel.raynal@bootlin.com> napisał(a): > > The ONIE standard describes the organization of tlv (type-length-value) > arrays commonly stored within NVMEM devices on common networking > hardware. > > Several drivers already make use of NVMEM cells for purposes like > retrieving a default MAC address provided by the manufacturer. > > What made ONIE tables unusable so far was the fact that the information > where "dynamically" located within the table depending on the > manufacturer wishes, while Linux NVMEM support only allowed statically > defined NVMEM cells. Fortunately, this limitation was eventually tackled > with the introduction of discoverable cells through the use of NVMEM > layouts, making it possible to extract and consistently use the content > of tables like ONIE's tlv arrays. > > Parsing this table at runtime in order to get various information is now > possible. So, because many Marvell networking switches already follow > this standard, let's consider using NVMEM cells as a new valid source of > information when looking for a base MAC address, which is one of the > primary uses of these new fields. Indeed, manufacturers following the > ONIE standard are encouraged to provide a default MAC address there, so > let's eventually use it if no other MAC address has been found using the > existing methods. > > Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html Thanks for the patch. Did you manage to test in on a real HW? I am curious about > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> > --- > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > index eb0fb8128096..7c8c323f4411 100644 > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > @@ -6104,6 +6104,12 @@ static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv, > } > } > > + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) { Unfortunately, nvmem cells seem to be not supported with ACPI yet, so we cannot extend fwnode_get_mac_address - I think it should be, however, an end solution. As of now, I'd prefer to use of_get_mac_addr_nvmem directly, to avoid parsing the DT again (after fwnode_get_mac_address) and relying implicitly on falling back to nvmem stuff (currently, without any comment it is not obvious). Best regards, Marcin > + *mac_from = "nvmem cell"; > + eth_hw_addr_set(dev, hw_mac_addr); > + return; > + } > + > *mac_from = "random"; > eth_hw_addr_random(dev); > } > -- > 2.34.1 >
Hi Marcin, mw@semihalf.com wrote on Sat, 19 Nov 2022 09:18:34 +0100: > Hi Miquel, > > > czw., 17 lis 2022 o 22:56 Miquel Raynal <miquel.raynal@bootlin.com> napisał(a): > > > > The ONIE standard describes the organization of tlv (type-length-value) > > arrays commonly stored within NVMEM devices on common networking > > hardware. > > > > Several drivers already make use of NVMEM cells for purposes like > > retrieving a default MAC address provided by the manufacturer. > > > > What made ONIE tables unusable so far was the fact that the information > > where "dynamically" located within the table depending on the > > manufacturer wishes, while Linux NVMEM support only allowed statically > > defined NVMEM cells. Fortunately, this limitation was eventually tackled > > with the introduction of discoverable cells through the use of NVMEM > > layouts, making it possible to extract and consistently use the content > > of tables like ONIE's tlv arrays. > > > > Parsing this table at runtime in order to get various information is now > > possible. So, because many Marvell networking switches already follow > > this standard, let's consider using NVMEM cells as a new valid source of > > information when looking for a base MAC address, which is one of the > > primary uses of these new fields. Indeed, manufacturers following the > > ONIE standard are encouraged to provide a default MAC address there, so > > let's eventually use it if no other MAC address has been found using the > > existing methods. > > > > Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html > > Thanks for the patch. Did you manage to test in on a real HW? I am curious about Yes, I have a Replica switch on which the commercial ports use the replica PCI IP while the config "OOB" port is running with mvpp2: [ 16.737759] mvpp2 f2000000.ethernet eth52: Using nvmem cell mac address 18:be:92:13:9a:00 > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> > > --- > > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > index eb0fb8128096..7c8c323f4411 100644 > > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > @@ -6104,6 +6104,12 @@ static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv, > > } > > } > > > > + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) { > > Unfortunately, nvmem cells seem to be not supported with ACPI yet, so > we cannot extend fwnode_get_mac_address - I think it should be, > however, an end solution. Agreed. > As of now, I'd prefer to use of_get_mac_addr_nvmem directly, to avoid > parsing the DT again (after fwnode_get_mac_address) and relying > implicitly on falling back to nvmem stuff (currently, without any > comment it is not obvious). I did not do that in the first place because of_get_mac_addr_nvmem() was not exported, but I agree it would be the cleanest (and quickest) approach, so I'll attempt to export the function first, and then use it directly from the driver. > Best regards, > Marcin > > > + *mac_from = "nvmem cell"; > > + eth_hw_addr_set(dev, hw_mac_addr); > > + return; > > + } > > + > > *mac_from = "random"; > > eth_hw_addr_random(dev); > > } > > -- > > 2.34.1 > > Thanks a lot, Miquèl
pon., 21 lis 2022 o 10:29 Miquel Raynal <miquel.raynal@bootlin.com> napisał(a): > > Hi Marcin, > > mw@semihalf.com wrote on Sat, 19 Nov 2022 09:18:34 +0100: > > > Hi Miquel, > > > > > > czw., 17 lis 2022 o 22:56 Miquel Raynal <miquel.raynal@bootlin.com> napisał(a): > > > > > > The ONIE standard describes the organization of tlv (type-length-value) > > > arrays commonly stored within NVMEM devices on common networking > > > hardware. > > > > > > Several drivers already make use of NVMEM cells for purposes like > > > retrieving a default MAC address provided by the manufacturer. > > > > > > What made ONIE tables unusable so far was the fact that the information > > > where "dynamically" located within the table depending on the > > > manufacturer wishes, while Linux NVMEM support only allowed statically > > > defined NVMEM cells. Fortunately, this limitation was eventually tackled > > > with the introduction of discoverable cells through the use of NVMEM > > > layouts, making it possible to extract and consistently use the content > > > of tables like ONIE's tlv arrays. > > > > > > Parsing this table at runtime in order to get various information is now > > > possible. So, because many Marvell networking switches already follow > > > this standard, let's consider using NVMEM cells as a new valid source of > > > information when looking for a base MAC address, which is one of the > > > primary uses of these new fields. Indeed, manufacturers following the > > > ONIE standard are encouraged to provide a default MAC address there, so > > > let's eventually use it if no other MAC address has been found using the > > > existing methods. > > > > > > Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html > > > > Thanks for the patch. Did you manage to test in on a real HW? I am curious about > > Yes, I have a Replica switch on which the commercial ports use the > replica PCI IP while the config "OOB" port is running with mvpp2: > [ 16.737759] mvpp2 f2000000.ethernet eth52: Using nvmem cell mac address 18:be:92:13:9a:00 > Nice. Do you have a DT snippet that can possibly be shared? I'd like to recreate this locally and eventually leverage EDK2 firmware to expose that. > > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> > > > --- > > > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > index eb0fb8128096..7c8c323f4411 100644 > > > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > @@ -6104,6 +6104,12 @@ static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv, > > > } > > > } > > > > > > + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) { > > > > Unfortunately, nvmem cells seem to be not supported with ACPI yet, so > > we cannot extend fwnode_get_mac_address - I think it should be, > > however, an end solution. > > Agreed. > > > As of now, I'd prefer to use of_get_mac_addr_nvmem directly, to avoid > > parsing the DT again (after fwnode_get_mac_address) and relying > > implicitly on falling back to nvmem stuff (currently, without any > > comment it is not obvious). > > I did not do that in the first place because of_get_mac_addr_nvmem() > was not exported, but I agree it would be the cleanest (and quickest) > approach, so I'll attempt to export the function first, and then use it > directly from the driver. > That would be great, thank you. Please add one-comment in the mvpp2_main.c, that this is valid for now only in DT world. Best regards, Marcin
Hi Marcin, mw@semihalf.com wrote on Mon, 21 Nov 2022 15:46:44 +0100: > pon., 21 lis 2022 o 10:29 Miquel Raynal <miquel.raynal@bootlin.com> napisał(a): > > > > Hi Marcin, > > > > mw@semihalf.com wrote on Sat, 19 Nov 2022 09:18:34 +0100: > > > > > Hi Miquel, > > > > > > > > > czw., 17 lis 2022 o 22:56 Miquel Raynal <miquel.raynal@bootlin.com> napisał(a): > > > > > > > > The ONIE standard describes the organization of tlv (type-length-value) > > > > arrays commonly stored within NVMEM devices on common networking > > > > hardware. > > > > > > > > Several drivers already make use of NVMEM cells for purposes like > > > > retrieving a default MAC address provided by the manufacturer. > > > > > > > > What made ONIE tables unusable so far was the fact that the information > > > > where "dynamically" located within the table depending on the > > > > manufacturer wishes, while Linux NVMEM support only allowed statically > > > > defined NVMEM cells. Fortunately, this limitation was eventually tackled > > > > with the introduction of discoverable cells through the use of NVMEM > > > > layouts, making it possible to extract and consistently use the content > > > > of tables like ONIE's tlv arrays. > > > > > > > > Parsing this table at runtime in order to get various information is now > > > > possible. So, because many Marvell networking switches already follow > > > > this standard, let's consider using NVMEM cells as a new valid source of > > > > information when looking for a base MAC address, which is one of the > > > > primary uses of these new fields. Indeed, manufacturers following the > > > > ONIE standard are encouraged to provide a default MAC address there, so > > > > let's eventually use it if no other MAC address has been found using the > > > > existing methods. > > > > > > > > Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html > > > > > > Thanks for the patch. Did you manage to test in on a real HW? I am curious about > > > > Yes, I have a Replica switch on which the commercial ports use the > > replica PCI IP while the config "OOB" port is running with mvpp2: > > [ 16.737759] mvpp2 f2000000.ethernet eth52: Using nvmem cell mac address 18:be:92:13:9a:00 > > > > Nice. Do you have a DT snippet that can possibly be shared? I'd like > to recreate this locally and eventually leverage EDK2 firmware to > expose that. Yes of course, the DT is public on Sartura's Github, but here is the exact file I used showing the diff cleaning the Armada 7040 TN48M DT eeprom description and its use as an nvmem-cell provider): https://github.com/miquelraynal/linux/commit/230ee68728799454e2f07f61792e11724e731d6d > > > > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> > > > > --- > > > > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > > index eb0fb8128096..7c8c323f4411 100644 > > > > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > > @@ -6104,6 +6104,12 @@ static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv, > > > > } > > > > } > > > > > > > > + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) { > > > > > > Unfortunately, nvmem cells seem to be not supported with ACPI yet, so > > > we cannot extend fwnode_get_mac_address - I think it should be, > > > however, an end solution. > > > > Agreed. > > > > > As of now, I'd prefer to use of_get_mac_addr_nvmem directly, to avoid > > > parsing the DT again (after fwnode_get_mac_address) and relying > > > implicitly on falling back to nvmem stuff (currently, without any > > > comment it is not obvious). > > > > I did not do that in the first place because of_get_mac_addr_nvmem() > > was not exported, but I agree it would be the cleanest (and quickest) > > approach, so I'll attempt to export the function first, and then use it > > directly from the driver. > > > > That would be great, thank you. Please add one-comment in the > mvpp2_main.c, that this is valid for now only in DT world. Ack. Thanks, Miquèl
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index eb0fb8128096..7c8c323f4411 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -6104,6 +6104,12 @@ static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv, } } + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) { + *mac_from = "nvmem cell"; + eth_hw_addr_set(dev, hw_mac_addr); + return; + } + *mac_from = "random"; eth_hw_addr_random(dev); }