Skip to content

Conversation

@pelwell
Copy link
Contributor

@pelwell pelwell commented Dec 4, 2025

The Raspberry Pi firmware has assumed that top level #size-cells value in dtb files is 1. As a result, the dts source files have had to use 32-bit sizes, making it awkward to declare memory regions of 4GB or larger, requiring them to be split into chunks. This primarily affects Pi 5, where the dts source has made use of conditional compilation to choose either 64-bit or 32-bit sizes, based on the presence or absence of the defined cpp symbol FIRMWARE_UPDATED.

As of EEPROM release pieeprom-2025-02-11, the firmware has read and made use of the actual #size-cells value declared in the dtb, allowing the use of 64-bit sizes. Remove the conditional sections, retaining the 64-bit size values.

@popcornmix
Copy link
Collaborator

If we run a kernel containing this PR, with a firmware preceding pieeprom-2025-02-11 what is the failure?
I assume it will fail to boot - is there anything in firmware or dmesg log that we should looks for when triaging?

(no objections to this change - just making sure if anyone hits the issue of mismatched versions we can identify the issue quickly).

@pelwell
Copy link
Contributor Author

pelwell commented Dec 4, 2025

With the EEPROM reverted to https://github.com/raspberrypi/rpi-eeprom/blob/0190dbc122fe0adeed591375fb4e80fbfe6aae15/firmware-2712/latest/pieeprom-2025-01-27.bin:

  1. With quiet removed from cmdline.txt, you get errors early in the boot:
[    0.000000] Machine model: Raspberry Pi 5 Model B Rev 1.0
[    0.000000] efi: UEFI not found.
[    0.000000] OF: reserved mem: Reserved memory: invalid reg property in 'nvram@0', skipping node.
[    0.000000] OF: reserved mem: invalid size property in 'linux,cma' node.
[    0.000000] OF: reserved mem: 0x0000000000000000..0x000000000007ffff (512 KiB) nomap non-reusable atf@0
[    0.000000] OF: reserved mem: Reserved memory: invalid reg property in 'nvram@0', skipping node.
  1. Surprisingly it does boot to a login prompt. However, the firmware interface is broken:
~$ vcgencmd bootloader_version
ioctl_set_msg failed:-1
bootloader_version

However, it still works well enough that you can install a good version:

$ sudo apt install rpi-eeprom rpi-eeprom-images
...
*** UPDATE AVAILABLE ***

Run "sudo rpi-eeprom-update -a" to install this update now.

To configure the bootloader update policy run "sudo raspi-config"

BOOTLOADER: update available
   CURRENT: Mon 27 Jan 13:08:59 UTC 2025 (1737983339)
    LATEST: Wed  5 Nov 17:37:18 UTC 2025 (1762364238)
   RELEASE: default (/usr/lib/firmware/raspberrypi/bootloader-2712/default)
            Use raspi-config to change the release.
$ sudo rpi-eeprom-update -a
....
UPDATING bootloader. This could take up to a minute. Please wait

*** Do not disconnect the power until the update is complete ***

If a problem occurs then the Raspberry Pi Imager may be used to create
a bootloader rescue SD card image which restores the default bootloader image.

flashrom -p linux_spi:dev=/dev/spidev10.0,spispeed=16000 -w /boot/firmware/pieeprom.upd
Verifying update
VERIFY: SUCCESS
UPDATE SUCCESSFUL
$ sudo reboot

@pelwell
Copy link
Contributor Author

pelwell commented Dec 4, 2025

To confirm that you are indeed running with 64-bit sizes:

pi@raspberrypi:~$ od -Ax -tx1 /proc/device-tree/#size-cells
000000 00 00 00 02
000004
pi@raspberrypi:~$ dmesg -l err
pi@raspberrypi:~$

@pelwell
Copy link
Contributor Author

pelwell commented Dec 4, 2025

@timg236 Do you have any concerns about current production? Is everything shipping with images from at least March?

@timg236
Copy link
Contributor

timg236 commented Dec 4, 2025

@timg236 Do you have any concerns about current production? Is everything shipping with images from at least March?

I don't think we can assume that a Pi5 has firmware than September 2024

@timg236
Copy link
Contributor

timg236 commented Dec 4, 2025

The last automatic update was "The last automatic update was "Thu 8 May 15:13:17 BST 2025" but there's no guarantee that other distros have that enabled. We also can't guess how longs boards might sit at a reseller so this could fail if someone gets a new board with earlier firmware and moves an SD card between devices.

@pelwell
Copy link
Contributor Author

pelwell commented Dec 4, 2025

It probably doesn't change anything, but upstream dts files have always used #size-cells = <2>;.

I guess we wait another year.

@pelwell pelwell changed the base branch from rpi-6.12.y to rpi-6.18.y December 5, 2025 10:58
The Raspberry Pi firmware has assumed that top level #size-cells value
in dtb files is 1. As a result, the dts source files have had to use
32-bit sizes, making it awkward to declare memory regions of 4GB or
larger, requiring them to be split into chunks. This primarily affects
Pi 5, where the dts source has made use of conditional compilation to
choose either 64-bit or 32-bit sizes, based on the presence or absence
of the defined cpp symbol FIRMWARE_UPDATED.

As of EEPROM release pieeprom-2025-02-11, the firmware has read and made
use of the actual #size-cells value declared in the dtb, allowing the
use of 64-bit sizes. Remove the conditional sections, retaining the
64-bit size values.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell
Copy link
Contributor Author

pelwell commented Dec 5, 2025

I've rebased against 6.18, as that represents a clear line in the sand. Any users/distros not happy with the idea of possibly inconveniencing/breaking non-updated Pi 5s should stay on 6.12.

@popcornmix
Copy link
Collaborator

Fine by me.

@timg236
Copy link
Contributor

timg236 commented Dec 5, 2025

Thanks @pelwell and @popcornmix

@pelwell pelwell merged commit ec2667d into raspberrypi:rpi-6.18.y Dec 5, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants