Skip to contentSkip to conversation

Setting up PPC440 Virtex Image for Qemu

Qemu-devel Suzuki Poulose 2 participants 6 messages Jun 30, 2011 – Jul 6, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

I am working on enabling the KEXEC on PPC440 chipsets. To debug my patches, I would like to use the Qemu. The only available PPC440 support in Qemu is for the ppc-virtex. (Thanks for adding the support).

I was trying to use the default image provided at

http://wiki.qemu.org/download/ppc-virtexml507-linux-2_6_34.tgz

However I cannot get the network up for the board to use the nfs root file system.
----
PPC 4xx OCP EMAC driver, version 3.54
TCP cubic registered
NET: Registered protocol family 17
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

---

I tried using a different dtb based on virtex440-ml507.dts, but the qemu complains :

[suzie@suzukikp ppc-virtex-ml507]$ ./qemu-run.sh
Unable to copy device tree in memory

Is there something I can do to get the networking up ? I think this may need to be fixed in the dtb.

Or is there any other mechanism to use a different file system ?
( I have the tool chain to build the kernel etc)

Thanks
Suzuki

#1 lore raw
Quoted 6 lines · Suzuki Poulose

Hi,

I am working on enabling the KEXEC on PPC440 chipsets. To debug my patches, I would like to use the Qemu. The only available PPC440 support in Qemu is for the ppc-virtex. (Thanks for adding the support).

Quoted 6 lines

I was trying to use the default image provided at

http://wiki.qemu.org/download/ppc-virtexml507-linux-2_6_34.tgz

However I cannot get the network up for the board to use the nfs root file system.

Hi,

The problem is that there is no model of the LL-TEMAC in qemu, the one in the refdesign beeing emulated. An easy way out is probably to connect a xilinx,ethlite instead. You'll need to modify both QEMU and the dtb.

IIRC, the dtb published with the image has the lltemac removed.

I've got a working LL-temac model here, will try to post it this weekend. Or if you're interested in hacking on it, I could probably code dump it as is.

Quoted 17 lines

----
PPC 4xx OCP EMAC driver, version 3.54
TCP cubic registered
NET: Registered protocol family 17
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

---

I tried using a different dtb based on virtex440-ml507.dts, but the qemu complains :

[suzie@suzukikp ppc-virtex-ml507]$ ./qemu-run.sh
Unable to copy device tree in memory

Quoted 5 lines

Is there something I can do to get the networking up ? I think this may need to be fixed in the dtb.

Or is there any other mechanism to use a different file system ?
( I have the tool chain to build the kernel etc)

Another way is to create ramdisks with all the stuff you need and just not use networking. Thats how the image from the wiki does it.

Cheers

#2 lore raw
Quoted 20 lines · Edgar E. Iglesias
Quoted 6 lines · Suzuki Poulose

Hi,

I am working on enabling the KEXEC on PPC440 chipsets. To debug my patches, I would like to use the Qemu. The only available PPC440 support in Qemu is for the ppc-virtex. (Thanks for adding the support).

Quoted 6 lines

I was trying to use the default image provided at

http://wiki.qemu.org/download/ppc-virtexml507-linux-2_6_34.tgz

However I cannot get the network up for the board to use the nfs root file system.

Hi,

The problem is that there is no model of the LL-TEMAC in qemu, the one in the refdesign beeing emulated. An easy way out is probably to connect a xilinx,ethlite instead. You'll need to modify both QEMU and the dtb.

Quoted 5 lines

IIRC, the dtb published with the image has the lltemac removed.

I've got a working LL-temac model here, will try to post it this weekend. Or if you're interested in hacking on it, I could probably code dump it as is.

Edgar,

Thanks a lot for the quick reply.

Quoted 10 lines
Quoted 6 lines

Is there something I can do to get the networking up ? I think this may need to be fixed in the dtb.

Or is there any other mechanism to use a different file system ?
( I have the tool chain to build the kernel etc)

Another way is to create ramdisks with all the stuff you need and just not use networking. Thats how the image from the wiki does it.

I think I can try this option. By the way, could you pass on the steps to attach the ramdisks to the image ?

Thanks
Suzuki

#3 lore raw
Quoted 38 lines · Suzuki Poulose
Quoted 20 lines · Edgar E. Iglesias
Quoted 6 lines · Suzuki Poulose

Hi,

I am working on enabling the KEXEC on PPC440 chipsets. To debug my patches, I would like to use the Qemu. The only available PPC440 support in Qemu is for the ppc-virtex. (Thanks for adding the support).

Quoted 6 lines

I was trying to use the default image provided at

http://wiki.qemu.org/download/ppc-virtexml507-linux-2_6_34.tgz

However I cannot get the network up for the board to use the nfs root file system.

Hi,

The problem is that there is no model of the LL-TEMAC in qemu, the one in the refdesign beeing emulated. An easy way out is probably to connect a xilinx,ethlite instead. You'll need to modify both QEMU and the dtb.

Quoted 5 lines

IIRC, the dtb published with the image has the lltemac removed.

I've got a working LL-temac model here, will try to post it this weekend. Or if you're interested in hacking on it, I could probably code dump it as is.

Edgar,

Thanks a lot for the quick reply.

Quoted 8 lines
Quoted 6 lines

Is there something I can do to get the networking up ? I think this may need to be fixed in the dtb.

Or is there any other mechanism to use a different file system ?
( I have the tool chain to build the kernel etc)

Quoted 5 lines
Quoted 2 lines

Another way is to create ramdisks with all the stuff you need and just not use networking. Thats how the image from the wiki does it.

I think I can try this option. By the way, could you pass on the steps to attach the ramdisks to the image ?

Hi,

If I dont remember wrong, the image on the wiki contains a kernelconfig file. The config file sets the CONFIG_INITRAMFS_SOURCE option to "./romfs". In my case I created a romfs subdir right in my linux-2.6 kernel tree, e.g linux-2.6/romfs/.

You'll then have to populate the romfs directory with all the things you need. romfs/dev/xxx, romfs/lib/xxx etc etc.

Then, once you build the kernel, an image of the romfs/ will be baked into the kernel image. You then need to choose your init cmd by passing an rdinit option in ther kernel cmd line.

With qemu:
-append "rdinit=/bin/sh"

The qemu-run.sh script from the wiki does that aswell.

There are probably other better ways to do it that I am not aware of at the moment. But I hope it helps as example.

Cheers

#4 lore raw
Quoted 59 lines · Edgar E. Iglesias
Quoted 38 lines · Suzuki Poulose
Quoted 20 lines · Edgar E. Iglesias
Quoted 6 lines · Suzuki Poulose

Hi,

I am working on enabling the KEXEC on PPC440 chipsets. To debug my patches, I would like to use the Qemu. The only available PPC440 support in Qemu is for the ppc-virtex. (Thanks for adding the support).

Quoted 6 lines

I was trying to use the default image provided at

http://wiki.qemu.org/download/ppc-virtexml507-linux-2_6_34.tgz

However I cannot get the network up for the board to use the nfs root file system.

Hi,

The problem is that there is no model of the LL-TEMAC in qemu, the one in the refdesign beeing emulated. An easy way out is probably to connect a xilinx,ethlite instead. You'll need to modify both QEMU and the dtb.

Quoted 5 lines

IIRC, the dtb published with the image has the lltemac removed.

I've got a working LL-temac model here, will try to post it this weekend. Or if you're interested in hacking on it, I could probably code dump it as is.

Edgar,

Thanks a lot for the quick reply.

Quoted 8 lines
Quoted 6 lines

Is there something I can do to get the networking up ? I think this may need to be fixed in the dtb.

Or is there any other mechanism to use a different file system ?
( I have the tool chain to build the kernel etc)

Quoted 5 lines
Quoted 2 lines

Another way is to create ramdisks with all the stuff you need and just not use networking. Thats how the image from the wiki does it.

I think I can try this option. By the way, could you pass on the steps to attach the ramdisks to the image ?

Hi,

If I dont remember wrong, the image on the wiki contains a kernelconfig file. The config file sets the CONFIG_INITRAMFS_SOURCE option to "./romfs". In my case I created a romfs subdir right in my linux-2.6 kernel tree, e.g linux-2.6/romfs/.

You'll then have to populate the romfs directory with all the things you need. romfs/dev/xxx, romfs/lib/xxx etc etc.

Then, once you build the kernel, an image of the romfs/ will be baked into the kernel image. You then need to choose your init cmd by passing an rdinit option in ther kernel cmd line.

Quoted 7 lines

With qemu:
-append "rdinit=/bin/sh"

The qemu-run.sh script from the wiki does that aswell.

There are probably other better ways to do it that I am not aware of at the moment. But I hope it helps as example.

Thanks a lot for the pointers. Somehow, the INITRAMFS_SOURCE was not working
for me even with the kernelconfig that is attached in the tar.gz. Btw, the
kernelconfig enabled additional image types, simpleImage.virtex507 etc, which
had no rules to build. I tried with the xilinix-2.6 git tree with no luck.

However, I have got it working using an initrd.img (7M) which I pass using -initrd option.

I have also hacked qemu to display the tlb entries (which is very much needed for my work) with "info registers" and gdb works like a charm. Nothing more, I could ask for.

Cheers
Suzuki

#5 lore raw
Quoted 65 lines · Suzuki Poulose
Quoted 64 lines · Edgar E. Iglesias
Quoted 38 lines · Suzuki Poulose
Quoted 20 lines · Edgar E. Iglesias
Quoted 6 lines · Suzuki Poulose

Hi,

I am working on enabling the KEXEC on PPC440 chipsets. To debug my patches, I would like to use the Qemu. The only available PPC440 support in Qemu is for the ppc-virtex. (Thanks for adding the support).

Quoted 6 lines

I was trying to use the default image provided at

http://wiki.qemu.org/download/ppc-virtexml507-linux-2_6_34.tgz

However I cannot get the network up for the board to use the nfs root file system.

Hi,

The problem is that there is no model of the LL-TEMAC in qemu, the one in the refdesign beeing emulated. An easy way out is probably to connect a xilinx,ethlite instead. You'll need to modify both QEMU and the dtb.

Quoted 5 lines

IIRC, the dtb published with the image has the lltemac removed.

I've got a working LL-temac model here, will try to post it this weekend. Or if you're interested in hacking on it, I could probably code dump it as is.

Edgar,

Thanks a lot for the quick reply.

Quoted 8 lines
Quoted 6 lines

Is there something I can do to get the networking up ? I think this may need to be fixed in the dtb.

Or is there any other mechanism to use a different file system ? ( I have the tool chain to build the kernel etc)

Quoted 5 lines
Quoted 2 lines

Another way is to create ramdisks with all the stuff you need and just not use networking. Thats how the image from the wiki does it.

I think I can try this option. By the way, could you pass on the steps to attach the ramdisks to the image ?

Hi,

If I dont remember wrong, the image on the wiki contains a kernelconfig file. The config file sets the CONFIG_INITRAMFS_SOURCE option to "./romfs". In my case I created a romfs subdir right in my linux-2.6 kernel tree, e.g linux-2.6/romfs/.

You'll then have to populate the romfs directory with all the things you need. romfs/dev/xxx, romfs/lib/xxx etc etc.

Then, once you build the kernel, an image of the romfs/ will be baked into the kernel image. You then need to choose your init cmd by passing an rdinit option in ther kernel cmd line.

With qemu:
-append "rdinit=/bin/sh"

The qemu-run.sh script from the wiki does that aswell.

Quoted 9 lines
Quoted 2 lines

There are probably other better ways to do it that I am not aware of at the moment. But I hope it helps as example.

However, I have got it working using an initrd.img (7M) which I pass using -initrd option.

I have also hacked qemu to display the tlb entries (which is very much needed for my work) with "info registers" and gdb works like a charm. Nothing more, I could ask for.

Btw, I have come across a bug in qemu-system-ppc while doing single stepping with GDB. Somehow, the "rfi" instruction is not emulated properly. If I single step on an rfi instruction, the pc is set to $pc+4 and not the value in SPRN_SRR0. I have a work around for the time being. I am not that familiar with the qemu code. I could take a look at fixing it, once I get some time to breath :-).

Cheers
Suzuki