From nobody Mon May 05 19:19:47 2025 X-Original-To: freebsd-riscv@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZrrvT5P2Qz5thgn for ; Mon, 05 May 2025 19:20:05 +0000 (UTC) (envelope-from pusateri@keehole.org) Received: from kem.keehole.org (kem.keehole.org [136.41.224.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZrrvT3c6Hz3W8K for ; Mon, 05 May 2025 19:20:05 +0000 (UTC) (envelope-from pusateri@keehole.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (syn-107-013-239-254.res.spectrum.com [107.13.239.254]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by kem.keehole.org (Postfix) with ESMTPSA id 9E2561516; Mon, 05 May 2025 15:19:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=keehole.org; s=202408; t=1746472798; bh=BQU7JpAH9mDkNJKDzNiCjqy4taNVdDGG1A9qg6U6L5E=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=dt61jEXYHZFeEh9RXQ9feqx/AIQ8d5SWv3GN98vZALYwobzv4mzGshZdbJnBVVTTm Xi8LIliBQD6D55dEYcny7ggf8emf+FXN6t1mie9zgQqZcRTOFjpV7u8oI0JwLT8U70 G2emHTyvwCfSbk4o99vLAh6rRFiqXfwdGPTvk3Cozq4h+OVr1RaIGiopTX3JdFdmIz wxFJ8wyGnj7FdcZE9A4H7YkuK4m5DDGiorYP3lzA7/JaQLevv0OA69a4T7TbsdABqM eQRE7qn4CRRCv7QEj1uBQUDWIQ0wdRDcDyjsPHYKhLuQHO5cDQSLkD+ep+IZqcjz/Q UkIV6J0vKD21A== Content-Type: text/plain; charset=utf-8 List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-riscv@freebsd.org Sender: owner-freebsd-riscv@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.2\)) Subject: Re: Orange Pi RV2 boot with some success From: Tom Pusateri In-Reply-To: <66d394c8-0c86-4932-a280-0a043af9b25c@smallcatbrain.com> Date: Mon, 5 May 2025 15:19:47 -0400 Cc: freebsd-riscv@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <3bb24f21-8f2c-40c2-944c-b8c7eea285ff@smallcatbrain.com> <8B847D37-7FB7-4615-98F3-91C3209C4197@keehole.org> <5ffff942-3a3a-4b29-acf5-c90a858bfe21@smallcatbrain.com> <66d394c8-0c86-4932-a280-0a043af9b25c@smallcatbrain.com> To: Rich Dunkle X-Mailer: Apple Mail (2.3776.700.51.11.2) X-Rspamd-Queue-Id: 4ZrrvT3c6Hz3W8K X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16591, ipnet:136.32.0.0/11, country:US] X-Spamd-Bar: ---- 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. Thanks, Tom > On May 5, 2025, at 3:33=E2=80=AFAM, Rich Dunkle = wrote: >=20 > On 05.05.2025 02:44, Tom Pusateri wrote: >> Rich, >>=20 >> 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. >>=20 >> I have another board (GlobalScale mochabin, aarch64) that I have = struggled with as well. >>=20 >> 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. >>=20 >> 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=E2=80= =99t seem to help any. Same results as before. >>=20 >> # /boot/loader.conf >> dtbfile_load=3D"YES" >> dtbfile_type=3D"dtb" >> dtbfile_name=3D"x1_orangepi-rv2.dtb=E2=80=9D >>=20 >> I=E2=80=99m assuming this is too late. >>=20 >> I=E2=80=99ll 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. >>=20 >> Thanks, >> Tom >>=20 > ---8<---- snip --- >=20 > The FreeBSD arm64 architecture is really good now. >=20 > You are correct the dtb file is getting loaded too late. >=20 > 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. >=20 > FreeBSD just does not have the resources that Linux has working on = riscv. > FreeBSD basically has one guy, Mitchell Horne. >=20 > Then look at all the patches submitted for Linux riscv in just a few = days: > https://patchwork.kernel.org/project/linux-riscv/list/ >=20 > OK... so we need to dig into the u-boot commands to make more = progress. >=20 > The u-boot environment is set up for linux boot. > We need to override the settings. >=20 > When u-boot starts up you need to break into the u-boot command prompt > before it starts up the FreeBSD boot. >=20 > Control c should break out to a u-boot prompt. >=20 > Enter: printenv > that will show the saved environment for u-boot > --> show that to us in email >=20 > You will notice some important variables right away: > fdtfile ---> show the pathname to the the dtb file >=20 > Here are the u-boot commands that will probably boot > (will not know for sure until looking at the printenv) >=20 > --SHOW US THE OUTPUT FROM THE CONSOLE-- >=20 > mmc list > ** u-boot will recognize the sd card >=20 > 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 >=20 > load mmc 1:1 ${fdt_addr_r} dtb/x1_orangepi-rv2.dtb > *** should see it read in the dtb file >=20 >=20 > load mmc 1:1 ${kernel_addr_r} efi/boot/bootriscv64.efi > *** should see it read in the bootriscv64.efi >=20 > bootefi ${kernel_addr_r} ${fdt_addr_r} > *** should see it start to boot FreeBSD >=20 > --------------------------------------------- > Here are some bonus commands for looking at the sd card > mmc list > mmc dev 1 > mmc part >=20 > *** show you the partitions of the sd card > ----------------------------------------------------------------- > ls mmc 1:1 > ** show the files on mmc(sd card) (devnum 1) (first partition) >=20 > ls mmc 1:1 dtb > ** show the file in the dtb directory >=20 > --------------------------------------- > There is also a help system: >=20 > help ls > ----------------------------------------