feat: Raspberry Pi 4 (aarch64) target #110
1 changed files with 40 additions and 1 deletions
fix(rpi4): raise CMA to 256M, document the firmware-partition step
Two findings from the first Pi 4 (actually a CM4) bring-up, chased from a
white screen to hardware-accelerated X.
CMA. The vc4 display pipeline allocates its framebuffer from the contiguous
memory area, and the default reservation here is 32MiB with ~11MiB free. The
attached panel is 3840x1080, whose framebuffer is ~16.6MB before double
buffering, so X picked the mode and then died:
Output HDMI-1 using initial mode 3840x1080 +0+0
(EE) AddScreen/ScreenInit failed for driver 0
nixos-hardware's fkms-3d injected a CMA overlay alongside its display one;
cma=256M replaces that half. This part is declarative, since kernelParams
reach the extlinux APPEND line.
The display itself is NOT declarative, and that is the uncomfortable part.
This board boots the FIRMWARE's vendor DTB, not the DTBs NixOS builds: the
live device tree carries __symbols__ and mainline's do not, and U-Boot found
no FDTDIR match for compatible "raspberrypi,4-compute-module" so it passed
the firmware's DTB straight through. hardware.deviceTree.overlays therefore
cannot reach the running tree at all, which is also why the earlier fkms-3d
removal fixed a build error without fixing the display.
In the vendor DTB every display node ships disabled, so config.txt needs
`dtoverlay=vc4-kms-v3d,noaudio` and /boot/firmware/overlays/ has to be
populated from raspberrypifw. Three traps in that one line, each of which
failed silently:
- the NixOS sd-image writes the DTBs to the firmware partition but NOT the
overlays, so the directory ships empty and dtoverlay= does nothing
- copying only vc4-kms-v3d.dtbo is insufficient; the firmware remaps that
to vc4-kms-v3d-pi4.dtbo on this board, so the whole directory goes
- without noaudio, vc4_hdmi cannot register its PCM component, returns
-517 (EPROBE_DEFER) forever, and the DRM device never registers, so X
finds no card. We deleted the audio stack anyway.
Result on the machine: card1 is vc4-drm with HDMI-A-1 connected, card2 is
v3d, and X reports
glamor X acceleration enabled on V3D 4.2.14.0
against swrast before. The manual steps are written into the module so the
next person does not rediscover them from a blank screen, but they are lost
on a reflash and belong in the image builder. Follow-up.
commit
8917b8b967
|
|
@ -57,7 +57,46 @@
|
|||
# highest priority survive. nixpkgs sets loglevel/lsm at normal priority, so
|
||||
# a mkDefault list here is dropped entirely — and with no console= at all
|
||||
# the kernel falls back to the device tree's stdout-path, i.e. this UART.
|
||||
boot.kernelParams = [ "console=tty0" ];
|
||||
# cma=256M: the vc4 display pipeline allocates its framebuffer from the
|
||||
# contiguous memory area, and the default reservation on this board is 32MiB
|
||||
# with about 11MiB free. A 3840x1080 framebuffer is ~16.6MB before double
|
||||
# buffering, so X got as far as picking the mode and then died:
|
||||
#
|
||||
# Output HDMI-1 using initial mode 3840x1080 +0+0
|
||||
# (EE) AddScreen/ScreenInit failed for driver 0
|
||||
#
|
||||
# nixos-hardware's fkms-3d injected a CMA overlay alongside the display one;
|
||||
# this replaces that half of it. 256M is generous for any panel an ATM will
|
||||
# carry and trivial against 4-8GB of RAM.
|
||||
boot.kernelParams = [ "console=tty0" "cma=256M" ];
|
||||
|
||||
# ── REQUIRES A MANUAL STEP ON THE FIRMWARE PARTITION ────────────────
|
||||
# This board boots the FIRMWARE's vendor DTB, not the DTBs NixOS builds.
|
||||
# Confirmed on the CM4: the live device tree carries __symbols__ and the
|
||||
# mainline DTBs in dtbs-filtered do not, and U-Boot found no FDTDIR match for
|
||||
# compatible "raspberrypi,4-compute-module" so it passed the firmware's DTB
|
||||
# through. That means hardware.deviceTree.overlays cannot reach the running
|
||||
# device tree, and the display has to be enabled by the firmware instead.
|
||||
#
|
||||
# In the vendor DTB every display node (hvs, gpu, all pixelvalves, both hdmi)
|
||||
# ships `disabled`. So /boot/firmware/config.txt needs:
|
||||
#
|
||||
# dtoverlay=vc4-kms-v3d,noaudio
|
||||
#
|
||||
# and /boot/firmware/overlays/ needs to be populated from raspberrypifw --
|
||||
# the NixOS sd-image writes the DTBs there but NOT the overlays, so the
|
||||
# directory ships empty and the dtoverlay line fails silently. Copy the whole
|
||||
# directory (2MB, 356 files); copying only vc4-kms-v3d.dtbo is not enough
|
||||
# because the firmware remaps that to vc4-kms-v3d-pi4.dtbo on this board.
|
||||
#
|
||||
# `noaudio` is required, not cosmetic. With HDMI audio enabled vc4_hdmi cannot
|
||||
# register its PCM component, returns -517 (EPROBE_DEFER) forever, and the DRM
|
||||
# device never registers -- so X finds no card at all. We removed the audio
|
||||
# stack anyway, so there is nothing to lose.
|
||||
#
|
||||
# This is a reflash-losing manual step and it should be folded into the image
|
||||
# builder. Tracked as a follow-up; noted here so the next person does not
|
||||
# rediscover it from a blank screen.
|
||||
|
||||
# Kiosk display: mainline full KMS, NOT nixos-hardware's fkms-3d.
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue