Bbl debugging using gdb


#21

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:

(Paul Walmsley) #22

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


#23

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

#24

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.


(Paul Walmsley) #25

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


#26

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.