Page MenuHomeFreeBSD

Migrate sysutils/u-boot-rpi3 to common u-boot framework
ClosedPublic

Authored by gonzo on Mar 9 2018, 4:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 11:53 PM
Unknown Object (File)
Jan 2 2024, 5:44 PM
Unknown Object (File)
Dec 24 2023, 3:55 AM
Unknown Object (File)
Dec 20 2023, 7:57 AM
Unknown Object (File)
Dec 17 2023, 9:49 AM
Unknown Object (File)
Dec 16 2023, 7:18 PM
Unknown Object (File)
Dec 15 2023, 7:23 PM
Unknown Object (File)
Dec 15 2023, 4:43 AM

Details

Reviewers
manu
db
Summary

Remove PSCI monitor and firmware bits from sysutils/u-boot-rpi3
and switch it to using u-boot-master framework. Some patches are
required to make this work:

  • Use old-style UART instead of new PL011 one. It requires "dtoverlay=pi3-disable-bt" line in config.txt
  • Override fdt_addr_r if DTB is provided by firmware. This variable is hardcoded and if DTB address is changed via config.txt it's pointing to wrong address nad it confuses loader/kernel. And DTB address change is required, it should be set to 0x4000

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 15862
Build 15870: arc lint + arc unit

Event Timeline

sysutils/u-boot-rpi3/files/patch-board_raspberry_rpi_rpi.c
13

That should be fdtcontroladdr, fdt_addr_r is for loading dtb to ram.
This should also be upstreamed.

sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__console.c
13

This should be upstreamed too if it's really needed

Set fdtcontroladdr instead of fdt_addr_r

gonzo marked an inline comment as done.Mar 9 2018, 9:28 PM

I will work on upstreaming these changes

Add fixes for regressions introduced by 2018.03

  • Use DTB provided by firmware, not the embedded one. In 2018.03 U-Boot added pinctl driver for RPi3 and since FreeBSD uses overlay to switch to PL011 console, pin configuration from embedded DTB conflicts with the one set by firmware. As a result of this switch multiple fixes are required to make U-Boot functional.
  • Add MMC 1 to boot sequence. Embedded DTB has both SDHOST and SDHCI enabled and they're recognized as mmc 0 and mmc 1. Upstream DTB does not enable SDHOST so driver attach fails but it still takes slot 0 so actual functioning mmc device becomes mmc 1.
  • U-Boot uses HDMI node in DTB as an attach point for framebuffer driver. HDMI node is actually used by VC4 DRM driver and disabled by default in upstream. Instead generic framebuffer node should be used.
  • Compatibility string for DWC2 USB controller is different in upstream
  • Fix netbooting by making efi_net_receive_filters no-op instead of failure
sysutils/u-boot-rpi3/files/patch-configs_rpi__3__defconfig
11

Why this change ?

sysutils/u-boot-rpi3/files/patch-drivers_usb_host_dwc2.c
10

Should we add this compatible to FreeBSD instead ?

sysutils/u-boot-rpi3/files/patch-drivers_video_bcm2835.c
10

Should we add -hdmi compatible to FreeBSD instead ?

sysutils/u-boot-rpi3/files/patch-lib_efi__loader_efi__net.c
10 ↗(On Diff #40716)

As said on IRC we should handle this in loader.efi

sysutils/u-boot-rpi3/files/patch-configs_rpi__3__defconfig
11

It's in the comment to the new revision:

Use DTB provided by firmware, not the embedded one. In 2018.03 U-Boot added pinctl driver for RPi3 and since FreeBSD uses overlay to switch to PL011 console, pin configuration from embedded DTB conflicts with the one set by firmware. As a result of this switch multiple fixes are required to make U-Boot functional.

Basically it's to fix console on RPi3

sysutils/u-boot-rpi3/files/patch-drivers_usb_host_dwc2.c
10

No. brcm,bcm2835-usb is compatibility string in .dts file included in U-Boot code, brcm,bcm2708-usb is compatibility string used in upstream DTS. We need to make U-Boot compatible with upstream DTS not FreeBSD compatible with U-Boot DTS.

sysutils/u-boot-rpi3/files/patch-drivers_video_bcm2835.c
10

Same as the previous one. HDMI node is not for actual framebuffer, it's for VC4 DRM linux driver. U-Boot just uses it as an attach point, ignores all register/interrupt values and uses generic framebuffer driver via mailbox API. HDMI node in upstream is disabled by default unless you apply drm overlay.

Remove patch to efi_net.c

manu added inline comments.
sysutils/u-boot-rpi3/Makefile
3

This should be uboot@freebsd.org but I'll change this at commit time.

This revision is now accepted and ready to land.Mar 30 2018, 4:37 PM