[PATCH 1/5] ARM: rpi: rename function getting mac address

Daniel Brát danek.brat at gmail.com
Mon Feb 6 17:05:21 PST 2023


Rename 'rpi_set_usbethaddr' and 'rpi_get_usbethaddr' to more generic
'rpi_set_ethaddr' and 'rpi_get_ethaddr', since they can also be used
to obtain factory assigned mac address on bcm2711 (rpi4), which uses
bcmgenet nic instead of usb ethernet nic.

Signed-off-by: Daniel Brát <danek.brat at gmail.com>
---
 arch/arm/boards/raspberry-pi/lowlevel.h     | 2 +-
 arch/arm/boards/raspberry-pi/mbox-helpers.c | 2 +-
 arch/arm/boards/raspberry-pi/rpi-common.c   | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/raspberry-pi/lowlevel.h b/arch/arm/boards/raspberry-pi/lowlevel.h
index a29860d607..260f96c714 100644
--- a/arch/arm/boards/raspberry-pi/lowlevel.h
+++ b/arch/arm/boards/raspberry-pi/lowlevel.h
@@ -10,7 +10,7 @@
 #define VIDEOCORE_FDT_ERROR 0xdeadfeed
 
 ssize_t rpi_get_arm_mem(void);
-int rpi_get_usbethaddr(u8 mac[6]);
+int rpi_get_ethaddr(u8 mac[6]);
 int rpi_get_board_rev(void);
 
 #endif /* __ARCH_ARM_BOARDS_LOWLEVEL_H__ */
diff --git a/arch/arm/boards/raspberry-pi/mbox-helpers.c b/arch/arm/boards/raspberry-pi/mbox-helpers.c
index 9f252c68ff..50fc1c5b45 100644
--- a/arch/arm/boards/raspberry-pi/mbox-helpers.c
+++ b/arch/arm/boards/raspberry-pi/mbox-helpers.c
@@ -37,7 +37,7 @@ ssize_t rpi_get_arm_mem(void)
 	return msg->get_arm_mem.body.resp.mem_size;
 }
 
-int rpi_get_usbethaddr(u8 mac[6])
+int rpi_get_ethaddr(u8 mac[6])
 {
 	BCM2835_MBOX_STACK_ALIGN(struct msg_get_mac_address, msg);
 	int ret;
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 13df6a140c..8d1e74acab 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -60,11 +60,11 @@ struct rpi_priv {
 	const char *name;
 };
 
-static void rpi_set_usbethaddr(void)
+static void rpi_set_ethaddr(void)
 {
 	u8 mac[ETH_ALEN];
 
-	if (rpi_get_usbethaddr(mac))
+	if (rpi_get_ethaddr(mac))
 		return; /* Ignore error; not critical */
 
 	eth_register_ethaddr(0, mac);
@@ -114,7 +114,7 @@ static int rpi_b_init(struct rpi_priv *priv)
 {
 	rpi_leds[0].gpio = 16;
 	rpi_leds[0].active_low = 1;
-	rpi_set_usbethaddr();
+	rpi_set_ethaddr();
 
 	return 0;
 }
@@ -123,7 +123,7 @@ static int rpi_b_plus_init(struct rpi_priv *priv)
 {
 	rpi_leds[0].gpio = 47;
 	rpi_leds[1].gpio = 35;
-	rpi_set_usbethaddr();
+	rpi_set_ethaddr();
 
 	return 0;
 }
-- 
2.34.1




More information about the barebox mailing list