summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/powernv/opal-nvram.c
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.vnet.ibm.com>2015-02-06 01:06:52 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-23 14:06:10 +1100
commitf7618299b4ab425956099508cba7b3a39a056d87 (patch)
tree946fa416958f910b14093732214e3c7515efed22 /arch/powerpc/platforms/powernv/opal-nvram.c
parentae011d2e48d2e6c2ae29fd8aab439caf2fbfb5a8 (diff)
powerpc/powernv: Add pstore support on powernv
This patch extends pstore, a generic interface to platform dependent persistent storage, support for powernv platform to capture certain useful information, during dying moments. Such support is already in place for pseries platform. This patch re-uses most of that code. It is a common practice to compile kernels with both CONFIG_PPC_PSERIES=y and CONFIG_PPC_POWERNV=y. The code in nvram_init_oops_partition() routine still works as intended, as the caller is platform specific code which passes the appropriate value for "rtas_partition_exists" parameter. In all other places, where CONFIG_PPC_PSERIES or CONFIG_PPC_POWERNV flag is used in this patchset, it is to reduce the kernel size in cases where this flag is not set and doesn't have any impact logic wise. Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-nvram.c')
-rw-r--r--arch/powerpc/platforms/powernv/opal-nvram.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-nvram.c b/arch/powerpc/platforms/powernv/opal-nvram.c
index f9896fd5d04a..9db4398ded5d 100644
--- a/arch/powerpc/platforms/powernv/opal-nvram.c
+++ b/arch/powerpc/platforms/powernv/opal-nvram.c
@@ -16,6 +16,7 @@
#include <linux/of.h>
#include <asm/opal.h>
+#include <asm/nvram.h>
#include <asm/machdep.h>
static unsigned int nvram_size;
@@ -62,6 +63,15 @@ static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index)
return count;
}
+static int __init opal_nvram_init_log_partitions(void)
+{
+ /* Scan nvram for partitions */
+ nvram_scan_partitions();
+ nvram_init_oops_partition(0);
+ return 0;
+}
+machine_arch_initcall(powernv, opal_nvram_init_log_partitions);
+
void __init opal_nvram_init(void)
{
struct device_node *np;