Re: Orange Pi RV2 boot with some success

From: Tom Pusateri <pusateri_at_keehole.org>
Date: Sun, 04 May 2025 23:44:06 UTC
Rich,

Thank-you for the descriptive reply. I have been using FreeBSD since 1997 and BSD 4.[234] since 1984 so I am very experienced with all the traditional boot stuff. The dtb and uboot are new and make no sense to me. Linux seems trivial to get working on these boards and FreeBSD almost impossible. Not sure why that is.

I have another board (GlobalScale mochabin, aarch64) that I have struggled with as well.

I had no luck getting the riscv board to find the .dtb file from Ubuntu no matter where I put it in the EFI or root directory. I also tried booting a separate single partition TF card with the .dtb in the root and in the dtb directory with no success. It only appears to be looking for EFI.

I was able to get the loader to find and load the .dtb by placing the info in /boot/loader.conf on the FreeBSD UFS partition but this didn’t seem to help any. Same results as before.

# /boot/loader.conf
dtbfile_load="YES"
dtbfile_type="dtb"
dtbfile_name="x1_orangepi-rv2.dtb”

I’m assuming this is too late. 

I’ll keep playing with it and maybe I can figure something out. Everything I can find online about FreeBSD / u-boot / and .dtb files seems to be very old and not applicable.

Thanks,
Tom


> On May 4, 2025, at 2:15 AM, Rich Dunkle <rdunkle@smallcatbrain.com> wrote:
> 
> On 04.05.2025 04:03, Tom Pusateri wrote:
> 
> --8<--- snip ---
> 
>> Device 0: unknown device
>> [   5.693] switch to partitions #0, OK
>> [   5.693] mmc0 is current device
>> [   5.783] Scanning mmc 0:3...
>> [   5.896] ** Unable to read file / **
>> [   5.897] Failed to load '/'
>> [   5.930] ** Unable to read file /dtb/ **
>> [   5.930] Failed to load '/dtb/'
> 
> --8<--- snip ---
> 
>> And this is where it hangs on both serial console and HDMI console.
>> 
>> Tom
>> 
> I do not have one of these boards.
> There is no HowTo written yet.
> So we are going on experience with similar boards.
> 
> OK.... so this is the first thing needed to boot-->   dtb file
> That file tells the operating system about the board resources.
> Since this is a new board for FreeBSD... there is no dtb.
> So let's try to find one.
> 
> There is a chance the the dtb file used by the Xunlong ported operating systems.
> Go to support page for the Pi RV2:
> http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-RV2.html
> 
> Look at the bottom of the page.  There is a link to Ubuntu Image Downloads.
> That will take you to the location of the Ubuntu images.
> Grab the small one--> Orangepirv2_1.0.0_ubuntu_noble_server_linux6.6.63.7z
> 
> Use some tool to explore that image.  I actually found that Nanazip is a nice tool to peruse these images.
> Look at this path--> Orangepirv2_1.0.0_ubuntu_noble_server_linux6.6.63.img\boot\dtb-6.6.63-ky\ky\
> 
> There you will find the Xunlong created dtb files.
> This is probably the one we want-->   x1_orangepi-rv2.dtb
> 
> Next we need some method to allow the u-boot system to read this dtb file
> before FreeBSD starts booting the EFI boot.
> 
> You can make a separate sd card with one partition and this dtb.
> Interrupt the u-boot process and force u-boot to read the dtb file.
> Swap in the FreeBSD sd card and start the EFI boot.
>    OR
> Copy the dtb file into the EFI partition of the existing sd card.
> I assume you have access to another working FreeBSD system.
> Examine the FreeBSD sd card image on the working FreeBSD system.
> Assume the sdcard is device:   da0
> It will look something like this:
>        #  gpart show da0
> 
>      =>      34  14746648  da0  GPT  (7.0G)  [CORRUPT]
> 
> You will probably get an benign error about a corrupt gpt
> 
> That is expected when you burn an image with dd command
> 
> Fix the error with-->     gpart recover da0
> 
> #  gpart show da0
> =>      34  14746648  da0   GPT  (7.0G)
>            34     66584          1    efi  (33M)
>      66618   2097152       2    freebsd-swap  (1.0G)
>    2163770  12582912    3   freebsd-ufs  (6.0G)
> 
> The partition we need to add the dtb file is -->  da0p1
> 
> mount -t msdosfs -o longnames /dev/da0p1 /mnt
> 
> Make a directory and copy the dtb file to the sd card:
> mkdir -p /mnt/dtb
> cp  x1_orangepi-rv2.dtb   /mnt/dtb
> umount /mnt
> 
> Now the sd card is ready for booting.
> But the problem is to get the dtb file read during boot.
> We do not know what location the the u-boot environment was set to look for the dtb file.
> It may boot the first time and pick up the dtb file.
> If it boots good.
> If it fails to find the dtb I can give more explanation of how to control u-boot.
> 
> 
> 
> 
> 
>