*spapr_pci: dump _FDT() error messages

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
*spapr_pci: add drc_entry lists for PHBs

Reserve 32 entries for SLOT type in each PHB's initial FDT. This is
necessary for allowing hotplugging of devices to it later.

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

Changes are a pretty tangled, committing changes as a stash for now.

- s/struct drc_entry/DrcEntry/ as per coding guidelines
- add 'child_entries' field to DrcEntry's to handle entries for each
  PHB
- rework hotplug path to attach FDT node directly to corresponding
  DrcEntry->ConfigureConnectorState field. Can probably drop all the
  code that was added to store/search the entire SPAPR DT.

With these changes in place we can now successfully pass a DT to a
guest via `drmgr -c slot -s "Slot xx" -a`.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
spapr: Add event-scan and rtas-event-scan-rate to rtas node in DT

The rtasd kernel thread expects the presence of the event-scan rtas
call and rtas-event-scan-rate property in the DT /rtas node otherwise
the error_log is not created in /proc/ppc64/rtas preventing events
surfaced through check-exception from being recorded.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
spapr-pci: Fixup ibm,drc-* values and send slot drc_index during hotplug

Fixed off by one array indexing issues. DrcEntry->child_entries should start
at index 0. The ibm,drc-* properties have array size at index 0 but all name
and index calculations should use (i - 1) so that first value matches slot 0.
The "Slot XXX" drc_names for a PHB should be (bus * 32) + slot #.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Make pci_update_mappings and pci_dev_fw_name non-static

Allow calling these pci configuration routines from external
files. For example, from an alternative PCI implementation. This patch
prepares for the next two patches in hw/ppc/spapr_pci.c to use these
utility routines.

Signed-off-by: Mike Day <ncmike@ncultra.org>
Add spapr_map_BARs function to hw/ppc/spapr_pci.c

This function reads devices PCI config memory and PCIIORegions then
maps (or remaps) the BARs into the host bus mapped memory as memory
subregions. If there is a conflicting overlap between a device BAR and
an existing subregion it will emit a warning message.

Signed-off-by: Mike Day <ncmike@ncultra.org>
Actually (re)map the hot-plugged device BARs and then add the device name to the fdt

Modify spapr_phb_add_pci_dt to actually call spapr_map_BARs. Then add
the device name to the fdt.

Signed-off-by: Mike Day <ncmike@ncultra.org>