Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version of LiteX #1

Open
troibe opened this issue Mar 16, 2022 · 24 comments
Open

Version of LiteX #1

troibe opened this issue Mar 16, 2022 · 24 comments

Comments

@troibe
Copy link

troibe commented Mar 16, 2022

Hi tongchen,
which version of LiteX were you using?
I tried reproducing your project but I'm stuck on the liftoff.
I saw enjoy-digital/litex#1212 and enjoy-digital/litex#1168 so there definitely seems to be some issue with current versions of LiteX if used with rocket.
Using the right (old) version probably helps with this issue.
Best wishes
Martin

@tongchen126
Copy link
Owner

@developandplay Thanks for the feedback. I will reproduce the process and see if there is some incompatibility.

@tongchen126
Copy link
Owner

@developandplay I guess the problem might be that the DTS file is not correctly specified. Specifically, the address of the uart address. A wrong uart address will make the kernel message nowhere to show thus you will see nothing after lift off. You may show me the content of your DTS file and csr.json file.

@troibe
Copy link
Author

troibe commented Mar 18, 2022 via email

@tongchen126
Copy link
Owner

@developandplay Yeah I forget to mention that I failed to build rocket bbl using the toolchain provided by the original steps. Then I use a riscv64-unknown-elf toolchain to build the bbl(forget from where I downloaded it). This toolchain which I used to build rocket bbl is uploaded here. You can try other toolchains as long as it is a 'elf' toolchain rather than 'linux' toolchain to build bbl.

@tongchen126
Copy link
Owner

@developandplay Sorry but I also stuck with liftoff using the latest litex, don't have a clue what changes have caused it...

@troibe
Copy link
Author

troibe commented Mar 19, 2022

Seems like my last message didn't get out.

Ok thanks for mentioning that.
I'll try another version of the toolchain then.
Also I managed to get up to INIT: No inittab.d directory found with your provided binary.
After that it seems to be stuck for some reason.

That being said I am using Rocket at 20Mhz and spi-sdcard because I couldn't get the boot to work at 100Mhz with the regular sdcard on my Arty board. Maybe that's why I'm running into issues later on. Did this work for you on the Arty or only on the Nexys video?

@troibe
Copy link
Author

troibe commented Mar 19, 2022

Also good to know that you are also facing issues with the current version. Maybe something broke that Florent can fix.

@troibe
Copy link
Author

troibe commented Mar 20, 2022

Went back to enjoy-digital/litex@c3b94a3 which seems to be working at 50Mhz and regular sdcard.
With that I managed to get to:
Using makefile-style concurrent boot in runlevel S.
Not sure if it is stuck or whether it will just take a long time.
Is your video real time or sped up?

@troibe
Copy link
Author

troibe commented Mar 20, 2022

Made some tiny progress:
Now I'm finally getting some error

Using makefile-style concurrent boot in runlevel S.
ERROR: could not open /proc/stat: No such file or directory

I know /proc is not a real file system anyways but did you encounter some similar issue?

@troibe
Copy link
Author

troibe commented Mar 20, 2022

So I'm now personally using the latest pre-built riscv toolchain and of course the right dts.
With that combination I think you should also have no issues with booting.

Seems like everything I was facing were toolchain issues.
Now of course the errors I described above seem more like Linux/Debian configuration issues...

@tongchen126
Copy link
Owner

@developandplay So you have booted rocket using the latest litex and toolchains without any tricky modification? That's great! If you have trouble booting Linux, maybe you can post some images of the Linux booting process and that may be helpful. Thanks.

@troibe
Copy link
Author

troibe commented Mar 20, 2022

Yep exactly. I attached the current console output that I'm getting.
The last line sometimes shows up and sometimes doesn't (but I guess that's only an issue related to when flushing happens).

The Starting hotplug events dispatcher: systemd-udevd line that appears next in your video I have not encountered so far.

lxterm /dev/ttyUSB2 

        __   _ __      _  __
       / /  (_) /____ | |/_/
      / /__/ / __/ -_)>  <
     /____/_/\__/\__/_/|_|
   Build your hardware, easily!

 (c) Copyright 2012-2022 Enjoy-Digital
 (c) Copyright 2007-2015 M-Labs

 BIOS built on Mar 20 2022 15:22:49
 BIOS CRC passed (8712d455)

 Migen git sha1: ac70301
 LiteX git sha1: f565bec7

--=============== SoC ==================--
CPU:            RocketRV64[imac] @ 50MHz
BUS:            WISHBONE 32-bit @ 4GiB
CSR:            32-bit data
ROM:            128KiB
SRAM:           8KiB
SDRAM:          262144KiB 16-bit @ 400MT/s (CL-7 CWL-5)

--========== Initialization ============--
Ethernet init...
Initializing SDRAM @0x80000000...
Switching SDRAM to software control.
Read leveling:
  m0, b00: |00000000000000000000000000000000| delays: -
  m0, b01: |11111111111111111111111111111000| delays: 14+-14
  m0, b02: |00000000000000000000000000000001| delays: 01+-02
  m0, b03: |00000000000000000000000000000000| delays: -
  m0, b04: |00000000000000000000000000000000| delays: -
  m0, b05: |00000000000000000000000000000000| delays: -
  m0, b06: |00000000000000000000000000000000| delays: -
  m0, b07: |00000000000000000000000000000000| delays: -
  best: m0, b01 delays: 14+-14
  m1, b00: |00000000000000000000000000000000| delays: -
  m1, b01: |11111111111111111111111111111000| delays: 14+-14
  m1, b02: |00000000000000000000000000000011| delays: 00+-02
  m1, b03: |00000000000000000000000000000000| delays: -
  m1, b04: |00000000000000000000000000000000| delays: -
  m1, b05: |00000000000000000000000000000000| delays: -
  m1, b06: |00000000000000000000000000000000| delays: -
  m1, b07: |00000000000000000000000000000000| delays: -
  best: m1, b01 delays: 14+-14
Switching SDRAM to hardware control.
Memtest at 0x80000000 (2.0MiB)...
  Write: 0x80000000-0x80200000 2.0MiB     
   Read: 0x80000000-0x80200000 2.0MiB     
Memtest OK
Memspeed at 0x80000000 (Sequential, 2.0MiB)...
  Write speed: 38.0MiB/s
   Read speed: 54.3MiB/s

--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
Timeout
Booting from SDCard in SD-Mode...
Booting from boot.json...
Copying boot.bin to 0x80000000 (17809576 bytes)...
[########################################]
Executing booted program at 0x80000000

--============= Liftoff! ===============--
bbl loader
              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 5.16.0-rc8 (root@ws) (riscv64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #2 SMP Fri Jan 7 13:28:11 HKT 2022
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Machine model: freechips,rocketchip-unknown
[    0.000000] earlycon: liteuart0 at I/O port 0x0 (options '')
[    0.000000] Malformed early option 'console'
[    0.000000] earlycon: liteuart0 at MMIO 0x0000000012006800 (options '')
[    0.000000] printk: bootconsole [liteuart0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x000000008fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x000000008fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x000000008fffffff]
[    0.000000] SBI specification v0.1 detected
[    0.000000] riscv: ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 13 pages/cpu s23896 r0 d29352 u53248
[    0.000000] pcpu-alloc: s23896 r0 d29352 u53248 alloc=13*4096
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64008
[    0.000000] Kernel command line: console=liteuart earlycon=liteuart,0x12006800 swiotlb=noforce root=/dev/mmcblk0p2 rootwait
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 239148K/260096K available (4319K kernel code, 4753K rwdata, 2048K rodata, 2115K init, 280K bss, 20948K reserved, 0K cma-reserved)
[    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]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@c000000: mapped 8 interrupts with 1 handlers for 2 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x4d4/0x6c6 with crng_init=0
[    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: 7052723233920 ns
[    0.000042] sched_clock: 64 bits at 500kHz, resolution 2000ns, wraps every 4398046511000ns
[    0.012654] Console: colour dummy device 128x32
[    0.017110] Calibrating delay loop (skipped), value calculated using timer frequency.. 1.00 BogoMIPS (lpj=5000)
[    0.027408] pid_max: default: 32768 minimum: 301
[    0.036602] LSM: Security Framework initializing
[    0.043316] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.050180] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.125476] ASID allocator disabled (0 bits)
[    0.134460] rcu: Hierarchical SRCU implementation.
[    0.148316] EFI services will not be available.
[    0.157714] smp: Bringing up secondary CPUs ...
[    0.161342] smp: Brought up 1 node, 1 CPU
[    0.178940] devtmpfs: initialized
[    0.245036] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.254940] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.276676] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.636232] pps_core: LinuxPPS API ver. 1 registered
[    0.640314] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.650134] PTP clock support registered
[    0.683714] clocksource: Switched to clocksource riscv_clocksource
[    1.010640] NET: Registered PF_INET protocol family
[    1.018830] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    1.046254] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.055458] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    1.064164] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    1.072080] TCP: Hash tables configured (established 2048 bind 2048)
[    1.081186] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.088236] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.099676] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    1.150010] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    1.757948] LiteX SoC Controller driver initialized
[    3.811748] 12006800.serial: ttyLXU0 at MMIO 0x0 (irq = 0, base_baud = 0) is a liteuart
[    3.824964] printk: console [liteuart0] enabled
[    3.824964] printk: console [liteuart0] enabled
[    3.833744] printk: bootconsole [liteuart0] disabled
[    3.833744] printk: bootconsole [liteuart0] disabled
[    4.059318] loop: module loaded
[    4.564154] liteeth 12001000.mac eth0: irq 2 slots: tx 2 rx 2 size 2048
[    4.619932] NET: Registered PF_INET6 protocol family
[    4.668620] Segment Routing with IPv6
[    4.672366] In-situ OAM (IOAM) with IPv6
[    4.678708] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    4.709506] NET: Registered PF_PACKET protocol family
[    4.855870] Waiting for root device /dev/mmcblk0p2...
[    4.946484] mmc0: new SDXC card at address aaaa
[    4.967272] mmcblk0: mmc0:aaaa SN64G 59.5 GiB 
[    4.997282]  mmcblk0: p1 p2
[    5.415632] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
[    5.427162] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    5.461902] devtmpfs: mounted
[    5.532376] Freeing unused kernel image (initmem) memory: 2112K
[    5.538532] Run /sbin/init as init process
[    5.542186]   with arguments:
[    5.545742]     /sbin/init
[    5.547830]   with environment:
[    5.550954]     HOME=/
[    5.553896]     TERM=linux
[    6.411634] random: fast init done
INIT: version 3.01 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.

@tongchen126
Copy link
Owner

@developandplay My first guess is that the configuration of the printk console is incorrect? Maybe you can write earlycon and console like this. I will try to get my rocket booting first then I will be able to test it.

@troibe
Copy link
Author

troibe commented Mar 20, 2022

Just changed earlycon and console but it seems like the result is pretty similar.

Seems like it made some more "progress" (It would only show up after I pressed CRTL+C though)
Maybe there are some permissions that I need to change other than the tmp and dev/null that you mentioned in your guide?

INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
touch: cannot touch '/var/log/dmesg': Read-only file system
chown: cannot access '/var/log/dmesg': No such file or directory
chmod: cannot access '/var/log/dmesg': No such file or directory
/etc/init.d/bootlogs: 35: cannot create /var/log/dmesg: Read-only file system
Starting enhanced syslogd: rsyslogd

To me it looks like the system non-deterministically enter either runlevel S or runlevel 2.

This is the furthest that runlevel S made it:

INIT: version 3.01 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.

@tongchen126
Copy link
Owner

@developandplay Seems like the filesystem is read-only or some permissions of the folders/files are not set correctly. You can execute ls -al to see if the folder on your second partition is read-only or not.

@tongchen126
Copy link
Owner

@developandplay I have rebuilt the bitstream and bbl using the latest litex/toolchains, and it booted into the login prompt. I guess you have to enable write access to some of the folders/files(have you tried this step?). See my filesystems mount options:

Screenshot from 2022-03-21 19-49-25

@tongchen126
Copy link
Owner

@developandplay I updated some parts of the dts file as this, according to how the latest litex generates dts file. Just to remind you as I don't know how much it will help.

@tongchen126
Copy link
Owner

@developandplay As litex has increased the number of rocket irq lines to eight, I have made a newer dts based on the generated original dts of rocket.
Here is its output:

        __   _ __      _  __
       / /  (_) /____ | |/_/
      / /__/ / __/ -_)>  <
     /____/_/\__/\__/_/|_|
   Build your hardware, easily!

 (c) Copyright 2012-2022 Enjoy-Digital
 (c) Copyright 2007-2015 M-Labs

 BIOS built on Mar 21 2022 18:09:04
 BIOS CRC passed (5a4e4348)

 Migen git sha1: ac70301
 LiteX git sha1: f5d4977d

--=============== SoC ==================--
CPU:		RocketRV64[imac] @ 100MHz
BUS:		WISHBONE 32-bit @ 4GiB
CSR:		32-bit data
ROM:		128KiB
SRAM:		8KiB
SDRAM:		524288KiB 16-bit @ 800MT/s (CL-7 CWL-5)

--========== Initialization ============--
Ethernet init...
Initializing SDRAM @0x80000000...
Switching SDRAM to software control.
Read leveling:
  m0, b00: |00000000000000000000000000000000| delays: -
  m0, b01: |10000000000000000000000000000000| delays: 02+-02
  m0, b02: |00111111111111110000000000000000| delays: 09+-07
  m0, b03: |00000000000000000011111111111110| delays: 24+-06
  m0, b04: |00000000000000000000000000000000| delays: -
  m0, b05: |00000000000000000000000000000000| delays: -
  m0, b06: |00000000000000000000000000000000| delays: -
  m0, b07: |00000000000000000000000000000000| delays: -
  best: m0, b02 delays: 09+-07
  m1, b00: |00000000000000000000000000000000| delays: -
  m1, b01: |10000000000000000000000000000000| delays: 02+-02
  m1, b02: |00111111111111111000000000000000| delays: 09+-07
  m1, b03: |00000000000000000001111111111111| delays: 25+-06
  m1, b04: |00000000000000000000000000000000| delays: -
  m1, b05: |00000000000000000000000000000000| delays: -
  m1, b06: |00000000000000000000000000000000| delays: -
  m1, b07: |00000000000000000000000000000000| delays: -
  best: m1, b02 delays: 09+-07
Switching SDRAM to hardware control.
Memtest at 0x80000000 (2.0MiB)...
  Write: 0x80000000-0x80200000 2.0MiB     
   Read: 0x80000000-0x80200000 2.0MiB     
Memtest OK
Memspeed at 0x80000000 (Sequential, 2.0MiB)...
  Write speed: 79.9MiB/s
   Read speed: 108.1MiB/s

--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
Timeout
Booting from SDCard in SD-Mode...
Booting from boot.json...
Copying boot.bin to 0x80000000 (17809576 bytes)...
[########################################]
Executing booted program at 0x80000000

--============= Liftoff! ===============--
bbl loader
[    0.000000] Linux version 5.16.0-rc8 (root@ws) (riscv64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #2 SMP Fri Jan 7 13:28:11 HKT 2022
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Machine model: freechips,rocketchip-unknown
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000] SBI specification v0.1 detected
[    0.000000] riscv: ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 13 pages/cpu s23896 r0 d29352 u53248
[    0.000000] pcpu-alloc: s23896 r0 d29352 u53248 alloc=13*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 128520
[    0.000000] Kernel command line: earlycon=sbi console=liteuart,115200 swiotlb=noforce root=/dev/mmcblk0p2 rootwait
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 496640K/522240K available (4319K kernel code, 4753K rwdata, 2048K rodata, 2115K init, 280K bss, 25600K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@c000000: mapped 8 interrupts with 4 handlers for 8 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x4d4/0x6c6 with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [3]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[    0.000010] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[    0.009830] Console: colour dummy device 128x32
[    0.013413] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=10000)
[    0.023467] pid_max: default: 32768 minimum: 301
[    0.029335] LSM: Security Framework initializing
[    0.033731] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.040105] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.070793] ASID allocator disabled (0 bits)
[    0.075418] rcu: Hierarchical SRCU implementation.
[    0.082190] EFI services will not be available.
[    0.089962] smp: Bringing up secondary CPUs ...
[    0.121421] smp: Brought up 1 node, 4 CPUs
[    0.130326] devtmpfs: initialized
[    0.153978] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.163000] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.174937] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.268794] pps_core: LinuxPPS API ver. 1 registered
[    0.272495] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.282272] PTP clock support registered
[    0.293790] clocksource: Switched to clocksource riscv_clocksource
[    0.401942] NET: Registered PF_INET protocol family
[    0.407595] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.425404] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.432904] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.441555] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.448885] TCP: Hash tables configured (established 4096 bind 4096)
[    0.455760] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.461390] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.470317] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.484277] workingset: timestamp_bits=46 max_order=17 bucket_order=0
[    0.601239] LiteX SoC Controller driver initialized
[    1.252535] 12006800.serial: ttyLXU0 at MMIO 0x0 (irq = 0, base_baud = 0) is a liteuart
[    1.264520] printk: console [liteuart0] enabled
[    1.264520] printk: console [liteuart0] enabled
[    1.273253] printk: bootconsole [sbi0] disabled
[    1.273253] printk: bootconsole [sbi0] disabled
[    1.349400] loop: module loaded
[    1.493161] liteeth 12001000.mac eth0: irq 2 slots: tx 2 rx 2 size 2048
[    1.511181] NET: Registered PF_INET6 protocol family
[    1.528948] Segment Routing with IPv6
[    1.531641] In-situ OAM (IOAM) with IPv6
[    1.536191] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.547878] NET: Registered PF_PACKET protocol family
[    1.612015] Waiting for root device /dev/mmcblk0p2...
[    1.853977] mmc0: new SDHC card at address aaaa
[    1.863012] mmcblk0: mmc0:aaaa TSBBH 3.69 GiB 
[    1.875818]  mmcblk0: p1 p2
[    1.910024] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[    1.916514] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[    2.324183] random: fast init done
[    3.114897] EXT4-fs (mmcblk0p2): recovery complete
[    3.124652] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
[    3.134277] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    3.144032] devtmpfs: mounted
[    3.175764] Freeing unused kernel image (initmem) memory: 2112K
[    3.180676] Run /sbin/init as init process
[    3.184723]   with arguments:
[    3.187521]     /sbin/init
[    3.190210]   with environment:
[    3.193337]     HOME=/
[    3.195845]     TERM=linux
INIT: version 3.01 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Starting hotplug events dispatcher: systemd-udevd.
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Waiting for /dev to be fully populated...done.
Activating swap...done.
[   27.318891] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: disabled.
Checking file systems...done.
Cleaning up temporary files... /tmp.
Mounting local filesystems...done.
Activating swapfile swap, if any...done.
Cleaning up temporary files....
[   37.901060] random: dd: uninitialized urandom read (512 bytes read)
Starting Setting kernel variables: sysctl.
Configuring network interfaces...Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/92:a6:21:50:27:8b
Sending on   LPF/eth0/92:a6:21:50:27:8b
Sending on   Socket/fallback
DHCPREQUEST for 192.168.1.215 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.215 from 192.168.1.1
bound to 192.168.1.215 -- renewal in 18504 seconds.
done.
Cleaning up temporary files....
Starting nftables: nonemnl.c:60: Unable to initialize Netlink socket: Protocol not supported
 failed!
startpar: service(s) returned failure: nftables ... failed!
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Starting enhanced syslogd: rsyslogd.
[   46.878539] random: dbus-daemon: uninitialized urandom read (12 bytes read)
[   47.124683] random: dbus-daemon: uninitialized urandom read (12 bytes read)
Starting periodic command scheduler: cron.
Starting system message bus: dbus.
Starting NTP server: ntpd.
Starting session management daemon: elogind.
[   50.354247] random: crng init done
Starting OpenBSD Secure Shell server: sshd
.

Debian GNU/Linux bookworm/sid rocket ttyLXU0

rocket login: root
Password: 
Linux rocket 5.16.0-rc8 #2 SMP Fri Jan 7 13:28:11 HKT 2022 riscv64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Mar 21 21:35:03 HKT 2022 on ttyLXU0
root@rocket:~# uname -a
Linux rocket 5.16.0-rc8 #2 SMP Fri Jan 7 13:28:11 HKT 2022 riscv64 GNU/Linux
root@rocket:~# ls -al /
total 68
drwxr-xr-x  18 root root  4096 Jan  7 15:00 .
drwxr-xr-x  18 root root  4096 Jan  7 15:00 ..
lrwxrwxrwx   1 root root     7 Jan  7 15:00 bin -> usr/bin
drwxr-xr-x   2 root root  4096 Jan  7 15:00 boot
drwxr-xr-x   7 root root 13160 Jan  1  1970 dev
drwxr-xr-x  66 root root  4096 Mar 21 21:43 etc
drwxr-xr-x   2 root root  4096 Jan  7 15:00 home
lrwxrwxrwx   1 root root     7 Jan  7 15:00 lib -> usr/lib
drwx------   2 root root 16384 Jan  7 15:00 lost+found
drwxr-xr-x   2 root root  4096 Jan  7 15:00 media
drwxr-xr-x   2 root root  4096 Jan  7 15:00 mnt
drwxr-xr-x   2 root root  4096 Jan  7 15:00 opt
dr-xr-xr-x 136 root root     0 Jan  1  1970 proc
drwx------   3 root root  4096 Jan  7 16:25 root
drwxr-xr-x  11 root root   500 Mar 21 21:44 run
lrwxrwxrwx   1 root root     8 Jan  7 15:00 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Jan  7 15:00 srv
dr-xr-xr-x  11 root root     0 Jan  1  1970 sys
drwxrwxrwt   2 root root  4096 Jan  1  1970 tmp
drwxr-xr-x  11 root root  4096 Jan  7 15:00 usr
drwxr-xr-x  11 root root  4096 Jan  7 15:00 var
root@rocket:~# cat /proc/mounts 
/dev/root / ext4 rw,relatime 0 0
devtmpfs /dev devtmpfs rw,relatime,size=248320k,nr_inodes=62080,mode=755 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=49876k,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=99740k 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=600,ptmxmode=000 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=49872k,nr_inodes=12468,mode=700 0 0
root@rocket:~# 

@troibe
Copy link
Author

troibe commented Mar 23, 2022 via email

@troibe
Copy link
Author

troibe commented Mar 23, 2022

@tongchen126
Which size/brand of sdcard are you using?
My mmcblk0p2 only ever gets mounted as read only on the FPGA but on my computer it mounts completly fine in read/write mode.

Some excerpts of boot attempts:

INIT: version 3.01 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Starting hotplug events dispatcher: systemd-udevdstart-stop-daemon: cannot create socket directory /run/.s-s-d-notify.RwqeBH (Read-only file system)
2 ... (warning).
Waiting 15 seconds and trying to continue anyway ... (warning).
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Waiting for /dev to be fully populated...done.
ln: failed to create symbolic link '/run/shm': Read-only file system
Activating swap...done.
[  242.186334] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: disabled.
Creating compatibility symlink from /etc/mtab to /proc/mounts. ... (warning).
-------
INIT: version 3.01 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Activating swap...done.
[   83.156374] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: disabled.
---------
INIT: version 3.01 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Starting hotplug events dispatcher: systemd-udevdstart-stop-daemon: cannot create socket directory /run/.s-s-d-notify.TBI2my (Read-only file system)
2 ... (warning).
Waiting 15 seconds and trying to continue anyway ... (warning).
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Waiting for /dev to be fully populated...done.

@troibe
Copy link
Author

troibe commented Mar 25, 2022

Just tried a new sdcard and I'm running into the same issues.

Just dropping into shell with init=/bin/bash works as expected on the Arty.
This is the output I'm getting for ls -la on the system:

total 64
drwxr-xr-x 17 root root  4096 Mar 25  2022 .
drwxr-xr-x 17 root root  4096 Mar 25  2022 ..
lrwxrwxrwx  1 root root     7 Mar 25  2022 bin -> usr/bin
drwxr-xr-x  2 root root  4096 Mar 25  2022 boot
drwxr-xr-x  2 root root 12620 Dec 31 23:00 dev
drwxr-xr-x 60 root root  4096 Dec 31  1969 etc
drwxr-xr-x  2 root root  4096 Mar 25  2022 home
lrwxrwxrwx  1 root root     7 Mar 25  2022 lib -> usr/lib
drwxr-xr-x  2 root root  4096 Mar 25  2022 media
drwxr-xr-x  2 root root  4096 Mar 25  2022 mnt
drwxr-xr-x  2 root root  4096 Mar 25  2022 opt
drwxr-xr-x  2 root root  4096 Mar 25  2022 proc
drwx------  2 root root  4096 Mar 25  2022 root
drwxr-xr-x  6 root root  4096 Dec 31  1969 run
lrwxrwxrwx  1 root root     8 Mar 25  2022 sbin -> usr/sbin
drwxr-xr-x  2 root root  4096 Mar 25  2022 srv
drwxr-xr-x  2 root root  4096 Mar 25  2022 sys
drwxrwxrwt  2 root root  4096 Mar 25  2022 tmp
drwxr-xr-x 11 root root  4096 Mar 25  2022 usr
drwxr-xr-x 11 root root  4096 Mar 25  2022 va

So I don't think the permissions were/are the issue.

@tongchen126
Copy link
Owner

tongchen126 commented Mar 26, 2022 via email

@tongchen126
Copy link
Owner

tongchen126 commented Mar 26, 2022 via email

@troibe
Copy link
Author

troibe commented Mar 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants