aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorAruna Balakrishnaiah <aruna@linux.vnet.ibm.com>2013-06-05 14:52:20 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-20 03:05:02 -0400
commita5e4797b0f46819a74a7233825137ed5d2f51b51 (patch)
tree2b7df1fd50f6b046a259eb21d046c70dbb70a1d2 /arch/powerpc/platforms/pseries
parentf33f748c964f6a6ee272b1c794b52f54f4da1d04 (diff)
powerpc/pseries: Read common partition via pstore
This patch exploits pstore subsystem to read details of common partition in NVRAM to a separate file in /dev/pstore. For instance, common partition details will be stored in a file named [common-nvram-6]. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: Jim Keniston <jkenisto@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index f7392f6ea7b3..14cc486709f6 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -138,10 +138,17 @@ static struct nvram_os_partition of_config_partition = {
138 .os_partition = false 138 .os_partition = false
139}; 139};
140 140
141static struct nvram_os_partition common_partition = {
142 .name = "common",
143 .index = -1,
144 .os_partition = false
145};
146
141static enum pstore_type_id nvram_type_ids[] = { 147static enum pstore_type_id nvram_type_ids[] = {
142 PSTORE_TYPE_DMESG, 148 PSTORE_TYPE_DMESG,
143 PSTORE_TYPE_PPC_RTAS, 149 PSTORE_TYPE_PPC_RTAS,
144 PSTORE_TYPE_PPC_OF, 150 PSTORE_TYPE_PPC_OF,
151 PSTORE_TYPE_PPC_COMMON,
145 -1 152 -1
146}; 153};
147static int read_type; 154static int read_type;
@@ -530,7 +537,7 @@ static int nvram_pstore_write(enum pstore_type_id type,
530} 537}
531 538
532/* 539/*
533 * Reads the oops/panic report, rtas and of-config partition. 540 * Reads the oops/panic report, rtas, of-config and common partition.
534 * Returns the length of the data we read from each partition. 541 * Returns the length of the data we read from each partition.
535 * Returns 0 if we've been called before. 542 * Returns 0 if we've been called before.
536 */ 543 */
@@ -566,6 +573,14 @@ static ssize_t nvram_pstore_read(u64 *id, enum pstore_type_id *type,
566 time->tv_sec = 0; 573 time->tv_sec = 0;
567 time->tv_nsec = 0; 574 time->tv_nsec = 0;
568 break; 575 break;
576 case PSTORE_TYPE_PPC_COMMON:
577 sig = NVRAM_SIG_SYS;
578 part = &common_partition;
579 *type = PSTORE_TYPE_PPC_COMMON;
580 *id = PSTORE_TYPE_PPC_COMMON;
581 time->tv_sec = 0;
582 time->tv_nsec = 0;
583 break;
569 default: 584 default:
570 return 0; 585 return 0;
571 } 586 }