Hey,

I have an rpi4 with uboot, archlinuxarm, mainline kernel. And rpi-eeprom-update fails with

```
Device does not a have a Raspberry Pi bootloader EEPROM (e.g. Pi 4 or Pi 5). Skipping bootloader update.
```

An LLM helped me fix this with a patch in the packaged `/boot/boot.txt`, that properly passes through the sysfs entries rpi-eeprom-update relies on

```
--- a/boot/boot.txt
+++ b/boot/boot.txt
@@ -7,6 +7,18 @@

 if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; then
+    fdt addr ${fdt_addr_r}
+    fdt resize 8192
+    if fdt addr ${fdtcontroladdr}; then
+      fdt get value fwrev /system linux,revision
+      fdt get value blts /chosen/bootloader build-timestamp
+      fdt addr ${fdt_addr_r}
+      fdt mknode / system
+      fdt set /system linux,revision <${fwrev}>
+      fdt mknode /chosen bootloader
+      fdt set /chosen/bootloader build-timestamp <${blts}>
+    fi
+    fdt addr ${fdt_addr_r}
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /initramfs-linux.img; then
       booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
     else
```

And suggested that the fix be upstream, please find attached the very small patch with the suggested (untested) changes that may be useful.

Kind regards,

Adel KARA SLIMANE
>From 5e79d602b15b80dc4eadc6a4aca32693b90307b0 Mon Sep 17 00:00:00 2001
From: Adel KARA SLIMANE <[email protected]>
Date: Sun, 6 Sep 2026 15:50:00 +0200
Subject: [PATCH 1/2] rpi: copy the board revision code from the firmware
 device tree

The firmware writes the board revision to /system/linux,revision, which
userspace reads to identify the board. The node is absent from a device
tree loaded from disk, so create it first.
---
 board/raspberrypi/rpi/rpi.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 1da5df92..0c821564 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -598,6 +598,22 @@ int copy_property(void *dst, void *src, char *path, char *property)
 	return fdt_setprop(dst, dst_offset, property, prop, len);
 }
 
+/* Add a subnode to @parent if it is not there already */
+static int ensure_subnode(void *fdt, const char *parent, const char *name)
+{
+	int poff, off;
+
+	poff = fdt_path_offset(fdt, parent);
+	if (poff < 0)
+		return poff;
+
+	off = fdt_subnode_offset(fdt, poff, name);
+	if (off >= 0)
+		return off;
+
+	return fdt_add_subnode(fdt, poff, name);
+}
+
 /* Copy tweaks from the firmware dtb to the loaded dtb */
 void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 {
@@ -608,6 +624,10 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 	/* The firmware provides a more precise model; so copy that */
 	copy_property(fdt, fw_fdt, "/", "model");
 
+	/* board revision code, read by userspace to identify the board */
+	if (ensure_subnode(fdt, "/", "system") >= 0)
+		copy_property(fdt, fw_fdt, "/system", "linux,revision");
+
 	/* memory reserve as suggested by the firmware */
 	copy_property(fdt, fw_fdt, "/", "memreserve");
 
-- 
2.55.0


>From 59edcbf174a6c9b5338445a5bc6e8a94e3ffb044 Mon Sep 17 00:00:00 2001
From: Adel KARA SLIMANE <[email protected]>
Date: Sun, 6 Sep 2026 15:50:00 +0200
Subject: [PATCH 2/2] rpi: copy the bootloader build timestamp from the
 firmware device tree

rpi-eeprom-update reads /chosen/bootloader/build-timestamp to find the
running EEPROM version. Without it the tool cannot tell whether an
update is needed.
---
 board/raspberrypi/rpi/rpi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 0c821564..c08af8d3 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -644,6 +644,11 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 	if (copy_property(fdt, fw_fdt, "blconfig", "reg") == 0)
 		copy_property(fdt, fw_fdt, "blconfig", "status");
 
+	/* version of the bootloader EEPROM */
+	if (ensure_subnode(fdt, "/chosen", "bootloader") >= 0)
+		copy_property(fdt, fw_fdt, "/chosen/bootloader",
+			      "build-timestamp");
+
 	/* kernel address randomisation seed as provided by the firmware */
 	copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed");
 
-- 
2.55.0

Reply via email to