Page MenuHomeFreeBSD

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

Authored by gonzo on Mar 9 2018, 4:45 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 Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15862
Build 15870: arc lint + arc unit

Event Timeline

gonzo created this revision.Mar 9 2018, 4:45 AM
manu added inline comments.Mar 9 2018, 5:14 AM
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

gonzo updated this revision to Diff 40114.Mar 9 2018, 9:28 PM

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

gonzo updated this revision to Diff 40716.Mar 25 2018, 4:01 AM

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
manu added inline comments.Mar 25 2018, 12:31 PM
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

gonzo added inline comments.Mar 25 2018, 6:39 PM
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.

gonzo updated this revision to Diff 40863.Mar 29 2018, 6:06 AM

Remove patch to efi_net.c

manu accepted this revision.Mar 30 2018, 4:37 PM
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
db accepted this revision.Apr 1 2018, 9:45 PM

I'm on it.

gonzo closed this revision.Apr 5 2018, 3:07 AM

Committed in rP466377