linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx6ul: Set macaddress location in ocotp
@ 2024-02-08 12:19 Manuel Traut
  2024-02-23 23:33 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Manuel Traut @ 2024-02-08 12:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Manuel Traut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, devicetree, linux-arm-kernel

If a bootloader does not configure the MAC address, devices come up with
a random MAC at the moment.

ocotp provides registers for storing the mac-address.
Configure those for i.MX6UL and i.MX6ULL allows net/core to retrieve it from
there.

Signed-off-by: Manuel Traut <manuel.traut@mt.com>
---
 arch/arm/boot/dts/nxp/imx/imx6ul.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi b/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi
index a27a7554c2e7..e5e8bf814f77 100644
--- a/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi
@@ -538,6 +538,8 @@ fec2: ethernet@20b4000 {
 				fsl,num-rx-queues = <1>;
 				fsl,stop-mode = <&gpr 0x10 4>;
 				fsl,magic-packet;
+				nvmem-cells = <&fec2_mac_addr>;
+				nvmem-cell-names = "mac-address";
 				status = "disabled";
 			};
 
@@ -897,6 +899,8 @@ fec1: ethernet@2188000 {
 				fsl,num-rx-queues = <1>;
 				fsl,stop-mode = <&gpr 0x10 3>;
 				fsl,magic-packet;
+				nvmem-cells = <&fec1_mac_addr>;
+				nvmem-cell-names = "mac-address";
 				status = "disabled";
 			};
 
@@ -1004,6 +1008,14 @@ tempmon_temp_grade: temp-grade@20 {
 				cpu_speed_grade: speed-grade@10 {
 					reg = <0x10 4>;
 				};
+				fec1_mac_addr: mac-addr@88 {
+					reg = <0x88 6>;
+				};
+
+				fec2_mac_addr: mac-addr@8e {
+					reg = <0x8e 6>;
+				};
+
 			};
 
 			csi: csi@21c4000 {
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: dts: imx6ul: Set macaddress location in ocotp
  2024-02-08 12:19 [PATCH] ARM: dts: imx6ul: Set macaddress location in ocotp Manuel Traut
@ 2024-02-23 23:33 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2024-02-23 23:33 UTC (permalink / raw)
  To: Manuel Traut
  Cc: linux-kernel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, devicetree, linux-arm-kernel

On Thu, Feb 08, 2024 at 01:19:59PM +0100, Manuel Traut wrote:
> If a bootloader does not configure the MAC address, devices come up with
> a random MAC at the moment.
> 
> ocotp provides registers for storing the mac-address.
> Configure those for i.MX6UL and i.MX6ULL allows net/core to retrieve it from
> there.
> 
> Signed-off-by: Manuel Traut <manuel.traut@mt.com>
> ---
>  arch/arm/boot/dts/nxp/imx/imx6ul.dtsi | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi b/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi
> index a27a7554c2e7..e5e8bf814f77 100644
> --- a/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi
> +++ b/arch/arm/boot/dts/nxp/imx/imx6ul.dtsi
> @@ -538,6 +538,8 @@ fec2: ethernet@20b4000 {
>  				fsl,num-rx-queues = <1>;
>  				fsl,stop-mode = <&gpr 0x10 4>;
>  				fsl,magic-packet;
> +				nvmem-cells = <&fec2_mac_addr>;
> +				nvmem-cell-names = "mac-address";
>  				status = "disabled";
>  			};
>  
> @@ -897,6 +899,8 @@ fec1: ethernet@2188000 {
>  				fsl,num-rx-queues = <1>;
>  				fsl,stop-mode = <&gpr 0x10 3>;
>  				fsl,magic-packet;
> +				nvmem-cells = <&fec1_mac_addr>;
> +				nvmem-cell-names = "mac-address";
>  				status = "disabled";
>  			};
>  
> @@ -1004,6 +1008,14 @@ tempmon_temp_grade: temp-grade@20 {
>  				cpu_speed_grade: speed-grade@10 {
>  					reg = <0x10 4>;
>  				};

Have a newline between nodes.

> +				fec1_mac_addr: mac-addr@88 {
> +					reg = <0x88 6>;
> +				};
> +
> +				fec2_mac_addr: mac-addr@8e {
> +					reg = <0x8e 6>;
> +				};
> +

Dropped this one.

I fixed them up and applied the patch.

Shawn

>  			};
>  
>  			csi: csi@21c4000 {
> -- 
> 2.43.0
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-23 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08 12:19 [PATCH] ARM: dts: imx6ul: Set macaddress location in ocotp Manuel Traut
2024-02-23 23:33 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).