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 4/5] ARM: rpi: add machine-id support
Date: Tue,  7 Feb 2023 02:05:24 +0100	[thread overview]
Message-ID: <20230207010525.2693-5-danek.brat@gmail.com> (raw)
In-Reply-To: <20230207010525.2693-1-danek.brat@gmail.com>

Pass board's serial number as hashable for machine-id generation and
enable machine-id support for rpi platform by default.

Signed-off-by: Daniel Brát <danek.brat@gmail.com>
---
 arch/arm/boards/raspberry-pi/rpi-common.c | 4 ++++
 arch/arm/configs/rpi_defconfig            | 1 +
 arch/arm/configs/rpi_v8a_defconfig        | 1 +
 3 files changed, 6 insertions(+)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 9bf6e0334d..7ddbe1c289 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -24,6 +24,7 @@
 #include <globalvar.h>
 #include <asm/system_info.h>
 #include <reset_source.h>
+#include <machine_id.h>
 #include <dt-bindings/gpio/gpio.h>
 
 #include <mach/core.h>
@@ -74,6 +75,9 @@ static void rpi_set_serial_number(void)
 	serial_str = basprintf("%016llx", serial);
 	barebox_set_serial_number(serial_str);
 	free(serial_str);
+
+	if (IS_ENABLED(CONFIG_MACHINE_ID))
+		machine_id_set_hashable(&serial, sizeof(serial));
 }
 
 static void rpi_set_ethaddr(void)
diff --git a/arch/arm/configs/rpi_defconfig b/arch/arm/configs/rpi_defconfig
index 500c92a821..6019584d48 100644
--- a/arch/arm/configs/rpi_defconfig
+++ b/arch/arm/configs/rpi_defconfig
@@ -24,6 +24,7 @@ CONFIG_BOOTM_OFTREE=y
 CONFIG_BLSPEC=y
 CONFIG_CONSOLE_ALLOW_COLOR=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_MACHINE_ID=y
 CONFIG_CMD_DMESG=y
 CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
diff --git a/arch/arm/configs/rpi_v8a_defconfig b/arch/arm/configs/rpi_v8a_defconfig
index 75f62ddb65..1ea86c5893 100644
--- a/arch/arm/configs/rpi_v8a_defconfig
+++ b/arch/arm/configs/rpi_v8a_defconfig
@@ -23,6 +23,7 @@ CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_CONSOLE_ALLOW_COLOR=y
 CONFIG_PBL_CONSOLE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_MACHINE_ID=y
 CONFIG_CMD_DMESG=y
 CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
-- 
2.34.1




  parent 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 ` [PATCH 1/5] ARM: rpi: rename function getting mac address Daniel Brát
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 ` Daniel Brát [this message]
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-5-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