I am running the BOOM medium config on a ZCU104 FPGA.
I followed the suggested prototyping workflow from the documentation.
At first I had some issues with the MIG parameters and the copying from the SD Card to the DRAM did not yield the expected results.
Then, I adapted the parameters and now the boot process the init script and then starts to throw segmentation faults.
Sometimes it even reaches the log in prompt and I am able to log in after several tries.
The DRAM contains the expected values after the first stage of the bootloader (I dumped the copied values and wrote a script to compare them)
I would be very glad if someone could pinpoint where things go south during the boot.
Can it still be some DRAM timing issue or is the linux image corrupted or is there even another reason?
Platform Name : freechips,rocketchip-unknown
Platform Features : timer,mfdeleg
Platform HART Count : 1
Boot HART ID : 0
Boot HART ISA : rv64imafdcsux
BOOT HART Features : pmp,scounteren,mcounteren
BOOT HART PMP Count : 16
Firmware Base : 0x80000000
Firmware Size : 92 KB
Runtime SBI Version : 0.2
MIDELEG : 0x0000000000000222
MEDELEG : 0x000000000000b109
PMP0 : 0x0000000080000000-0x000000008001ffff (A)
PMP1 : 0x0000000000000000-0x00000001ffffffff (A,R,W,X)
[ 0.000000] OF: fdt: No chosen node found, continuing without
[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[ 0.000000] Forcing kernel command line to: console=hvc0 earlycon=sbi
[ 0.000000] Linux version 5.7.0-rc3-58539-g5f5fd87b36e2 (XXX@pop-os) (gcc version 9.2.0 (GCC), GNU ld (GNU Binutils) 2.32) #1 SMP Mon Mar 28 21:28:15 CEST 2022
[ 0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[ 0.000000] printk: bootconsole [sbi0] enabled
[ 0.000000] initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080200000-0x00000000ffffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080200000-0x00000000ffffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff]
[ 0.000000] software IO TLB: mapped [mem 0xfa3fa000-0xfe3fa000] (64MB)
[ 0.000000] SBI specification v0.2 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x8
[ 0.000000] SBI v0.2 TIME extension detected
[ 0.000000] SBI v0.2 IPI extension detected
[ 0.000000] SBI v0.2 RFENCE extension detected
[ 0.000000] SBI v0.2 HSM extension detected
[ 0.000000] elf_hwcap is 0x112d
[ 0.000000] percpu: Embedded 17 pages/cpu s31976 r8192 d29464 u69632
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516615
[ 0.000000] Kernel command line: console=hvc0 earlycon=sbi
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 1974032K/2095104K available (6544K kernel code, 4152K rwdata, 4096K rodata, 6327K init, 318K bss, 121072K reserved, 0K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] fixmap : 0xffffffcefee00000 - 0xffffffceff000000 (2048 kB)
[ 0.000000] pci io : 0xffffffceff000000 - 0xffffffcf00000000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffcf00000000 - 0xffffffcfffffffff (4095 MB)
[ 0.000000] vmalloc : 0xffffffd000000000 - 0xffffffdfffffffff (65535 MB)
[ 0.000000] lowmem : 0xffffffe000000000 - 0xffffffe07fe00000 (2046 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU debug extended QS entry/exit.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] plic: mapped 2 interrupts with 1 handlers for 2 contexts.
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[ 0.000680] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[ 0.022352] Console: colour dummy device 80x25
[ 0.029700] printk: console [hvc0] enabled
[ 0.029700] printk: console [hvc0] enabled
[ 0.041318] printk: bootconsole [sbi0] disabled
[ 0.041318] printk: bootconsole [sbi0] disabled
[ 0.055010] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=4000)
[ 0.069757] pid_max: default: 32768 minimum: 301
[ 0.098274] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.111558] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.274512] rcu: Hierarchical SRCU implementation.
[ 0.322427] smp: Bringing up secondary CPUs ...
[ 0.329990] smp: Brought up 1 node, 1 CPU
[ 0.370383] devtmpfs: initialized
[ 0.500244] random: get_random_u32 called from bucket_table_alloc.isra.0+0x4a/0xbe with crng_init=0
[ 0.541409] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.555823] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.614186] NET: Registered protocol family 16
[ 2.540167] vgaarb: loaded
[ 2.581780] SCSI subsystem initialized
[ 2.629699] usbcore: registered new interface driver usbfs
[ 2.643342] usbcore: registered new interface driver hub
[ 2.654875] usbcore: registered new device driver usb
[ 2.755802] clocksource: Switched to clocksource riscv_clocksource
[ 3.681130] NET: Registered protocol family 2
[ 3.771527] tcp_listen_portaddr_hash hash table entries: 1024 (order: 3, 40960 bytes, linear)
[ 3.795955] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 3.859152] TCP bind hash table entries: 16384 (order: 7, 524288 bytes, linear)
[ 4.012187] TCP: Hash tables configured (established 16384 bind 16384)
[ 4.037711] UDP hash table entries: 1024 (order: 4, 98304 bytes, linear)
[ 4.072672] UDP-Lite hash table entries: 1024 (order: 4, 98304 bytes, linear)
[ 4.120707] NET: Registered protocol family 1
[ 4.192134] RPC: Registered named UNIX socket transport module.
[ 4.203459] RPC: Registered udp transport module.
[ 4.211435] RPC: Registered tcp transport module.
[ 4.219445] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 4.230956] PCI: CLS 0 bytes, default 64
[ 47.380997] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[ 48.975038] NFS: Registering the id_resolver key type
[ 48.984896] Key type id_resolver registered
[ 48.992748] Key type id_legacy registered
[ 49.000695] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 49.027280] 9p: Installing v9fs 9p2000 file system support
[ 49.084169] NET: Registered protocol family 38
[ 49.095630] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 49.107104] io scheduler mq-deadline registered
[ 49.114990] io scheduler kyber registered
[ 55.835414] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 55.984920] 64000000.serial: ttySIF0 at MMIO 0x64000000 (irq = 1, base_baud = 0) is a SiFive UART v0
[ 56.063782] [drm] radeon kernel modesetting enabled.
[ 57.211634] loop: module loaded
[ 57.291788] sifive_spi 64001000.spi: mapped; irq=2, cs=1
[ 57.444010] libphy: Fixed MDIO Bus: probed
[ 57.571740] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 57.581282] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 57.604765] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 57.615153] ehci-pci: EHCI PCI platform driver
[ 57.627852] ehci-platform: EHCI generic platform driver
[ 57.644985] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 57.657012] ohci-pci: OHCI PCI platform driver
[ 57.671733] ohci-platform: OHCI generic platform driver
[ 57.728856] usbcore: registered new interface driver uas
[ 57.745251] usbcore: registered new interface driver usb-storage
[ 57.776594] mousedev: PS/2 mouse device common for all mice
[ 57.915668] mmc_spi spi0.0: SD/MMC host mmc0, no DMA, no WP, no poweroff, cd polling
[ 57.955661] usbcore: registered new interface driver usbhid
[ 57.964745] usbhid: USB HID core driver
[ 58.087476] NET: Registered protocol family 10
[ 58.263094] Segment Routing with IPv6
[ 58.280123] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 58.367006] NET: Registered protocol family 17
[ 58.403469] 9pnet: Installing 9P2000 support
[ 58.416115] Key type dns_resolver registered
[ 59.375316] Freeing unused kernel memory: 6324K
[ 59.399966] Run /init as init process
[ 59.880452] mmc0: host does not support reading read-only switch, assuming write-enable
[ 59.895037] mmc0: new SDHC card on SPI
[ 60.024182] mmcblk0: mmc0:0000 SL16G 14.8 GiB
[ 60.483820] random: fast init done
Running FireMarshal nodisk init
[ 64.881375] init[47]: unhandled signal 11 code 0x1 at 0xffffffe00080122c in busybox[10000+d6000]
[ 64.904652] CPU: 0 PID: 47 Comm: init Not tainted 5.7.0-rc3-58539-g5f5fd87b36e2 #1
[ 64.916371] epc: 000000000005bb2c ra : 000000000005bb2c sp : 0000003fffd6f830
[ 64.927557] gp : 00000000000e7d70 tp : 0000003fdb2cb7e0 t0 : 0000003fdb1b9d58
[ 64.938821] t1 : 0000003fdb235fc4 t2 : 00000000000e7940 s0 : 00000000000ea320
[ 64.951043] s1 : 00000000000e9710 a0 : 0000000000000000 a1 : 0000000000000000
[ 64.963262] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000001
[ 64.975414] a5 : 0000000000000001 a6 : 0000000000000006 a7 : 00000000000000dc
[ 64.986644] s2 : 00000000000e9670 s3 : 0000000000000000 s4 : 00000000000e9670
[ 64.998895] s5 : 00000000000e17ef s6 : ffffffffffffffff s7 : 0000000000000000
[ 65.011123] s8 : 0000000000000000 s9 : 00000000000c62c0 s10: 00000000000e17ef
[ 65.023333] s11: 00000000000c6300 t3 : 0000000000000000 t4 : 000000000007ffc4
[ 65.035370] t5 : 0000000000000004 t6 : 0000000000000000
[ 65.044280] status: 0000000200004020 badaddr: ffffffe00080122c cause: 000000000000000c
[ 66.980385] mmcblk0: p1 p2
Segmentation fault
Loading FireMarshal platform drivers
[ 68.288304] modprobe[50]: unhandled signal 11 code 0x1 at 0xffffffe00080121c in
libc-2.29.so[3fc33a0000+fb000]
[ 68.305785] CPU: 0 PID: 50 Comm: modprobe Not tainted 5.7.0-rc3-58539-g5f5fd87b36e2 #1
[ 68.319394] epc: 0000003fc342069c ra : 00000000000186d8 sp : 0000003fffb2ccd0
[ 68.331559] gp : 00000000000e7d70 tp : 0000003fc34b57e0 t0 : 0000003fc33a3d58
[ 68.342915] t1 : 0000003fc342069c t2 : 00000000000e7940 s0 : 00000000000bab6e
[ 68.355288] s1 : 0000003fffb2ce48 a0 : 0000003fffb2cfbd a1 : 6c2d0065626f7270
[ 68.367533] a2 : 81030103017f0101 a3 : 0000000000000000 a4 : 000000000000002f
[ 68.379577] a5 : 0000003fffb2cfc8 a6 : 7efefefefefefeff a7 : 43022f4a4d405d5f
[ 68.390935] s2 : 00000000000e1838 s3 : 0000000000000000 s4 : 0000000000000000
[ 68.403270] s5 : 0000000000000008 s6 : 0000003fdb2cb7f0 s7 : 0000000000000002
[ 68.415515] s8 : 0000000000000014 s9 : 0000003fdb2cb7f0 s10: 00000000000e17ef
[ 68.426849] s11: 00000000000c6300 t3 : 0000000000000000 t4 : 000000000008069c
[ 68.439461] t5 : 0000000000000004 t6 : 0000000000000000
[ 68.448499] status: 8000000200006020 badaddr: ffffffe00080121c cause: 000000000000000c
Segmentation fault
[ 68.827364] modprobe[51]: unhandled signal 11 code 0x1 at 0xffffffe000801224 in busybox[10000+d6000]
[ 68.844167] CPU: 0 PID: 51 Comm: modprobe Not tainted 5.7.0-rc3-58539-g5f5fd87b36e2 #1
[ 68.856329] epc: 00000000000ae464 ra : 000000000003245c sp : 0000003fff86fad0
[ 68.867488] gp : 00000000000e7d70 tp : 0000003fd26037e0 t0 : 0000003fd24f1d58
[ 68.878735] t1 : 0000003fd2552f22 t2 : 00000000000e7940 s0 : 00000000000bb3c8
[ 68.890993] s1 : 0000003fff86fe48 a0 : 0000003fff86fe48 a1 : 00000000000bf8f8
[ 68.903218] a2 : 00000000000e3245 a3 : 00000000000009a0 a4 : 00000000000e9c00
[ 68.915448] a5 : 00000000000e9c00 a6 : 0000000000000004 a7 : 00000000000e9be0
[ 68.926668] s2 : 0000000000000002 s3 : 00000000000e9260 s4 : 0000000000000000
[ 68.938893] s5 : 0000000000000008 s6 : 0000003fdb2cb7f0 s7 : 0000000000000002
[ 68.951128] s8 : 0000000000000014 s9 : 0000003fdb2cb7f0 s10: 00000000000e17ef
[ 68.963356] s11: 00000000000c6300 t3 : 0000000000000000 t4 : 0000000000064f22
[ 68.975380] t5 : 0000000000000004 t6 : 0000000000000000
[ 68.984302] status: 8000000200006020 badaddr: ffffffe000801224 cause: 000000000000000c
Segmentation fault
umount: can't unmount /proc: Invalid argument
Calling distro init
[ 70.087691] init[1]: unhandled signal 11 code 0x1 at 0xffffffe000801c46 in
libc-2.29.so[3fbc19a000+fb000]
[ 70.103440] CPU: 0 PID: 1 Comm: init Not tainted 5.7.0-rc3-58539-g5f5fd87b36e2 #1
[ 70.115175] epc: 0000003fbc1fe046 ra : 0000003fbc23a3f2 sp : 0000003ffff0fd70
[ 70.127416] gp : 00000000000e7d70 tp : 0000003fbc2af7e0 t0 : 0000003fbc2b0198
[ 70.138762] t1 : 0000000000000002 t2 : 0000000000000000 s0 : 0000003ffff0fe58
[ 70.151083] s1 : 0000003ffff0ffc2 a0 : 0000003ffff0ffc2 a1 : 000000000000002f
[ 70.163400] a2 : 0000003ffff0fe68 a3 : 000000000000000b a4 : 0000003fbc29e012
[ 70.174745] a5 : 0000003fbc2b0824 a6 : 0000000000000003 a7 : 0000003fbc2b0270
[ 70.187078] s2 : 0000003ffff0fe68 s3 : 0000003ffff0fd98 s4 : 0000003ffff0fe68
[ 70.199401] s5 : fffffffffffffff8 s6 : 0000003fdb2cb7f0 s7 : 0000000000000000
[ 70.211227] s8 : 0000000000000000 s9 : 00000000000c62c0 s10: 00000000000e17ef
[ 70.223509] s11: 00000000000c6300 t3 : 0000000000000000 t4 : 0000000000000824
[ 70.234745] t5 : 0000000000000001 t6 : 0000000000000040
[ 70.244162] status: 0000000200004020 badaddr: ffffffe000801c46 cause: 000000000000000c
[ 70.268325] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 70.279063] CPU: 0 PID: 1 Comm: init Not tainted 5.7.0-rc3-58539-g5f5fd87b36e2 #1
[ 70.289014] Call Trace:
[ 70.293262] [<ffffffe000802430>] walk_stackframe+0x0/0xaa
[ 70.301084] [<ffffffe00080261c>] show_stack+0x2a/0x34
[ 70.308692] [<ffffffe000a7ec20>] dump_stack+0x6e/0x88
[ 70.316274] [<ffffffe000808126>] panic+0xf2/0x278
[ 70.323200] [<ffffffe00080a372>] do_exit+0x7a0/0x7b2
[ 70.330460] [<ffffffe00080af48>] do_group_exit+0x2a/0x7e
[ 70.338161] [<ffffffe0008130a8>] get_signal+0xbc/0x54c
[ 70.345635] [<ffffffe000801cc2>] do_notify_resume+0x5c/0x33e
[ 70.354009] [<ffffffe0008011aa>] ret_from_exception+0x0/0xc
[ 70.362275] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---