!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

236 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux 71 Servers

Load older messages


SenderMessageTime
8 Apr 2024
@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 (you can mention me) 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 (you can mention me)
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 Patel (you can mention me)it's easy to override it08:34:32
@thefossguy:matrix.orgPratham Patel (you can mention me)using 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 Patel (you can mention me)best 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 (you can mention me)
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 Patel (you can mention me)I'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 Patel (you can mention me)flash the SPI flash's partition table?08:41:59
@thefossguy:matrix.orgPratham Patel (you can mention me)that reminds me08:42:05
@thefossguy:matrix.orgPratham Patel (you can mention me)you 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
@thefossguy:matrix.orgPratham Patel (you can mention me)that way, you an keep the SPI intact and experiment by keeping opensbi and uboot on the SD/eMMC08:43:21
@cnx:loang.net@cnx:loang.net
In reply to @thefossguy:matrix.org
flash the SPI flash's partition table?
i was still on the bootloader on emmc train of thought, i.e. if i want to partition the emmc manually, i suppose i need to flash an image with opensbi and u-boot first, or do i have to build a whole system image then resize
08:43:40
@thefossguy:matrix.orgPratham Patel (you can mention me)you can partition it manually and flash both components individually :)08:45:32
@thefossguy:matrix.orgPratham Patel (you can mention me)
  1. create partitions
  2. assign "partition type"
08:48:20
@cnx:loang.net@cnx:loang.net thanks, i found the expected layout for sdio here: https://hill9.org/journal/2023/08/08/risc-v-debian-ubuntu-and-fedora-linux-on-visionfive-2/ 08:58:36
@cnx:loang.net@cnx:loang.nethmmm weird partion 1 and 2 here are half-ish the size of the one in arch's script09:02:04
@alex:tunstall.xyzAlex

This can also be found in the vendor's official documentation: https://doc-en.rvspace.org/VisionFive2/Boot_UG/JH7110_SDK/boot_address_allocation.html

Now whether or not those offsets are important is still unknown.
Note that partitions 1 and 2 are now "reserved"; this is because the vendor at some point changed their mind and now only wants to support booting from flash and booting from UART.
But SDIO and eMMC boot still work AFAIK.

09:34:00

Show newer messages


Back to Room ListRoom Version: 10