litex-hub / linux-on-litex-rocket

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

Adjust json2dts.py to work with Rocket #15

Open troibe opened 3 years ago

troibe commented 3 years ago

Note: I might be able to pick this up within the next weeks.

troibe commented 3 years ago

I started to look into this and it seems fairly straightforward. One thing I'm not so sure about are the bootarguments. They seem to differ a lot between Rocket and Litex default as Litex is a lot more detailed.

Rocket:

bootargs = "earlycon=sbi console=liteuart swiotlb=noforce";

Litex default:

bootargs = "mem={main_ram_size_mb}M@0x{main_ram_base:x} rootwait console=liteuart earlycon=sbi root=/dev/ram0 init=/sbin/init swiotlb=32";
            linux,initrd-start = <0x{linux_initrd_start:x}>;
            linux,initrd-end   = <0x{linux_initrd_end:x}>;
gsomlo commented 3 years ago

On Wed, Jun 16, 2021 at 03:57:28AM -0700, developandplay wrote:

One thing I'm not so sure about are the bootarguments. They seem to differ a lot between Rocket and Litex default.

For one thing, that's due to how on linux-on-litex-vexriscv the standard behavior is to load multiple blobs (emulator, dtb, kernel, initrd) separately, and then telling linux where e.g. the initrd was loaded in RAM.

On Rocket, initrd is built into the kernel, which in turn is built into bbl, and the whole thing is loaded as a single blob (boot.bin), which allows linux to start with significantly less "handholding" in terms of necessary command line arguments.

No technical reason it couldn't be done "the other way" (on either -rocket or -vexriscv)