I am using modified bbl + Linux.
Bumped the Linux to 5.1, which worked well on the upstream QEMU 4.1.
However, when I try to boot in HiFive Unleashed board, it does not print out anything after the bbl.
Getting all of the drivers necessary for the hifive unleashed board accepted upstream has been a long and slow process. I don’t think that 5.1 was complete, I think it was either 5.2 or 5.3 when we finally had all of the necessary drivers upstream.
The necessary drivers can be found in various places. github.com/riscv/meta-riscv is for OpenEmbedded and has a list of drivers needed to boot on the fu540. it is currently at 5.3, but if you go backwards a bit in the git tree you can find the list of patches for 5.1. Look in recipes-kernel/linux/files/freedom-u540
v5.1 is pretty old in RISC-V terms. Consider using a newer kernel. v5.4 works pretty well on HiFive Unleashed.
You’re using BBL - you’ll need to use a different BBL branch for more recent versions of mainline Linux. BBL uses a DT data format that differs from what’s in upstream Linux. This might help:
Update: I was able to cherry-pick the changes in bbl (that passes bbl without parsing) to my riscv-pk,
and it now goes on up until printing out the bbl logo. (Linux v5.4 and dtb from that)
Thank you for the defconfig!
I’m still struggling with the DT.
We currently use a modified FSBL and some additional security extensions in bbl.
We also need to apply some patches to QEMU and Linux,
so we are unable to just download and use the upstream freedom-u-sdk because apparently freedom-u-sdk has been radically changed since our last fork.
It has changed the entire build system and replaced a bunch of components (e.g., bbl --> opensbi),
which is very hard to catch up.
The bbl at dev/paulw/configurable-machine-data-methods-v1 branch with --with-config-method, --enable-dtb, and --with-dtb-path flags make it hang in both QEMU and HiFive. --> it now only hangs on QEMU, but I think it makes sense since the dtb is invalid?
I could figure out it just hangs while parsing DT (query_mem()), failing at assert(mem_size > 0). Also, I got Linux 5.4 booted in QEMU without those DT flags in bbl. Thus, these clearly indicate it’s still a DT issue.
Yes - it’s simply designed to be usable with the HiFive-U, not QEMU. The reason why is that the BBL branch doesn’t use DTBs to configure BBL any longer. You could create a similar C file inside riscv-pk for a particular QEMU configuration, similar to what was done for the HiFive-U. If you wish to do that, the code in the “configurable-machine-data” branch of sifive/riscv-pk is somewhat cleaner; it may be easier to use:
The reason that this branch removes DT parsing from BBL is simply because BBL looks for non-standard DT data using the same DT data that is passed to the kernel (which uses the upstream DT data format only in its in-tree DT data). This mismatch causes problems in BBL.
Usually what I do is that I keep around a “standard” BBL binary for my QEMU tests. Then as part of my test flow for the HiFive-U, I build the BBL from the configurable-machine-data branch for that use case, since I want to test with an unmodified upstream kernel DTS file.
Another approach would be to upstream DT bindings into the kernel tree for whatever BBL needs, then to upstream a combined set of DT data into the upstream Linux kernel tree.
And another option would be to switch to OpenSBI and U-Boot instead of using BBL.
Anyone have a git repo with all of this in it? After following these instructions, I still can’t get it to boot the kernel. I want to essentially upgrade the buildroot-based SDK to a newer kernel (such as 5.4 or higher) in hopes of getting spidev access.
You might consider trying our OpenEmbedded-based Freedom-U SDK. The master branch has new kernels, DT files, and an up-to-date userspace. We’re about to issue a new stable release, but in the meantime, try the following:
Thanks, I realized that I was using an older version of OpenEmbedded-based Freedom-U SDK (20because I was just following the docs from the freedom-u-sdk repo, which don’t include syncing from master, but an older version.
Now that I am on a newer kernel (5.5.7), I still don’t see any spidev devices in /dev
Is this something I need to include in the DTS file? in:
build/tmp-glibc/work-shared/freedom-u540/kernel-source/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts