Closed trabucayre closed 1 week ago
Hi, I'm trying to build and to use this repo with an lambdaconcept ECPIX5 and observe some issues:
* litex: `linuxq` must be replaced by `linux`, `linux4` by `linux --cpu-num-cores 4` * busybox: `CONFIG_USE_BB_CRYPT` and `CONFIG_USE_BB_CRYPT_SHA` must be set (fix issue [build busybox : fatal error:crypt.h No such file #38](https://github.com/litex-hub/linux-on-litex-rocket/issues/38)) * linux: indeed `CONFIG_RISCV_SBI_V01` must be set * riscv_pk: with recent toolchain `rv64imac` must be replaced by `rv64i2p0_mac`
(I have to open a PR to fix these issue).
Yeah, that changed with https://github.com/enjoy-digital/litex/commit/c3e93620 and the corresponding https://github.com/litex-hub/pythondata-cpu-rocket/commit/ef6cf0a -- the variant naming scheme was getting a bit out of hand, and I felt I had to do something to get it back under control :)
But once everything build and a boot.bin copied into /tftpboot the boot fails with: ... Any idea? Thanks.
The *.dts
files are likely also out of date, and so is everything related to using BBL.
Here's the current DTS files I'm using:
Once you've compiled them into dtb
files (dtc -O dtb foo.dts -o foo.dtb
), use them to build an opensbi firmware "blob":
git clone https://github.com/riscv-software-src/opensbi.git
cd opensbi
rm -rf build; make CROSS_COMPILE=riscv64-unknown-linux-gnu- PLATFORM=generic FW_FDT_PATH=/path/to/foo.dtb FW_JUMP_FDT_ADDR=0x82400000
cp build/platform/generic/firmware/fw_jump.bin /litex/boot/folder/
Note the FW_JUMP_FDT_ADDR which forces the DTB to be relocated in a way that doesn't have it stomp all over the kernel (learned that the hard way, see https://github.com/riscv-software-src/opensbi/commit/ee016a7)
My ECPIX5 build command is
litex-boards/litex_boards/targets/lambdaconcept_ecpix5.py --build \\
--cpu-type rocket --cpu-variant linux --cpu-num-cores 1 --cpu-mem-width 2 --sys-clk-freq 50e6 \\
--with-ethernet --with-sdcard --yosys-flow3 --nextpnr-timingstrict
The nexys-video command:
litex-boards/litex_boards/targets/digilent_nexys_video.py --build \\
--cpu-type rocket --cpu-variant linux --cpu-num-cores 4 --cpu-mem-width 2 --sys-clk-freq 50e6 \\
--with-ethernet --with-sdcard --with-sata --sata-gen 1
And, finally, my boot.json
file (in /var/lib/tftpboot, but could be on the sdcard, or wherever you're booting from):
{
"initrd_bb": "0x82000000",
"Image": "0x80200000",
"fw_jump.bin": "0x80000000"
}
HTH, and LMK if you need me to elaborate on any of the details :)
what we could really use is a programmatic way to "cut'n'paste" relevant cpu related bits and pieces from the elaborated rocket-chip sample .dts
files in pythondata-cpu-rocket/generated-src into the output generated by litex_json2dts
, and that would prevent this (linux-on-litex-rocket) repo from going stale in the first place... :)
Note that hard-coding rocket-cpu related properties in the litex json2dts generator is probably still suboptimal, as the cpu string (and other values) in dts change as the upstream rocket sources evolve, and we'd be back to having to "keep up" with something again...
Thanks for your answers! I will try it in this way. I observe with ecpix5 timings not met with pythondata-cpu-rocket HEAD, and a file is missing with the hash you mention. For dts: yes a compromise must be found between a wrong/partial dts and a too much hardcoded/hard to maintain solution.
I observe with ecpix5 timings not met with pythondata-cpu-rocket HEAD,
nextpnr
is known to be a bit "pessimistic" with timing, so if you get $glbnet$sdrio_clk
over 47MHz you "should" be OK :)
If I want to be stubborn about it, I follow that up with:
cd build/lambdaconcept_ecpix5/gateware
while true; do
nextpnr-ecp5 --json lambdaconcept_ecpix5.json --lpf lambdaconcept_ecpix5.lpf \
--textcfg lambdaconcept_ecpix5.config --um5g-85k --package CABGA554 --speed 8 \
--seed $RANDOM
[ "$?" == "0" ] && break
done 2>&1 | grep 'Max frequency for clock'
ecppack --bootaddr 0 lambdaconcept_ecpix5.config --svf lambdaconcept_ecpix5.svf
and I end up with a fully timing compliant bitstream within a day or two (running in a VM on top of a 2012 era xeon server, FWIW) There's probably a "smarter" way to accomplish the same goal, but I haven't done a deep dive into studying nextpnr's fancier set of flags and options...
and a file is missing with the hash you mention.
Not sure what you mean by that, sorry. Can you please clarify, assuming there's something within my power to fix? :)
closing since last I remember this worked :) @trabucayre please re-open if somehow there's still something we need to do about this issue.
Hi, I'm trying to build and to use this repo with an lambdaconcept ECPIX5 and observe some issues:
linuxq
must be replaced bylinux
,linux4
bylinux --cpu-num-cores 4
CONFIG_USE_BB_CRYPT
andCONFIG_USE_BB_CRYPT_SHA
must be set (fix issue #38)CONFIG_RISCV_SBI_V01
must be setrv64imac
must be replaced byrv64i2p0_mac
(I have to open a PR to fix these issue).
But once everything build and a boot.bin copied into /tftpboot the boot fails with:
Any idea? Thanks.