Skip to contentSkip to conversation

board: amlogic: vim3: ethernet mac fixed from serial

PATCH New Artem Lapkin 2 participants 4 messages Jan 8, 2021 – Jan 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: amlogic: vim3: ethernet mac fixed from serial

Fixed randomly generated ethernet mac address!

Used meson_generate_serial_ethaddr for generate mac address from board serial number, if ethaddr variable not defined.

---
 board/amlogic/vim3/vim3.c | 9 +++++++++
 1 file changed, 9 insertions(+)
board/amlogic/vim3/vim3.c +9 -0
index 09ef39ff30..0315eaf569 100644
@@ -133,5 +133,14 @@ int misc_init_r(void)
 {
 	meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
 
+	u8 mac_addr[6];
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
+		meson_generate_serial_ethaddr();
+		eth_env_get_enetaddr("ethaddr", mac_addr);
+		printf("[i] serial eth mac %02X:%02X:%02X:%02X:%02X:%02X\n",
+			mac_addr[0],mac_addr[1],mac_addr[2],
+			mac_addr[3],mac_addr[4],mac_addr[5]);
+	}
+
 	return 0;
 }
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 board: amlogic: vim3: ethernet mac fixed from serial

Hi,

Quoted 4 lines · Artem Lapkin

Fixed randomly generated ethernet mac address!

Used meson_generate_serial_ethaddr for generate mac address from board serial number, if ethaddr variable not defined.

AFAIK, it's fixed with Marek's patch

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Best Regards,
Jaehoon CHung

Quoted 26 lines
---
 board/amlogic/vim3/vim3.c | 9 +++++++++
 1 file changed, 9 insertions(+)
board/amlogic/vim3/vim3.c +9 -0
index 09ef39ff30..0315eaf569 100644
@@ -133,5 +133,14 @@ int misc_init_r(void)
 {
 	meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
 
+	u8 mac_addr[6];
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
+		meson_generate_serial_ethaddr();
+		eth_env_get_enetaddr("ethaddr", mac_addr);
+		printf("[i] serial eth mac %02X:%02X:%02X:%02X:%02X:%02X\n",
+			mac_addr[0],mac_addr[1],mac_addr[2],
+			mac_addr[3],mac_addr[4],mac_addr[5]);
+	}
+
 	return 0;
 }
author
#2 lore raw

PATCH 1/1 board: amlogic: vim3: ethernet mac fixed from serial

Quoted 2 lines

AFAIK, it's fixed with Marek's patch

https://patchwork.ozlabs.org/project/uboot/patch/20201217072642.1319-1-m.szyprowski at samsung.com/

not solve !
because mac which must stored in mcu is empty by default and by default we have random mac every time

i think i will make new complex patch from both patches

Quoted 45 lines · Jaehoon Chung

Hi,

Quoted 4 lines · Artem Lapkin

Fixed randomly generated ethernet mac address!

Used meson_generate_serial_ethaddr for generate mac address from board serial number, if ethaddr variable not defined.

AFAIK, it's fixed with Marek's patch

https://patchwork.ozlabs.org/project/uboot/patch/20201217072642.1319-1-m.szyprowski at samsung.com/

Best Regards,
Jaehoon CHung

Quoted 11 lines
---
 board/amlogic/vim3/vim3.c | 9 +++++++++
 1 file changed, 9 insertions(+)
board/amlogic/vim3/vim3.c +0 -0
index 09ef39ff30..0315eaf569 100644

board/amlogic/vim3/vim3.c int misc_init_r(void) · line 140

Quoted 8 lines
board/amlogic/vim3/vim3.c +5 -0
@@ -133,5 +133,14 @@ int misc_init_r(void)
 {
      meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
 
+     u8 mac_addr[6];
+     if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
+             meson_generate_serial_ethaddr();
+             eth_env_get_enetaddr("ethaddr", mac_addr);
+             printf("[i] serial eth mac

%02X:%02X:%02X:%02X:%02X:%02X\n",

Quoted 7 lines
board/amlogic/vim3/vim3.c +4 -0
+                     mac_addr[0],mac_addr[1],mac_addr[2],
+                     mac_addr[3],mac_addr[4],mac_addr[5]);
+     }
+
      return 0;
 }
author
#3 lore raw

PATCH 1/1 board: amlogic: vim3: ethernet mac fixed from serial

plz ignore my prev emails

Quoted 2 lines

AFAIK, it's fixed with Marek's patch

https://patchwork.ozlabs.org/project/uboot/patch/20201217072642.1319-1-m.szyprowski at samsung.com/

look like yes ! u right

Best regards Art

Quoted 58 lines · Art Nikpal
Quoted 2 lines

AFAIK, it's fixed with Marek's patch

https://patchwork.ozlabs.org/project/uboot/patch/20201217072642.1319-1-m.szyprowski at samsung.com/

not solve !
because mac which must stored in mcu is empty by default and by default we have random mac every time

i think i will make new complex patch from both patches

Quoted 45 lines · Jaehoon Chung

Hi,

Quoted 4 lines · Artem Lapkin

Fixed randomly generated ethernet mac address!

Used meson_generate_serial_ethaddr for generate mac address from board serial number, if ethaddr variable not defined.

AFAIK, it's fixed with Marek's patch

https://patchwork.ozlabs.org/project/uboot/patch/20201217072642.1319-1-m.szyprowski at samsung.com/

Best Regards,
Jaehoon CHung

Quoted 11 lines
---
 board/amlogic/vim3/vim3.c | 9 +++++++++
 1 file changed, 9 insertions(+)
board/amlogic/vim3/vim3.c +0 -0
index 09ef39ff30..0315eaf569 100644

board/amlogic/vim3/vim3.c int misc_init_r(void) · line 140

Quoted 8 lines
board/amlogic/vim3/vim3.c +5 -0
@@ -133,5 +133,14 @@ int misc_init_r(void)
 {
      meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
 
+     u8 mac_addr[6];
+     if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
+             meson_generate_serial_ethaddr();
+             eth_env_get_enetaddr("ethaddr", mac_addr);
+             printf("[i] serial eth mac

%02X:%02X:%02X:%02X:%02X:%02X\n",

Quoted 7 lines
board/amlogic/vim3/vim3.c +4 -0
+                     mac_addr[0],mac_addr[1],mac_addr[2],
+                     mac_addr[3],mac_addr[4],mac_addr[5]);
+     }
+
      return 0;
 }