cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
299 Views
Registered: ‎09-17-2018

Petalinux QEMU rootfs on sdcard

Hello,

I have small problem regarding booting QEMU petalinux with rootfs on sd-card.

(base) bartek@beepboop:~/workDir/mzeem/mzmine/pre-built/linux$ petalinux-boot --qemu  --kernel
INFO: sourcing build tools
INFO: The image provided is a zImage
INFO: No DTB has been specified, use the default one "/home/bartek/workDir/mzeem/mzmine/images/linux/system.dtb".
INFO: Set QEMU tftp to /home/bartek/workDir/mzeem/mzmine/images/linux 
INFO: TCP PORT is free 
INFO: Starting arm QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on   -serial /dev/null -serial mon:stdio -serial /dev/null -display none -kernel /home/bartek/workDir/mzeem/mzmine/images/linux/zImage -gdb tcp::9000 -dtb /home/bartek/workDir/mzeem/mzmine/images/linux/system.dtb  -device loader,addr=0xf8000008,data=0xDF0D,data-len=4 -device loader,addr=0xf8000140,data=0x00500801,data-len=4 -device loader,addr=0xf800012c,data=0x1ed044d,data-len=4 -device loader,addr=0xf8000108,data=0x0001e008,data-len=4 -device loader,addr=0xF8000910,data=0xF,data-len=0x4   
Booting Linux on physical CPU 0x0
Linux version 5.4.0-xilinx-v2020.1 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Fri Jun 26 23:09:33 UTC 2020
CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
OF: fdt: Machine model: xlnx,zynq-7000
earlycon: cdns0 at MMIO 0xe0001000 (options '115200n8')
printk: bootconsole [cdns0] enabled
Memory policy: Data cache writeback
cma: Reserved 16 MiB at 0x1f000000
CPU: All CPU(s) started in SVC mode.
percpu: Embedded 15 pages/cpu s31948 r8192 d21300 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 129920
Kernel command line: console=ttyPS0,115200 earlycon root=/dev/mmcblk1p1 rw rootwait
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 491576K/524288K available (6144K kernel code, 217K rwdata, 1840K rodata, 1024K init, 131K bss, 16328K reserved, 16384K cma-reserved, 0K highmem)
rcu: Preemptible hierarchical RCU implementation.
rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
	Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to (ptrval)
slcr mapped to (ptrval)
irq-xilinx: /amba_pl/interrupt-controller@41800000: num_irq=32, sw_irq=0, edge=0xffffffff
L2C: platform modifies aux control register: 0x00000000 -> 0x30400000
L2C: DT/platform modifies aux control register: 0x00000000 -> 0x30400000
L2C-310 errata 588369 769419 enabled
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 cache controller enabled, 8 ways, 64 kB
L2C-310: CACHE_ID 0x00000000, AUX_CTRL 0x00000000
random: get_random_bytes called from start_kernel+0x260/0x440 with crng_init=0
zynq_clock_init: clkc starts at (ptrval)
Zynq clock init
global-timer: non support for this cpu version.
Failed to initialize '/amba/timer@f8f00200': -38
Console: colour dummy device 80x30
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Calibrating delay loop... 1784.21 BogoMIPS (lpj=8921088)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
smp: Brought up 1 node, 1 CPU
SMP: Total of 1 processors activated (1784.21 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: 2, 16384 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
OF: amba_device_add() failed (-19) for /amba/etb@f8801000
OF: amba_device_add() failed (-19) for /amba/tpiu@f8803000
OF: amba_device_add() failed (-19) for /amba/funnel@f8804000
OF: amba_device_add() failed (-19) for /amba/ptm@f889c000
OF: amba_device_add() failed (-19) for /amba/ptm@f889d000
hw-breakpoint: debug architecture 0x4 unsupported.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x(ptrval)
e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 24, base_baud = 992063) is a xuartps
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 25, base_baud = 992063) is a xuartps
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc: Linux media interface: v0.10
videodev: 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
FPGA manager framework
Advanced Linux Sound Architecture Driver Initialized.
thermal_sys: Registered thermal governor 'step_wise'
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
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.
PCI: CLS 0 bytes, default 64
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 5 counters available
workingset: timestamp_bits=14 max_order=17 bucket_order=3
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
io scheduler mq-deadline registered
io scheduler kyber registered
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: 	DBUFF-256x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
brd: module loaded
loop: module loaded
spi-nor spi0.0: m25p80 (1024 Kbytes)
5 fixed-partitions partitions found on MTD device spi0.0
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000500000 : "boot"
mtd: partition "boot" extends beyond the end of device "spi0.0" -- size truncated to 0x100000
0x000000500000-0x000000520000 : "bootenv"
mtd: partition "bootenv" is out of reach -- disabled
0x000000520000-0x000000fa0000 : "kernel"
mtd: partition "kernel" is out of reach -- disabled
0x000000fa0000-0x000000100000 : "spare"
mtd: partition "spare" is out of reach -- disabled
0x000000000000-0x000000ff0000 : "boot"
mtd: partition "boot" extends beyond the end of device "spi0.0" -- size truncated to 0x100000
sysfs: cannot create duplicate filename '/bus/nvmem/devices/boot'
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-xilinx-v2020.1 #1
Hardware name: Xilinx Zynq Platform
[<c010e37c>] (unwind_backtrace) from [<c010a124>] (show_stack+0x10/0x14)
[<c010a124>] (show_stack) from [<c06a1568>] (dump_stack+0xb4/0xd0)
[<c06a1568>] (dump_stack) from [<c025f8a4>] (sysfs_warn_dup+0x4c/0x60)
[<c025f8a4>] (sysfs_warn_dup) from [<c025fb08>] (sysfs_do_create_link_sd+0x90/0xb4)
[<c025fb08>] (sysfs_do_create_link_sd) from [<c03f0e8c>] (bus_add_device+0x50/0xc8)
[<c03f0e8c>] (bus_add_device) from [<c03eed44>] (device_add+0x364/0x568)
[<c03eed44>] (device_add) from [<c056dc4c>] (nvmem_register+0x1a8/0x594)
[<c056dc4c>] (nvmem_register) from [<c0429fb4>] (add_mtd_device+0x224/0x348)
[<c0429fb4>] (add_mtd_device) from [<c042d1c0>] (add_mtd_partitions+0xb8/0x140)
[<c042d1c0>] (add_mtd_partitions) from [<c042cf70>] (parse_mtd_partitions+0x224/0x314)
[<c042cf70>] (parse_mtd_partitions) from [<c042a214>] (mtd_device_parse_register+0x64/0xfc)
[<c042a214>] (mtd_device_parse_register) from [<c0449328>] (spi_nor_probe+0x134/0x188)
[<c0449328>] (spi_nor_probe) from [<c044a3c0>] (spi_drv_probe+0x88/0xa4)
[<c044a3c0>] (spi_drv_probe) from [<c03f1bfc>] (really_probe+0x1d4/0x2ec)
[<c03f1bfc>] (really_probe) from [<c03f1fa8>] (driver_probe_device+0x13c/0x154)
[<c03f1fa8>] (driver_probe_device) from [<c03f02d0>] (bus_for_each_drv+0xa0/0xb8)
[<c03f02d0>] (bus_for_each_drv) from [<c03f1dcc>] (__device_attach+0xb8/0x134)
[<c03f1dcc>] (__device_attach) from [<c03f0f2c>] (bus_probe_device+0x28/0x80)
[<c03f0f2c>] (bus_probe_device) from [<c03eee4c>] (device_add+0x46c/0x568)
[<c03eee4c>] (device_add) from [<c044a918>] (spi_add_device+0xfc/0x13c)
[<c044a918>] (spi_add_device) from [<c044b914>] (of_register_spi_device+0x2c0/0x338)
[<c044b914>] (of_register_spi_device) from [<c044be04>] (spi_register_controller+0x478/0x64c)
[<c044be04>] (spi_register_controller) from [<c044c00c>] (devm_spi_register_controller+0x34/0x64)
[<c044c00c>] (devm_spi_register_controller) from [<c0450574>] (zynq_qspi_probe+0x2cc/0x350)
[<c0450574>] (zynq_qspi_probe) from [<c03f36e0>] (platform_drv_probe+0x48/0x94)
[<c03f36e0>] (platform_drv_probe) from [<c03f1bfc>] (really_probe+0x1d4/0x2ec)
[<c03f1bfc>] (really_probe) from [<c03f1fa8>] (driver_probe_device+0x13c/0x154)
[<c03f1fa8>] (driver_probe_device) from [<c03f2144>] (device_driver_attach+0x44/0x5c)
[<c03f2144>] (device_driver_attach) from [<c03f2208>] (__driver_attach+0xac/0xb4)
[<c03f2208>] (__driver_attach) from [<c03f01dc>] (bus_for_each_dev+0x64/0xa4)
[<c03f01dc>] (bus_for_each_dev) from [<c03f11b0>] (bus_add_driver+0x150/0x1b0)
[<c03f11b0>] (bus_add_driver) from [<c03f28ac>] (driver_register+0xac/0xf0)
[<c03f28ac>] (driver_register) from [<c0102668>] (do_one_initcall+0x74/0x16c)
[<c0102668>] (do_one_initcall) from [<c0a00f4c>] (kernel_init_freeable+0x1f4/0x248)
[<c0a00f4c>] (kernel_init_freeable) from [<c06b5488>] (kernel_init+0x8/0x10c)
[<c06b5488>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xde43dfb0 to 0xde43dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
mtd mtd4: Failed to register NVMEM device
libphy: Fixed MDIO Bus: probed
CAN device driver interface
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
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: unable to init phy: -110
ci_hdrc: probe of ci_hdrc.0 failed with error -110
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 21
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer with timeout 10s
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 e0101000.mmc [e0101000.mmc] using ADMA 64-bit
ledtrig-cpu: registered to indicate activity on CPUs
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 826992825 ns
clocksource: Switched to clocksource ttc_clocksource
sched_clock: 16 bits at 35kHz, resolution 28357ns, wraps every 929205421ns
timer #0 at (ptrval), irq=41
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20190810) max_hops=1
Registering SWP/SWPB emulation handler
of-fpga-region fpga-full: FPGA Region probed
mmc1: SDHCI controller on e0100000.mmc [e0100000.mmc] using ADMA 64-bit
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Warning: unable to open an initial console.
Waiting for root device /dev/mmcblk1p1...
random: fast init done
wlreg_on: disabling
random: crng init done

System components are all on flash (BOOT.BIN, u-boot, image.ub) and system.dtb from boot image. Root filesytem is ext4 (SD/emmc/sata/USB) and the device node is /dev/mmcblk1p1.

I have tried mounting it like this:

petalinux-boot --qemu  --u-boot --kernel --qemu-args "-sd /home/bartek/workDir/mzeem/mzmine/images/linux/rootfs.ext4"

and also I have tried:

petalinux-boot --qemu  --u-boot --kernel --qemu-args "-sd /home/bartek/workDir/mzeem/mzmine/images/linux/rootfs.ext4 -append root=/dev/mmcblk1p1/"  

but then QEMU freezes

petalinux-boot --qemu  --u-boot --kernel --qemu-args "-sd /home/bartek/workDir/mzeem/mzmine/images/linux/rootfs.ext4 -append root=/dev/mmcblk1p1/"   
INFO: sourcing build tools
INFO: The image provided is a zImage
INFO: No DTB has been specified, use the default one "/home/bartek/workDir/mzeem/mzmine/images/linux/system.dtb".
INFO: Set QEMU tftp to /home/bartek/workDir/mzeem/mzmine/images/linux 
INFO: TCP PORT is free 
INFO: Starting arm QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on   -serial /dev/null -serial mon:stdio -serial /dev/null -display none -kernel /home/bartek/workDir/mzeem/mzmine/images/linux/zImage -gdb tcp::9000 -dtb /home/bartek/workDir/mzeem/mzmine/images/linux/system.dtb  -device loader,addr=0xf8000008,data=0xDF0D,data-len=4 -device loader,addr=0xf8000140,data=0x00500801,data-len=4 -device loader,addr=0xf800012c,data=0x1ed044d,data-len=4 -device loader,addr=0xf8000108,data=0x0001e008,data-len=4 -device loader,addr=0xF8000910,data=0xF,data-len=0x4  -sd /home/bartek/workDir/mzeem/mzmine/images/linux/rootfs.ext4 -append root=/dev/mmcblk1p1/  
WARNING: Image format was not specified for '/home/bartek/workDir/mzeem/mzmine/images/linux/rootfs.ext4' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

I don't know what to do.... could someone give me some tips how can i send this rootfs.ext4 to /dev/mmcblk1p1/ in qemu?

Packaging everything to initram isn't a solution because of size of rootfs.

Thanks for help.

Tags (3)
0 Kudos
1 Reply
Highlighted
Visitor
Visitor
170 Views
Registered: ‎06-22-2020

Did anyone find a solution ? I have the same problem using PetaLinux 2019.2. I tried with qemu-args "-drive file=sd.img,if=sd,format=raw" or "-sd sd.img". Result is the same: "Waiting dor /dev/mmcblkp2 ...". Device MPSoC works fine.

Documentation https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_2/ug1169-xilinx-qemu.pdf (page 23.) says, that it should work.

 

0 Kudos