!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

223 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux https://github.com/orgs/NixOS/teams/risc-v64 Servers

Load older messages


SenderMessageTime
8 Apr 2024
@alex:tunstall.xyzAlexOr was it GRUB?08:26:05
@thefossguy:matrix.orgPratham Patelbut if you want a non-ext for rootfs, it's best to boot into a bootloader (grub/systemd-boto) from uboot and then load kernel08:26:20
@cnx:loang.net@cnx:loang.netthanks!08:27:05
@alex:tunstall.xyzAlex

Anyway, here's the full boot chain typically used on the JH7110-based SBCs:

ZSBL (ROM) -> OpenSBI and u-boot (usually flash) -> GRUB/systemd-boot (boot partition) -> kernel (boot partition) -> initrd, AKA NixOS stage 1 (boot partition) -> root system, AKA NixOS stage 2

08:29:19
@cnx:loang.net@cnx:loang.nethow is opensbi and u-boot loaded?08:30:04
@cnx:loang.net@cnx:loang.neti mean where are they loaded from a storage in case of sdio?08:30:25
@cnx:loang.net@cnx:loang.netthe beginning of the drive?08:30:32
@alex:tunstall.xyzAlexNope, the ZSBL looks for a partition with a specific type in the GPT.08:30:56
@cnx:loang.net@cnx:loang.neti see, so say i can have a partition for them on the emmc and use the rest for boot partition and os?08:31:59
@alex:tunstall.xyzAlexYes, but you can also keep them in flash and have the entire disk for yourself.08:32:21
@cnx:loang.net@cnx:loang.neti'm reluctant to override the stock flash, is it possible to back it up?08:32:58
@alex:tunstall.xyzAlexPresumably, though I don't know how you'd do that.08:33:14
@alex:tunstall.xyzAlexYou probably should be updating it because the vendor has significantly improved it over the past year.08:33:42
@thefossguy:matrix.orgPratham Patel ZSBL is in SoC's ROM. That has an offset to look for, where OpenSBI is stored. OpenSBI either has a hardcoded offset that it looks for, to load U-Boot, or you can specify one at build-time (IIRC, the later is done for the VF2) and then U-Boot scans storage mediums in the given order and scans for EFI partitions and loads from the first match. 08:34:01
@alex:tunstall.xyzAlexUp to you I guess.08:34:03
@thefossguy:matrix.orgPratham Patel
In reply to @cnx:loang.net
i'm reluctant to override the stock flash, is it possible to back it up?
even if you f it up
08:34:26
@thefossguy:matrix.orgPratham Patelit's easy to override it08:34:32
@thefossguy:matrix.orgPratham Patelusing the vendor's recovery tool08:34:40
@alex:tunstall.xyzAlex

That has an offset to look for, where OpenSBI is stored.

I've been playing around with booting custom binaries on the SBC before, and it definitely won't load it if the partition type ID doesn't match.
Now I haven't tried whether or not it supports having that partition at a different location, so you could still be right...

08:35:52
@thefossguy:matrix.orgPratham Patelbest not to try it, and remain sane :)08:36:38
@alex:tunstall.xyzAlex
In reply to @thefossguy:matrix.org
using the vendor's recovery tool
To elaborate: as long as you have access to UART, you can't brick your system because the ZSBL is also capable of loading the next stage directly over UART.
08:37:21
@cnx:loang.net@cnx:loang.netthanks, that's good to know08:37:44
@alex:tunstall.xyzAlex
In reply to @thefossguy:matrix.org
best not to try it, and remain sane :)
Well I've already reverse engineered some of the ZSBL code, so I'm not sure what sanity I have left...
08:38:10
@cnx:loang.net@cnx:loang.net
In reply to @thefossguy:matrix.org
ZSBL is in SoC's ROM. That has an offset to look for, where OpenSBI is stored. OpenSBI either has a hardcoded offset that it looks for, to load U-Boot, or you can specify one at build-time (IIRC, the later is done for the VF2) and then U-Boot scans storage mediums in the given order and scans for EFI partitions and loads from the first match.
if the opensbi offset is fixed does it mean you need to flash the partition table along with it?
08:40:14
@thefossguy:matrix.orgPratham Patel
In reply to @cnx:loang.net
if the opensbi offset is fixed does it mean you need to flash the partition table along with it?
this is selected at compile-time for the VF2
08:40:44
@cnx:loang.net@cnx:loang.netI meant the offset to find opensbi08:41:04
@thefossguy:matrix.orgPratham PatelI'm not sure if I follow what you mean by the question "flash the partition table along with it"08:41:47
@thefossguy:matrix.orgPratham Patelflash the SPI flash's partition table?08:41:59
@thefossguy:matrix.orgPratham Patelthat reminds me08:42:05
@thefossguy:matrix.orgPratham Patelyou can just switch the DIP switches to tell ZSBL (not tell, more like electrically change path; but same thing) to load OpenSBI+U-Boot from the eMMC/SD.08:42:54

Show newer messages


Back to Room ListRoom Version: 10