I’ve fixed like below. I’ve changed the order of sifive_serial_add_console_port because register_console function refers sifive_serial_console_ports[ssp->port.line]. Therefore before register_console is called, sifive_serial_console_ports[ssp->port.line] have to be set.
/* drivers/tty/serial/sifive.c */
sifive_serial_add_console_port(ssp);
r = uart_add_one_port(&sifive_serial_uart_driver, &ssp->port);
//sifive_serial_add_console_port(ssp);
This is my current state. I just have to load initramfs.cpio.gz or initrd.
[ 3.170000] bootconsole [early0] disabled
[ 3.180000] ALSA device list:
[ 3.180000] No soundcards found.
[ 3.190000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 3.200000] Please append a correct "root=" boot option; here are the available partitions:
[ 3.210000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 3.210000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.0-sifive-1+ #30
[ 3.210000] Call Trace:
Looks like you might be using an out-of-date version of the serial driver patch. Best one to use is the one from mainline Linux, since it fixes several bugs.
Hi,
I’m also facing same issue. My design is also not having FPU.but while compilation with ISA=rv64imac and ABI=lp64 didn’t you face soft float -hard float link issue.
See i got this…
riscv32-unknown-elf-gcc -march=rv32imac -mabi=ilp32 -g -Og -o output abc.c
/opt/riscv/lib/gcc/riscv32-unknown-elf/9.2.0/…/…/…/…/riscv32-unknown-elf/bin/ld: /tmp/cc8mUvuD.o: can’t link soft-float modules with double-float modules
/opt/riscv/lib/gcc/riscv32-unknown-elf/9.2.0/…/…/…/…/riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /tmp/cc8mUvuD.o
collect2: error: ld returned 1 exit status
The compiler can emit code for any arch/abi combination by adding -march=X -mabi=Y options, but the startfiles and libraries will only be built for the default arch/abi combination(s).
How did you configure the compiler? If you didn’t build the compiler multilib, then it only supports one arch/abi combination, which is apparently not the arch/abi combination that you want to compile for. You can add --with-arch=rv32imac --with-abi=ilp32 configure options to build for your chosen arch/abi. Or you can add --enable-multilib configure option to build for multiple arch/abi combinations.