Fix for firmware changes affecting non Linux kernels

Releases, updates and announcements from the Ultibo team.
User avatar
Ultibo
Site Admin
Posts: 2303
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Fix for firmware changes affecting non Linux kernels

Postby Ultibo » Sun Sep 29, 2019 1:33 am

While working through the bootstrap process for the Raspberry Pi 4 we noticed some changes to the Pi firmware which on closer examination have now been applied to the firmware for all Pi models.

The Pi firmware previously supported the option to include a trailer on the end of the kernel image which would indicate to the loader whether to supply a device tree blob (DTB) or the traditional ARM tags (ATAGs) in order to pass information to the loaded kernel.

For some time now Ultibo has included the trailer information in every kernel image to indicate that we require ATAGs instead of a DTB when booting, Ultibo uses the information from the ATAGs to determine initial memory layout and to obtain command line parameters (from cmdline.txt) which are used for many optional settings such as providing a static IP address or other tuning parameters.

Given that the Linux kernel is now totally dependent on the use of device tree for all configuration details, the support for the kernel trailer was recently (in the last few weeks) removed from the firmware so the indication provided by Ultibo is now being ignored.

We have spoken with the developers at Raspberry Pi and they are unwilling to reinstate the kernel trailer support, stating that either removing all DTB files from the SD card or adding an empty device_tree= line to config.txt will produce the same result. Aside from the suggested solutions being rather fragile and prone to mistakes we are also aware of Ultibo users who dual boot between Raspbian and Ultibo by switching kernel files on the SD card, following these firmware changes the Ultibo image would fail to boot due to the lack of ATAG information.

To initially resolve this issue we have modified the Ultibo startup code so that it can detect if a device tree blob (DTB) is supplied and use an alternate method for setting up initial memory which will allow a successful boot in all cases. The downside is that when supplied with DTB information Ultibo will not receive the command line parameters so all support for passing options from the cmdline.txt will be unavailable, we intend to undertake further work to allow extracting the command line parameters directly from the DTB which will allow full functionality without reliance on the Pi firmware to support additional options.

Just to clarify, if you always place your Ultibo images on a dedicated SD card containing only the mandatory boot files (bootcode.bin, start.elf, fixup.dat) then you will not be affected by these changes. The only users who will be impacted are those which use a Raspbian image as the basis for their SD card, in this case if you require command line parameters to be passed to your Ultibo image then you must modify the contents of the SD card accordingly.

For details of how to apply the latest source to your Ultibo core installation and rebuild your run time library see the wiki page Building from Source or watch the Building the RTL video on YouTube.
Ultibo.org | Make something amazing
https://ultibo.org
pik33
Posts: 891
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: Fix for firmware changes affecting non Linux kernels

Postby pik33 » Sun Sep 29, 2019 7:14 am

Some time ago I changed my dual boot configuration - it has now its independent config.txt.

Does it mean that if I add device_tree= to this config, Ultibo can boot from it using the new firmware AND it will read cmdline.txt?

What I need is fixed IP address. The only metod which worked for me was setting it in cmdline.txt.

Now I have "old" Ultibo and "old" raspbian, so I will try to not update both of systems unil the project finished OR cmdline.txt works again OR there is a method which can set static IP without cmdline.txt
User avatar
Ultibo
Site Admin
Posts: 2303
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Fix for firmware changes affecting non Linux kernels

Postby Ultibo » Sun Sep 29, 2019 11:48 pm

pik33 wrote:Some time ago I changed my dual boot configuration - it has now its independent config.txt.

Does it mean that if I add device_tree= to this config, Ultibo can boot from it using the new firmware AND it will read cmdline.txt?

Yes, our testing and information from Raspberry Pi indicates that either removing all the .dtb files from the SD card (not probably an option if Linux needs them) or adding device_tree= to the config.txt will cause the firmware to pass ATAGs to Ultibo during boot which will provide the normal behavior and allow the full functionality including command line parameters from cmdline.txt.
Ultibo.org | Make something amazing
https://ultibo.org

Return to “Ultibo”

Who is online

Users browsing this forum: No registered users and 40 guests