[Qemu-devel] PCI virtual address

2011-02-24 Thread asim khan
Hi,
 Iam trying to emulate USB for realview board in QEMU.
trying to access it thru the PCI bus.for realview board Idont see PCI
support in QEMU although it is there for versatile boad.so I googled and
found realview PCIX support.I applied the patch. but then in
arch/arm/mach-realview/pcix.c inside function
"realview_pb_pcix_unit_init(void)"

u32 data = readl(PCIX_UNIT_BASE + PCI_UNITCNT);
the data value it is printing is zero.

#define PCIX_UNIT_BASE  0xF800 which seems to be virtual
adress

realview spec PCI memory map:

AXI2PCI   0x9004
PCI IO window  0x9005
PCI Memory Window 0xA000-0XBFFF

and in qemu realview.c

 if (is_pb) {
dev = sysbus_create_varargs("realview_pci",
0x9004,/*0x6000*/
pic[48], pic[49], pic[50], pic[51],
NULL);
pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci");
if (usb_enabled) {
fprintf(stderr, "USB ENABLED\n");
usb_ohci_init_pci(pci_bus, -1);
}
but it seems the virtual adress are not proper for above physical address as
Iam getting error


Error: PCI-X unit not in PCI-X mode.

pci_bus :00: scanning bus

pci_bus :00: fixups for bus

the macro for vrtual address Iam using is

#define IO_ADDRESS(x)   (((x) & 0x03ff) + 0xfb00)
//#define IO_ADDRESS(x) ((void __iomem *)(unsigned
long)IO_ADDRESS(x))
#else
#define IO_ADDRESS(x)   (x)
#endif
#define __io_address(n) __io(IO_ADDRESS(n))
#endif



Plz help me in that whats going wrong..its bit urgen plz reply as soon as
possible

--thanx in advance

ak


Re: [Qemu-devel] PCI virtual address

2011-02-24 Thread Peter Maydell
On 24 February 2011 10:52, asim khan  wrote:
> Hi,
>  Iam trying to emulate USB for realview board in QEMU.
> trying to access it thru the PCI bus.for realview board Idont see PCI
> support in QEMU although it is there for versatile boad.so I googled and
> found realview PCIX support.I applied the patch.

QEMU models the PCI controller in versatile boards and
the EB (emulation baseboard). It does not have a model
of the different PCIX controller found in the realview
PB and PBX boards.
(The model of the versatile PCI controller is also buggy
in that it works only with the buggy Linux kernel driver;
there are patches for the kernel which fix it to work
with real versatile PCI hardware, at which point it
doesn't work on qemu any more.)

> arch/arm/mach-realview/pcix.c

This is the kernel code for handling the PCIX controller.
QEMU doesn't model that controller, so this won't work.

>  if (is_pb) {
>     dev = sysbus_create_varargs("realview_pci",
> 0x9004,/*0x6000*/
>     pic[48], pic[49], pic[50], pic[51],
> NULL);

The code in git says "if (!is_pb) { ..." -- this is
for the EB/versatile PCI controller.

> Plz help me in that whats going wrong.

You're trying to use something that isn't implemented.
Sorry.

In answer to your other email, QEMU doesn't implement
a model of the ISP1761 USB controller either.

-- PMM