From nobody Mon May 05 19:31:38 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 4Zrs945RSyz5tjd0 for ; Mon, 05 May 2025 19:31:52 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zrs943Xlyz3fmm for ; Mon, 05 May 2025 19:31:52 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso5168805f8f.0 for ; Mon, 05 May 2025 12:31:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746473510; x=1747078310; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CrQiIla9vbl/TaKc+p/wGy7E0BNi90feYesgDfLAAW4=; b=I1+/HeG0gkdRDFwzLsaLbXMOEaOyB9GZmEvfEJS8y5ArUUKLY+TK1dfFN4LqajR6G5 OaHXBW0v3yAP6PSBfafF5HoIqUUyPAimyGonmzc231YTvO+nYpsJSWBJcMx8XKnDy7f5 fnjcDPSiFDvZu6S3Ouyc5RcJZyOpvxmrCkWI9R3iBUhafWgto+CeNW9vwrOldUqwOB8G KNSnk2EXXsYep/33712sDMsOkpOoy0hvMfL3XPiTx314OROx4CID4PEHqxXrcDDnRDcV EpY4PdUQFFxFzUDyq8HPOZ3HV0v/Kgf8vzi7blFdQfd5lnGxrV1RItzPNs/sYegN9NFN qWRw== X-Gm-Message-State: AOJu0YzIaxNdWibWcyY+v55XJJ53iBT17jSvjkgUDz0YNZSaQ1F6l8N+ xKc/K6x6+GcyzYSooT0CU9p741cfGLt4kwXgnb67M6UhAsxyi+a6LWhYNH/3/wI2YUC7Qj3CzS7 pd1I= X-Gm-Gg: ASbGncvP5L0lw2sBmBY4lpF8vTdOexVM7FpUP/FOk/W3haKwMZO/ivFSTxxQ8GaLPJn DqybkVejI+rhHMmNsdb73hBxPcBUBnJSakJ13VqS09cPm/qu5/9RyqYEnyr6iMwH/Pc6eRIyacs UxYdiPKIqx9cX4NdaRWnPpqwjQSVKxFgHrtubvS7qxDF4UczUfPaxE3ktIS/q8/JjF8uymydI+S GJvvkjX3dC9xn7GTFY23UXcHvFa6CgTVXTeoMJkh5pbNgnVwQo+DqfyYiDyKWUadWRpp/Sy88YS tyeFFkZRG+8Sxwt2pKedzAFoZemqxrBMTGEZuas0pA2KGdMS+bWP1jSHRyh16o0NxQ== X-Google-Smtp-Source: AGHT+IF7zH8z8GOjfmUFgvF8H8dvTyISDkqTxP7YnVltAgxz1TyQx+CER3JEFV2lohL1q3vubD6YSQ== X-Received: by 2002:a5d:5f8e:0:b0:39f:fcb:3bf6 with SMTP id ffacd0b85a97d-3a0ac0cb0c2mr188139f8f.2.1746473509590; Mon, 05 May 2025 12:31:49 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a099b0ff5asm11303763f8f.75.2025.05.05.12.31.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 May 2025 12:31:49 -0700 (PDT) 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 \(3826.500.181.1.5\)) Subject: Re: Orange Pi RV2 boot with some success From: Jessica Clarke In-Reply-To: Date: Mon, 5 May 2025 20:31:38 +0100 Cc: freebsd-riscv@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <258AA5F2-DBCF-428F-8051-C33D1F042859@freebsd.org> 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: Tom Pusateri X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Rspamd-Queue-Id: 4Zrs943Xlyz3fmm 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:15169, ipnet:209.85.128.0/17, country:US] X-Spamd-Bar: ---- [Resending with right From: for the list] On 5 May 2025, at 20:19, Tom Pusateri wrote: >=20 > 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. >=20 > I included the output of printenv in the first message I sent. You can = see the variables there. >=20 > 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=E2=80=99t the problem here. It=E2=80=99s 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=E2=80=99s needed for the USB controller. Note that loader(8) works because it=E2=80=99s an EFI application and = thus U-Boot=E2=80=99s drivers are being used, it=E2=80=99s only once the = kernel boots that the lack of drivers matters. Jess > Thanks, > Tom >=20 >=20 >> 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 >> ---------------------------------------- >=20 >=20 >=20 Jess