[SRU] 2019.07 to support Pi4 boot

Bug #1846329 reported by Dave Jones
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
u-boot (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Dave Jones

Bug Description

Impact
======

The current stable release (bionic) does not support booting on the Raspberry Pi 4. Several packages need back-porting from devel to support this, along with a new kernel. In addition, there are now changes in the back-port that require updates to focal.

Bionic back-port branch:

https://code.launchpad.net/~waveform/ubuntu/+source/u-boot/+git/u-boot/+ref/bionic-clean-up

Focal branch:

https://code.launchpad.net/~waveform/ubuntu/+source/u-boot/+git/u-boot/+ref/focal-clean-up

Builds of packages for both releases available from the following PPA (along with all packages required for testing the bionic back-port):

https://launchpad.net/~waveform/+archive/ubuntu/pi4

Test Case
=========

* Attempt to boot the latest bionic image (18.04.3) on a pi4; note failure
* Move the SD card to a pi3 and boot successfully
* Ensure all packages are up to date (apt update/upgrade)
* sudo add-apt-repository ppa:waveform/pi4
* sudo apt upgrade
* sudo reboot
* Ensure boot proceeds successfully on the pi3
* Verify facilities (USB peripherals, USB mass storage, wifi, bluetooth, audio, etc.) work
* sudo apt install linux-image-raspi2-hwe-18.04-edge
* sudo reboot
* Ensure boot proceeds successfully on the pi3
* Verify facilities (USB peripherals, USB mass storage, wifi, bluetooth, audio, etc.) work
* Move the SD card back to the pi4
* Ensure boot proceeds successfully on the pi4
* Verify facilities (USB peripherals, USB mass storage, wifi, bluetooth, audio, etc.) work
* Repeat for both archs (armhf and arm64)

Regression Potential
====================

Plenty; pi4 support on bionic requires back-ports of flash-kernel, u-boot, linux-firmware-raspi2, and the kernel. Furthermore, the firmware package needs to support two kernels (the current 4.x series and the proposed 5.x series). Verification of boot, and other facilities (USB peripherals, mass storage, free memory, wifi, etc. etc.) should be performed on both archs and all supported models of pi (2, 3, 3A+, 3B+, 4B all memory variants).

Revision history for this message
Dave Jones (waveform) wrote :
Revision history for this message
Dave Jones (waveform) wrote :
Revision history for this message
Robie Basak (racb) wrote :
Download full text (6.0 KiB)

This is a review of your branch ubuntu-2019.07-pi4 with commit hash 94f89d8. I adjusted it to make my review eaiser (mainly splitting some commits). I've pushed to https://code.launchpad.net/~racb/ubuntu/+source/u-boot/+git/u-boot/+ref/review/waveform/ubuntu-2019.07-pi4 if you want to use it, but this isn't necessary.

In general, excellent work! The approach you've taken seems nice and clean, which is impressive given how tricky things are in this area.

debian/changelog:

Please squash all changelog entries into a single one for 2019.07+dfsg-1ubuntu1. That also means that the changelog should describe only the differences from 2019.04+dfsg-2ubuntu3, describing only the end result as visible from the archive and skipping any churn that took place during development in your branch.

Looking at your PPA, rather than using the orig tarball as published by upstream, that orig tarball is supposed to have been repacked to remove non-DFSG code, according to Files-Excluded in debian/copyright. uscan(1) can help with this. But in this case an upload of this upstream version had already been made by Debian. Therefore, please use the repacked orig tarball as published by Debian (eg. as archived at https://launchpad.net/debian/+source/u-boot/2019.07+dfsg-1) to avoid potential mismatches. There's no point in changing anything in your PPA now; your sponsor (presumably me) should be able to correct this when uploading.

Only debian/patches/am57xx/omap5_distro_bootcmd actually needed updating, and it was more than a refresh. I suggest avoiding using the word "refresh" to describe the change, and please drop the unnecessary refresh of the other patches.

Bump to v2019.07:

This is not practical to review. I understand it is necessary for rpi4 support. I'll leave it to the release team to make a call on the regression risk.

python-pyelftools dependency: note that this binary package is in universe even though its source is in main. Are you expecting to put u-boot-rpi in main? I only see it in universe currently.

debian/patches/rpi4.patch:

Typo "Descrpition"

Consider doing this with multiple patches, one per commit, depending on how often you expect you need to update it against Andrei Gherzan's work. Maybe easier to leave it now it's done. Your choice.

Makefile: DTB addition duplicates existing bcm2837-rpi-3-b.dtb entry

rpi_4_defconfig drops:
-CONFIG_USB_DWC2=y
-CONFIG_USB_ETHER_LAN78XX=y
-CONFIG_USB_ETHER_SMSC95XX=y
-CONFIG_SUPPORT_RAW_INITRD=y
-CONFIG_ENV_IS_IN_FAT=y
...are all of these intentional? CONFIG_SUPPORT_RAW_INITRD and CONFIG_ENV_IS_IN_FAT in particular strike me as non-pi4-specific which is why I found this surprising.

bcm2835_sdhci.c: dev_get_driver_data call: no error checking now this is a dynamic lookup and not a constant?

Quite a bit of RPi code is touched - for example the introduction of bcm2835-common.dtsi and status -> status_r/status_w. Are all rpi hardware variants tested against this branch?

debian/patches/rpi-import-mkknlimg.patch:

As we discussed, I'm not sure if we should drop this change (as it's not strictly necessary for the rpi4) or keep it (as it cleans things up and will make future backports easier). The trade-off ...

Read more...

Revision history for this message
Adam Conrad (adconrad) wrote :

I'm approving the FFe for the major version bump and postinst magic, assuming that you address any concerns Robie has, use the Debian orig, make sure you line up appropriate testing on all armhf u-boot platforms we support, etc.

Revision history for this message
Adam Conrad (adconrad) wrote :

(And make sure to close this bug in the changelog of the upload)

Revision history for this message
Dave Jones (waveform) wrote : Re: [Bug 1846329] Re: [FFe] 2019.07 to support Pi4 boot
Download full text (9.7 KiB)

On Thu, 3 Oct 2019 at 19:30, Robie Basak <email address hidden> wrote:
[snip]
> debian/changelog:
>
> Please squash all changelog entries into a single one for 2019.07+dfsg-
> 1ubuntu1. That also means that the changelog should describe only the
> differences from 2019.04+dfsg-2ubuntu3, describing only the end result
> as visible from the archive and skipping any churn that took place
> during development in your branch.

Done.

> Looking at your PPA, rather than using the orig tarball as published by
> upstream, that orig tarball is supposed to have been repacked to remove
> non-DFSG code, according to Files-Excluded in debian/copyright. uscan(1)
> can help with this. But in this case an upload of this upstream version
> had already been made by Debian. Therefore, please use the repacked orig
> tarball as published by Debian (eg. as archived at
> https://launchpad.net/debian/+source/u-boot/2019.07+dfsg-1) to avoid
> potential mismatches. There's no point in changing anything in your PPA
> now; your sponsor (presumably me) should be able to correct this when
> uploading.

Ah, that explains one of the lintian warnings I was confused about!
Useful to learn this is the implication of the +dfsg tag when
maintaining such a package.

> Only debian/patches/am57xx/omap5_distro_bootcmd actually needed
> updating, and it was more than a refresh. I suggest avoiding using the
> word "refresh" to describe the change, and please drop the unnecessary
> refresh of the other patches.

Done.

> Bump to v2019.07:
>
> This is not practical to review. I understand it is necessary for rpi4
> support. I'll leave it to the release team to make a call on the
> regression risk.

The cert team have now had a chance to test the new version on a
variety of hardware. Rather ironically the only failure we encountered
was on the Pi Compute Module 3/3+ which turned out to be because our
u-boot builds ignore the device-tree provided by the board. That's now
fixed too and the result has been re-tested on every supported pi
platform and architecture (the required change was only to pi u-boot
configurations).

> python-pyelftools dependency: note that this binary package is in
> universe even though its source is in main. Are you expecting to put u
> -boot-rpi in main? I only see it in universe currently.

Not a question I'd thought about, but it would seem sensible to
propose it for main at some point given our reliance upon it. I assume
this is all stuff that can be sorted out at some arbitrary point in
the future?

> debian/patches/rpi4.patch:
>
> Typo "Descrpition"

Doh! Fixed.

> Consider doing this with multiple patches, one per commit, depending on
> how often you expect you need to update it against Andrei Gherzan's
> work. Maybe easier to leave it now it's done. Your choice.

Andrei's branch hasn't been touched since July, so I'd guess he's
happy with where it is for now. I'd vaguely hope the next time I touch
this, it'll be to pull the changes from upstream so I'm sanguine about
leaving this as a single blob for now.

> Makefile: DTB addition duplicates existing bcm2837-rpi-3-b.dtb entry
>
> rpi_4_defconfig drops:
> -CONFIG_USB_DWC2=y
> -CONFIG_USB_ETHER_LAN78XX=...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: [FFe] 2019.07 to support Pi4 boot

This bug was fixed in the package u-boot - 2019.07+dfsg-1ubuntu1

---------------
u-boot (2019.07+dfsg-1ubuntu1) eoan; urgency=medium

  * New upstream release to support Pi 4 boot (LP: #1846329)
  * Removed patches applied upstream:
    - d/p/dreamplug/Commit-ARM-CPU-arm926ejs-Consolidate-cache-routines-.patch
    - d/p/mkimage/0001-fdt-Fix-mkimage-list-to-try-every-header-type.patch
    - d/p/sunxi/teres-i.patch
  * Updated patch:
    - d/p/am57xx/omap5_distro_bootcmd
  * Add missing build dependency on arm/arm64
  * Correct odroid README paths
  * Add d/p/rpi4.patch to support Raspberry Pi 4 boot
  * Remove redundant d/p/rpi-import-mkknlimg.patch
  * Add script to migrate old boot configurations to split, selective style
  * Use the board's device-tree instead of an embedded one

 -- Dave Jones <email address hidden> Tue, 23 Jul 2019 10:02:04 +0000

Changed in u-boot (Ubuntu):
status: New → Fix Released
Dave Jones (waveform)
Changed in u-boot (Ubuntu Bionic):
assignee: nobody → Dave Jones (waveform)
status: New → In Progress
Dave Jones (waveform)
summary: - [FFe] 2019.07 to support Pi4 boot
+ [SRU] 2019.07 to support Pi4 boot
description: updated
Dave Jones (waveform)
description: updated
tags: added: id-5db0502bcb3f2112497e1b92
Dave Jones (waveform)
description: updated
Dave Jones (waveform)
description: updated
Revision history for this message
Robie Basak (racb) wrote :

After much review discussion I am sponsoring 2019.07+dfsg-1ubuntu4 to Focal and 2019.07+dfsg-1ubuntu3~18.04.1 to Bionic (I tweaked the version).

On the Bionic backport, I note that it's essentially impossible to review all the upstream changes for functional behaviour changes to users on Bionic, so we will have to rely entirely on QA instead. The alternative is to not enable Pi 4 on Bionic at all, so on balance this seems like the only reasonable path forward.

Eoan needs looking at. Some changes from 2019.07+dfsg-1ubuntu3 to 2019.07+dfsg-1ubuntu4 may need backporting in an SRU to Eoan to make sure the upgrade path Bionic->Eoan->Focal works correctly at both of those points. I suggest this needs resolving before the Bionic SRU lands in the updates pocket, but leave that decision to the SRU reviewer.

We also identified a race condition: if flash-kernel is deconfigured to resolve the Breaks and then upgraded afterwards, flash-kernel won't run itself. This will be fixed separately in flash-kernel and will need no further changes to u-boot.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Dave, or anyone else affected,

Accepted u-boot into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/u-boot/2019.07+dfsg-1ubuntu4~18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in u-boot (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

This is upload is good. Certification was testing our daily images and the images look fine.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package u-boot - 2019.07+dfsg-1ubuntu4~18.04.1

---------------
u-boot (2019.07+dfsg-1ubuntu4~18.04.1) bionic; urgency=medium

  * Backport of 2019.07+dfsg1 to support Raspberry Pi 4 boot (LP: #1846329)
  * Handle differing root partition labels during migration
  * Ensure boot.scr is from recent flash-kernel

u-boot (2018.07~rc3+dfsg1-0ubuntu3~18.04.2) bionic; urgency=medium

  [ Shrirang Bagul ]
  * Enable Ubuntu support for the Nitrogen6x board (LP: #1838064)
    - Add d/p/ubuntu-nitrogen6q2g-config-tweaks.patch to tweak the
      nitrogen6q2g configs to better fit our Ubuntu usage.
    - Start building the nitrogen6x2g target for u-boot.

 -- Dave Jones <email address hidden> Thu, 19 Dec 2019 22:06:27 +0000

Changed in u-boot (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for u-boot has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.