OpenWRT doesn't boot - linux

I have a RT5350F router device (Hardware is almost the same as Nexx WT1520). It used to run Zyxel Keenetic 4G II firmware, and now I decided to reflash OpenWRT to it.
I tried a lot of versions, and all of them don't boot any further than this:
U-Boot 1.1.3 (Apr 11 2013 - 00:10:51)
Board: Ralink APSoC DRAM: 16 MB
relocate_code Pointer at: 80fb4000
spi_wait_nsec: 42
spi device id: c2 20 16 c2 20 (2016c220)
find flash: MX25L3205D
raspi_read: from:30000 len:1000
.*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 3.6.0.0
--------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 128 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 16 MBytes
Flash component: SPI Flash
Date:Apr 11 2013 Time:00:10:51
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ ####
estimate memory size =16 Mbytes
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP. 0
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
. Image Name: MIPS OpenWrt Linux-3.18.45
Created: 2017-03-05 12:30:01 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1087633 Bytes = 1 MB
Load Address: 80000000
Entry Point: 80000000
raspi_read: from:50040 len:109891
................. Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 16
Starting kernel ...
[ 0.000000] Linux version 3.18.45 (wayfarer#VirtualBox) (gcc version 4.8.3 (O penWrt/Linaro GCC 4.8-2014.04 r49389) ) #3 Sun Mar 5 14:29:13 EET 2017
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is Nexx WT1520
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 # 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x00000000-0x01ffffff]
I reflashed U-boot as well, which didn't really help.
Some other OpenWRT firmwares boot, but crash right away, saying "Not enough RAM".

Related

QEMU Linux Kernel Panic With BusyBox

I am following this guide to run a minimal linux kernel on top of QEMU, and keep running into the same issue. I have also tried other similar tutorials and end up with the same panic. Since the panic seems to be related to the /init script, I have tried swapping this out with a (statically linked) binary but still end up with the panic. The only thing I have done differently from the tutorial is using the latest stable version of BusyBox (currently 1.34.1). The text of the panic is here and linked below. If anyone has any insight on this that would be great!
Linux version 5.15.0+ (michael#tree) (gcc (Gentoo Hardened 10.3.0-r2 p3) 10.3.0, GNU ld (G1
Command line: console=ttyS0
x86/fpu: x87 FPU will use FXSAVE
signal: max sigframe size: 1040
BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x0000000007fdffff] usable
BIOS-e820: [mem 0x0000000007fe0000-0x0000000007ffffff] reserved
BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
NX (Execute Disable) protection: active
SMBIOS 2.8 present.
DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014
tsc: Fast TSC calibration using PIT
tsc: Detected 3992.482 MHz processor
last_pfn = 0x7fe0 max_arch_pfn = 0x400000000
x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT
found SMP MP-table at [mem 0x000f5c80-0x000f5c8f]
RAMDISK: [mem 0x07cf6000-0x07fdffff]
Zone ranges:
DMA [mem 0x0000000000001000-0x0000000000ffffff]
DMA32 [mem 0x0000000001000000-0x0000000007fdffff]
Normal empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000000001000-0x000000000009efff]
node 0: [mem 0x0000000000100000-0x0000000007fdffff]
Initmem setup node 0 [mem 0x0000000000001000-0x0000000007fdffff]
On node 0, zone DMA: 1 pages in unavailable ranges
On node 0, zone DMA: 97 pages in unavailable ranges
On node 0, zone DMA32: 32 pages in unavailable ranges
Intel MultiProcessor Specification v1.4
MPTABLE: OEM ID: BOCHSCPU
MPTABLE: Product ID: 0.1
MPTABLE: APIC at: 0xFEE00000
Processor #0 (Bootup-CPU)
IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
Processors: 1
[mem 0x08000000-0xfffbffff] available for PCI devices
clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 764551s
Built 1 zonelists, mobility grouping on. Total pages: 31968
Kernel command line: console=ttyS0
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 114084K/130552K available (4097K kernel code, 768K rwdata, 484K rodata, 532K init,)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS: 4352, nr_irqs: 48, preallocated irqs: 16
Console: colour VGA+ 80x25
printk: console [ttyS0] enabled
APIC: Switch to symmetric I/O mode setup
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x73193cf9da3, max_idle_ns: 8s
Calibrating delay loop (skipped), value calculated using timer frequency.. 7984.96 BogoMIP)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
CPU: AMD QEMU Virtual CPU version 2.5+ (family: 0x6, model: 0x6, stepping: 0x3)
Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
Spectre V2 : Spectre mitigation: kernel not compiled with retpoline; no mitigation availab!
Speculative Store Bypass: Vulnerable
Performance Events: PMU not available due to virtualization, using software events only.
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417851000s
futex hash table entries: 256 (order: 0, 6144 bytes, linear)
clocksource: Switched to clocksource tsc-early
platform rtc_cmos: registered platform RTC device (no PNP device found)
Unpacking initramfs...
workingset: timestamp_bits=62 max_order=15 bucket_order=0
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
random: get_random_bytes called from init_oops_id+0x2f/0x40 with crng_init=0
sched_clock: Marking stable (333996480, 16836404)->(354705829, -3872945)
Freeing initrd memory: 2984K
Freeing unused kernel image (initmem) memory: 532K
Write protecting the kernel read-only data: 8192k
Freeing unused kernel image (text/rodata gap) memory: 2044K
Freeing unused kernel image (rodata/data gap) memory: 1564K
Run /init as init process
Failed to execute /init (error -13)
Run /sbin/init as init process
Run /etc/init as init process
Run /bin/init as init process
Run /bin/sh as init process
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. Se.
CPU: 0 PID: 1 Comm: swapper Not tainted 5.15.0+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014
Call Trace:
<TASK>
dump_stack+0x20/0x22
panic+0xd0/0x246
? rest_init+0x90/0x90
kernel_init+0xfc/0x100
ret_from_fork+0x1f/0x30
</TASK>
Kernel Offset: disabled
---[ end Kernel panic - not syncing: No working init found. Try passing init= option to k-
QEMU 6.0.0 monitor - type 'help' for more information
(qemu) quit
Additionally, I have actually tried very similar steps on a completely different computer, so I'm pretty sure there is something I am missing in-general. Both machines are running Gentoo but I have successfully used QEMU to emulate other existing operating systems on both devices (so I think I can exclude a missing kernel configuration)?
Add execute mode to /init file before you build CPIO initramfs:
chmod +x <path-to-your-initrd-root>/init

Linux kernel fails to detect rootfs from SD card while booting

I am trying to manually build a mainline kernel and boot in Pine64_Plus board.
Linux kernel unable to mount the boot partition. And wierdly it doesn't display any partition under available partition in boot log.
I did the below steps.
Cloned the linux mainline git repo
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git --depth=1
Installed the cross compiler tool chain.
and then..
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 Image
Generated the dtb
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 dtbs
Generated the kernel modules
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j4 modules
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=ker_mod_temp_dir make modules modules_install
Partitioned the SD card like below
I kept the MLO, Uboot and firmware files in the boot partition.
I downloaded the ArchLinux rootfs from here
I copied the downloaded rootfs to the ROOTFS partition of my SD card.
sudo cp -rT <path-to-downloaded-rootfs> /media/user/ROOTFS
I copied the linux image and dts folder from /arch/arm64/boot to boot folder in the rootfs.
I copied the kernel modules to roots
sudo cp -rT ker_mod_temp_dir /media/user/ROOTFS/lib
I tried to boot the board with the SD card.
Uboot successfully boots up. I gave the below commands in Uboot to load the kernel.
setenv kernel_addr_r 0x42000000
setenv dtb_addr_r 0x48000000
ext4load mmc 0:2 $kernel_addr_r /boot/Image
ext4load mmc 0:2 $dtb_addr_r /boot/dts/allwinner/sun50i-a64-pine64-plus.dtb
setenv bootargs console=ttyS0,115200 earlyprintk ignore_loglevel root=/dev/mmcblk0p2 rootfstype=ext4 rw
booti $kernel_addr_r - $dtb_addr_r
Linux kernel boots but it ends with error - [ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
Boot log
sunxi#booti $kernel_addr_r - $dtb_addr_r
## Flattened Device Tree blob at 48000000
Booting using the fdt blob at 0x48000000
Loading Device Tree to 44ff7000, end 44fffba9 ... OK
Starting kernel ...
[mmc]: MMC Device 2 not found
[mmc]: mmc 2 not find, so not exit
INFO: BL3-1: Next image address = 0x41080000
INFO: BL3-1: Next image spsr = 0x3c9
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.4.0-rc3 (janani#janani-Vostro-2520) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #2 SMP PREEMPT Fri Nov 1 13:01:35 IST 2019
[ 0.000000] Machine model: Pine64+
[ 0.000000] printk: debug: ignoring loglevel setting.
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x000000007e000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000041000000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x7dde6800-0x7dde7fff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000041000000-0x000000007fffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000041000000-0x000000007fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000041000000-0x000000007fffffff]
[ 0.000000] On node 0 totalpages: 258048
[ 0.000000] DMA32 zone: 4032 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 258048 pages, LIFO batch:63
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv0.2 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: Trusted OS migration not required
[ 0.000000] percpu: Embedded 22 pages/cpu s52952 r8192 d28968 u90112
[ 0.000000] pcpu-alloc: s52952 r8192 d28968 u90112 alloc=22*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] CPU features: detected: ARM erratum 843419
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 254016
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk ignore_loglevel root=/dev/mmcblk0p2 rootfstype=ext4 rw
[ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 952956K/1032192K available (12156K kernel code, 1860K rwdata, 6420K rodata, 5056K init, 452K bss, 46468K reserved, 32768K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[ 0.000000] Tasks RCU enabled.
[ 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=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] random: get_random_bytes called from start_kernel+0x2b8/0x458 with crng_init=0
[ 0.000000] arch_timer: Enabling global workaround for Allwinner erratum UNKNOWN1
[ 0.000000] arch_timer: CPU0: Trapping CNTVCT access
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000004] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000656] Console: colour dummy device 80x25
[ 0.000738] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[ 0.000748] pid_max: default: 32768 minimum: 301
[ 0.000829] LSM: Security Framework initializing
[ 0.000889] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.000903] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.024021] ASID allocator initialised with 32768 entries
[ 0.032014] rcu: Hierarchical SRCU implementation.
[ 0.041639] EFI services will not be available.
[ 0.048045] smp: Bringing up secondary CPUs ...
[ 5.092138] CPU1: failed to come online
[ 5.092145] CPU1: failed in unknown state : 0x0
[ 10.216301] CPU2: failed to come online
[ 10.216308] CPU2: failed in unknown state : 0x0
[ 15.340451] CPU3: failed to come online
[ 15.340457] CPU3: failed in unknown state : 0x0
[ 15.340505] smp: Brought up 1 node, 1 CPU
[ 15.340510] SMP: Total of 1 processors activated.
[ 15.340521] CPU features: detected: 32-bit EL0 Support
[ 15.340531] CPU features: detected: CRC32 instructions
[ 15.346286] CPU: All CPU(s) started at EL2
[ 15.346311] alternatives: patching kernel code
[ 15.347526] devtmpfs: initialized
[ 15.353004] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 15.353025] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 15.354219] pinctrl core: initialized pinctrl subsystem
[ 15.355443] DMI not present or invalid.
[ 15.355817] NET: Registered protocol family 16
[ 15.357162] DMA: preallocated 256 KiB pool for atomic allocations
[ 15.357176] audit: initializing netlink subsys (disabled)
[ 15.358361] cpuidle: using governor menu
[ 15.358626] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 15.359812] Serial: AMBA PL011 UART driver
[ 15.364601] audit: type=2000 audit(15.344:1): state=initialized audit_enabled=0 res=1
[ 15.380908] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[ 15.380920] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[ 15.380926] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 15.380933] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[ 15.388682] cryptd: max_cpu_qlen set to 1000
[ 15.401330] ACPI: Interpreter disabled.
[ 15.404770] iommu: Default domain type: Translated
[ 15.404955] vgaarb: loaded
[ 15.405266] SCSI subsystem initialized
[ 15.408762] libata version 3.00 loaded.
[ 15.409025] usbcore: registered new interface driver usbfs
[ 15.409065] usbcore: registered new interface driver hub
[ 15.409108] usbcore: registered new device driver usb
[ 15.409680] pps_core: LinuxPPS API ver. 1 registered
[ 15.409686] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
[ 15.409701] PTP clock support registered
[ 15.409802] EDAC MC: Ver: 3.0.0
[ 15.416828] FPGA manager framework
[ 15.416910] Advanced Linux Sound Architecture Driver Initialized.
[ 15.417650] clocksource: Switched to clocksource arch_sys_counter
[ 15.417813] VFS: Disk quotas dquot_6.6.0
[ 15.417869] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 15.418051] pnp: PnP ACPI: disabled
[ 15.423643] thermal_sys: Registered thermal governor 'step_wise'
[ 15.423647] thermal_sys: Registered thermal governor 'power_allocator'
[ 15.423942] NET: Registered protocol family 2
[ 15.424316] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[ 15.424342] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 15.424417] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[ 15.424565] TCP: Hash tables configured (established 8192 bind 8192)
[ 15.424669] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 15.424699] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 15.424834] NET: Registered protocol family 1
[ 15.437311] RPC: Registered named UNIX socket transport module.
[ 15.437317] RPC: Registered udp transport module.
[ 15.437322] RPC: Registered tcp transport module.
[ 15.437326] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 15.437338] PCI: CLS 0 bytes, default 64
[ 15.438134] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[ 15.438351] kvm [1]: IPA Size Limit: 40bits
[ 15.439050] kvm [1]: vgic interrupt IRQ1
[ 15.439134] kvm [1]: Hyp mode initialized successfully
[ 15.445931] Initialise system trusted keyrings
[ 15.446070] workingset: timestamp_bits=44 max_order=18 bucket_order=0
[ 15.453479] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 15.458294] NFS: Registering the id_resolver key type
[ 15.458319] Key type id_resolver registered
[ 15.458323] Key type id_legacy registered
[ 15.458335] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 15.458518] 9p: Installing v9fs 9p2000 file system support
[ 15.474148] Key type asymmetric registered
[ 15.474156] Asymmetric key parser 'x509' registered
[ 15.474191] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[ 15.474198] io scheduler mq-deadline registered
[ 15.474204] io scheduler kyber registered
[ 15.475689] sun50i-de2-bus 1000000.bus: Error couldn't map SRAM to device
[ 15.476383] sun4i-usb-phy 1c19400.phy: failed to get clock usb0_phy
[ 15.482035] sun50i-a64-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[ 15.489405] EINJ: ACPI disabled.
[ 15.502212] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 15.504391] SuperH (H)SCI(F) driver initialized
[ 15.504889] msm_serial: driver initialized
[ 15.513007] loop: module loaded
[ 15.517237] libphy: Fixed MDIO Bus: probed
[ 15.517519] tun: Universal TUN/TAP device driver, 1.6
[ 15.518323] thunder_xcv, ver 1.0
[ 15.518361] thunder_bgx, ver 1.0
[ 15.518396] nicpf, ver 1.0
[ 15.518923] hclge is initializing
[ 15.518930] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[ 15.518935] hns3: Copyright (c) 2017 Huawei Corporation.
[ 15.518990] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 15.518994] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 15.519031] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[ 15.519036] igb: Copyright (c) 2007-2014 Intel Corporation.
[ 15.519073] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[ 15.519079] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[ 15.519367] sky2: driver version 1.30
[ 15.519963] VFIO - User Level meta-driver version: 0.3
[ 15.525385] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 15.525393] ehci-pci: EHCI PCI platform driver
[ 15.525431] ehci-platform: EHCI generic platform driver
[ 15.525709] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 15.525733] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 15.525833] ehci-platform 1c1a000.usb: irq 17, io mem 0x01c1a000
[ 15.541660] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 15.542245] hub 1-0:1.0: USB hub found
[ 15.542273] hub 1-0:1.0: 1 port detected
[ 15.542788] ehci-orion: EHCI orion driver
[ 15.542933] ehci-exynos: EHCI EXYNOS driver
[ 15.543017] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 15.543039] ohci-pci: OHCI PCI platform driver
[ 15.543101] ohci-platform: OHCI generic platform driver
[ 15.543243] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 15.543262] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 15.543356] ohci-platform 1c1a400.usb: irq 18, io mem 0x01c1a400
[ 15.606146] hub 2-0:1.0: USB hub found
[ 15.606173] hub 2-0:1.0: 1 port detected
[ 15.606637] ohci-exynos: OHCI EXYNOS driver
[ 15.607181] usbcore: registered new interface driver usb-storage
[ 15.610102] sun6i-rtc 1f00000.rtc: registered as rtc0
[ 15.610111] sun6i-rtc 1f00000.rtc: RTC enabled
[ 15.610335] i2c /dev entries driver
[ 15.614705] sdhci: Secure Digital Host Controller Interface driver
[ 15.614711] sdhci: Copyright(c) Pierre Ossman
[ 15.615069] Synopsys Designware Multimedia Card Interface Driver
[ 15.615953] sdhci-pltfm: SDHCI platform and OF driver helper
[ 15.617242] ledtrig-cpu: registered to indicate activity on CPUs
[ 15.618422] usbcore: registered new interface driver usbhid
[ 15.618428] usbhid: USB HID core driver
[ 15.624090] NET: Registered protocol family 17
[ 15.624260] 9pnet: Installing 9P2000 support
[ 15.624313] Key type dns_resolver registered
[ 15.624694] registered taskstats version 1
[ 15.624700] Loading compiled-in X.509 certificates
[ 15.637906] sun50i-a64-r-pinctrl 1f02c00.pinctrl: 1f02c00.pinctrl supply vcc-pl not found, using dummy regulator
[ 15.638123] sunxi-rsb 1f03400.rsb: RSB running at 3030303 Hz
[ 15.638499] axp20x-rsb sunxi-rsb-3a3: AXP20x variant AXP803 found
[ 15.650253] dcdc1: supplied by regulator-dummy
[ 15.650589] dcdc2: supplied by regulator-dummy
[ 15.650808] dcdc4: supplied by regulator-dummy
[ 15.651048] dcdc5: supplied by regulator-dummy
[ 15.651111] vcc-dram: Bringing 1500000uV into 1360000-1360000uV
[ 15.651308] dcdc6: supplied by regulator-dummy
[ 15.651509] dc1sw: supplied by regulator-dummy
[ 15.651697] aldo1: supplied by regulator-dummy
[ 15.651903] aldo2: supplied by regulator-dummy
[ 15.652139] aldo3: supplied by regulator-dummy
[ 15.652380] dldo1: supplied by regulator-dummy
[ 15.652598] dldo2: supplied by regulator-dummy
[ 15.652814] dldo3: supplied by regulator-dummy
[ 15.653048] dldo4: supplied by regulator-dummy
[ 15.653277] eldo1: supplied by regulator-dummy
[ 15.653506] eldo2: supplied by regulator-dummy
[ 15.653768] eldo3: supplied by regulator-dummy
[ 15.653995] fldo1: supplied by regulator-dummy
[ 15.654231] fldo2: supplied by regulator-dummy
[ 15.654484] rtc-ldo: supplied by regulator-dummy
[ 15.654666] ldo-io0: supplied by regulator-dummy
[ 15.654876] ldo-io1: supplied by regulator-dummy
[ 15.655073] axp20x-rsb sunxi-rsb-3a3: AXP20X driver loaded
[ 15.659737] sun50i-a64-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 15.660680] sun50i-a64-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[ 15.661132] printk: console [ttyS0] disabled
[ 15.681709] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 26, base_baud = 1500000) is a U6_16550A
[ 16.928325] printk: console [ttyS0] enabled
[ 16.934096] ehci-platform 1c1b000.usb: EHCI Host Controller
[ 16.939689] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 3
[ 16.947533] ehci-platform 1c1b000.usb: irq 19, io mem 0x01c1b000
[ 16.965665] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00
[ 16.972292] hub 3-0:1.0: USB hub found
[ 16.976092] hub 3-0:1.0: 1 port detected
[ 16.981558] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[ 16.988223] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 4
[ 16.996091] ohci-platform 1c1b400.usb: irq 20, io mem 0x01c1b400
[ 17.066206] hub 4-0:1.0: USB hub found
[ 17.069997] hub 4-0:1.0: 1 port detected
[ 17.075561] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 17.086998] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 17.092774] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[ 17.101105] hub 5-0:1.0: USB hub found
[ 17.104901] hub 5-0:1.0: 1 port detected
[ 17.111036] sun50i-a64-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-ph not found, using dummy regulator
[ 17.123109] sun50i-a64-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[ 17.133728] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 17.163428] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[ 17.172748] sun6i-rtc 1f00000.rtc: setting system clock to 1970-01-01T00:01:49 UTC (109)
[ 17.181341] ALSA device list:
[ 17.184340] No soundcards found.
[ 17.188171] VFS: Cannot open root device "mmcblk0p2" or unknown-block(0,0): error -6
[ 17.195947] Please append a correct "root=" boot option; here are the available partitions:
[ 17.204326] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 17.212579] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc3 #2
[ 17.218748] Hardware name: Pine64+ (DT)
[ 17.222577] Call trace:
[ 17.225026] dump_backtrace+0x0/0x150
[ 17.228685] show_stack+0x14/0x20
[ 17.231997] dump_stack+0xb0/0xf8
[ 17.235308] panic+0x16c/0x37c
[ 17.238360] mount_block_root+0x1b0/0x2a8
[ 17.242362] mount_root+0x144/0x178
[ 17.245845] prepare_namespace+0x138/0x19c
[ 17.249935] kernel_init_freeable+0x22c/0x24c
[ 17.254287] kernel_init+0x10/0x108
[ 17.257772] ret_from_fork+0x10/0x18
[ 17.261348] Kernel Offset: disabled
[ 17.264831] CPU features: 0x0002,24002004
[ 17.268832] Memory Limit: none
[ 17.271888] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
The below line
Please append a correct "root=" boot option; here are the available partitions:
doesn't display any partition. What could be the reason?
mmc drivers are selected in the config as below
CONFIG_MMC_BLOCK=y and CONFIG_MMC_SUNXI=y
What am i doing wrong?
Try adding the kernel command line option rootwait to bootargs so that the kernel does not immediately give-up and instead waits forever hoping the root filesystem appears. It might be that kernel did not wait long enough during boot-up for the SD card to appear.
[mmc]: MMC Device 2 not found
[mmc]: mmc 2 not find, so not exit
...
Kernel command line: console=ttyS0,115200 earlyprintk ignore_loglevel root=/dev/mmcblk0p2 rootfstype=ext4 rw
...
VFS: Cannot open root device "mmcblk0p2" or unknown-block(0,0): error -6
It is possible that you need to delay and rootwait may solve it. However, this is the exact situation that initramfs is attempting to solve and is at least a 'debug' path for you. If you create an initramfs image and attach it to the Linux binary you can use a shell to probe Linux's partition layout and/or delay mounting the rootfs until it is ready. You can do other things in the initramfs like add a splash screen, parallel the USB infrastructure like module loading of detected devices with the rootfs mounting. This will make your boot faster as well as giving you a tool to diagnose booting.
It also look like u-boot can not see the /dev/mmcblk0p2 either. The fact that both u-boot and Linux seem to be complaining could indicate that something went wrong with the partition generation. It is definitely useful to compare boot logs versus a know working version as suggested by sawdust. For instance, timing/clocks, supplies or pinmux may not be set for the MMC and this can prevent the device from being recognized. It seems you have the driver, but not the device from the logs. Ie, no mmcblk0 anything. See: DTS mmc entries for some values that you may need to define for your board. The fact that Linux is found would seem to contradict this, but it would be useful to add the MMC device entries that the system is using. I would expect some output in the kernel logs. Another possibility is that something was built as a module and is expected to load to make the MMC accessible.
Getting a minimal initramfs will give you some shell tools to diagnose. You can use klibc or buildroot, etc to make a small initramfs that will let you look around the Linux device nodes, proc and sysfs value to diagnose things. Unfortunately, there are many things that may go wrong here. However, since you have Linux booting adding an initramfs is usually straight forward, even if you don't keep it for the final system.

Glitch Booting Linux with Spike?

I used Spike to boot linux using the riscv tools but the linux boot sequence seems to stop at Bootconsole[early0] disabled.
I tried adding kernel command line root=/dev/vda ro console=ttyS0 but didn't work. The same console settings works in QEMU. Also checked the .config file for the line CONFIG_HVC_RISCV_SBI=y. It was there. Still coulnd't get past it.
Tried with Linux kernel version 4.19 to 5.2. No luck. Am I doing something wrong here?
Steps I followed:
Compiled linux with Riscv toolchain
compiled riscv-pk with ../configure --host=riscv64-unknown-elf --with-payload= [path to vmlinux]
used "Spike bbl" to start spike image.
Please let me know if any more info is required.
Sorry, noob here.
Attaching terminal output
bbl loader
OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
Linux version 4.19.59 (root#AsusFX504) (gcc version 8.2.0 (GCC)) #2 SMP Sat Jul 20 05:11:32 IST 2019
bootconsole [early0] enabled
initrd not found or empty - disabling initrd
Zone ranges:
DMA32 [mem 0x0000000080200000-0x00000000ffffffff]
Normal empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000080200000-0x00000000ffffffff]
Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff]
software IO TLB: mapped [mem 0xfa3fe000-0xfe3fe000] (64MB)
elf_hwcap is 0x112d
percpu: Embedded 17 pages/cpu s29912 r8192 d31528 u69632
Built 1 zonelists, mobility grouping on. Total pages: 516615
Kernel command line:
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Sorting __ex_table...
Memory: 1988760K/2095104K available (5468K kernel code, 329K rwdata, 1751K rodata, 193K init, 806K bss, 106344K reserved, 0K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Hierarchical RCU implementation.
rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
Console: colour dummy device 80x25
console [tty0] enabled
bootconsole [early0] disabled
This might be because Virtual Terminal is enabled in your linux config. Disabling Virtual Terminal might solve your issue.
In Linux make menuconfig go to :-
Location:
-> Device Drivers
-> Character devices
and Disble Virtual terminal .
Symbol: VT [=y] n
Type : bool
Prompt: Virtual terminal
As mentioned previously, the reason is that VT is enabled so kernel has a dummy VT framebuffer that simply goes nowhere, but you don't have to disable it. console=ttyS0 will also not work, since SPIKE doesn't emulate it. Note that this won't work on the HiFive Unleashed, either, since serial terminals there are ttySIF0 and ttySIF1. What you want is console=hvc0 and SPIKE will be able to continue from there, e.g. in your kernel .config:
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlyprintk console=hvc0"
CONFIG_CMDLINE_FORCE=y

unexpected crash of embedded-linux on Zynq-Device (Zybo)

We have created, following the instruction on wiki-xilinx-linux web page, a system Zybo + embedded linux kernel (I want to remark that we didn't use PetaLinux but we have built all the file with the Xilinx tools).
When we turn on the system everything works fine and this is the output at the boot time:
U-Boot 2016.07-03720-g95e11f6-dirty (Oct 17 2016 - 02:56:48 -0700)
Model: Zynq ZYBO Development Board
Board: Xilinx Zynq
I2C: ready
DRAM: ECC disabled 512 MiB
MMC: sdhci#e0100000: 0
SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial#e0001000
Out: serial#e0001000
Err: serial#e0001000
Model: Zynq ZYBO Development Board
Board: Xilinx Zynq
Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id
I2C EEPROM MAC address read failed
eth0: ethernet#e000b000
Hit any key to stop autoboot: 0
Device: sdhci#e0100000
Manufacturer ID: 3
OEM: 8368
Name: NCard
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3843104 bytes read in 367 ms (10 MiB/s)
reading devicetree.dtb
10331 bytes read in 17 ms (592.8 KiB/s)
reading uramdisk.image.gz
5310018 bytes read in 504 ms (10 MiB/s)
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-4.6.0-xilinx-22285-g0e4e40
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3843040 Bytes = 3.7 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
Image Name:
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 5309954 Bytes = 5.1 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Ramdisk to 1e601000, end 1eb11602 ... OK
Loading Device Tree to 1e5fb000, end 1e60085a ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.6.0-xilinx-22285-g0e4e407-dirty (leonardo#ubuntu) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.05-17) ) #1 SMP PREEMPT Mon Oct 17 03:54:44 PDT 2016
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: xlnx,zynq-7000
bootconsole [earlycon0] enabled
cma: Reserved 16 MiB at 0x1f000000
Memory policy: Data cache writealloc
percpu: Embedded 12 pages/cpu #debcc000 s19776 r8192 d21184 u49152
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=1
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 489332K/524288K available (5304K kernel code, 230K rwdata, 1844K rodata, 1024K init, 222K bss, 18572K reserved, 16384K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc07fb004 (8141 kB)
.init : 0xc0800000 - 0xc0900000 (1024 kB)
.data : 0xc0900000 - 0xc0939b60 ( 231 kB)
.bss : 0xc0939b60 - 0xc09714e8 ( 223 kB)
Preemptible hierarchical RCU implementation.
Build-time adjustment of leaf fanout to 32.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to e0800000
slcr mapped to e0802000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at e0802100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4af477f6aa, max_idle_ns: 440795207830 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 551318127 ns
timer #0 at e080a000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 650.00 BogoMIPS (lpj=3250000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100058
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (1300.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB # 0xe0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 5188K (de601000 - deb12000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=28 max_order=17 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 6250000) is a xuartps
�console [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e086c000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:01:22)
RTL8211E Gigabit Ethernet e000b000.etherne:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
mmc0: new high speed SDHC card at address b368
No soundcards found.
mmcblk0: mmc0:b368 NCard 3.72 GiB
mmcblk0: p1 p2
RAMDISK: gzip image found at block 0
EXT4-fs warning (device ram0): ext4_update_dynamic_rev:746: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 1:0.
Starting rcS...
++ Mounting filesystem
mount: mounting /dev/mmcblk0p1 on /mnt failed: No such file or directory
mount: mounting /dev/mmcblk0 on /mnt failed: No such file or directory
++ Setting up mdev
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting ssh daemon
random: sshd urandom read with 1 bits of entropy available
rcS Complete
zynq>
zynq>
zynq>
The problem is that, after some instructions, the system crash with this output:
zynq> EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
Trying to move old root to /initrd ... /initrd does not exist. Ignored.
Unmounting old root
Trying to free ramdisk memory ... failed
devtmpfs: error mounting -2
Unable to handle kernel NULL pointer dereference at virtual address 00000020
pgd = c0004000
[00000020] *pgd=00000000
Internal error: Oops - BUG: 17 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 10 Comm: migration/0 Not tainted 4.6.0-xilinx-22285-g0e4e407-dirty #1
Hardware name: Xilinx Zynq Platform
task: de060040 ti: de06a000 task.ti: de06a000
PC is at set_section_perms+0x8c/0x110
LR is at set_section_perms+0x18/0x110
pc : [<c0113404>] lr : [<c0113390>] psr: 80000093
sp : de06bec0 ip : dc4f3018 fp : 00000600
r10: 00000000 r9 : 00000000 r8 : 00000001
r7 : 00000003 r6 : c0902468 r5 : 00000000 r4 : c0908508
r3 : 00000000 r2 : c0000000 r1 : 00000003 r0 : 00000009
Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
Control: 18c5387d Table: 1c4f804a DAC: 00000051
Process migration/0 (pid: 10, stack limit = 0xde06a210)
Stack: (0xde06bec0 to 0xde06c000)
bec0: c0908508 00000003 00000001 de0db780 de0db780 de0db998 00000003 c0908508
bee0: c09065c0 00000000 00000000 c01134f4 de04df70 00000001 a0000013 de04df84
bf00: 00000003 00000000 00000000 c011355c c011354c c017c420 de04df30 debccf64
bf20: de06a000 debccf68 00000000 c017c4f8 c017c478 de06a000 de02db40 c090cd94
bf40: 00000001 c0135454 de060040 de02d9c0 00000000 de02db40 c0135218 00000000
bf60: 00000000 c0132a40 4dff1176 00000001 00000000 de02db40 00000000 00030003
bf80: de06bf80 de06bf80 00000000 00000000 de06bf90 de06bf90 de06bfac de02d9c0
bfa0: c0132968 00000000 00000000 c0106ef8 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 dfefe0f2 77e519c8
[<c0113404>] (set_section_perms) from [<c01134f4>] (update_sections_early+0x6c/0xc4)
[<c01134f4>] (update_sections_early) from [<c011355c>] (__fix_kernmem_perms+0x10/0x1c)
[<c011355c>] (__fix_kernmem_perms) from [<c017c420>] (multi_cpu_stop+0xb0/0x108)
[<c017c420>] (multi_cpu_stop) from [<c017c4f8>] (cpu_stopper_thread+0x80/0xb0)
[<c017c4f8>] (cpu_stopper_thread) from [<c0135454>] (smpboot_thread_fn+0x23c/0x254)
[<c0135454>] (smpboot_thread_fn) from [<c0132a40>] (kthread+0xd8/0xec)
[<c0132a40>] (kthread) from [<c0106ef8>] (ret_from_fork+0x14/0x3c)
Code: e1520003 2a00001b e5943014 e1a0baa2 (e599a020)
---[ end trace 07a0838423ee7708 ]---
note: migration/0[10] exited with preempt_count 2
It is clear that there is an error with the "mounted filesystem":
zynq> EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
Trying to move old root to /initrd ... /initrd does not exist. Ignored.
Unmounting old root
Trying to free ramdisk memory ... failed
devtmpfs: error mounting -2
Why does this happen? Why before I can do everything with the system and, suddenly, I have a crash? Yes, the system crashes when I am doing nothing on it and not when I am working with it.
Are there some advice to solve this? to not to have anymore these crashes?
From the Linux Kernel Command line I can see "root=/dev/mmcblk0p2" and also the target is started with initial ramdisk image "uramdisk.image.gz". So the init process or scripts inside ramdisk image should be responsible to mount the real file system from SD i.e. from /dev/mmcblk0p2 and remove the used memory of ramdisk. To narrow down the problem, you need to analyze the steps taken in ramdisk image to mount the real filesystem and make sure you have the proper RFS flashed inside SD in /dev/mmcblk0p2. I can also seen some missing directories to mount the /dev/mmcblk0p1 and /dev/mmcblk0.
++ Mounting filesystem
mount: mounting /dev/mmcblk0p1 on /mnt failed: No such file or directory
mount: mounting /dev/mmcblk0 on /mnt failed: No such file or directory
In simple words, check the init scripts inside the ramdisk image and make sure the RFS is mounted properly.

Linux 2.6.28 crashes when mem=1024M is passed as boot parameter from u-boot

I am working on building an linux for powerpc 8641d board. My U-boot has been modified to recognize 1 GB of memory(RAM) and it does. But Linux 2.6.28 crashes when mem=1024M is passed as boot parameter from u-boot. I have specified the memory size as 0x40000000 (1GB) in DTS file. Can any one help me to findout the reason?
But the same Linux image works when I specify bootargs as 'mem=256M'. But OS idetifies the total memory of 256MB only but I want it to identify complete 1GB memory.
Here is the dump of linux boot: ** It hangs at this point:
CPU: 8641D, Version: 3.0, (0x80900130)
Core: E600 Core 0, Version: 2.2, (0x80040202)
Clock Configuration:
CPU:1000 MHz, MPX:400 MHz
DDR:200 MHz (400 MT/s data rate), LBC:25 MHz
L1: D-cache 32 KB enabled
I-cache 32 KB enabled
L2: 512 KB enabled
Board: Wind River SBC8641D
I2C: ready
DRAM: DDR: 1 GiB
FLASH: 16 MiB
PCI-EXPRESS 1: Configured as Host
IGAPS: PCIE link is Up
Scanning PCI bus 01
01 00 10cf 2034 0380 ff
PCI-EXPRESS 1 on bus 00 - 01
PCI-EXPRESS 2: Disabled
In: serial
Out: serial
Err: serial
IGAPS: Interrupts enabled...!!!!
Net: eTSEC1, eTSEC2, eTSEC3, eTSEC4
Hit any key to stop autoboot: 0
=> bootm 1000000 - 2000000
WARNING: adjusting available memory to 30000000
## Booting kernel from Legacy Image at 01000000 ...
Image Name: Linux-2.6.28
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 2417424 Bytes = 2.3 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Uncompressing Kernel Image ... OK
Loading Device Tree to 007fb000, end 007ffb2d ... OK
WARNING: your dts/dtb is old. You must update before the next kernel release
Using MPC86xx HPCN machine description
Total memory = 1024MB; using 2048kB for hash table (at cfe00000)
Linux version 2.6.28 (TCS#localhost) (gcc version 4.5.4 (Buildroot 2012.11.1) ) #42 SMP Tue Aug 20 22:32:49 IST 2013
CPU maps initialized for 1 thread per core
console [udbg0] enabled
setup_arch: bootmem
mpc86xx_hpcn_setup_arch()
Found FSL PCI host bridge at 0x00000000f8008000. Firmware bus number: 0->1
Zone PFN ranges:
DMA 0x00000000 -> 0x00030000
Normal 0x00030000 -> 0x00030000
HighMem 0x00030000 -> 0x00040000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00040000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260096
Kernel command line: console=ttyS0,115200 mem=1024M ip=172.19.180.10:172.19.180.30:172.19.180.1:255.255.255.0:sbc8641d:eth0:off rw root=/dev/nfs nfsroot=172.19.180.30:/opt/nfsRootfs
PID hash table entries: 4096 (order: 12, 16384 bytes)
clocksource: timebase mult[2800000] shift[22] registered
Console: colour dummy device 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1031376k/1048576k available (4632k kernel code, 16396k reserved, 144k data, 175k bss, 208k init)
Any reason why it hangs here?

Resources