Bbl debugging using gdb

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. :joy:

[    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.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=45c054d0815b1530d7c7ff8441389a0421dd05e7

Oh, I see. Thanks a lot.

I used this version of freedom-u-sdk/linux.

commit 20eeb6522e3302c5f6e435c0bdba40ff57ffa41a (HEAD, origin/riscv-linux-4.19)
Author: Troy Benjegerdes troy.benjegerdes@sifive.com
Date: Tue Mar 12 14:21:40 2019 -0500

Use ttySIF instead of ttySI to match (future) upstream

I’m trying to mount rootfs but it’s a little difficult. Could you help me?

I’ve tried 2 manners. But I couldn’t succeed anything.
What is your advice ?

(1) initrd (block dev)
in dts

bootargs = "earlyprintk console=ttySIF0,115200n1 initrd=0x82000000,16M root=/dev/ram0 ramdisk_size=16584";
linux,initrd-start = <0x82000000>;
linux,initrd-end = <0x82447fff>;

(2) initramfs (ramfs)
kernel config

CONFIG_INITRAMFS_SOURCE="initramfs.cpio"

Lastly, do you know how to reset dram using openocd? I think dram is insane.
Sometimes dtb file loaded in dram looks like not updated.

Hi. Yes, unfortunately freedom-u-sdk is out of date. Sorry about that. We hope to have a replacement for it soon.

Hi,

Maybe, my fpga board seems insane. I worked at remote. So I couldn’t reset a board. After board reboot, I can see a shell. :slight_smile:

# cat /proc/cpuinfo
processor       : 0
hart            : 0
isa             : rv64imafdc
mmu             : sv39
uarch           : sifive,rocket0

Thanks.

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

please assist…

Thanks

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.

Thanks Jim, It worked…

I dont know what was the issue but i rebuilt toolchain with
.–with-arch=rv32imac --with-abi=ilp32. It is working now…:smile: