pci: make pci_bar useable outside pci.c

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
memory: add memory_region_find_subregion

Similar to memory_region_find, but only search for overlaps among
regions that are a child of the region passed in. This is useful
for finding free ranges within a parent range to map to, in
addition to the use-cases similarly served by memory_region_find.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
*spapr_pci: rework spapr_map_BARs to use new mr func

This re-works the code a little to remove reliance on
MemoryRegionSections and instead just return a hwaddr based on the
results of the search.

We also add logic to search in increments of r->size, since the
pci code expects that and masks of any that aren't r->size-aligned.

Also, pci code has some checks against PCI_COMMAND region memory
it'll allow BARs to be programmed, so add those calls as well.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
*spapr_pci: add missing OF properties for PCI nodes

The main ones we were missing to allow discovery by kernel was
name, reg, and assigned-addresses. With these in place the device
will *in some cases* get added to /sys/devices, but there are
page fault errors present that need to be worked through. Possibly
we need to begin region allocation at higher addresses for mmio
regions, as that seems to be the only difference between the
hotplug assignments vs. SLOF

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>