summaryrefslogtreecommitdiffstats
path: root/hw/pci_host.c
Commit message (Collapse)AuthorAgeFilesLines
* Add get_fw_dev_path callback for system bus.Gleb Natapov2010-12-111-0/+2
| | | | | | | Prints out mmio or pio used to access child device. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci-host: Delegate bswap to mmio layerAlexander Graf2010-12-111-85/+20
| | | | | | | | | | | | The only reason we have bswap versions of the pci host code is that most pci host devices are little endian. The ppc e500 is the only odd one here, being big endian. So let's directly pass the endianness down to the mmio layer and not worry about it on the pci host layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make simple io mem handler endian awareAlexander Graf2010-12-111-4/+8
| | | | | | | | | As an alternative to the 3 individual handlers, there is also a simplified io mem hook function. To be consistent, let's add an endianness parameter there too. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci_host: fix breakageAurelien Jarno2010-03-231-5/+5
| | | | | | This has been broken by commit 952760bb7bce7fbfe0afcf04fee268745f297b87 Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Compile pci_host only onceBlue Swirl2010-03-211-30/+51
| | | | | | | | | | | Convert pci_host_conf_register_mmio_noswap(x) to pci_host_conf_register_mmio(x, 0). Convert pci_host_conf_register_mmio(x) to pci_host_conf_register_mmio(x, 1) for big endian hosts, all cases happen to be BE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Update to a hopefully more future proof FSF addressBlue Swirl2010-03-071-2/+1
| | | | | | | | See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa, 530e7615ce3c01882e582c84dc6304ab98a3d5c5 and fad6cb1a565bb73f83fc0e2654489457b489e436. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci_host: rewrite using rwhandlerMichael S. Tsirkin2010-02-141-102/+70
| | | | | | Save a ton of code by switching pcihost to use rwhandler. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* PCI: Fix a typoBlue Swirl2010-01-101-1/+1
| | | | | | Fixes build with PCI_DEBUG defined. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci_host: remove unnecessary & 0xff.Isaku Yamahata2009-12-011-2/+3
| | | | | | | This patch removes unnecessary & 0xff in pci_dev_find_by_addr(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: shorten pci_host_{conf, data}_register_xxx function a bit.Isaku Yamahata2009-12-011-4/+4
| | | | | | | | | pci_host_data_register_io_memory and its variants are too long a bit. So shorten them. Now they are pci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}() Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: rename (pci_/pcie_mmcfg_)addr_to_devIsaku Yamahata2009-12-011-3/+3
| | | | | | | | | This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev() to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr() as "Michael S. Tsirkin" <mst@redhat.com> suggested. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: remove pci_addr_to_config() by open codeIsaku Yamahata2009-12-011-7/+2
| | | | | | | | This patch removes pci_addr_to_config() and open code it as suggested by Michael S. Tsirkin <mst@redhat.com>. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: simplify (pci_/pcie_mmcfg_)data_read()Michael S. Tsirkin2009-12-011-16/+6
| | | | | | | | | Remove switch on length: we don't care about high bits for value, so just return all ones if no device. And add one assert(). Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
* pci_host: change the signature of pci_data_{read, write}.Isaku Yamahata2009-11-091-4/+2
| | | | | | | | | | | change the first argument, void *opaque to PCIBus *s of the pci_data_{read, write}. They aren't used as direct callback so the argument type don't have to be void*. So change it to the right type. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: move pci host stuff from pci.c to pci_host.cIsaku Yamahata2009-11-091-0/+63
| | | | | | | | | | Move pci host stuff from pci.c to pci_host.c. And add some comments. Later pcie host bridge functions will be defined in pcie_host.c not to bloat pci.c. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci_host: consolidate pci config address access.Isaku Yamahata2009-11-091-0/+108
| | | | | | | consolidate pci_config address access into pci_host.c Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci_host.h: move functions in pci_host.h into .c file.Isaku Yamahata2009-11-091-0/+75
split static functions in pci_host.h into pci_host.c and pci_host_template.h. Later a structures declared in pci_host.h, PCIHostState, will be used. However pci_host.h doesn't allow to include itself easily. This patches addresses it. pci_host.h includes functions which are instantiated in .c by including pci_host.h with typedefing pci_addr_t. pci_addr_t is per pci host bridge and is typedef'ed to uint32_t for ioio or target_phys_addr_t for mmio in .c file. That prevents from including pci_host.h to use PCIHostState because of requiring type, pci_addr_t. Its purpose to include is to instantiate io function for mmio or ioio depending on which pci host bridge requires ioio or mmio. To avoid including code, we always instantiate both version. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud