foundation-v8.dtb missing from EFI System Partition

Bug #1249866 reported by Laszlo Ersek (Red Hat)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro OpenEmbedded
Invalid
Undecided
Unassigned

Bug Description

- Release: linaro-openembedded-13.10
- Architecture: Aarch64
- Image file: vexpress64-openembedded_lamp-armv8-gcc-4.8_20131023-504.img

The image file has two partitions:
- /dev/vda1: FAT32 partition
- /dev/vda2: Ext4 partition

/dev/vda1 contains a copy of the kernel image called "Image", and a series of binary device tree files (DTBs):

- fvp-base-gicv2-psci.dtb
- fvp-base-gicv2legacy-psci.dtb
- fvp-base-gicv3-psci.dtb

The "foundation-v8.dtb" file is missing, even though it is available on /dev/vda2, as "/lib/firmware/3.12.0-1-linaro-vexpress64/device-tree/foundation-v8.dtb".

This is a problem because the image cannot be very easily booted on the Foundation Model *with manually built UEFI firmware*.

According to

  https://releases.linaro.org/13.10/openembedded/aarch64/#tabs-5

the Foundation Model is the only Fast Model from ARM that is free (as in price) and requires no additional licensing. Hence it is useful to make the image to work with the Foundation Model.

I'm now providing two "failure modes" in which the bug is annoying.

I. Semi-hosted mode.

(1) install the gcc-linaro 4.8 (Aarch64, GNU/Linux) toolchain
(2) download the image in question
(3) clone the central EDK2 repository: git clone https://github.com/tianocore/edk2.git
(4) Build it for the Foundation Model:

  source edksetup.sh
  make -C "$EDK_TOOLS_PATH"
  build --arch=AARCH64 \
      --platform=ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc \
      --buildtarget=DEBUG --tagname=ARMLINUXGCC \
      -n 4

The output file (UEFI binary) is

  Build/ArmVExpress-RTSM-AEMv8Ax4-foundation/DEBUG_ARMLINUXGCC/FV/RTSM_VE_FOUNDATIONV8_EFI.fd

(5) A bootstrap file is needed too:

  cd ArmPlatformPkg/ArmVExpressPkg/Scripts/uefi-aarch64-bootstrap
  make clean
  CROSS_COMPILE=aarch64-linux-gnu- make

The relevant output file is

  uefi-bootstrap-el3-foundation.axf

(6) Boot the Foundation Model:

  Foundation_v8 --cores=4 \
      --image=uefi-bootstrap-el3-foundation.axf \
      --nsdata=RTSM_VE_FOUNDATIONV8_EFI.fd@0xA0000000 \
      --block-device=vexpress64-openembedded_lamp-armv8-gcc-4.8_20131023-504.img

This starts the bootstrap image first, which loads the UEFI binary. The UEFI binary then tries to load the kernel image (called "Image") and the Device Tree Binary (called "foundation-v8.dtb") via semi-hosting. That is, these files are looked up on the *host*, in the current working directory.

The "Image" file is easy enough to copy out from /dev/vda1 (for example, using libguestfs), but the DTB file is not there (even though DTB files are there for Fast Models that require licensing). The DTB file has to be fished out from /dev/vda2, "/lib/firmware/3.12.0-1-linaro-vexpress64/device-tree/foundation-v8.dtb" -- see above.

II. Full virtio-blk boot mode.

In this mode we're not relying on semi-hosting at all, we want the Foundation Model to load all files from the Linaro OpenEmbedded image file. For this we need some changes in the build process:

Steps (1)-(3) are identical.

In step (4), before building the UEFI binary called "RTSM_VE_FOUNDATIONV8_EFI.fd", we apply the following patches:

(a) patches 04/11 to 11/11, from http://thread.gmane.org/gmane.comp.bios.tianocore.devel/4557

This series from Olivier Martin @ARM implements virtio-mmio support in edk2. Consequently, the virtio-blk driver in the UEFI binary is able to access the FAT32 EFI System Partition (/dev/vda1) in the Linaro OpenEmbedded image.

(Pathes 01-03 have already been applied and pushed to git.)

(b) For convenience, the default UEFI boot option should be re-pointed from SemiHosted to VirtioBlk, so that the UEFI binary finds the kernel image and the device tree binary without manual intervention. I'm attaching the patch that does this.

With these patches in place the UEFI binary can be built just like in step I/(4).

Steps (5)-(6) are identical to those under I., including the Foundation Model command line.

However, the same command line works differently this time:

Again, the bootstrap image is started first. It loads the UEFI binary. The UEFI binary then tries to load the kernel image (called "Image") and the Device Tree Binary (called "foundation-v8.dtb") from the FAT32 EFI System Partition, inside the Linaro OpenEmbedded image. The kernel image is found all right, but the DTB matching the Foundation Model is missing. Worse, since it's available only on /dev/vda2, an Ext4 filesystem, for which edk2 has no driver, we can't even specify the DTB interactively, in the UEFI boot manager.

Therefore I'm requesting / proposing that the "foundation-v8.dtb" file be added to the EFI System Partition.

----------------

Small note: currently, if the user copies the DTB to the ESP (which is of course doable, either inside the guest or from the host using libguestfs / guestfish), then the kernel starts fine, but very soon it panicks -- it can't switch the root fs to /dev/vda2.

The reason for this is a Foundation Model bug, which prevents Linux from using the virtio-blk device after the UEFI driver has used it. See

  http://people.redhat.com/~lersek/arm_case566785_queuepfn_repro/

for more.

But, that's an independent issue -- can you please add the Foundation Model DTB to the ESP? Thank you.

Revision history for this message
Laszlo Ersek (Red Hat) (lersek) wrote :
Revision history for this message
Laszlo Ersek (Red Hat) (lersek) wrote :

This bug report is extremely obsolete at this point. Closing.

Changed in linaro-oe:
status: New → Invalid
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.