Re: Orange Pi RV2 boot with some success
- In reply to: Tom Pusateri : "Re: Orange Pi RV2 boot with some success"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 05 May 2025 19:31:38 UTC
[Resending with right From: for the list]
On 5 May 2025, at 20:19, Tom Pusateri <pusateri@keehole.org> wrote:
>
> Thanks for the continued effort. I was not criticizing the FreeBSD effort, just amazed that linux centric everything is. You would have thought we would have learned our lesson from the bios.
>
> I included the output of printenv in the first message I sent. You can see the variables there.
>
> Loading the dtb and kernel by hand into memory and using bootefi with the memory and fdt address yields exactly the same results as before with both FreeBSD 14.2 and FreeBSD 15.
U-Boot isn’t the problem here. It’s working just fine, using EFI and
providing a device tree to the kernel (note the loader.conf is
unnecessary). The problem lies solely in a lack of drivers in FreeBSD
for the various devices present on this particular board, including
whatever’s needed for the USB controller.
Note that loader(8) works because it’s an EFI application and thus
U-Boot’s drivers are being used, it’s only once the kernel boots that
the lack of drivers matters.
Jess
> Thanks,
> Tom
>
>
>> On May 5, 2025, at 3:33 AM, Rich Dunkle <rdunkle@smallcatbrain.com> wrote:
>>
>> On 05.05.2025 02:44, Tom Pusateri wrote:
>>> 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
>>>
>> ---8<---- snip ---
>>
>> The FreeBSD arm64 architecture is really good now.
>>
>> You are correct the dtb file is getting loaded too late.
>>
>> As for riscv---
>> The board vendors just ship a board and expect a linux binary blob to be OK.
>> They send a board to some "internet influencer" and that is about it.
>>
>> FreeBSD just does not have the resources that Linux has working on riscv.
>> FreeBSD basically has one guy, Mitchell Horne.
>>
>> Then look at all the patches submitted for Linux riscv in just a few days:
>> https://patchwork.kernel.org/project/linux-riscv/list/
>>
>> OK... so we need to dig into the u-boot commands to make more progress.
>>
>> The u-boot environment is set up for linux boot.
>> We need to override the settings.
>>
>> When u-boot starts up you need to break into the u-boot command prompt
>> before it starts up the FreeBSD boot.
>>
>> Control c should break out to a u-boot prompt.
>>
>> Enter: printenv
>> that will show the saved environment for u-boot
>> --> show that to us in email
>>
>> You will notice some important variables right away:
>> fdtfile ---> show the pathname to the the dtb file
>>
>> Here are the u-boot commands that will probably boot
>> (will not know for sure until looking at the printenv)
>>
>> --SHOW US THE OUTPUT FROM THE CONSOLE--
>>
>> mmc list
>> ** u-boot will recognize the sd card
>>
>> mmc dev 1
>> ** should see something like this:
>> ** switch to partitions #0, OK
>> ** mmc1 is current device
>> ** this set a variable for addressing the sd card
>>
>> load mmc 1:1 ${fdt_addr_r} dtb/x1_orangepi-rv2.dtb
>> *** should see it read in the dtb file
>>
>>
>> load mmc 1:1 ${kernel_addr_r} efi/boot/bootriscv64.efi
>> *** should see it read in the bootriscv64.efi
>>
>> bootefi ${kernel_addr_r} ${fdt_addr_r}
>> *** should see it start to boot FreeBSD
>>
>> ---------------------------------------------
>> Here are some bonus commands for looking at the sd card
>> mmc list
>> mmc dev 1
>> mmc part
>>
>> *** show you the partitions of the sd card
>> -----------------------------------------------------------------
>> ls mmc 1:1
>> ** show the files on mmc(sd card) (devnum 1) (first partition)
>>
>> ls mmc 1:1 dtb
>> ** show the file in the dtb directory
>>
>> ---------------------------------------
>> There is also a help system:
>>
>> help ls
>> ----------------------------------------
>
>
>
Jess