Unable to set MAC address on RDB2 with BSP v33

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Unable to set MAC address on RDB2 with BSP v33

ソリューションへジャンプ
4,797件の閲覧回数
rishabh-j-dev
Contributor I

We are using the GMAC interface on our RDB2 and require a stable MAC address. On AutoLinux BSP v30, we are able to set the MAC addr with the following command in u-boot. However, when we try the same command in BSP v33, the MAC address does not seem to change for the interface. 

We are checking the MAC address with the "ifconfig" utility in Linux

setenv ethaddr "66:22:00:02:22:17"

 

Is there a way to set a stable MAC address for the GMAC interface while using BSP v33? 

 

The specific board we are using is s32g274ardb2

0 件の賞賛
返信
1 解決策
4,700件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

We have received the following comments:

"

Please add following patch into u-boot to have a try

From aaec17964098c65072dff5d11246933e94b37584 Mon Sep 17 00:00:00 2001
From: Yibo Liu <yibo.liu@nxp.com>
Date: Mon, 6 Feb 2023 11:10:03 +0800
Subject: [PATCH] gmac_addr_fix

---
 arch/arm/mach-s32/s32-cc/eth.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-s32/s32-cc/eth.c b/arch/arm/mach-s32/s32-cc/eth.c
index 3270a773e0..586e33353d 100644
--- a/arch/arm/mach-s32/s32-cc/eth.c
+++ b/arch/arm/mach-s32/s32-cc/eth.c
@@ -26,7 +26,7 @@
 #include <dm/platform_data/pfeng_dm_eth.h>
 #endif
 
-#if CONFIG_IS_ENABLED(FSL_PFENG)
+#if CONFIG_IS_ENABLED(FSL_PFENG) || CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
 static void ft_update_eth_addr_by_name(const char *name, const u8 idx,
 				       void *fdt, int nodeoff)
 {
@@ -170,6 +170,9 @@ void ft_enet_fixup(void *fdt)
 {
 	int __maybe_unused nodeoff;
 	bool __maybe_unused ena;
+#if CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
+	u8 idx = 0;
+#endif /* CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC) */
 
 	/* PFE */
 #if CONFIG_IS_ENABLED(FSL_PFENG)
@@ -191,6 +194,15 @@ void ft_enet_fixup(void *fdt)
 	}
 #endif /* CONFIG_IS_ENABLED(FSL_PFENG) */
 
+#if CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
+	nodeoff = fdt_node_offset_by_compatible(fdt, -1, "nxp,s32cc-dwmac");
+	while (nodeoff != -FDT_ERR_NOTFOUND) {
+		ft_update_eth_addr_by_name("eth", idx, fdt, nodeoff);
+		nodeoff = fdt_node_offset_by_compatible(fdt, nodeoff, "nxp,s32cc-dwmac");
+		idx++;
+	}
+#endif /* CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC) */
+
 	/* GMAC */
 #if CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
 	bool gmac0_ena = true;
-- 
2.17.1

"

Please, let us know if this works or not.

元の投稿で解決策を見る

0 件の賞賛
返信
8 返答(返信)
4,701件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

We have received the following comments:

"

Please add following patch into u-boot to have a try

From aaec17964098c65072dff5d11246933e94b37584 Mon Sep 17 00:00:00 2001
From: Yibo Liu <yibo.liu@nxp.com>
Date: Mon, 6 Feb 2023 11:10:03 +0800
Subject: [PATCH] gmac_addr_fix

---
 arch/arm/mach-s32/s32-cc/eth.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-s32/s32-cc/eth.c b/arch/arm/mach-s32/s32-cc/eth.c
index 3270a773e0..586e33353d 100644
--- a/arch/arm/mach-s32/s32-cc/eth.c
+++ b/arch/arm/mach-s32/s32-cc/eth.c
@@ -26,7 +26,7 @@
 #include <dm/platform_data/pfeng_dm_eth.h>
 #endif
 
-#if CONFIG_IS_ENABLED(FSL_PFENG)
+#if CONFIG_IS_ENABLED(FSL_PFENG) || CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
 static void ft_update_eth_addr_by_name(const char *name, const u8 idx,
 				       void *fdt, int nodeoff)
 {
@@ -170,6 +170,9 @@ void ft_enet_fixup(void *fdt)
 {
 	int __maybe_unused nodeoff;
 	bool __maybe_unused ena;
+#if CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
+	u8 idx = 0;
+#endif /* CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC) */
 
 	/* PFE */
 #if CONFIG_IS_ENABLED(FSL_PFENG)
@@ -191,6 +194,15 @@ void ft_enet_fixup(void *fdt)
 	}
 #endif /* CONFIG_IS_ENABLED(FSL_PFENG) */
 
+#if CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
+	nodeoff = fdt_node_offset_by_compatible(fdt, -1, "nxp,s32cc-dwmac");
+	while (nodeoff != -FDT_ERR_NOTFOUND) {
+		ft_update_eth_addr_by_name("eth", idx, fdt, nodeoff);
+		nodeoff = fdt_node_offset_by_compatible(fdt, nodeoff, "nxp,s32cc-dwmac");
+		idx++;
+	}
+#endif /* CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC) */
+
 	/* GMAC */
 #if CONFIG_IS_ENABLED(DWC_ETH_QOS_S32CC)
 	bool gmac0_ena = true;
-- 
2.17.1

"

Please, let us know if this works or not.

0 件の賞賛
返信
4,502件の閲覧回数
rishabh-j-dev
Contributor I
This patch worked. Thanks!
0 件の賞賛
返信
4,487件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Thanks for your feedback.

Have a great day.

0 件の賞賛
返信
4,776件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Once you set the environment, you saved it? Also, is it needed for your application to change it on u-boot? Or can you define the MAC prior to building the image?

Please, let us know.

0 件の賞賛
返信
4,775件の閲覧回数
rishabh-j-dev
Contributor I
Yes, I can verify I save it using "saveenv". I can also verify that the env variable is set as if do printenv I can see the value on reboot.

It can be defined during the image build, what is the way of doing that?
0 件の賞賛
返信
4,766件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

The Device tree files should have this information. Help us verify if the following files do help with your request.

"arch/arm64/boot/dts/freescale/s32cc.dtsi"

"arch/arm64/boot/dts/freescale/s32g-pfe.dtsi"

In the meantime, we will continue our investigation on why the environment variable did not work.

Please, let us know.

0 件の賞賛
返信
4,758件の閲覧回数
rishabh-j-dev
Contributor I
I do not see where those files are located. Is it a part of the yocto BSP? Can you provide some steps on where they are lcoated?
0 件の賞賛
返信
4,756件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

We have access to them once we copy the linux repository from codeaurora.

It will be inside the linux folder then following the different addresses we have mentioned before.

Please, let us know.

0 件の賞賛
返信