[U-Boot] Problem in booting an u-boot image for raspberry pi 2 on QEMU

Pradeep M C pradeepmcp at gmail.com
Tue May 9 02:51:03 UTC 2017


Hi people,
Needed some help in running u-boot on qemu emulating Raspberry pi 2.
I came across qemu supporting emulation of Raspbeerry pi 2 (raspi2 machine
in qemu).
I thought of giving it a try by running u-boot compiled for Raspberry pi 2.
I used the config "rpi_2_defconfig" to build u-boot.

following is the command I used to invoke QEMU
qemu-system-arm -M raspi2 -kernel u-boot

i see the following message on the serial console of qemu

U-Boot 2017.03-01088-gd0ffda8-dirty (Apr 27 2017 - 09:21:24 +0530)

DRAM: 960 MiB
RPI 2 Model B (0xa21041)
MMC: bcm2835_sdhci: 0

And it never goes past this point and I never get the u-boot console.

I tried debugging through gdb.

this is the back trace of the stack
#0 timer_get_us () at lib/time.c:124
#1 0x3bf643d4 in bcm2835_sdhci_raw_writel (reg=44, val=16777216,
host=0x3bb3d3e8) at drivers/mmc/bcm2835_sdhci.c:74
#2 bcm2835_sdhci_writeb (host=0x3bb3d3e8, val=<optimized out>,
reg=<optimized out>) at drivers/mmc/bcm2835_sdhci.c:117
#3 0x3bf63270 in sdhci_writeb (reg=47, val=val at entry=1 '\001',
host=host at entry=0x3bb3d3e8) at include/sdhci.h:285
#4 sdhci_reset (host=host at entry=0x3bb3d3e8, mask=mask at entry=1 '\001') at
drivers/mmc/sdhci.c:29
#5 0x3bf63308 in sdhci_init (mmc=0x3bb3d460) at drivers/mmc/sdhci.c:481
#6 0x3bf62b48 in mmc_start_init (mmc=0x3bb3d460) at drivers/mmc/mmc.c:1673
#7 0x3bf62d90 in mmc_init (mmc=mmc at entry=0x3bb3d460) at
drivers/mmc/mmc.c:1746
#8 0x3bf610b4 in mmc_get_dev (dev=<optimized out>, descp=0x3bb38ccc) at
drivers/mmc/mmc_legacy.c:221
#9 0x3bf602c8 in blk_get_devnum_by_typename
(if_typename=if_typename at entry=0x3bf89bc5
"mmc", devnum=devnum at entry=0)
at drivers/block/blk_legacy.c:205
#10 0x3bf5ce48 in get_dev_hwpart (hwpart=0, dev=0, ifname=0x3bf89bc5 "mmc")
at disk/part.c:48
#11 blk_get_device_by_str (ifname=ifname at entry=0x3bf89bc5 "mmc",
dev_hwpart_str=dev_hwpart_str at entry=0x3bb3d5c0 "0",
dev_desc=0x3bb38dc4, dev_desc at entry=0x3bf5cf78
<blk_get_device_part_str+176>) at disk/part.c:367
#12 0x3bf5cf78 in blk_get_device_part_str (ifname=ifname at entry=0x3bf89bc5
"mmc",
dev_part_str=dev_part_str at entry=0x3bf854c1 "0:1", dev_desc=0x3bf5cf78
<blk_get_device_part_str+176>,
dev_desc at entry=0x3bb38dbc, info=0x3bb38dc8, info at entry=0x3bb38dc0,
allow_whole_dev=allow_whole_dev at entry=1)
at disk/part.c:475
#13 0x3bf51db4 in env_relocate_spec () at common/env_fat.c:85
#14 0x3bf578a0 in env_relocate () at common/env_common.c:268
#15 0x3bf501c4 in initr_env () at common/board_r.c:479
#16 0x3bf71144 in initcall_run_list
(init_sequence=init_sequence at entry=0x3bf8ecd8)
at lib/initcall.c:31
#17 0x3bf50314 in board_init_r (new_gd=<optimized out>,
dest_addr=<optimized out>) at common/board_r.c:947
#18 0x3bf41710 in _main () at arch/arm/lib/crt0.S:153
#19 0x3bf41710 in _main () at arch/arm/lib/crt0.S:153


Could somebody help me in further debugging?

QEMU version: 2.8

Regards,
Pradeep M C


More information about the U-Boot mailing list