Posts: 2
Joined: Tue May 26, 2015 8:27 am

Problem in booting a u-boot image for raspberry pi 2 on QEMU

Mon May 01, 2017 4:55 pm

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, [email protected]=1 '\001', [email protected]=0x3bb3d3e8) at include/sdhci.h:285
#4 sdhci_reset ([email protected]=0x3bb3d3e8, [email protected]=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 ([email protected]=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 ([email protected]=0x3bf89bc5 "mmc", [email protected]=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 ([email protected]y=0x3bf89bc5 "mmc", [email protected]=0x3bb3d5c0 "0",
dev_desc=0x3bb38dc4, [email protected]=0x3bf5cf78 <blk_get_device_part_str+176>) at disk/part.c:367
#12 0x3bf5cf78 in blk_get_device_part_str ([email protected]=0x3bf89bc5 "mmc",
[email protected]=0x3bf854c1 "0:1", dev_desc=0x3bf5cf78 <blk_get_device_part_str+176>,
[email protected]=0x3bb38dbc, info=0x3bb38dc8, [email protected]=0x3bb38dc0, [email protected]=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 ([email protected]=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

Seems there seems to be a problem in mmc driver.
Could somebody help me in further debugging?

Pradeep M C

Posts: 26
Joined: Wed Mar 23, 2016 10:39 pm

Re: Problem in booting a u-boot image for raspberry pi 2 on QEMU

Thu Nov 16, 2017 8:26 pm

Comment the while loop in drivers/mmc/bcm2835_sdhci.c in the bcm2835_sdhci_raw_writel function and you will get further.

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 15 guests