aboutsummaryrefslogtreecommitdiff
path: root/hw/fsp
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2014-07-31 11:15:25 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-31 11:15:41 +1000
commit08aff4155937106980c8c4b301bb9be8411b9742 (patch)
tree6d879e637e204a72bd8c5581d19a4a4fbab9a7b3 /hw/fsp
parentaf3728e69e43b7ecce20d82a92a95bcd6b8dd8d5 (diff)
downloadskiboot-08aff4155937106980c8c4b301bb9be8411b9742.zip
skiboot-08aff4155937106980c8c4b301bb9be8411b9742.tar.gz
skiboot-08aff4155937106980c8c4b301bb9be8411b9742.tar.bz2
MDST: Add OPAL interface to register host memory region
Add OPAL interface to add host memory region to SYSDUMP. [ Added exported IDs in opal.h --BenH ] Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/fsp')
-rw-r--r--hw/fsp/fsp-mdst-table.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/hw/fsp/fsp-mdst-table.c b/hw/fsp/fsp-mdst-table.c
index 88076d3..f0808f9 100644
--- a/hw/fsp/fsp-mdst-table.c
+++ b/hw/fsp/fsp-mdst-table.c
@@ -276,6 +276,40 @@ static int dump_region_add_entries(void)
return rc;
}
+static int64_t fsp_opal_register_dump_region(uint32_t id,
+ uint64_t addr, uint64_t size)
+{
+ int rc = OPAL_SUCCESS;
+
+ if (!fsp_present())
+ return rc;
+
+ if (!fsp_mdst_supported()) {
+ printf("MDST: Not supported\n");
+ return rc;
+ }
+
+ /* Validate memory region id */
+ if (id < DUMP_REGION_HOST_START || id > DUMP_REGION_HOST_END) {
+ prerror("MDST: Invalid dump region id : 0x%x\n", id);
+ return OPAL_PARAMETER;
+ }
+
+ if (size <= 0) {
+ prerror("MDST: Invalid size : 0x%llx\n", size);
+ return OPAL_PARAMETER;
+ }
+
+ rc = __dump_region_add_entry(id, addr, size);
+ if (rc)
+ return rc;
+
+ /* Send updated MDST to FSP */
+ rc = fsp_update_mdst_table();
+
+ return rc;
+}
+
/* TCE mapping */
static inline void mdst_table_tce_map(void)
{
@@ -337,6 +371,10 @@ void fsp_mdst_table_init(void)
if (!fsp_present())
return;
+ /* OPAL interface */
+ opal_register(OPAL_REGISTER_DUMP_REGION,
+ fsp_opal_register_dump_region, 3);
+
if (!fsp_mdst_supported())
return;