Message ID | 20221128084749.5F10D1D73@mail.steuer-voss.de |
---|---|
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 q4csp5521092wrr; Mon, 28 Nov 2022 00:52:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lPghXD6uG7n6zQqyyr6xflW2N9lVrBVCZwgi2acSK+1uzdbAsoElQXkIXNwodq5uGk5AC X-Received: by 2002:a05:6a00:18a9:b0:572:6da6:218e with SMTP id x41-20020a056a0018a900b005726da6218emr31564747pfh.1.1669625555914; Mon, 28 Nov 2022 00:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669625555; cv=none; d=google.com; s=arc-20160816; b=dLzgG6kVAHhoKLJmqF1lISwicj0wC+quvtE6MluFohCjLXEuyIXzaZorfUzJ/72N/g +6pGHTakBC6laS8N8TdMp7JkE5KHeoDC96jGFCL4gTQOZVEm2G+jlcB+QKuznEGj5KF9 sS5ehs+GSknn1FP9ZtRVwwP5A3kGJha0wnHrbkpKWnRgaqMdXyCU0hslLyi2aVz4o3F6 trKfZHCgr8HfmirxEOMIltbs2H3LIf9pEp0RMhZHdTa78zf58FiZuIRqwx72cncxiulA xNZMaqDLHcq9Tx5NCEH1p/rdOjVopQ0tfyYN2gHBKGA7H9u7HyvqsAYm94uiINK+GtIl Rn9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:subject:date:cc:to:from; bh=3n1FBkr4Nf3exOC9CL/PuXcSxUJUHF0wA5NHjU3Md44=; b=Pd6ugzIC088nwDwvcypQ5NLgS8Ctptsi4LrWqgoCS2h3nmgTc8TKAX+RNWg/4nBLfo qZgJ+pbYqg0rZvTb3rtNIX6gk/aztiqyFxAab2vlIRI+O9F6PT66F9svmDk8lFaeLru5 TcH4oEZZWmfl6xKiGhn7lbBq//E2liaRFEKM7uy+Vm4nzvLV18edmopA9E+nQKdA9mII 1HqNdrONDj6lPfUDcxeoRE91tHdwse44JDpBj47oT46XGkJc3akSPkhw32Z9SuKgQM7J vhQolfsqKlOJefU6t5RB5WmRU3/2Qc7nY4zlje5WRfHYIKCVvJEGC5ckaMIeM2mRnTbl EWgw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=haag-streit.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020a170902b08500b00188e5c9e026si10245236plr.102.2022.11.28.00.52.22; Mon, 28 Nov 2022 00:52:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=haag-streit.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbiK1IsA (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Mon, 28 Nov 2022 03:48:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiK1Irz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Nov 2022 03:47:55 -0500 Received: from mail.steuer-voss.de (mail.steuer-voss.de [85.183.69.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B89965EB; Mon, 28 Nov 2022 00:47:53 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id 5F10D1D73; Mon, 28 Nov 2022 09:47:49 +0100 (CET) From: Nikolaus Voss <nikolaus.voss@haag-streit.com> To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Rob Herring <robh+dt@kernel.org>, nv@vosn.de Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Date: Wed, 2 Nov 2022 15:27:19 +0100 Subject: [PATCH 2/2] imx6qdl.dtsi: use MAC-address from nvmem Message-Id: <20221128084749.5F10D1D73@mail.steuer-voss.de> X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_00,DATE_IN_PAST_96_XX, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1750729286968849321?= X-GMAIL-MSGID: =?utf-8?q?1750729286968849321?= |
Series |
None
|
|
Commit Message
Nikolaus Voss
Nov. 2, 2022, 2:27 p.m. UTC
IMX6QDL has fuse locations specified for storing the MAC for the
built-in ethernet (Table 5-8 in Reference Manual).
Define the fuse location in ocotp and refer to them in fec-ethernet.
If the cells are not flashed, the driver behavior is unchanged, i.e.
other MAC sources will be probed and a random MAC will be used as a
last resort.
Signed-off-by: Nikolaus Voss <nikolaus.voss@haag-streit.com>
---
arch/arm/boot/dts/imx6qdl.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On Wed, Nov 02, 2022 at 03:27:19PM +0100, Nikolaus Voss wrote: > IMX6QDL has fuse locations specified for storing the MAC for the > built-in ethernet (Table 5-8 in Reference Manual). > Define the fuse location in ocotp and refer to them in fec-ethernet. > > If the cells are not flashed, the driver behavior is unchanged, i.e. > other MAC sources will be probed and a random MAC will be used as a > last resort. > > Signed-off-by: Nikolaus Voss <nikolaus.voss@haag-streit.com> > --- > arch/arm/boot/dts/imx6qdl.dtsi | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi > index 4f7fefc14d0ac..7449d554ef1aa 100644 > --- a/arch/arm/boot/dts/imx6qdl.dtsi > +++ b/arch/arm/boot/dts/imx6qdl.dtsi > @@ -1053,6 +1053,8 @@ fec: ethernet@2188000 { > <&clks IMX6QDL_CLK_ENET_REF>; > clock-names = "ipg", "ahb", "ptp", "enet_out"; > fsl,stop-mode = <&gpr 0x34 27>; > + nvmem-cells = <&fec_mac_addr>; > + nvmem-cell-names = "mac-address"; May I ask where is the support of FEC driver for this? Shawn > status = "disabled"; > }; > > @@ -1186,6 +1188,10 @@ tempmon_calib: calib@38 { > tempmon_temp_grade: temp-grade@20 { > reg = <0x20 4>; > }; > + > + fec_mac_addr: mac-addr@88 { > + reg = <0x88 6>; > + }; > }; > > tzasc@21d0000 { /* TZASC1 */ > -- > 2.34.1 >
> > @@ -1053,6 +1053,8 @@ fec: ethernet@2188000 { > > <&clks IMX6QDL_CLK_ENET_REF>; > > clock-names = "ipg", "ahb", "ptp", "enet_out"; > > fsl,stop-mode = <&gpr 0x34 27>; > > + nvmem-cells = <&fec_mac_addr>; > > + nvmem-cell-names = "mac-address"; > > May I ask where is the support of FEC driver for this? The fec uses of_get_mac_address() which calls of_get_mac_address_nvmem() as its last place to look for the MAC address. Andrew
On Sat, Dec 31, 2022 at 06:08:41PM +0100, Andrew Lunn wrote: > > > @@ -1053,6 +1053,8 @@ fec: ethernet@2188000 { > > > <&clks IMX6QDL_CLK_ENET_REF>; > > > clock-names = "ipg", "ahb", "ptp", "enet_out"; > > > fsl,stop-mode = <&gpr 0x34 27>; > > > + nvmem-cells = <&fec_mac_addr>; > > > + nvmem-cell-names = "mac-address"; > > > > May I ask where is the support of FEC driver for this? > > The fec uses of_get_mac_address() which calls > of_get_mac_address_nvmem() as its last place to look for the MAC > address. Ah, of_get_mac_address() gets extended to call of_get_mac_address_nvmem() nowadays. Thanks, Andrew! Shawn
On Wed, Nov 02, 2022 at 03:27:19PM +0100, Nikolaus Voss wrote: > IMX6QDL has fuse locations specified for storing the MAC for the > built-in ethernet (Table 5-8 in Reference Manual). > Define the fuse location in ocotp and refer to them in fec-ethernet. > > If the cells are not flashed, the driver behavior is unchanged, i.e. > other MAC sources will be probed and a random MAC will be used as a > last resort. > > Signed-off-by: Nikolaus Voss <nikolaus.voss@haag-streit.com> I fixed the patch subject prefix like: ARM: dts: imx6qdl: use MAC-address from nvmem Applied, thanks! Shawn
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 4f7fefc14d0ac..7449d554ef1aa 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -1053,6 +1053,8 @@ fec: ethernet@2188000 { <&clks IMX6QDL_CLK_ENET_REF>; clock-names = "ipg", "ahb", "ptp", "enet_out"; fsl,stop-mode = <&gpr 0x34 27>; + nvmem-cells = <&fec_mac_addr>; + nvmem-cell-names = "mac-address"; status = "disabled"; }; @@ -1186,6 +1188,10 @@ tempmon_calib: calib@38 { tempmon_temp_grade: temp-grade@20 { reg = <0x20 4>; }; + + fec_mac_addr: mac-addr@88 { + reg = <0x88 6>; + }; }; tzasc@21d0000 { /* TZASC1 */