summaryrefslogtreecommitdiffstats
path: root/hw/p7ioc-phb.c
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2017-04-20 16:46:41 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-05-01 13:25:39 +1000
commitc205afe6143c017cf88f60d5f5ea038fa928ff01 (patch)
tree03955e9406c794eeb662e9ea49986634da610145 /hw/p7ioc-phb.c
parentaaa8ccb9a08ddf65872f0d3aff92645bb4454fb3 (diff)
downloadblackbird-skiboot-c205afe6143c017cf88f60d5f5ea038fa928ff01.tar.gz
blackbird-skiboot-c205afe6143c017cf88f60d5f5ea038fa928ff01.zip
pci: Describe PHB diag data size in device tree
Linux hardcodes the PHB diag data buffer at (as of this commit) 8192 bytes. This has been enough for P7IOC and PHB3, but the 512 PEs of PHB4 pushes the diag data blob over this size. Rather than just increasing the hardcoded size in Linux, provide the size of the diag data blob in the device tree so that the OS can dynamically allocate as much as it needs. This both enables more space for PHB4 and less wasted memory for P7IOC and PHB3. P7IOC communicates both hub and PHB data using this buffer, so when setting the size, use whichever struct is largest. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/p7ioc-phb.c')
-rw-r--r--hw/p7ioc-phb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index 21f6c3e1..6c074518 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -2597,6 +2597,15 @@ static void p7ioc_pcie_add_node(struct p7ioc_phb *p)
dt_add_property_cells(np, "ibm,opal-tce-kill",
hi32(tkill), lo32(tkill));
+ /*
+ * Linux may use this property to allocate the diag data buffer, which
+ * can be used for either of these structs. Pass the largest to ensure
+ * they can both fit in this buffer.
+ */
+ dt_add_property_cells(np, "ibm,phb-diag-data-size",
+ MAX(sizeof(struct OpalIoP7IOCPhbErrorData),
+ sizeof(struct OpalIoP7IOCErrorData)));
+
/* Add associativity properties */
add_chip_dev_associativity(np);
OpenPOWER on IntegriCloud