litex-hub / linux-on-litex-rocket

Run 64-bit Linux on LiteX + RocketChip
BSD 2-Clause "Simplified" License
189 stars 20 forks source link

litex_sim fails loading opensbi: Liftoff hangs #30

Closed OrkunAliOzkan closed 1 year ago

OrkunAliOzkan commented 1 year ago

Hi, I posted the issue on the main Litex repo (https://github.com/enjoy-digital/litex/issues/1672), but in retrospect heavily believe it to be much more appropriate to have here. I beg of you to review the URL listed above to see what it is I've been getting up to. I am unsure if copy pasting the entire message would be appropriate or not, but would be more than willing to move the entire discussion here if one were to think that I should.

gsomlo commented 1 year ago

I did look through issue #1672. IMHO you're stretching the limits of what is feasible to simulate with verilator :)

I do remember using simulation and verilator in the early days of getting LiteX working with Rocket. But it was the low-end (mmu- and fpu-less variant) I was using, and mostly just long enough to boot the litex bios.

I remember trying to once boot linux in simulation, and it took about 8 hours of 8-core threaded verilator time to make it through the whole boot process (and that was with bbl, so no actual experience booting opensbi in simulation).

Generally, I get things hanging at liftoff mostly when the UART register address is wrong in the .dts file (you need to get it right both where the uart node is specified, and also on the kernel command line in the "chosen" section).

So there's a small chance it's not related to the fact you're simulating...

HTH, and good luck, --Gabriel

OrkunAliOzkan commented 1 year ago

Hello Gabriel!

To be honest hearing this all from you has been music to my ears, it has been disturbingly slow which was a bit disheartening.

Right, back to the topic of conversation, I had checked all of which you said regarding the UART address in the .dts, and believe found it to be exactly as you specified, but I will upload it still as a point of reference, I would be very grateful if you could quickly just check through it to see if I have made any naive mistakes or errors. dts_file_orkun.txt

OrkunAliOzkan commented 1 year ago

Hi, removed any misc. questions I had in my original inquiry, apologies about that...

OrkunAliOzkan commented 1 year ago

Hi I have resolved this issue now, I realised that if you want to have the correct address pin layout, well maybe use the litex_sim's in built csr generation tools (duh!)

I have a new issue however, the kernel hangs, but this is unrelated to this issues tab and if I must, I'll generate a new issue. I quite like the litex platform and I would be absolutely delighted to contribute by adding more extensive documentation on how to boot linux on litex_sim using opensbi as the bootloader. Let me know if that is something desired