Re: [EXT] no HDMI on rpi4b NetBSD 10.1

Ramiro Aceves <[email protected]> Tue, 15 Jul 2025 08:14:18 +0200
Newsgroups gmane.os.netbsd.ports.arm
Message-ID <[email protected]>

El 14/7/25 a las 23:00, Steve Rikli escribió:
> On Mon, Jul 14, 2025 at 04:21:50PM +0000, Kulesa, Craig A - (ckulesa) wrote:
>> The "generic" system does support UEFI but it does not come with the
>> RPI4 UEFI firmware -- it's 'generic'.
> 
> I believe that makes sense. I was (unconsciously) thinking like the
> NetBSD img was for Rpi (the previous OS I used on this rpi4 was FreeBSD,
> and they offer an rpi-specific img), but of course there are also Rocks
> and Pines and Bananas etc. in the world.  :-)
> 
> Absent this additional RPI4 UEFI firmware, is there a way to tell what
> firmware version comes with the NetBSD .img file?
> 
> In general, is there a way to check what version a file from a given
> UEFI firmware bundle is (e.g. from commandline or similar), other than
> "just knowing" which .zip file you downloaded?

Good question. I do not know...

> 
>> When you install the RPI4 UEFI firmware to SD card, NetBSD will pick
>> up and support the residual hardware like HDMI that doesn't come up
>> without UEFI and ACPI.   See this link for the firmware:
>>
>> https://github.com/pftf/RPi4
> 
> OK. The installation instructions from that page says:
> 
> "Extract all the files from the archive onto the partition you created
> above.  Note that outside of this Readme.md, which you can safely
> remove, you should not change the names of the extracted files and
> directories."
> 
> Which sounds like the zip archive expects to be unpacked as-is into
> a fat/msdos partition, e.g. like the /boot/ partition from the NetBSD
> img file -- more on this below, where you discuss options.

yes.

> 
>> There are a couple options here:
>>
>> - install the RPI4 UEFI firmware to micro-SD card, install the NetBSD
>>    image file to a USB-attached device (such as a flash drive or SSD).
>>    This is cleaner since UEFI firmware and NetBSD are on independent
>>    devices -- and certainly faster if an SSD is used.
> 
> I wasn't planning to use additional storage with this rpi4 aside from
> the microSD sysdisk, so it sounds like I'll try your 2nd option:
> 
>> - Install the NetBSD image file to microSD, then mount its msdos
>>    partition and unzip the RPI4 UEFI files into it.  Then you can boot
>>    both UEFI and NetBSD from the same microSD.  This minimizes hardware
>>    footprint at the expense of more complexity and a large hit to drive
>>    speed.
> 
> Is is possible to simply unzip the RPi4_UEFI_Firmware_v1.42.zip archive
> into a running NetBSD system's msdos /boot/ directory, and then reboot?
> Or it it better to do that "offline", with the microSD mounted in
> another system?

I have done it in a running system and reboot without problems. Also 
Offline.

> 
> I note that the zip archive and msdos partition /boot/ directory from
> the NetBSD img have different layouts and content, but there's some
> overlap; here's what I have from the booted NetBSD arm64.img
> installation:
> 
> rpi4# uname -v
> NetBSD 10.1 (GENERIC64) #0: Mon Dec 16 13:08:11 UTC 2024  [email protected]:/usr/src/sys/arch/evbarm/compile/GENERIC64
> 
> rpi4# df -h /boot
> Filesystem     Size   Used  Avail %Cap Mounted on
> /dev/dk0        79M    32M    47M  40% /boot
> rpi4# mount | grep dk0
> /dev/dk0 on /boot type msdos (local)
> 
> rpi4# ls -l /boot
> total 23155
> drwxr-xr-x  1 root  wheel      1024 Dec 17  2024 EFI
> -rwxr-xr-x  1 root  wheel      1594 Dec 17  2024 LICENCE.broadcom
> -rwxr-xr-x  1 root  wheel     52476 Dec 17  2024 bootcode.bin
> -rwxr-xr-x  1 root  wheel        33 Jul 13 17:08 cmdline.txt
> -rwxr-xr-x  1 root  wheel       155 Jul 12 12:23 config.txt
> drwxr-xr-x  1 root  wheel      1024 Dec 17  2024 dtb
> -rwxr-xr-x  1 root  wheel      7269 Dec 17  2024 fixup.dat
> -rwxr-xr-x  1 root  wheel      5412 Dec 17  2024 fixup4.dat
> -rwxr-xr-x  1 root  wheel      3180 Dec 17  2024 fixup4cd.dat
> -rwxr-xr-x  1 root  wheel      3180 Dec 17  2024 fixup_cd.dat
> -rwxr-xr-x  1 root  wheel  16775144 Dec 17  2024 netbsd.img
> -rwxr-xr-x  1 root  wheel   2979264 Dec 17  2024 start.elf
> -rwxr-xr-x  1 root  wheel   2254944 Dec 17  2024 start4.elf
> -rwxr-xr-x  1 root  wheel    808060 Dec 17  2024 start4cd.elf
> -rwxr-xr-x  1 root  wheel    808060 Dec 17  2024 start_cd.elf
> rpi4# ls -l /boot/dtb/broadcom/
> total 158
> -r-xr-xr-x  1 root  wheel  37735 Jul 12 04:03 bcm2711-rpi-4-b.dtb
> -r-xr-xr-x  1 root  wheel  37679 Jul 12 04:03 bcm2711-rpi-400.dtb
> -r-xr-xr-x  1 root  wheel  20741 Jul 12 04:03 bcm2837-rpi-3-a-plus.dtb
> -r-xr-xr-x  1 root  wheel  21610 Jul 12 04:03 bcm2837-rpi-3-b-plus.dtb
> -r-xr-xr-x  1 root  wheel  21142 Jul 12 04:03 bcm2837-rpi-3-b.dtb
> -r-xr-xr-x  1 root  wheel  20465 Jul 12 04:03 bcm2837-rpi-cm3-io3.dtb
> 
> And here's what I see in the zip archive bundle before unpacking:
> 
> rpi4# unzip -l /tmp/RPi4_UEFI_Firmware_v1.42.zip
> Archive:  /tmp/RPi4_UEFI_Firmware_v1.42.zip
>    Length     Date   Time    Name
>   --------    ----   ----    ----
>    3997696  05-25-25 02:21   RPI_EFI.fd
>      54264  05-25-25 02:21   bcm2711-rpi-4-b.dtb
>      54353  05-25-25 02:21   bcm2711-rpi-400.dtb
>      54873  05-25-25 02:21   bcm2711-rpi-cm4.dtb
>        243  05-25-25 02:14   config.txt
>       5454  05-25-25 02:21   fixup4.dat
>    2264064  05-25-25 02:21   start4.elf
>          0  05-25-25 02:21   overlays/
>       2775  05-25-25 02:21   overlays/upstream-pi4.dtbo
>       1566  05-25-25 02:21   overlays/miniuart-bt.dtbo
>       4885  05-25-25 02:14   Readme.md
>          0  05-25-25 02:14   firmware/
>          0  05-25-25 02:14   firmware/brcm/
>     631467  05-25-25 02:14   firmware/brcm/brcmfmac43455-sdio.bin
>       7163  05-25-25 02:14   firmware/brcm/brcmfmac43455-sdio.clm_blob
>       2074  05-25-25 02:14   firmware/brcm/brcmfmac43455-sdio.Raspberry
>       2172  05-25-25 02:14   firmware/brcm/brcmfmac43455-sdio.txt
>        502  05-25-25 02:14   firmware/Readme.txt
>       9136  05-25-25 02:14   firmware/LICENCE.txt
>   --------                   -------
>    7092687                   19 files
> 
> If I simply unpack the zip archive directly into /boot/, it will
> overwrite the config.txt which came with NetBSD img; and also end up
> with different copies of at least bcm2711-rpi-4-b.dtb in /boot/ as well
> as in /boot/dtb/broadcom/ .

I think that config.txt overwritting is needed in order to make UEFI 
work. Compare UEFI firmare zip file  config.txt with the NetBSD supplied 
one and you will see the difference. Keep a copy of yours just in case 
you need something. I have only changed arm_boost=1 to arm_boost=0 to 
not stress my RPi too much on long compilation.

I believe that the UEFI firmware is RPI_EFI.fd.  Also think that 
fixup4.dat and start4.elf come tweaked by the UEFI firmare ZIP file to work.

This is the config.txt supplied with the UEFI firmware:

netbsd-raspa4$ cat config.txt
arm_64bit=1
arm_boost=0
enable_uart=1
uart_2ndstage=1
enable_gic=1
armstub=RPI_EFI.fd
disable_commandline_tags=1
disable_overscan=1
device_tree_address=0x1f0000
device_tree_end=0x200000
dtoverlay=miniuart-bt
dtoverlay=upstream-pi4
netbsd-raspa4$

> 
> Should the existing /boot/ content be removed first? I.e. empty out
> the /boot/ directory which came with NetBSD img, and then unzip the
> new UEFI archive into it?

Good question, UEFI instructions say it should work, but I have not 
tested. I have never understood dtb files. My understanding of all of 
this subject is very limited. Hope not having said something wrong.
All of this is very  is a bit difficult for me to understand. We need 
better documentation.



> 
> The existing /boot/config.txt appears to have NetBSD specific settings
> in it, so I'm guessing those should be preserved in some fashion rather
> than entirely overwritten by the config.txt from UEFI zip archive, no?
> 
>> Regardless, I recommend booting to the UEFI screen (via serial console
>> or HDMI) and configuring UEFI as desired (to remove the 3 GB RAM
>> limit, set boot order, verify the ACPI mapping to allow the wifi chip
>> to attach, etc) -- then have it boot NetBSD from whichever device
>> holds NetBSD.   Doing it in two stages helps debugging later.
> 
> I don't know how to "boot to the UEFI screen" yet, but perhaps this
> will become clearer after installing and booting the UEFI zip bundle?

You will see inmediately at boot a screen with a big raspberry from 
which you can enter UEFI, similar to a PC BIOS (pressing F2 perhaps? I 
do not remember exactly the keys).
> 
> I'm happy to experiment here, since this rpi4 system isn't deployed
> yet, while I work out the installation and config procedures.
> 
>> That's a quick start.   I just did this recently, so if you get stuck
>> on anything feel free to give a holler.
> 
> Thanks very much; even just the clarification about the NetBSD .img file
> contents being "generic" UEFI is helpful. It already explains some of
> the behavior I see so far.
> 
> Cheers,
> sr.
> 
>>> On Jul 14, 2025, at 8:26 AM, Steve Rikli <[email protected]> wrote:
>>>
>>> I've used NetBSD for a while, but this is my first time with ARM. My
>>> setup:
>>>
>>> - Raspberry pi4 model B, 8GB RAM, microSD sysdisk, serial HAT with db9
>>>
>>> - connected serial console, plus HDMI monitor and USB keyboard,mouse
>>>
>>> - installed with dd image NetBSD-10-aarch64--generic.img.gz from
>>>      https://nycdn.netbsd.org/pub/arm/
>>>    as I understand it, these images come with UEFI.
>>>
>>> During first boot I watched both serial and HDMI consoles. At poweron,
>>> the serial console quickly showed output, but while the HDMI monitor
>>> woke up right away, like it was getting a signal, no output ever
>>> appeared there.
>>>
>>> I was able to complete setup on serial console, and since that's how
>>> I run most of my servers this is good enough to get started.
>>>
>>> Is HDMI supposed to work at this point?
>>>
>>> I'm confident in the HDMI monitor and cables, and the rpi4's HDMI; they
>>> work with the original Raspbian OS, and I see rpi bootloader text output
>>> on the monitor when I remove the microSD and power on.
>>>
>>>  From NetBSD, the 'drvctl -l wsdisplay0' rc.conf routine doesn't find a
>>> device, and 'dmesg' doesn't list anything that looks like "display"; I
>>> do see these lines:
>>> [ 1.000004] /soc/hdmi@7ef00700 at simplebus1 not configured
>>> [ 1.000004] /soc/hdmi@7ef05700 at simplebus1 not configured
>>>
>>> Presumably that's all related, but I don't know what to expect here.
>>>
>>> I've sysupgrade to the daily NetBSD from Jul 12 as a matter of course,
>>> but it didn't change HDMI behavior.
>>>
>>> Do I need to add to (or replace?) any UEFI files which came along with
>>> the NetBSD-10-aarch64--generic.img ? Also, is there a way to check
>>> the version of the UEFI file(s) there?
>>>
>>> Newer/different kernel required? Or load some additional module?
>>>
>>> Fwiw the full 8GB RAM appears available, I didn't have to do anything
>>> to enable it.
>>>
>>> I tried a few suggestions from rpi forums and wikis, e.g. hdmi_safe=1
>>> in /boot/config.txt and similar things; no change. I don't know how
>>> much NetBSD makes use of some of those settings -- I'm guessing some
>>> functionality from NetBSD /boot.cfg is handled there for evbarm?
>>>
>>> I'm thinking of updating the rpi4 bootloader using the "Raspberry Pi
>>> Imager", the version this unit came with is dated 2022/01/25.
>>>
>>> I'm not roadblocked without HDMI, but it'd be nice to know what I'm
>>> missing here -- ideas and suggestions always welcome.
>>>