Broken EFI Support in the Raspberry Pi Kernel

Open
#5,543 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

Reproduce the problem from the rpi-6.2.y source with the supplied .config, booting arch/arm64/boot/Image through the EFI shell. Compare the EFI boot with the stock Debian kernel while collecting logs for the reported audio, WiFi, power-off, Bluetooth, and overclocking failures. Done means identifying the EFI-specific regressions and preserving the required Raspberry Pi device nodes.

Written by the indexing model from the issue text.

Description

Describe the bug

For some reason, compiling the Raspberry Pi kernel with EFI boot support breaks many features of Raspberry Pi OS. For example, I lose the following features when booting with EFI:
• The ability for audio output
• WiFi support
• The ability to power off (I get [23634.13552] Rebooting system but it never turns off)
• Bluetooth support
• Crashes with overclocking
• etc

However, when booting with the stock Debian kernel, have none of the above issues (except bluetooth), but I don't have /dev/gpiomem, /dev/vcio, nor /dev/vc-mem. This is why I wish to enable the EFI stub in the Raspberry Pi kernel.

Steps to reproduce the behaviour
  1. Download the latest kernel source git clone --depth=1 --branch=rpi-6.2.y https://github.com/raspberrypi/linux
  2. Download my configuration cd ./linux && make -j distclean && wget https://pastebin.com/raw/AVmn0AgF -O ./.config
  3. Update configuration in case anything has changed make -j oldconfig
  4. Compile the kernel make -j6 dtbs Image modules
  5. Install devicetree and modules make -j6 dtbs_install modules_install
  6. Paste the kernel in /boot sudo cp ./arch/arm64/boot/Image /boot
  7. Download EFI Firmware and unzip its contents in /boot.
  8. Reboot
  9. Press F1 when you see the Raspberry Pi Logo to enter the EFI Shell.
  10. Type fs0: in the EFI shell.
  11. Type Image root=/dev/mmcblk0p2 rootwait ro (replacing /dev/mmcblk0p2 with whatever device you boot from)

All of the above steps have been performed on a Raspberry Pi, I have not cross-compiled anything

Device (s)

Raspberry Pi 4 Mod. B

System
  1. cat /etc/rpi-issue Not found
  2. vcgencmd version
    Dec 12 2022 11:56:56 Copyright (c) 2021 Broadcom version ed6f6b8fcdc6476410b9cf75d141633461d34bdd (clean) (release) (start)
  3. uname -a Linux raspberrypi 6.2.16-v8+ #5 SMP PREEMT Sun Jul 16 18:48:02 CDT 2023 aarch64 GNU/Linux
Logs

No response

Additional context

No response

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.