mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Daniel Brát" <danek.brat@gmail.com>
To: barebox@lists.infradead.org
Cc: "Daniel Brát" <danek.brat@gmail.com>
Subject: [PATCH 1/5] ARM: rpi: rename function getting mac address
Date: Tue,  7 Feb 2023 02:05:21 +0100	[thread overview]
Message-ID: <20230207010525.2693-2-danek.brat@gmail.com> (raw)
In-Reply-To: <20230207010525.2693-1-danek.brat@gmail.com>

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@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




  reply	other threads:[~2023-02-07  1:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  1:05 [PATCH 0/5] rpi: platform code improvements Daniel Brát
2023-02-07  1:05 ` Daniel Brát [this message]
2023-02-07  1:05 ` [PATCH 2/5] ARM: rpi: add serial number readout Daniel Brát
2023-02-08  9:17   ` Marco Felsch
2023-02-07  1:05 ` [PATCH 3/5] ARM: rpi: rework rpi board init code Daniel Brát
2023-02-08  9:18   ` Marco Felsch
2023-02-07  1:05 ` [PATCH 4/5] ARM: rpi: add machine-id support Daniel Brát
2023-02-07  1:05 ` [PATCH 5/5] ARM: rpi: enable reset source detection in defconfig Daniel Brát

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230207010525.2693-2-danek.brat@gmail.com \
    --to=danek.brat@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox