AnsweredAssumed Answered

Can't mount rootfs using initrd and /dev/ram0

Question asked by karak on Sep 25, 2016
Latest reply on Sep 27, 2016 by karak

Hi, all!

 

I try to boot system using initrd and rootfs ad root=/dev/ram0. I need separate kernel and filesystem images.

All related kernel options was set properly (suppose). Command line arguments passed. May be I miss something? Look on the web and that forum, compare my settings and don't understand where errors? Is this mode supported on BF or not? If I use initramfs image or boot via NFS all working fine. Help me please.

 

Thank you.

 

Board: custom board with BF537 based on BF537-STAMP. Memory 32MB

 

Kernel command line: root=/dev/ram0 rw initrd=400000,8M ramdisk_size=8192 ip=dhcp waitroot earlyprintk=serial,uart0,57600 console=ttyBF0,57600

 

Kernel config: attached

 

Buildroot config: attached

 

U-boot env:

 

bfin> print
addip=set bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):eth0:off
autoload=no
baudrate=57600
board=bf32
bootargs=root=/dev/ram0 rw initrd=400000,8M ramdisk_size=8192 ip=dhcp waitroot earlyprintk=serial,uart0,57600 console=ttyBF0,57600
bootargs_spi=root=/dev/ram0 rw initrd=400000,8M ramdisk_size=8192 ip=dhcp waitroot earlyprintk=serial,uart0,57600 console=ttyBF0,57600
bootcmd=tftp 1000000 bf32/uImage; tftp 400000 bf32/ramdisk.img.gz; bootm 1000000;
bootcmd_spi=tftp 1000000 bf32/uImage; tftp 400000 bf32/ramdisk.img.gz; bootm 1000000;
bootdelay=5
ethact=bfin_mac
flashboot=bootm 0x20100000
gatewayip=192.168.1.1
hostname=bf537-stamp
ipaddr=192.168.1.77
loadaddr=0x1000000
loads_echo=1
nc=set ncip ${serverip};set stdin nc;set stdout nc;set stderr nc
netmask=255.255.255.0
nfsargs=set bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3
nfsboot=tftp $(loadaddr) $(nfsfile);run nfsargs;run addip;bootm
nfsfile=./bf32/uImage
ramargs=set bootargs root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600
ramboot=tftp $(loadaddr) $(ramfile);run ramargs;run addip;bootm
ramfile=./bf32/uImage
rootpath=/home/karak/targetfs-bf32
serveraddr=94:de:80:6a:48:d1
serverip=192.168.1.44
stderr=serial
stdin=serial
stdout=serial
ubootfile=u-boot.ldr
update=tftp $(loadaddr) $(ubootfile);sf probe 1;sf erase 0 0x40000;sf write $(loadaddr) 0 $(filesize)

Environment size: 1511/8188 bytes

 

Boot log:

 

U-Boot 2015.07 ADI-2014R1-pre-00454-gfabdc61-dirty (Aug 09 2016 - 22:46:31 +0300)

CPU: ADSP bf537-0.2 (Detected Rev: 0.2) (spi flash boot)
Clock: VCO: 500 MHz, Core: 500 MHz, System: 125 MHz
I2C: ready
DRAM: 32 MiB
Flash: 4 MiB
MMC:
SF: Detected M25P64 with page size 256 Bytes, erase size 64 KiB, total 8 MiB
In: serial
Out: serial
Err: serial
KGDB: [on serial] ready
Net: bfin_mac
Warning: bfin_mac (eth0) using random MAC address - 3a:11:23:63:21:88

Hit any key to stop autoboot: 0
Using bfin_mac device
TFTP from server 192.168.1.44; our IP address is 192.168.1.77
Filename 'bf32/uImage'.
Load address: 0x1000000
Loading: T #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#############################################
379.9 KiB/s
done
Bytes transferred = 2225329 (21f4b1 hex)
Using bfin_mac device
TFTP from server 192.168.1.44; our IP address is 192.168.1.77
Filename 'bf32/ramdisk.img.gz'.
Load address: 0x400000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#####
3.1 MiB/s
done
Bytes transferred = 2352242 (23e472 hex)
## Booting kernel from Legacy Image at 01000000 ...
Image Name: bf537-0.2-4.0.0-ADI-2014R1-pre
Created: 2016-09-25 15:45:31 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 2225265 Bytes = 2.1 MiB
Load Address: 00001000
Entry Point: 003e7b54
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 003e7b54
Linux version 4.0.0-ADI-2014R1-pre (karak@HomeStudio) (gcc version 4.3.5 (ADI-2014R1-RC2) ) #5 Sun Sep 25 18:45:25 MSK 2016
register early platform devices
bootconsole [early_shadow0] enabled
bootconsole [early_BFuart0] enabled
early printk enabled on early_BFuart0
Could not find valid ram mtd attached.
Board Memory: 24MB
Kernel Managed Memory: 24MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x002c6da0
rodata = 0x002c6dc4-0x003a6dbc
bss = 0x003a7000-0x003c2928
data = 0x003c2940-0x003e0000
stack = 0x003de000-0x003e0000
init = 0x003e0000-0x00404000
available = 0x00404000-0x01700000
rootfs = 0x (null)-0x1db78000
DMA Zone = 0x01700000-0x01800000
Hardware Trace active and enabled
Boot Mode: 3
Blackfin support (C) 2004-2010 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 125 MHz System Clock
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
External memory: cacheable in instruction cache
Data Cache Enabled for CPU0
External memory: cacheable (write-back) in data cache
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 5842
Kernel command line: root=/dev/ram0 rw initrd=400000,8M ramdisk_size=8192 ip=dhcp waitroot earlyprintk=serial,uart0,57600 console=ttyBF0,57600 mem=24M
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 19112K/23552K available (2839K kernel code, 117K rwdata, 895K rodata, 144K init, 110K bss, 4440K reserved, 0K cma-reserved, 1024K DMA)
NR_IRQS:146
Configuring Blackfin Priority Driven Interrupts
Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
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)
devtmpfs: initialized
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (16 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (33 KB free)
NET: Registered protocol family 16
Blackfin DMA Controller
stamp_init(): registering device resources
bfin-spi bfin-spi.0: master is unqueued, this is deprecated
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs@ffc00500, dma channel@7
i2c-bfin-twi i2c-bfin-twi.0: Blackfin on-chip I2C TWI Contoller, regs_base@ffc01400
Switched to clocksource bfin_cs_cycles
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 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.
debug-mmrs: setting up Blackfin MMR debugfs
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
ntfs: driver 2.1.31 [Flags: R/W].
jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler cfq registered (default)
bfin-uart: Blackfin serial driver
bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18, base_baud = 7812500) is a BFIN-UART
console [ttyBF0] enabled
console [ttyBF0] enabled
bootconsole [early_BFuart0] disabled
bootconsole [early_BFuart0] disabled
bootconsole [early_shadow0] disabled
bfin-dma: initialized
sport0: misc = 0089350c
sport1: misc = 0089340c
brd: module loaded
nbd: registered device at major 43
physmap platform flash device: 00400000 at 20000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000020 Chip ID 0x0022cb
Amd/Fujitsu Extended Query Table at 0x0040
Amd/Fujitsu Extended Query version 1.0.
number of CFI chips: 1
Creating 4 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000040000 : "bootloader(nor)"
0x000000040000-0x0000001c0000 : "linux kernel(nor)"
0x0000001c0000-0x0000003f0000 : "file system(nor)"
0x0000003f0000-0x000000400000 : "MAC Address(nor)"
uclinux[mtd]: probe address=0x3c2928 size=0x0
Creating 1 MTD partitions on "rom":
0x000000000000-0x000000000000 : "ROMfs"
mtd: partition "ROMfs" is out of reach -- disabled
m25p80 spi0.1: found m25p64, expected m25p80
m25p80 spi0.1: m25p64 (8192 Kbytes)
Creating 3 MTD partitions on "m25p80":
0x000000000000-0x000000040000 : "bootloader(spi)"
0x000000040000-0x0000001c0000 : "linux kernel(spi)"
0x0000001c0000-0x000000800000 : "file system(spi)"
libphy: bfin_mii_bus: probed
bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=bfin_mii_bus-0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)
bfin_mac bfin_mac.0 eth0: Blackfin on-chip Ethernet MAC driver, Version 1.1
rtc (null): invalid alarm value: 1900-1-29 0:0:0
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
i2c /dev entries driver
bfin_wdt: initialized: timeout=20 sec (nowayout=0)
Driver 'mmcblk' needs updating - please use bus_type methods
mmc_spi spi0.6: ASSUMING 3.2-3.4 V slot power
mmc_spi spi0.6: setup: unsupported mode bits 4
mmc_spi spi0.6: can't change chip-select polarity
mmc_spi spi0.6: SD/MMC host mmc0, no DMA, no WP, no poweroff
mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
rtc-bfin rtc-bfin: setting system clock to 2009-08-28 13:41:59 UTC (1251466919)
Sending DHCP requests .
mmc0: new MMC card on SPI
mmcblk0: mmc0:0001 MMC 967 MiB
mmcblk0:
bfin_mac bfin_mac.0 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
., OK
IP-Config: Got DHCP answer from 192.168.1.1, my address is 192.168.1.35
IP-Config: Complete:
device=eth0, hwaddr=3a:11:23:63:21:88, ipaddr=192.168.1.35, mask=255.255.255.0, gw=192.168.1.1
host=192.168.1.35, domain=, nis-domain=(none)
bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=
nameserver0=192.168.1.1
dma_alloc_init: dma_page @ 0x00a5b000 - 256 pages at 0x01700000
List of all partitions:
0100 8192 ram0 (driver?)
1f00 256 mtdblock0 (driver?)
1f01 1536 mtdblock1 (driver?)
1f02 2240 mtdblock2 (driver?)
1f03 64 mtdblock3 (driver?)
1f05 256 mtdblock5 (driver?)
1f06 1536 mtdblock6 (driver?)
1f07 6400 mtdblock7 (driver?)
b300 990720 mmcblk0 driver: mmcblk
No filesystem could mount root, tried: reiserfs ext3 ext2 ext4 vfat msdos ntfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Hardware Trace:
0 Target : <0x002c6944> { _dump_stack + 0x0 }
Source : <0x002c69f2> { _panic + 0x6a } CALL pcrel
1 Target : <0x002c69e0> { _panic + 0x58 }
Source : <0x0000b0ea> { _test_taint + 0x22 } RTS
2 Target : <0x0000b0c8> { _test_taint + 0x0 }
Source : <0x002c69dc> { _panic + 0x54 } CALL pcrel
3 Target : <0x002c69da> { _panic + 0x52 }
Source : <0x002c6b58> { _printk + 0x1c } RTS
4 Target : <0x002c6b54> { _printk + 0x18 }
Source : <0x00027e84> { _vprintk_default + 0x18 } RTS
5 Target : <0x00027e80> { _vprintk_default + 0x14 }
Source : <0x00027e64> { _vprintk_emit + 0x2f8 } RTS
6 Target : <0x00027e5a> { _vprintk_emit + 0x2ee }
Source : <0x00027e6a> { _vprintk_emit + 0x2fe } JUMP.S
7 Target : <0x00027e6a> { _vprintk_emit + 0x2fe }
Source : <0x00026d9a> { _wake_up_klogd + 0x4a } RTS
8 Target : <0x00026d96> { _wake_up_klogd + 0x46 }
Source : <0x00026d60> { _wake_up_klogd + 0x10 } IF CC JUMP pcrel
9 Target : <0x00026d50> { _wake_up_klogd + 0x0 }
Source : <0x0002717c> { _console_unlock + 0x388 } CALL pcrel
10 Target : <0x0002716c> { _console_unlock + 0x378 }
Source : <0x00027162> { _console_unlock + 0x36e } IF CC JUMP pcrel
11 Target : <0x0002715c> { _console_unlock + 0x368 }
Source : <0x0002714e> { _console_unlock + 0x35a } IF CC JUMP pcrel (BP)
12 Target : <0x0002713e> { _console_unlock + 0x34a }
Source : <0x0002479c> { _up + 0x40 } RTS
13 Target : <0x00024796> { _up + 0x3a }
Source : <0x00024788> { _up + 0x2c } IF CC JUMP pcrel (BP)
14 Target : <0x00024782> { _up + 0x26 }
Source : <0x0002477a> { _up + 0x1e } JUMP.S
15 Target : <0x0002475c> { _up + 0x0 }
Source : <0x0002713a> { _console_unlock + 0x346 } CALL pcrel
CPU: 0 PID: 1 Comm: swapper Not tainted 4.0.0-ADI-2014R1-pre #5
Stack info:
SP: [0x00821ddc] <0x00821ddc> /* kernel dynamic memory (maybe user-space) */
FP: (0x00821f0c)
Memory from 0x00821dd0 to 00822000
00821dd0:<0033e75c> 00821ddc <002c6b54>[003396b4] 002c69f6 <00a76028> 003396b4 003ac37a
00821df0: 003ac37a 003ac37a 00821e24 003faf3c 003e0d00 <00a76028> 003fb38c 003395fc
00821e10: 00821e30 ffffffea 00008001 0041aec0 00000000 00821e30 00821e30 00000000
00821e30: 6e6b6e75 2d6e776f 636f6c62 2c31286b 00002930 003faf1c 003395fc 0000004b
00821e50: 003e0dec 003a702c 003fb348 003faf1c 00100000 0000004b 003a7018 003e02c8
00821e70: ffffff9c 003395fc 00000002 00821e98 00000000 003a7020 003e0f3a 003a702c
00821e90: 003fb34c 0000004b 003a7018 003e02c8 003faf3c 003e02b0 003a7020 003faf40
00821eb0: 003faf1c 003e02bc 003a7020 003faf40 00000008 ffffff9c 003393a4 <003a6900>
00821ed0: 0000004b 00000007 00000007 003e02c8 00825eb8 002c57de 00000000 0081e6e0
00821ef0: 0081ea40 003cc908 00000000 0000003f 003c4074 00000000 003cc908 (00000000)
00821f10:<ffa00014> 00000000 33333333 002c57d4 00000000 00000000 00008000 00000000
00821f30: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00821f50: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00821f70: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00821f90: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00821fb0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00821fd0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00821ff0: 00000000 00000000 ffffffff 00000006
Return addresses in stack:
address : <0x0033e75c> /* kernel dynamic memory (maybe user-space) */
address : <0x002c6b54> { _printk + 0x18 }
address : <0x00a76028> /* kernel dynamic memory (maybe user-space) */
address : <0x00a76028> /* kernel dynamic memory (maybe user-space) */
address : <0x003a6900> /* kernel dynamic memory (maybe user-space) */
frame 1 : <0xffa00014> { _ret_from_fork + 0x14 }
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

Outcomes