diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2014-07-31 00:21:33 +0530 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-31 11:15:49 +1000 |
commit | 55d99488f8cd1ba926316cecb8ba1c502529822a (patch) | |
tree | 36272c52b9e74d30ea31da0868760477b494e818 /hw | |
parent | 08aff4155937106980c8c4b301bb9be8411b9742 (diff) | |
download | blackbird-skiboot-55d99488f8cd1ba926316cecb8ba1c502529822a.tar.gz blackbird-skiboot-55d99488f8cd1ba926316cecb8ba1c502529822a.zip |
MDST: Add OPAL interface to unregister dump region
Add OPAL interface to remove host memory region from SYSDUMP.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/fsp/fsp-mdst-table.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/hw/fsp/fsp-mdst-table.c b/hw/fsp/fsp-mdst-table.c index f0808f9a..5629cc12 100644 --- a/hw/fsp/fsp-mdst-table.c +++ b/hw/fsp/fsp-mdst-table.c @@ -310,6 +310,36 @@ static int64_t fsp_opal_register_dump_region(uint32_t id, return rc; } +static int64_t fsp_opal_unregister_dump_region(uint32_t id) +{ + 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; + } + + rc = dump_region_del_entry(id); + if (rc) { + prerror("MDST: dump region id : 0x%x not found\n", id); + return OPAL_PARAMETER; + } + + /* Send updated MDST to FSP */ + rc = fsp_update_mdst_table(); + + return rc; +} + /* TCE mapping */ static inline void mdst_table_tce_map(void) { @@ -374,6 +404,8 @@ void fsp_mdst_table_init(void) /* OPAL interface */ opal_register(OPAL_REGISTER_DUMP_REGION, fsp_opal_register_dump_region, 3); + opal_register(OPAL_UNREGISTER_DUMP_REGION, + fsp_opal_unregister_dump_region, 1); if (!fsp_mdst_supported()) return; |