RISC-V Linux Priv 1.9

254 views
Skip to first unread message

Elias Kouskoumvekakis

unread,
Aug 4, 2016, 12:02:44 PM8/4/16
to RISC-V SW Dev
Hi all,

I'm trying to boot RISC-V Linux with spike using the latest priv1.9 branches of riscv-tools and riscv-linux.

My kernel uses an initramfs (cpio.gz) root I created from the riscv-poky repo. I then inserted the vmlinux image as a payload to bbl.

I see that the HTIF driver has been removed from the priv1.9 kernel and thus I changed the last line of riscv-poky's inittab to point to ttySBI0 (I saw the naming on the SBI console kernel driver) instead of the default ttyHTIF0.

=====
Inittab
=====

# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:5:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
H0:12345:respawn:/sbin/getty 38400 ttySBI0

===
Boot
===

When I boot this kernel on spike I get the following (it hangs until I terminate it with CTRL+C):

$ spike bbl
              vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
                  vvvvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvv 
rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvv   
rr                vvvvvvvvvvvvvvvvvvvvvv     
rr            vvvvvvvvvvvvvvvvvvvvvvvv      rr
rrrr      vvvvvvvvvvvvvvvvvvvvvvvvvv      rrrr
rrrrrr      vvvvvvvvvvvvvvvvvvvvvv      rrrrrr
rrrrrrrr      vvvvvvvvvvvvvvvvvv      rrrrrrrr
rrrrrrrrrr      vvvvvvvvvvvvvv      rrrrrrrrrr
rrrrrrrrrrrr      vvvvvvvvvv      rrrrrrrrrrrr
rrrrrrrrrrrrrr      vvvvvv      rrrrrrrrrrrrrr
rrrrrrrrrrrrrrrr      vv      rrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrr          rrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrr      rrrrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrrrr  rrrrrrrrrrrrrrrrrrrrrr

       INSTRUCTION SETS WANT TO BE FREE
[    0.000000] Linux version 4.1.26-g67628e0-dirty (lupo@gene) (gcc version 6.1.0 (GCC) ) #6 Thu Aug 4 02:51:35 EEST 2016
[    0.000000] Available physical memory: 1988MB
[    0.000000] Physical memory usage limited to 384MB
[    0.000000] Initial ramdisk at: 0xffffffff800135d8 (28008120 bytes)
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000081e00000-0x0000000099dfffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000081e00000-0x0000000099dfffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000081e00000-0x0000000099dfffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 96960
[    0.000000] Kernel command line: mem=384M
[    0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 356956K/393216K available (1833K kernel code, 96K rwdata, 400K rodata, 27432K init, 211K bss, 36260K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:0 nr_irqs:0 0
[    0.000000] clocksource riscv_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126044627 ns
[    0.000000] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=100000)
[    0.000000] pid_max: default: 32768 minimum: 301
[    0.000000] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[    0.000000] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[    0.000000] devtmpfs: initialized
[    0.000000] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.000000] NET: Registered protocol family 16
[    0.000000] Switched to clocksource riscv_clocksource
[    0.000000] NET: Registered protocol family 2
[    0.000000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] TCP: Hash tables configured (established 4096 bind 4096)
[    0.000000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.000000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.000000] NET: Registered protocol family 1
[    1.560000] Unpacking initramfs...
[    3.160000] console [sbi_console0] enabled
[    3.160000] futex hash table entries: 256 (order: 0, 6144 bytes)
[    3.170000] io scheduler noop registered
[    3.170000] io scheduler cfq registered (default)
[    3.170000] Warning: unable to open an initial console.
[    3.180000] Freeing unused kernel memory: 27432K (ffffffff80000000 - ffffffff81aca000)
: q


It seems that although spike and bbl boot the kernel fine, it can't use the SBI console driver to drop me a shell.

I must note that the older kernel (master branch of it along with riscv-tools) boots fine on spike and my Zedboard and I have even ported everything to work on the Parallella board for my GSoC project (https://github.com/eliaskousk/parallella-riscv).
So my riscv-poky  initramfs is probably not to be blamed for this behavior.

Is there something more I need to do to get a shell on the priv1.9 kernel after the boot? Or something totally different I am missing?

And one last question somewhat related:
Does the removal of HTIF from the priv 1.9 kernel means that it won't work on Zynq using an FPGA rocket core generated with the latest commit that the HTIF port was available (commit 255ef05 June 23rd)?
Can't the SBI console be used to communicate with fesvr via the HTIF port like the latest version pk does (priv1.9 branch of riscv-tools)?
Because I can run baremetal RISC-V programs with fesvr and latest version pk on Zynq but I can't boot RISC-V Linux priv 1.9 with fesvr and bbl (it hangs on the logo).

I'm a bit confused on these so please excuse my ignorance! The reason I am asking this and needing to use the priv1.9 versions of riscv-tools and riscv-linux, instead of the already working master ones, is that rocket-chip (e.g commit 255ef05) gives the ability to add extra AXI master MMIO ports (NExtMMIOAXIChannels chisel config option). This is something that I cannot do with my older generated core, using a stable commit from March, which works and boots RISC-V Linux (master branch) fine on ZedBoard and Parallella as I said above.

If I can't boot RISC-V Linux priv1.9 on spike or Zynq maybe I can stick with the older versions and add the extra AXI port somehow?


Thank you in advance for any help you can provide and sorry for the long post,
Elias
Reply all
Reply to author
Forward
0 new messages