sifive / freedom-u-sdk

Freedom U Software Development Kit (FUSDK)
276 stars 127 forks source link

failed to boot linux #56

Closed xubaqian closed 6 years ago

xubaqian commented 6 years ago

freedom commit id cd9a525a662b9eaf27c14533159d723efcf4c184 freedom-u-sdk commit id 62ae153449574c6d9a9f83510e735ef632a3ef8b vivado 2016.4 Nothing went wrong during compilation. But when I boot linux, error message occurred

INIT
CMD0
CMD8
ACMD41
CMD58
CMD16
CMD18
LOADING  
BOOT
bbl loader

                SIFIVE, INC.

         5555555555555555555555555
        5555                   5555
       5555                     5555
      5555                       5555
     5555       5555555555555555555555
    5555       555555555555555555555555
   5555                             5555
  5555                               5555
 5555                                 5555
5555555555555555555555555555          55555
 55555           555555555           55555
   55555           55555           55555
     55555           5           55555
       55555                   55555
         55555               55555
           55555           55555
             55555       55555
               55555   55555
                 555555555
                   55555
                     5

           SiFive RISC-V Coreplex
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 4.15.0-00044-g2b0aa1d (xqz@cas) (gcc version 7.2.0 (GCC)) #3 SMP Tue May 15 15:34:10 CST 2018
[    0.000000] bootconsole [early0] enabled
[    0.000000] Initial ramdisk at: 0x        (ptrval) (9436160 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000]   Normal   [mem 0x00000000c0000000-0x00000bffffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] software IO TLB [mem 0xbb1fb000-0xbf1fb000] (64MB) mapped at [        (ptrval)-        (ptrval)]
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: Embedded 14 pages/cpu @        (ptrval) s28632 r0 d28712 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258055
[    0.000000] Kernel command line: 
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 950092K/1046528K available (3110K kernel code, 215K rwdata, 856K rodata, 9379K init, 780K bss, 96436K reserved, )
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU event tracing is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] riscv,cpu_intc,0: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,1: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,2: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,3: 64 local interrupts mapped
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 3 PID: 0 at /home/xqz/sifive/freedom-u-sdk/linux/drivers/irqchip/irq-riscv-intc.c:158 riscv_irq_enable+0x94
[    0.000000] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.15.0-00044-g2b0aa1d #3
[    0.000000] Call Trace:
[    0.000000] [<        (ptrval)>] walk_stackframe+0x0/0xa2
[    0.000000] [<        (ptrval)>] show_stack+0x26/0x34
[    0.000000] [<        (ptrval)>] dump_stack+0x5e/0x7c
[    0.000000] [<        (ptrval)>] __warn+0xc6/0xdc
[    0.000000] [<        (ptrval)>] warn_slowpath_null+0x2c/0x3e
[    0.000000] [<        (ptrval)>] riscv_irq_enable+0x8e/0x94
[    0.000000] [<        (ptrval)>] irq_enable+0x3a/0x6a
[    0.000000] [<        (ptrval)>] __irq_startup+0x80/0x88
[    0.000000] [<        (ptrval)>] irq_startup+0x4e/0xe2
[    0.000000] [<        (ptrval)>] irq_activate_and_startup+0x1c/0x28
[    0.000000] [<        (ptrval)>] __irq_do_set_handler+0x6e/0x134
[    0.000000] [<        (ptrval)>] irq_set_chained_handler_and_data+0x2c/0x4a
[    0.000000] [<        (ptrval)>] plic_init+0x1ea/0x316
[    0.000000] [<        (ptrval)>] of_irq_init+0x136/0x252
[    0.000000] [<        (ptrval)>] irqchip_init+0x10/0x1c
[    0.000000] [<        (ptrval)>] init_IRQ+0x8/0x14
[    0.000000] [<        (ptrval)>] start_kernel+0x20a/0x350
[    0.000000] [<        (ptrval)>] _sinittext+0x4e/0x56
[    0.000000] random: get_random_bytes called from print_oops_end_marker+0x3a/0x52 with crng_init=0
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] riscv,plic0,c000000: mapped 7 interrupts to 4/8 handlers
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.000125] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.009300] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=10000)
[    0.019413] pid_max: default: 32768 minimum: 301
[    0.026667] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.033720] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.067048] Hierarchical SRCU implementation.
[    0.084172] smp: Bringing up secondary CPUs ...
[    0.098377] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.109161] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.131541] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.142329] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.163958] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.174743] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.185514] smp: Brought up 1 node, 4 CPUs
[    0.199657] devtmpfs: initialized
[    0.234821] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.244681] futex hash table entries: 1024 (order: 4, 65536 bytes)
[   15.762629] ------------[ cut here ]------------
[   15.767487] WARNING: CPU: 3 PID: 1 at /home/xqz/sifive/freedom-u-sdk/linux/mm/page_alloc.c:3926 __alloc_pages_nodemask+0x130/0x8da
[   15.779099] CPU: 3 PID: 1 Comm: swapper/3 Tainted: G        W        4.15.0-00044-g2b0aa1d #3
[   15.787177] Call Trace:
[   15.789814] [<        (ptrval)>] walk_stackframe+0x0/0xa2
[   15.795136] [<        (ptrval)>] show_stack+0x26/0x34
[   15.800190] [<        (ptrval)>] dump_stack+0x5e/0x7c
[   15.805200] [<        (ptrval)>] __warn+0xc6/0xdc
[   15.809908] [<        (ptrval)>] warn_slowpath_null+0x2c/0x3e
[   15.815698] [<        (ptrval)>] __alloc_pages_nodemask+0x12c/0x8da
[   15.821938] [<        (ptrval)>] kmalloc_order+0x12/0x52
[   15.827254] [<        (ptrval)>] __kmalloc+0x122/0x156
[   15.832358] [<        (ptrval)>] __register_sysctl_table+0x4a/0x450
[   15.838602] [<        (ptrval)>] register_sysctl+0x14/0x20
[   15.844129] [<        (ptrval)>] net_sysctl_init+0x1e/0x68
[   15.849564] [<        (ptrval)>] sock_init+0xa/0xa0
[   15.854437] [<        (ptrval)>] do_one_initcall+0x6c/0xf8
[   15.859921] [<        (ptrval)>] kernel_init_freeable+0x126/0x1be
[   15.866077] [<        (ptrval)>] kernel_init+0xe/0xf0
[   15.871079] [<        (ptrval)>] ret_from_syscall+0xa/0xe
[   15.876871] ---[ end trace 28977a436e0715df ]---
[   15.884523] NET: Registered protocol family 16
[   15.889207] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
[   15.897452] Oops [#1]
[   15.899770] CPU: 3 PID: 1 Comm: swapper/3 Tainted: G        W        4.15.0-00044-g2b0aa1d #3
[   15.908256] sepc: ffffffe000b97290 ra : ffffffe000b97bfc sp : ffffffe03a679be0
[   15.915470]  gp : ffffffe000d3ea80 tp : ffffffe03a670000 t0 : ffffffe03a6460c0
[   15.922690]  t1 : 0000000200000022 t2 : ffffffe03a679c70 s0 : ffffffe03a679c00
[   15.929905]  s1 : ffffffe03a679c28 a0 : 0000000000000010 a1 : 0000000000000002
[   15.937126]  a2 : 0000000000000000 a3 : ffffffe03a679c28 a4 : 0000000000000000
[   15.944354]  a5 : 0000000000000000 a6 : ffffffe000deb770 a7 : 000000003a661000
[   15.951568]  s2 : 0000000000000002 s3 : 0000000000000000 s4 : 0000000000000000
[   15.958800]  s5 : ffffffe000d33430 s6 : ffffffe000d40050 s7 : 000000000000001f
[   15.966024]  s8 : ffffffe000c75270 s9 : 00000000000000d8 s10: ffffffe000d3eb68
[   15.973238]  s11: 0000000000000000 t3 : 000000000001e3c8 t4 : 000000000001e3c8
[   15.980446]  t5 : 0000000000000000 t6 : ffffffe03a646095
[   15.985774] sstatus: 0000000200000120 sbadaddr: 0000000000000008 scause: 000000000000000d
[   15.994327] ---[ end trace 28977a436e0715e0 ]---
[   15.998715] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[   15.998715] 
terpstra commented 6 years ago

Right. This is probably because the current kernel does not support the DTS output by the current freedom repository. We need to fix this.

terpstra commented 6 years ago

The bug is actually in the freedom repository, which we are also currently working on, so we will fix it there in the next week.

xubaqian commented 6 years ago

@terpstra Thanks, sir. I found the newest freedom commits on May 16, 2018 still didn't work. Would you please remind me when you fix this bug? Thanks again!

terpstra commented 6 years ago

Yeah, sorry for my overly optimistic time estimate. It seems this is probably not going to happen immediately. If you want to diagnose it yourself, try to find out which function the kernel is crashing in from the sepc register. We would like to ideally convert our existing boot process from the HiFive Unleashed boards to also work on the FPGA, but I'm not sure when someone will take up this task.

xubaqian commented 6 years ago

@terpstra OK. So is there any earlier commit available? Even in 2017.

xubaqian commented 6 years ago

@terpstra Well, I have found one and it works. Thanks